Fade2D Documentation pages v2.16.7
Delaunay Features
GEOM_FADE2D::VoroCell2 Class Reference

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 &centroid) 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...
 
Point2getSite () 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...
 

Detailed Description

This class represents a Voronoi cell. A Voronoi cell corresponds to a certain site, which is a vertex of the dual Delaunay triangulation.

Member Function Documentation

◆ getAdjacentVCells()

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.

Parameters
[out]vAdjacentCellsa vector to store the adjacent Voronoi cells.
Returns
true if the cell is finite, false otherwise.

◆ getArea()

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.

Returns
the area of the Voronoi cell if it is finite, or -1.0 if it is infinite.

◆ getBoundaryPoints()

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.

Parameters
[out]vPointscontains the boundary points in counterclockwise order.
[out]pvInfiniteDirectionsan optional vector to store the directions of the infinite Voronoi edges. If the cell is finite, this parameter is ignored. Default value: NULL
Returns
true if the cell is finite, false otherwise.
See also
getVoronoiVertices()

◆ getCentroid()

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.

Parameters
[out]centroidthe centroid of the Voronoi cell.
Returns
the area of the Voronoi cell if it is finite, or -1.0 if it is infinite.

◆ getCustomCellIndex()

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.

Returns
the custom cell index.
See also
setCustomCellIndex()

◆ getIncidentTriangles()

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.

Parameters
[out]vIncTrianglesa vector to store the Delaunay triangles incident to the site of the cell.
Returns
true if the cell is finite, false otherwise.

◆ getNeighborSites()

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.

Parameters
[out]vSitesa vector to store the sites of the neighbor cells.
Returns
true if the cell is finite, false otherwise.

◆ getSite()

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.

Returns
a pointer to the site Point2.

◆ getVoronoiVertices()

bool GEOM_FADE2D::VoroCell2::getVoronoiVertices ( std::vector< VoroVertex2 * > &  vVoroVertices) const

Get Voronoi vertices

Used to retrieve the Voronoi vertices of the cell.

Parameters
[out]vVoroVerticescontains VoroVertex2 objects of the current cell in counterclockwise order.
Returns
true if the cell is finite, false otherwise.
See also
getBoundaryPoints()

◆ isFinite()

bool GEOM_FADE2D::VoroCell2::isFinite ( ) const

Checks if the current Voronoi cell is finite.

Returns
true if the cell is finite, false otherwise.

◆ setCustomCellIndex()

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.

Parameters
customCellIndex_an arbitrary integer that will be assigned to the Voronoi cell.
See also
getCustomCellIndex()

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