Kambiz wrote:You are out of topic, aren't you?
There's always that odd chance that we weren't
![Smile :-)](./images/smilies/icon_smile.gif)
Kambiz wrote:Adem, I think you are more focused on your current case. SimpleGraph supposed to be a general purpose library and should kept generalized.
Actually, I don't have a current case per se. I was more like voicing the results of my frustration (results of the past decade) with various other components.
Kambiz wrote:Object Deletion:
In the new release, there would be a new OnCanDelete event. This event is raised if Delete method of the object is called. Calling Free method of the object, releases the object without triggering the event.
This is good.
Kambiz wrote:Auto Orphan Removal:
Which object is an Orphan? A link not hooked to any node, a link not connecting two nodes, a node not connected to any link, or a node not connected to any node via a link?
In my point of view, if somebody needs "Auto Orpan Removal", it's better to write his/her specific code in OnObjectRemove event. A more complex code is more difficult to maintain and improve.
By my definition, an orphan is an object that has no connection to another object --this definition covers, IMO, both the nodes and the links.
I have already given up on auto-orphan-removal, though. It is not worth the bother.
But, it would be nice if I could get a list of orphan objects through a single routine call.
Kambiz wrote:Tracking objects used as hook:
In v2.0, when an object that is used as a hook is released, the interface doesn't release Unhook event. This bug will be fixed for the new release, and seems this bug is cause of some posts in this thread.
I am confused by this 'hook' metaphor. What is a hook??
Do you call a TGraphLink between any 2 TGraphNodes a hook. If not what is it?
Plus, why does the Source and Target be at the ends of Polyline.
I mean, I have no objections for the Polyline to be related (in some way) to Source and Target nodes, but IMHO Source and Target should be independent variables, and Polyline should adjust itself to what Source and Target are.
If this sentence sounds confused, it is because I am confused about all this Hook thing.
And, then, how can I do simple check like
function IsLinked(ASource, ATarget: TGraphNode): Boolean;
or, to find which nodes a given GraphLink connects:
procedure LinksNodes(ALink: TGraphLink; var ASource, ATarget: TGraphNode);
Kambiz wrote:The "Two List" solution is only very good for traversing the graph and doesn't provide any aid for adding new features.
Mostly agreed.
Kambiz wrote:Because I'm more interested to provide a generic graph component, and in the other hand there's only two votes, I go for "Three List" solution. Having two more list has some overloads, but provides much more flexibility.
I am fine with this.
Kambiz wrote:In the other hand, the overload is almost nothig for less than few thousnds objects on the graph. I don't think someone uses even more than a few hundreds objects on a graph.
Well.. if you build <i><b>better mousetrap</b></i>, you'll be surprised to see how many <i><b>better mice</b></i> will flock in
![Smile :-)](./images/smilies/icon_smile.gif)
Kambiz wrote:For the new release I've added some new events, which may make your job much easier.
Thank you very much.
BTW, as I mentioned above, can you somehow separte the logic between the Polyline stuff and the nodes a TGraphLink connects to. For all I can see, PolyLine stuff is a special case of Line and that alone could make it something like TSomekindOfLine whose sole purpose is to draw a fancy line between 2 nodes.