YOUSEFUL / DELPHI / COMPONENTS

TAtlasGraphEdge

A directed graph edge: source and target node IDs.

Record Unit Atlas.Graph · Product Atlas VCL

Description

Returned by TAtlasGraph.Edges as a copy. Create and delete edges with AddEdge and DeleteEdge.

Members

MemberKindWhat it does
SourceIDfieldID of the node the edge starts at.
TargetIDfieldID 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.

pascal
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;

TAtlasGraph · TAtlasGraphNode

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