SimpleGraph 2.0 Released!

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

Postby kokkoras » February 24th, 2006, 1:44 pm

Kambiz wrote:Simply use the following code, to prevent links being used as a connection point.

Code: Select all
procedure TForm1.SimpleGraphObjectInsert(Graph: TSimpleGraph;
  GraphObject: TGraphObject);
begin
  with GraphObject do
    if IsLink then
      Options := Options - [goLinkable];
end;


Thats great. I take not of that. (Never thought of it beeing so simple).

BUT, what does it exactly do? It seems like event handler for onObjectInsert. So when I insert a link I prevent this link to accept other links on itself. Right??
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby kokkoras » February 24th, 2006, 1:47 pm

Kambiz wrote:My gosh! Seems you don't like to write even a single line of code in your application, right? Dropping components on the form, setting properties, and voila!


Are you talking to me?? I am dying to find time for programming. Unfortunatly I have a thesis to write. :cry:
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby Kambiz » February 24th, 2006, 3:14 pm

No, I was talking in general. :)
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby Kambiz » February 24th, 2006, 3:24 pm

kokkoras wrote:
Kambiz wrote:Simply use the following code, to prevent links being used as a connection point.

Code: Select all
procedure TForm1.SimpleGraphObjectInsert(Graph: TSimpleGraph;
  GraphObject: TGraphObject);
begin
  with GraphObject do
    if IsLink then
      Options := Options - [goLinkable];
end;


Thats great. I take not of that. (Never thought of it beeing so simple).

BUT, what does it exactly do? It seems like event handler for onObjectInsert. So when I insert a link I prevent this link to accept other links on itself. Right??

No, this causes the new inserted object cannot be used as a hook for the other links.

Another way you can prevent a link for being used as a hook is:

Code: Select all
procedure TForm1.SimpleGraphCanHookLink(Graph: TSimpleGraph;
  GraphObject: TGraphObject; Link: TGraphLink; Index: Integer;
  var CanHook: Boolean);
begin
  if GraphObject.IsLink then
    CanHook := False;
end;
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby kokkoras » February 24th, 2006, 3:53 pm

Kambiz wrote:No, this causes the new inserted object cannot be used as a hook for the other links. Another way you can prevent a link for being used as a hook is:

Code: Select all
procedure TForm1.SimpleGraphCanHookLink(Graph: TSimpleGraph;
  GraphObject: TGraphObject; Link: TGraphLink; Index: Integer;
  var CanHook: Boolean);
begin
  if GraphObject.IsLink then
    CanHook := False;
end;


So, I can easily prevent links over links, as well as certain nodes to accept links. Love it!

Other questions:
Can I have both versions installed? I guess I need a different name.
(No plan to use both in the same project of course).
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby Adem » February 24th, 2006, 10:29 pm

Kambiz wrote:Whenever it was saved to place a field in protected or public section, they are there. And, whenever it was possible I've provided a protected method for accessing to the private field. The remained private fields are really private variables an because of that without F prefix.

Naturally, one can choose to name anything <b><i>anything</b></i> other than reseved keywords, but my point in suggesting prefixing <b><i>all</b></i> private variables with an 'F' is merely to do with conssitency. It helps a lot when you're reading someone else's code. In the case of TS, renaming them doesn't affect any functionality, but improves readability. Then again, it is your code.
Kambiz wrote:
Adem wrote:When there are a large number of nodes, it is very time consuming to iterate TSimpleGraph.Objects in order to find which node a particular node (TGraphNode) is linked to (and by what TGraphLink object).
Consider that since this release:
  1. Links as well as nodes can be hooked to a link. So, if we define a list of hooked objects, it should be contain of all graph object types.
  2. Two objects can connect together more than once. Because of that, you have to look again in all the objects to find all connections.
Maybe for some specific implementations we can use a list to speed up things, but in general it doesn't help so much.

There are three OnObjectHook, OnObjectUnhook, and OnLinkObjects events, and TGraphObjectList type that a host application can use it to build up a custom list of connected objects if needed.

Kambiz, you're defending a wrong design principle, <i>IMHO</i> and <i>with respect</i>.

An item (either a link or a node) should have all the information pertinent to itself in itself.

There is no significant difficulty in re-arranging the code to be that way; and, unless, by TSimpleGraph, what you really mean and emphasize is the <b><i>simple</b></i> part of it, the performance hit is <b>significant</b>.

One could use TSimpleGraph to depict a network (either a physical network, or a social network), or sitemap, or something similar and can easily come up with (hundreds of) thousands nodes.

There are very few things in TS that make it infeasible to use in such an application, the most important of which is <b>this</b>: You have to iterate all those objects to determine what uses what.

This information belongs with the item object; is static; does not change momentarily.. so, what rational is there to force the application to waste CPU power to retrieve it --Other than it is good enough for simple things.. and, that <b>it is <i>your</i> code</b>
Adem
Active Member
Active Member
 
Posts: 22
Joined: February 20th, 2006, 12:47 pm

Postby Mirage » February 27th, 2006, 8:47 am

Hello
Thank you for the excellent work.

I am very happy for this work

Thank you kambiz.
User avatar
Mirage
Junior Member
Junior Member
 
Posts: 44
Joined: October 26th, 2005, 11:41 am

Postby elias » March 2nd, 2006, 11:02 am

I have to say that I find the Adem's arguments about links reasonable; I should say.
Consider too that TSimpleGraph is becoming a very versatile component and there's not very much alternatives like this in Delphi. As for me I'll continue sending you comments and code; I'm conviced that soon you will see your component running in lots of applications.
elias
Senior Member
Senior Member
 
Posts: 90
Joined: November 8th, 2005, 12:09 pm
Location: Galicia, Spain

Postby elias » March 2nd, 2006, 11:40 am

:) When I first found DelphiArea, I didn't Know I was going to become habitual; so I used a mail account to keeping from not desired mail, eliasbasura@hotmail.com; "basura" is a spanish word that comes to mean "rubbish"... Not my surname, how you thought when writting acknowledges. Now I can see in documentation a guy such "Elias Rubbish". ----Embarrassed :)
Last edited by elias on July 8th, 2008, 3:28 pm, edited 1 time in total.
elias
Senior Member
Senior Member
 
Posts: 90
Joined: November 8th, 2005, 12:09 pm
Location: Galicia, Spain

Postby kokkoras » March 2nd, 2006, 12:13 pm

elias wrote:..."basura" is a spanish word that comes to mean "rubbish"... Not my surname, how you thought when writting acknowledges



:lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol:

I am LOL not because of your surname but about Kambiz's assumption.

BTW, my surname (kokkoras) means "Rooster" in greek.

Regarding TSimpleGraph, I searched a lot for quite some time. There is nothing similar of this quality. But I also believe that it must stay clean of any personal desire unless it fits the vision. Such representations are usually used to visualize some more or less serious ideas. I personally use them to draw semantic networs. I have no demant from Kambiz to implement specific features for me. If asked, I will vote YES only for features that can potencialy serve many users and do no harm to existing users.


Fotis Kokkoras
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby Kambiz » March 2nd, 2006, 12:49 pm

:lol: I'm so sorry elias. Soon we will have v2.1 of SimpleGraph, and this sor of bugs will be fixed too. ;)

To be honest, I looked for the meaning of kokkoras but I couldn't find anything. Thanks for telling us its meaning.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby kokkoras » March 2nd, 2006, 12:57 pm

Kambiz wrote::lol: I'm so sorry elias. Soon we will have v2.1 of SimpleGraph, and this sor of bugs will be fixed too. ;)

To be honest, I looked for the meaning of kokkoras but I couldn't find anything. Thanks for telling us its meaning.


I quess you will use the surname, not it's meaning :lol:
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby Kambiz » March 2nd, 2006, 1:04 pm

About having a list (or some lists) of linkes hooked to an object: I was not denying what Adem told. The subject is how we can make it more general. I make a new topic for this issue, let's have a survey about it.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby kokkoras » March 2nd, 2006, 1:50 pm

Kambiz wrote:About having a list (or some lists) of linkes hooked to an object: I was not denying what Adem told. The subject is how we can make it more general. I make a new topic for this issue, let's have a survey about it.


In my POV, the link owns the nodes. But if you want to traverse a graph optimaly, then you definitely need the node to know the links it hosts. But, all these have a managerial trade-off.
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby Kambiz » March 2nd, 2006, 2:08 pm

Here is the topic for the link issue:
http://www.delphiarea.com/forum/viewtopic.php?t=647
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Previous

Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 4 guests

cron