Delaunator
2D Delaunay Triangulation in C++ with Python wrapper.
 All Classes Namespaces Functions
Public Member Functions | List of all members
Delaunator Class Reference

#include <delaunator.h>

Public Member Functions

 Delaunator (const float, const float, const float, const float, const VertexFinderMode=VERTEX_FINDER_MODE_LAST)
 ~Delaunator ()
VirtualVertexaddVirtualVertex (Coordinates)
VirtualVertexaddVirtualVertex (float, float)
void delVirtualVertex (VirtualVertex *)
VirtualVertexmovVirtualVertex (VirtualVertex *, Coordinates)
VirtualVertexmovVirtualVertex (VirtualVertex *, float, float)
VirtualVertexvirtualVertexAt (Coordinates, float=EPSILON) const
VirtualVertexvirtualVertexAt (float, float, float=EPSILON) const
std::list< VirtualVertex * > virtualVerticesAt (Coordinates, float=EPSILON) const
std::list< VirtualVertex * > virtualVerticesAt (float, float, float=EPSILON) const
unsigned int objectCount () const
float getXmin () const
float getXmax () const
float getYmin () const
float getYmax () const
float epsilon () const
float distanceMax () const
bool haveVertex (Vertex *) const
bool collideAt (Coordinates) const
bool opt_isdebug () const
bool opt_follow_search () const
std::list< VirtualVertex * > virtualVertices () const

Detailed Description

Delaunay class definition. Provide iterators, access to VirtualVertexs… Have all methods for add, delete and move Objects.

Constructor & Destructor Documentation

Delaunator::Delaunator ( const float  xmin,
const float  xmax,
const float  ymin,
const float  ymax,
const VertexFinderMode  finder_mode = VERTEX_FINDER_MODE_LAST 
)

Wait for limits of triangulation in axis x and y.

Parameters
xminminimal value in x axis allowed
xmaxmaximal value in x axis allowed
yminminimal value in y axis allowed
ymaxmaximal value in y axis allowed
finder_modefor choose which mode of finder will be used for search Coordinates, LAST by default
See Also
VertexFinderMode
Delaunator::~Delaunator ( )

Frees

Member Function Documentation

VirtualVertex * Delaunator::addVirtualVertex ( Coordinates  coords)

Place an object in the triangulation, at the given coords

Parameters
coordsplace where object will be
Returns
obj, just for facilitate functionnal approach
Note
object is not free or moved in memory
VirtualVertex * Delaunator::addVirtualVertex ( float  x,
float  y 
)

Place an object in the triangulation, at the given coords

Parameters
xcoordinate in x-axis
ycoordinate in y-axis
Returns
new VirtualVertex object address, or NULL if invalid coords
Note
no modifications if given coords are invalids (out of bounds)
bool Delaunator::collideAt ( Coordinates  c) const
Parameters
cCoordinates of tested point
Returns
true if point is in-limit of this
void Delaunator::delVirtualVertex ( VirtualVertex obj)

Remove given object of the triangulation.

Parameters
obja VirtualVertex that have been added before
Returns
obj, just for facilitate functionnal approach
Note
given VirtualVertex is deleted
float Delaunator::distanceMax ( ) const
Returns
the maximum distance reachable in triangulation
Note
that distance is equal to distance between (xmin;ymin) and (xmax;ymax)
bool Delaunator::haveVertex ( Vertex v) const
Parameters
vtested Vertex
Returns
true iff tested Vertex is referenced by triangulation
VirtualVertex * Delaunator::movVirtualVertex ( VirtualVertex obj,
Coordinates  relative_move 
)

Move given object by given values. (relative move)

Parameters
obja VirtualVertex that have been added before
relative_moveused for movement
Returns
obj, just for facilitate functionnal approach
Note
object is not free or moved in memory
VirtualVertex * Delaunator::movVirtualVertex ( VirtualVertex obj,
float  rel_x,
float  rel_y 
)

Move given object by given values. (relative move)

Parameters
obja VirtualVertex that have been added before
rel_xrelative move in x-axis
rel_yrelative move in y-axis
Returns
obj, just for facilitate functionnal approach
Note
object is not free or moved in memory
unsigned int Delaunator::objectCount ( ) const
inline
Returns
total number of VirtualVertex in Delaunator
VirtualVertex * Delaunator::virtualVertexAt ( Coordinates  coords,
float  precision = EPSILON 
) const
Parameters
coordsCoordinates where looking for
Returns
VirtualVertex found at given coords, or NULL if nothing found
VirtualVertex * Delaunator::virtualVertexAt ( float  x,
float  y,
float  precision = EPSILON 
) const
Parameters
xcoord in x-axis where looking for
ycoord in y-axis where looking for
Returns
VirtualVertex found at given coords, or NULL if nothing found
std::list< VirtualVertex * > Delaunator::virtualVerticesAt ( Coordinates  coords,
float  precision = EPSILON 
) const
Parameters
coordsCoordinates where looking for
Returns
VirtualVertex list, found at given coords
std::list< VirtualVertex * > Delaunator::virtualVerticesAt ( float  x,
float  y,
float  precision = EPSILON 
) const
Parameters
xcoord in x-axis where looking for
ycoord in y-axis where looking for
Returns
VirtualVertex list, found at given coords

The documentation for this class was generated from the following files: