Voronoi cell. More...
#include <VoroCell2.h>
Public Member Functions | |
bool | getAdjacentVCells (std::vector< VoroCell2 * > &vAdjacentCells) const |
double | getArea () const |
bool | getBoundaryPoints (std::vector< Point2 > &vPoints, std::vector< Vector2 > *pvInfiniteDirections=NULL) const |
double | getCentroid (Point2 ¢roid) const |
int | getCustomCellIndex () const |
bool | getIncidentTriangles (std::vector< Triangle2 * > &vIncTriangles) const |
bool | getNeighborSites (std::vector< Point2 * > &vSites) const |
Point2 * | getSite () const |
bool | getVoronoiVertices (std::vector< VoroVertex2 * > &vVoroVertices) const |
bool | isFinite () const |
void | setCustomCellIndex (int customCellIndex_) |
Voronoi cell.
This class represents a Voronoi cell. A Voronoi cell corresponds to a certain site which is also a vertex of the dual Delaunay triangulation.
bool GEOM_FADE2D::VoroCell2::getAdjacentVCells | ( | std::vector< VoroCell2 * > & | vAdjacentCells | ) | const |
Get adjacent Voronoi cells
vAdjacentCells | is used to return the neighbor cells in counterclockwise order. |
double GEOM_FADE2D::VoroCell2::getArea | ( | ) | const |
Get the area
bool GEOM_FADE2D::VoroCell2::getBoundaryPoints | ( | std::vector< Point2 > & | vPoints, |
std::vector< Vector2 > * | pvInfiniteDirections = NULL |
||
) | const |
Get boundary points
Use this method to retrieve the Voronoi vertices of the present cell as Point2.
[out] | vPoints | contains the boundary points in counterclockwise order. |
[out] | pvInfiniteDirections | can optionally be used to retrieve the directions of the infinite Voronoi edges: When a pointer to a vector is provided for pvInfiniteDirections and the cell is finite, then the first stored Vector2 describes the direction of the infinite edge at vPoints[0] and the second one the direction of the infinite edge at vPoints.back(). |
double GEOM_FADE2D::VoroCell2::getCentroid | ( | Point2 & | centroid | ) | const |
Get the centroid and area
[out] | centroid |
int GEOM_FADE2D::VoroCell2::getCustomCellIndex | ( | ) | const |
Get custom cell-index
bool GEOM_FADE2D::VoroCell2::getIncidentTriangles | ( | std::vector< Triangle2 * > & | vIncTriangles | ) | const |
Get incident triangles
The site of the present Voronoi cell is also a vertex of the dual Delaunay triangulation.
vIncTriangles | is used to return the the Delaunay triangles incident to the site of the cell in counterclockwise order. |
bool GEOM_FADE2D::VoroCell2::getNeighborSites | ( | std::vector< Point2 * > & | vSites | ) | const |
Get neighbor sites
vSites | is used to return the sites of the adjacent cells in counterclockwise order. |
Point2* GEOM_FADE2D::VoroCell2::getSite | ( | ) | const |
Get site
bool GEOM_FADE2D::VoroCell2::getVoronoiVertices | ( | std::vector< VoroVertex2 * > & | vVoroVertices | ) | const |
Get Voronoi vertices
Used to retrieve the Voronoi vertices of the cell.
[out] | vVoroVertices | contains VoroVertex2 objects in counterclockwise order. |
bool GEOM_FADE2D::VoroCell2::isFinite | ( | ) | const |
Is finite cell
void GEOM_FADE2D::VoroCell2::setCustomCellIndex | ( | int | customCellIndex_ | ) |
Set custom cell-index
Use this method to associate Voronoi cells with your own data structures or to assign labels for a visualization.
customCellIndex_ | is an arbitrary integer |