Adem wrote:Finally, I have a request:
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).
Instead of having to iterate through TSimpleGraph.Objects, could we have two more private variables in TGraphNode class, such that TGraphNode has 2 more private variables.
FNodesLinkedTo: TList;
FNodesLinkedFrom: TList;
These lists (as the names suggest) contain the counterpart node *and* the TGraphLink object for that particular link. Then, a couple of suitable procedures make this functionality public for the node.
I really hope you will consider this. I can do the coding if necessary.
Adem wrote:-- it might be good idea to declare TGraphChangeFlags as below
TGraphChangeFlag = (gcState, gcData, gcStyle, gcCaption, gcPlacement, gcDependency);
TGraphChangeFlags = set of TGraphChangeFlag;
-- it might be good idea to declare TObjectSides as below
TObjectSide = (osLeft, osTop, osRight, osBottom);
TObjectSides = set of TObjectSide;
Adem wrote:-- TGraphObject contains these variables in its private section. It would be better if they were prefixed with the 'F' character.
InSyncFont: Boolean;
PendingChanges: TGraphChangeFlags;
UpdateCount: Integer;
-- TGraphLink contains these variables in its private section. It would be better if they were prefixed with the 'F' character.
OldVersion: Integer;
SourceID: DWORD;
TargetID: DWORD;
UpdatingEndPoints: Boolean;
-- TSimpleGraph contains these variables in its private section. It would be better if they were prefixed with the 'F' character.
GraphModified: Boolean;
IgnoreNotification: Boolean;
InsertedObject: TGraphObject;
LockedCalcBounds: array[0..1] of TRect;
SavedCanvas: TCanvas;
SelectionRect: TRect;
UndoStorage: TMemoryStream;
UpdateCount: Integer;
UpdateSelectionCount: Integer;
UpdatingScrollBars: Boolean;
WheelAccumulator: Integer;
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).
Instead of having to iterate through TSimpleGraph.Objects, could we have two more private variables in TGraphNode class, such that TGraphNode has 2 more private variables.
FNodesLinkedTo: TList;
FNodesLinkedFrom: TList;
These lists (as the names suggest) contain the counterpart node *and* the TGraphLink object for that particular link. Then, a couple of suitable procedures make this functionality public for the node.
kokkoras wrote:Is there any way to have a container (ex. TList) with only the type of objects desired? As far as I know all the objects are in a single list now. We don't have links and nodes anymore. Just objects.
kokkoras wrote:I knew from the first time I heard about links originated or ended upon other links, that this will create some trouble. But for those drawing flow charts, it's fine. For me creating semantic networks, it's not. We can't have them all.
procedure TForm1.SimpleGraphObjectInsert(Graph: TSimpleGraph;
GraphObject: TGraphObject);
begin
with GraphObject do
if IsLink then
Options := Options - [goLinkable];
end;
Kambiz wrote:Since the initial release of component, there was only two list: Objects and Selected Objects.
You should use OnObjectInsert and OnObjectRemove events to manage your own custom lists.
Return to DELPHI AREA Projects
Users browsing this forum: No registered users and 5 guests