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

#include <vertex.h>

Inheritance diagram for Vertex:
Coordinates VertexGroup

Public Member Functions

 Vertex (const float=0., const float=0., Edge *=NULL)
 Vertex (const Coordinates c, Edge *=NULL)
 ~Vertex ()
unsigned int neighbourCount () const
void take (VirtualVertex *, Vertex *=NULL)
void giveVirtualVerticesTo (Vertex *)
void forget (VirtualVertex *)
unsigned int getID () const
unsigned int getObjectCount () const
std::list< VirtualVertex * > getObjects (unsigned int=0) const
VirtualVertexgetFirstObject () const
EdgegetEdge () const
void setEdge (Edge *e)
bool isNeighbourOf (Vertex *) const
bool isACorner () const
bool have (VirtualVertex *) const
- Public Member Functions inherited from Coordinates
 Coordinates (const float x=0., const float y=0.)
float squareDistanceTo (const Coordinates &othr) const
float distanceTo (const Coordinates &othr) const
float x () const
float y () const
void setX (float x)
void setY (float y)
void setCoord (float x, float y)
bool operator== (const Coordinates &othr)
bool operator!= (const Coordinates &othr)
Coordinates operator+ (const Coordinates &c)
Coordinates operator- (const Coordinates &c)
Coordinates operator/ (const float value)
Coordinates operator+= (const Coordinates &c)

Detailed Description

Vertex are Coordinates with a unique ID and that is linked to an Edge.

Constructor & Destructor Documentation

Vertex::Vertex ( const float  x = 0.,
const float  y = 0.,
Edge edge = NULL 
)

Creat a new Vertex.

Parameters
xcoordinate
ycoordinate
edgereference to an Edge that have this new Vertex for origin
Returns
a new and well initialized Vertex
Vertex::Vertex ( const Coordinates  c,
Edge edge = NULL 
)

Creat a new Vertex.

Parameters
cCoordinates that defined position of new Vertex
edgereference to an Edge that have this new Vertex for origin
Returns
a new and well initialized Vertex
Vertex::~Vertex ( )

Destructor Forget all VirtualVertex

Member Function Documentation

void Vertex::forget ( VirtualVertex trob)
Parameters
troba VirtualVertex that will be forgeted by this
Note
if this have not trob in memory, nothing is done by that function.
trob is not modified

Reimplemented in VertexGroup.

Edge * Vertex::getEdge ( ) const
Returns
an Edge that had this Vertex for origin
VirtualVertex * Vertex::getFirstObject ( ) const

Access to one VirtualVertex of this instance.

Returns
a VirtualVertex pointer, or NULLĀ if no Object referenced

Reimplemented in VertexGroup.

std::list< VirtualVertex * > Vertex::getObjects ( unsigned int  nb = 0) const

Access to all VirtualVertexs of this instance.

Parameters
nbnumber of objects returned. If 0, default or greater than object count, all are returned.
Returns
a std::list of VirtualVertex pointers

Reimplemented in VertexGroup.

void Vertex::giveVirtualVerticesTo ( Vertex v)
Parameters
va Vertex that will receive all VirtualVertex of this

Reimplemented in VertexGroup.

bool Vertex::have ( VirtualVertex vv) const
Parameters
vva VirtualVertex address
Returns
true iff this have vv in objects list

Reimplemented in VertexGroup.

bool Vertex::isACorner ( ) const
Returns
true iff this is referenced by triangulation and is one of the four corner vertice

Reimplemented in VertexGroup.

bool Vertex::isNeighbourOf ( Vertex v) const
Parameters
va Vertex return true iff an edge have for origin this and for destination v

Reimplemented in VertexGroup.

void Vertex::setEdge ( Edge e)
Parameters
ethe reference to an Edge, the new Edge that have this Vertex for origin
void Vertex::take ( VirtualVertex trob,
Vertex ancient = NULL 
)
Parameters
troba VirtualVertex that will be added in list of this
ancientthe Vertex that have trob, and that will forget it, or NULLĀ (default value)
Note
trob is modified by a call to setVertex(this)

Reimplemented in VertexGroup.


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