• 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 LineGraphDrawer

Makes it extremely easy to 'draw' a road graph. Just add lines/edges and close enough vertices will automatically be joined together.

Inheritance
object
LineGraphDrawer
Namespace: AnyPath.Graphs.Line
Assembly: AnyPath.dll
Syntax
public class LineGraphDrawer
Examples
void Example()
{
    // create a drawer which merges vertices that are closer than .1f
    var drawer = new LineGraphDrawer(.1f);

    // draw a square
    drawer.AddUndirected(new float3(0, 0, 0), new float3(1, 0, 0));
    drawer.AddUndirected(new float3(1, 0, 0), new float3(1, 1, 0));
    drawer.AddUndirected(new float3(1, 1, 0), new float3(0, 1, 0));
    drawer.AddUndirected(new float3(0, 1, 0), new float3(0, 0, 0));

    // create our graph
    var graph = new LineGraph(Allocator.Persistent);

    // populate it with our square
    graph.Populate(drawer.Vertices, drawer.UndirectedEdges);
}

Constructors

LineGraphDrawer(float)

Construct a LineGraphDrawer

Declaration
public LineGraphDrawer(float weldThreshold)
Parameters
Type Name Description
float weldThreshold

Approx maximum distance vertices can have in order to be joined/welded together

Properties

DirectedEdges

All edges that have been added as directed edges, use to populate the graph

Declaration
public IReadOnlyList<LineGraph.Edge> DirectedEdges { get; }
Property Value
Type Description
IReadOnlyList<LineGraph.Edge>

UndirectedEdges

All edges that have been added as undirected, use to populate the graph

Declaration
public IReadOnlyList<LineGraph.Edge> UndirectedEdges { get; }
Property Value
Type Description
IReadOnlyList<LineGraph.Edge>

Vertices

The welded vertices, use to populate the graph

Declaration
public IReadOnlyList<float3> Vertices { get; }
Property Value
Type Description
IReadOnlyList<float3>

Methods

AddDirected(float3, float3)

Draw a directed edge

Declaration
public void AddDirected(float3 from, float3 to)
Parameters
Type Name Description
float3 from
float3 to

AddDirected(float3, float3, float, int, int)

Draw a directed edge with some additional traversal cost and flags associated with it

Declaration
public void AddDirected(float3 from, float3 to, float enterCost, int flags = 0, int id = 0)
Parameters
Type Name Description
float3 from
float3 to
float enterCost
int flags
int id

AddUndirected(float3, float3)

Draw an undirected edge

Declaration
public void AddUndirected(float3 from, float3 to)
Parameters
Type Name Description
float3 from
float3 to

AddUndirected(float3, float3, float, int, int)

Draw an undirected edge with some additional traversal cost and flags associated with it

Declaration
public void AddUndirected(float3 from, float3 to, float enterCost, int flags = 0, int id = 0)
Parameters
Type Name Description
float3 from
float3 to
float enterCost
int flags
int id

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