Voronoi cell. More...
#include <VoroCell2.h>
Public Member Functions | |
bool | getAdjacentVCells (std::vector< VoroCell2 * > &vAdjacentCells) const |
Get adjacent Voronoi cells. More... | |
double | getArea () const |
Get the area. More... | |
bool | getBoundaryPoints (std::vector< Point2 > &vPoints, std::vector< Vector2 > *pvInfiniteDirections=NULL) const |
Get boundary points. More... | |
double | getCentroid (Point2 ¢roid) const |
Get the centroid and area. More... | |
int | getCustomCellIndex () const |
Get custom cell-index. More... | |
bool | getIncidentTriangles (std::vector< Triangle2 * > &vIncTriangles) const |
Get incident triangles. More... | |
bool | getNeighborSites (std::vector< Point2 * > &vSites) const |
Get neighbor sites. More... | |
Point2 * | getSite () const |
Get site. More... | |
bool | getVoronoiVertices (std::vector< VoroVertex2 * > &vVoroVertices) const |
bool | isFinite () const |
Is finite cell. More... | |
void | setCustomCellIndex (int customCellIndex_) |
Set custom cell-index. More... | |
This class represents a Voronoi cell. A Voronoi cell corresponds to a certain site, which is a vertex of the dual Delaunay triangulation.
bool GEOM_FADE2D::VoroCell2::getAdjacentVCells | ( | std::vector< VoroCell2 * > & | vAdjacentCells | ) | const |
Retrieves the Voronoi cells adjacent to the current cell. The cells are returned in counterclockwise order.
[out] | vAdjacentCells | a vector to store the adjacent Voronoi cells. |
true
if the cell is finite, false
otherwise. double GEOM_FADE2D::VoroCell2::getArea | ( | ) | const |
Retrieves the area of the Voronoi cell. If the cell is finite, the area is computed and returned. If the cell is infinite, -1.0 is returned.
bool GEOM_FADE2D::VoroCell2::getBoundaryPoints | ( | std::vector< Point2 > & | vPoints, |
std::vector< Vector2 > * | pvInfiniteDirections = NULL |
||
) | const |
This method retrieves the boundary points of the current Voronoi cell as Point2
objects. The points are returned in counterclockwise order.
[out] | vPoints | contains the boundary points in counterclockwise order. |
[out] | pvInfiniteDirections | an optional vector to store the directions of the infinite Voronoi edges. If the cell is finite, this parameter is ignored. Default value: NULL |
true
if the cell is finite, false
otherwise.double GEOM_FADE2D::VoroCell2::getCentroid | ( | Point2 & | centroid | ) | const |
Retrieves the centroid of the Voronoi cell and its area. If the cell is finite, the area is computed and returned. If the cell is infinite, -1.0 is returned for the area.
[out] | centroid | the centroid of the Voronoi cell. |
int GEOM_FADE2D::VoroCell2::getCustomCellIndex | ( | ) | const |
Retrieves the custom cell index that was set previously. Returns -1 if no custom cell index has been set.
bool GEOM_FADE2D::VoroCell2::getIncidentTriangles | ( | std::vector< Triangle2 * > & | vIncTriangles | ) | const |
Retrieves the Delaunay triangles that are incident to the site of the Voronoi cell. These triangles are returned in counterclockwise order.
[out] | vIncTriangles | a vector to store the Delaunay triangles incident to the site of the cell. |
true
if the cell is finite, false
otherwise. bool GEOM_FADE2D::VoroCell2::getNeighborSites | ( | std::vector< Point2 * > & | vSites | ) | const |
Retrieves the sites of the Voronoi cells adjacent to the current cell in counterclockwise order.
[out] | vSites | a vector to store the sites of the neighbor cells. |
true
if the cell is finite, false
otherwise. Point2* GEOM_FADE2D::VoroCell2::getSite | ( | ) | const |
Retrieves the site associated with the current Voronoi cell. The site is also a vertex of the dual Delaunay triangulation.
Point2
. 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 of the current cell in counterclockwise order. |
true
if the cell is finite, false
otherwise.bool GEOM_FADE2D::VoroCell2::isFinite | ( | ) | const |
Checks if the current Voronoi cell is finite.
true
if the cell is finite, false
otherwise. void GEOM_FADE2D::VoroCell2::setCustomCellIndex | ( | int | customCellIndex_ | ) |
Use this method to associate Voronoi cells with your own data structures or to assign labels for visualization.
customCellIndex_ | an arbitrary integer that will be assigned to the Voronoi cell. |