C# Class EdgeGraph.EdgeGraphUtility

显示文件 Open project: famerij/EdgeGraph Class Usage Examples

Public Methods

Method Description
CheckAdjacentNodes ( List &_nodes, List &_edges ) : void
CleanUpEdges ( List &nodes, List &edges ) : void
CopyNodesAndEdges ( List _nodes, List _edges, List &_newNodes, List &_newEdges, bool adjacentCheck = true, bool cleanUp = true ) : void

Makes copies of edges and nodes New edges will have new IDs and new copies of nodes

FindEdgeByNodes ( Node n1, Node n2, List _edges ) : Edge
FindEdgeByNodes ( string n1, string n2, List _edges ) : Edge
FixIntersectingEdges ( List &nodes, List &edges ) : bool
GetClosestEdge ( Vector3 point, List nodes, List edges, Transform refTransform ) : Edge

Returns closest edge to the world point. Edge positions are changed to world coordinates in reference to refTransform.

GetClosestNode ( Vector3 point, List nodes, Transform refTransform ) : Node

Returns closest node to the world point. Node positions are changed to world coordinates in reference to refTransform.

GetClosestPointOnEdge ( Vector3 point, List nodes, List edges, Transform refTransform, Edge &closestEdge ) : Vector3

Returns closest point on all the given edges. Edge positions are changed to world coordinates in reference to refTransform.

GetEdge ( string id, List &_edges ) : Edge
GetEdgePosition ( string id, List &_nodes, List &_edges, Transform transform = null ) : Vector3
GetNode ( int index, List &_nodes ) : Node
GetNode ( string id, List &_nodes ) : Node
GetPointOnClosestEdge ( Vector3 point, List nodes, List edges, Transform refTransform ) : Vector3

Returns closest point on the closest point with given point

PointIsInside ( Vector3 point, List nodes, List edges ) : bool

Checks if given point is inside the edges. The point must be in the same space than node positions

RemoveEdgeAndCleanAdjacents ( Node _n0, Node _n1, List &_nodes, List &_edges ) : Edge
RemoveNodeAndCleanAdjacents ( Node n, List &_nodes, List &_edges ) : void

Method Details

CheckAdjacentNodes() public static method

public static CheckAdjacentNodes ( List &_nodes, List &_edges ) : void
_nodes List
_edges List
return void

CleanUpEdges() public static method

public static CleanUpEdges ( List &nodes, List &edges ) : void
nodes List
edges List
return void

CopyNodesAndEdges() public static method

Makes copies of edges and nodes New edges will have new IDs and new copies of nodes
public static CopyNodesAndEdges ( List _nodes, List _edges, List &_newNodes, List &_newEdges, bool adjacentCheck = true, bool cleanUp = true ) : void
_nodes List
_edges List
_newNodes List
_newEdges List
adjacentCheck bool
cleanUp bool
return void

FindEdgeByNodes() public static method

public static FindEdgeByNodes ( Node n1, Node n2, List _edges ) : Edge
n1 Node
n2 Node
_edges List
return Edge

FindEdgeByNodes() public static method

public static FindEdgeByNodes ( string n1, string n2, List _edges ) : Edge
n1 string
n2 string
_edges List
return Edge

FixIntersectingEdges() public static method

public static FixIntersectingEdges ( List &nodes, List &edges ) : bool
nodes List
edges List
return bool

GetClosestEdge() public static method

Returns closest edge to the world point. Edge positions are changed to world coordinates in reference to refTransform.
public static GetClosestEdge ( Vector3 point, List nodes, List edges, Transform refTransform ) : Edge
point UnityEngine.Vector3
nodes List
edges List
refTransform UnityEngine.Transform
return Edge

GetClosestNode() public static method

Returns closest node to the world point. Node positions are changed to world coordinates in reference to refTransform.
public static GetClosestNode ( Vector3 point, List nodes, Transform refTransform ) : Node
point UnityEngine.Vector3
nodes List
refTransform UnityEngine.Transform
return Node

GetClosestPointOnEdge() public static method

Returns closest point on all the given edges. Edge positions are changed to world coordinates in reference to refTransform.
public static GetClosestPointOnEdge ( Vector3 point, List nodes, List edges, Transform refTransform, Edge &closestEdge ) : Vector3
point UnityEngine.Vector3
nodes List
edges List
refTransform UnityEngine.Transform
closestEdge Edge
return UnityEngine.Vector3

GetEdge() public static method

public static GetEdge ( string id, List &_edges ) : Edge
id string
_edges List
return Edge

GetEdgePosition() public static method

public static GetEdgePosition ( string id, List &_nodes, List &_edges, Transform transform = null ) : Vector3
id string
_nodes List
_edges List
transform UnityEngine.Transform
return UnityEngine.Vector3

GetNode() public static method

public static GetNode ( int index, List &_nodes ) : Node
index int
_nodes List
return Node

GetNode() public static method

public static GetNode ( string id, List &_nodes ) : Node
id string
_nodes List
return Node

GetPointOnClosestEdge() public static method

Returns closest point on the closest point with given point
public static GetPointOnClosestEdge ( Vector3 point, List nodes, List edges, Transform refTransform ) : Vector3
point UnityEngine.Vector3
nodes List
edges List
refTransform UnityEngine.Transform
return UnityEngine.Vector3

PointIsInside() public static method

Checks if given point is inside the edges. The point must be in the same space than node positions
public static PointIsInside ( Vector3 point, List nodes, List edges ) : bool
point UnityEngine.Vector3
nodes List
edges List
return bool

RemoveEdgeAndCleanAdjacents() public static method

public static RemoveEdgeAndCleanAdjacents ( Node _n0, Node _n1, List &_nodes, List &_edges ) : Edge
_n0 Node
_n1 Node
_nodes List
_edges List
return Edge

RemoveNodeAndCleanAdjacents() public static method

public static RemoveNodeAndCleanAdjacents ( Node n, List &_nodes, List &_edges ) : void
n Node
_nodes List
_edges List
return void