YOUSEFUL / DELPHI / COMPONENTS
TAtlasGraphEdge
A directed graph edge: source and target node IDs.
Description
Returned by TAtlasGraph.Edges as a copy. Create and delete edges with AddEdge and DeleteEdge.
Members
| Member | Kind | What it does |
|---|---|---|
SourceID | field | ID of the node the edge starts at. |
TargetID | field | ID of the node the edge points to. |
Fields
SourceID field
SourceID, TargetID: Integer;ID of the node the edge starts at.
TargetID field
SourceID, TargetID: Integer;ID of the node the edge points to.
Examples
Children of a node
Follows the outgoing edges of one node.
uses System.Generics.Collections, Atlas.Graph;
function ChildrenOf(Graph: TAtlasGraph; ID: Integer): TArray<Integer>;
var
Edge: TAtlasGraphEdge;
List: TList<Integer>;
begin
List := TList<Integer>.Create;
try
for Edge in Graph.Edges do
if Edge.SourceID = ID then List.Add(Edge.TargetID);
Result := List.ToArray;
finally
List.Free;
end;
end;
Related
Also in Atlas VCL
TAtlasTable · TAtlasGrid · TAtlasValueEdit · TAtlasTree · TAtlasWorkbook · TAtlasSheetGrid · TAtlasPivot · TAtlasInspector · TAtlasRichEdit · TAtlasSpellChecker · TAtlasChart · TAtlasGauge · TAtlasThemer · TAtlasWizard · TAtlasWorkspace · TAtlasCommandBar · TAtlasActionTile · TAtlasTileBoard · TAtlasNavigation · TAtlasMap · TAtlasGraph · TAtlasDiagram · TAtlasPrintDocument · TAtlasSchedule · TAtlasScheduler · TAtlasTaskPlan · TAtlasGantt · TAtlasPdfDocument · TAtlasPdfViewer