Packagecom.yworks.yfiles.geom
Classpublic class Triangulator
InheritanceTriangulator Inheritance YObject Inheritance Object

This class provides algorithms for the triangulation of point sets in the plane.



Public Methods
 MethodDefined By
  
Triangulator(init:Boolean = true)
Triangulator
  
[static] Computes a Delauney triangulation of the given points.
Triangulator
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
Triangulator
 Inherited
hashCode():int
YObject
  
[static]
Triangulator
  
triangulatePoints(result:Graph, pointData:DataProvider, reverseEdgeMap:EdgeMap):Edge
[static] Computes a triangulation of the given points.
Triangulator
  
triangulatePoints2(points:YList, result:Graph, resultMap:NodeMap, reverseEdgeMap:EdgeMap):Edge
[static] Computes a triangulation of the given points.
Triangulator
Protected Methods
 MethodDefined By
  
Triangulator
Constructor Detail
Triangulator()Constructor
public function Triangulator(init:Boolean = true)



Parameters
init:Boolean (default = true)
Method Detail
calcDelauneyTriangulation()method
public static function calcDelauneyTriangulation(result:Graph, pointData:DataProvider, revMap:EdgeMap):Edge

Computes a Delauney triangulation of the given points. A Delauney triangulation is a triangulation such that none of the given points is inside the circumcircle of any of the calculated triangles.

The calculated triangulation is represented by an embedded graph, i.e. to each edge there exists a reverse edge and the outedges around each node are in embedded order. The returned edge and the (optional) reverseEdgeMap can be used to construct all faces of the plane graph and to determine its outer face.

Parameters

result:Graph — a graph whose nodes represent the points that need to be triangulated.
 
pointData:DataProvider — must provide the location (YPoint) for each node in the given graph.
 
revMap:EdgeMap — a node map that will contain for each edge its reverse edge. If this argument is null then no reverse edge information will be available.

Returns
Edge — an edge on the outer face of the result graph.
getClass()method 
override public function getClass():Class

Returns
Class
initTriangulator()method 
protected final function initTriangulator():void

newTriangulator()method 
public static function newTriangulator():Triangulator

Returns
Triangulator
triangulatePoints()method 
public static function triangulatePoints(result:Graph, pointData:DataProvider, reverseEdgeMap:EdgeMap):Edge

Computes a triangulation of the given points. The calculated triangulation is represented by an embedded graph, i.e. to each edge there exists a reverse edge and the outedges around each node are in embedded order. The returned edge and the (optional) reverseEdgeMap can be used to construct all faces of the plane graph and to determine its outer face.

Parameters

result:Graph — a graph whose nodes represent the points that need to be triangulated.
 
pointData:DataProvider — must provide the location (YPoint) for each node in the given graph.
 
reverseEdgeMap:EdgeMap — a node map that will contain for each edge its reverse edge. If this argument is null then no reverse edge information will be available.

Returns
Edge — an edge on the outer face of the result graph.
triangulatePoints2()method 
public static function triangulatePoints2(points:YList, result:Graph, resultMap:NodeMap, reverseEdgeMap:EdgeMap):Edge

Computes a triangulation of the given points. The calculated triangulation is represented by an embedded graph, i.e. to each edge there exists a reverse edge and the outedges around each node are in embedded order. The returned edge and the (optional) reverseEdgeMap can be used to construct all faces of the plane graph and to determine its outer face.

Parameters

points:YList — the point set to be triangulated. The points must be provided as a YList of YPoints.
 
result:Graph — the resulting triangulation
 
resultMap:NodeMap — the node map that forms the link between a point and a node.
 
reverseEdgeMap:EdgeMap — a node map that will contain for each edge its reverse edge. If this argument is null then no reverse edge information will be available.

Returns
Edge — an edge on the outer face of the result graph.