• Articles
  • Api Documentation
Show / Hide Table of Contents
  • AnyPath
    • Graphs
      • Extra
        • Line2D
        • Line3D
        • Triangle
      • HexGrid
        • HexGrid
        • HexGrid.Enumerator
        • HexGridCell
        • HexGridHeuristicProvider
        • HexGridType
      • Line
        • ClosestLineLocationPredicate
        • LineGraph
        • LineGraph.Edge
        • LineGraph.Enumerator
        • LineGraphBuilder
        • LineGraphBuilder.ProtoEdge
        • LineGraphDrawer
        • LineGraphHeuristic
        • LineGraphLocation
        • LineGraphPopulator
        • LineGraphProcessor
        • LineGraphWelder
        • SceneGraph
          • LineGraphNode
          • LineSceneGraph
          • LineSceneGraphEdge
          • SceneGraphNodeEditor
      • NavMesh
        • ClosestNavMeshLocationPredicate
        • CornerAndNormal
        • IUnrolledNavMeshGraphPortal
        • NavMeshGraph
        • NavMeshGraph.EnterCostAndFlags
        • NavMeshGraph.Enumerator
        • NavMeshGraphCorners
        • NavMeshGraphCorners3D
        • NavMeshGraphHeuristic
        • NavMeshGraphLocation
        • NavMeshGraphUnroller
        • NavMeshLineBitmaskMod
        • NavMeshLineMod
        • NavMeshPlaneBitmaskMod
        • NavMeshPlaneMod
        • NavMeshPopulator
        • NavMeshWelder
        • SSFA
        • UnrolledNavMeshGraphPortal
      • Node
        • NodeGraph
        • NodeGraphNode
      • PlatformerGraph
        • ClosestPlatformerGraphLocationPredicate
        • PlatformerGraph
        • PlatformerGraph.Enumerator
        • PlatformerGraphBuilder
        • PlatformerGraphBuilder.ProtoEdge
        • PlatformerGraphDrawer
        • PlatformerGraphHeuristic
        • PlatformerGraphLocation
        • PlatformerGraphPopulator
        • PlatformerGraphProcessor
        • PlatformerGraphWelder
        • SceneGraph
          • PlatformerSceneGraph
          • PlatformerSceneGraphEdge
          • PlatformerSceneGraphNode
          • SceneGraphNodeEditor
      • SquareGrid
        • SquareGrid
        • SquareGrid.Enumerator
        • SquareGridCell
        • SquareGridHeuristicProvider
        • SquareGridHeuristicProviderEightDirectional
        • SquareGridHeuristicProviderManhattanDistance
        • SquareGridType
      • VoxelGrid
        • VoxelGrid
        • VoxelGrid.DirCost
        • VoxelGrid.Enumerator
        • VoxelGridCell
        • VoxelGridDirectionFlags
        • VoxelGridDirectionMod
        • VoxelGridHeuristicProvider
        • VoxelGridHeuristicProviderManhattanDistance
    • Managed
      • ClearFinderFlags
      • FinderExtensions
      • IFinder
      • IOptionReserver<TOption>
      • IOptionValidator<TOption>
      • ImmutableFinderException
      • ManagedDisposeExtensions
      • Results
        • DijkstraResult<TNode>
        • Eval
        • Eval<TOption>
        • MultiEvalResult
        • MultiPathResult<TSeg>
        • Path<TSeg>
        • Path<TOption, TSeg>
    • Native
      • AStarCheapestOption
      • AStarEvalOptionResult
      • AStarEvalResult
      • AStarFindOptionResult
      • AStarFindPathResult
      • AStarOption
      • AStarStops
      • AStar<TNode>
      • ComposedGraph<TGraph, TNode>
      • Edge<TNode>
      • FlagBitmask<TNode>
      • IEdgeMod<TNode>
      • IGraph<TNode>
      • IHeuristicProvider<TNode>
      • INodeFlags
      • IPathProcessor<TNode, TSeg>
      • NativeListWrapper<TSeg>
      • NoEdgeMod<TNode>
      • NoProcessing<TNode>
      • OffsetInfo
      • ReversedGraph<TNode>
      • EdgeMods
        • AdditionalAndExcludeEdges<TNode>
        • AdditionalEdges<TNode>
        • ExcludeEdges<TNode>
        • ExcludeLocations<TNode>
      • Heuristics
        • ALTCompute<TGraph, TNode>
        • ALTSerialization
        • ALT<TNode>
        • LandmarkSelection<TGraph, TNode, TEnumerator>
      • Util
        • IRefComparer<T>
        • NativeMinHeap<T, TComp>
        • NativeRefMinHeap<T, TComp>

Class LineGraphBuilder

Utility to construct a line graph by connecting vertices by Id instead of index, which is far more convenient when building a custom editor. As an example use case, this class is used to construct the LineGraph by the LineGraph.

Inheritance
object
LineGraphBuilder
Namespace: AnyPath.Graphs.Line
Assembly: AnyPath.dll
Syntax
public class LineGraphBuilder
Remarks

Also have a look at LineGraphDrawer which is simpler to use

Constructors

LineGraphBuilder()

Declaration
public LineGraphBuilder()

Methods

Clear()

Clear the builder.

Declaration
public void Clear()

ContainsVertex(int)

Check if a vertex has been added

Declaration
public bool ContainsVertex(int id)
Parameters
Type Name Description
int id
Returns
Type Description
bool

GetData(out List<float3>, out List<Edge>, out List<Edge>)

Convert this representation to a representation suitable to construct the line graph.

Declaration
public void GetData(out List<float3> verts, out List<LineGraph.Edge> undirectedIndices, out List<LineGraph.Edge> directedIndices)
Parameters
Type Name Description
List<float3> verts
List<LineGraph.Edge> undirectedIndices
List<LineGraph.Edge> directedIndices

GetVertex(int)

Returns the position of the vertex with a given Id

Declaration
public float3 GetVertex(int id)
Parameters
Type Name Description
int id
Returns
Type Description
float3

LinkDirected(int, int)

Links two vertices together creating a traversable edge only from a to b

Declaration
public void LinkDirected(int a, int b)
Parameters
Type Name Description
int a
int b

LinkDirected(int, int, float, int, int)

Links two vertices together creating a traversable edge only from a to b

Declaration
public void LinkDirected(int a, int b, float enterCost, int flags = 0, int id = 0)
Parameters
Type Name Description
int a

Id of vertex A

int b

Id of vertex B

float enterCost

Additional cost associated with entering this edge in a path

int flags

Flags that can be used to filter the edge being traversable

int id

Optional user defined Id that is given to the edge. This Id can be used for obtaining the edge from the LineGraph that is constructed

LinkUndirected(int, int)

Links two vertices together creating a traversable edge in both directions

Declaration
public int LinkUndirected(int a, int b)
Parameters
Type Name Description
int a
int b
Returns
Type Description
int

The index of the edge in the internal list of edges

LinkUndirected(int, int, float, int, int)

Links two vertices together creating a traversable edge in both directions

Declaration
public int LinkUndirected(int a, int b, float enterCost, int flags = 0, int id = 0)
Parameters
Type Name Description
int a

Id of vertex A

int b

Id of vertex B

float enterCost

Additional cost associated with entering this edge in a path

int flags

Flags that can be used to filter the edge being traversable

int id

Optional user defined Id that is given to the edge. This Id can be used for obtaining the edge from the LineGraph that is constructed

Returns
Type Description
int

The index of the edge in the internal list of edges

SetVertex(int, float3)

Assigns a position to a vertex Id. If the vertex Id doesn't exist yet, it will be created. Otherwise it will be overwritten.

Declaration
public void SetVertex(int id, float3 pos)
Parameters
Type Name Description
int id
float3 pos

Extension Methods

FinderExtensions.AddOption<T, TNode, TOption>(T, TOption, TNode, TNode)
FinderExtensions.AddOptions<T, TNode, TOption>(T, IEnumerable<TOption>, TNode, Func<TOption, TNode>)
FinderExtensions.AddRange<T, TNode, TOption>(T, IEnumerable<TOption>, TNode, Func<TOption, TNode>)
FinderExtensions.AddRequest<T, TNode>(T, TNode, TNode)
FinderExtensions.AddRequests<T, TNode>(T, IEnumerable<TNode>)
FinderExtensions.AddStop<T, TNode>(T, TNode)
FinderExtensions.AddStops<T, TNode>(T, IEnumerable<TNode>)
FinderExtensions.SetComparer<T, TOption>(T, IComparer<TOption>)
FinderExtensions.SetEdgeMod<T, TMod>(T, TMod)
FinderExtensions.SetGraph<T, TGraph>(T, TGraph)
FinderExtensions.SetHeuristicProvider<T, TH>(T, TH)
FinderExtensions.SetPathProcessor<T, TProc>(T, TProc)
FinderExtensions.SetReserver<T, TOption>(T, IOptionReserver<TOption>)
FinderExtensions.SetStartAndGoal<T, TNode>(T, TNode, TNode)
FinderExtensions.SetValidator<T, TOption>(T, IOptionValidator<TOption>)
In This Article
Back to top Generated by DocFX