Voronoi diagram. More...
#include <Voronoi2.h>
Public Member Functions | |
bool | getVCellsAtVEdge (VoroVertex2 *pVoroVtx0, VoroVertex2 *pVoroVtx1, VoroCell2 *&pCell0, VoroCell2 *&pCell1) |
Get the Voronoi cells adjacent to a Voronoi edge. More... | |
VoroCell2 * | getVoronoiCell (Point2 *pSite) |
Get Voronoi cell. More... | |
void | getVoronoiCells (std::vector< VoroCell2 * > &vVoronoiCells) |
Get all Voronoi cells. More... | |
VoroVertex2 * | getVoronoiVertex (Triangle2 *pT) |
Get the Voronoi vertex of a triangle. More... | |
bool | isValid () const |
Is valid. More... | |
VoroCell2 * | locateVoronoiCell (const Point2 &queryPoint) |
Locate a Voronoi Cell. More... | |
void | show (const char *filename, bool bVoronoi=true, bool bCellColors=true, bool bSites=true, bool bDelaunay=true, bool bCellLabels=false) |
Draw the Voronoi diagram. More... | |
void | show (Visualizer2 *pVisualizer, bool bVoronoi=true, bool bCellColors=true, bool bSites=true, bool bDelaunay=true, bool bCellLabels=false) |
Draw the Voronoi diagram. More... | |
Protected Attributes | |
Voronoi2Impl * | pImpl |
Voronoi diagram.
This class represents a Voronoi diagram. A Voronoi diagram is the dual graph of a Delaunay triangulation i.e.,
bool GEOM_FADE2D::Voronoi2::getVCellsAtVEdge | ( | VoroVertex2 * | pVoroVtx0, |
VoroVertex2 * | pVoroVtx1, | ||
VoroCell2 *& | pCell0, | ||
VoroCell2 *& | pCell1 | ||
) |
Get the Voronoi cells adjacent to a Voronoi edge.
pVoroVtx0,pVoroVtx1 | are the Voronoi vertices that define the Voronoi edge |
pCell0,pCell1 | are used to return the adjacent Voronoi cells or NULL if the command fails. |
Get Voronoi cell.
Use this method to retrieve the Voronoi cell of a specific site.
[in] | pSite |
pSite
. void GEOM_FADE2D::Voronoi2::getVoronoiCells | ( | std::vector< VoroCell2 * > & | vVoronoiCells | ) |
Get all Voronoi cells.
Use this method to retrieve all finite and infinite Voronoi cells.
[out] | vVoronoiCells |
VoroVertex2* GEOM_FADE2D::Voronoi2::getVoronoiVertex | ( | Triangle2 * | pT | ) |
Get the Voronoi vertex of a triangle.
Get the Voronoi vertex of a certain dual Delaunay triangle pT
[in] | pT |
pT
bool GEOM_FADE2D::Voronoi2::isValid | ( | ) | const |
Is valid.
Locate a Voronoi Cell.
This is a high performance method to locate the Voronoi cell of an arbitrary queryPoint
[in] | queryPoint |
queryPoint
or NULL if the Voronoi diagram is invalid. void GEOM_FADE2D::Voronoi2::show | ( | const char * | filename, |
bool | bVoronoi = true , |
||
bool | bCellColors = true , |
||
bool | bSites = true , |
||
bool | bDelaunay = true , |
||
bool | bCellLabels = false |
||
) |
Draw the Voronoi diagram.
filename | is the output *.ps filename |
bVoronoi | draw the edges of the Voronoi diagram (default: true) |
bCellColors | use background colors for the Voronoi cells (default: true) |
bSites | draw the sites (default: true) |
bDelaunay | draw the Delaunay triangles (default: true) |
bCellLabels | show cell labels (or -1 if not assigned) (default: false) |
This method does automatically crop the viewport to twice the range of the sites. Thus very large and infinite cells appear clipped.
void GEOM_FADE2D::Voronoi2::show | ( | Visualizer2 * | pVisualizer, |
bool | bVoronoi = true , |
||
bool | bCellColors = true , |
||
bool | bSites = true , |
||
bool | bDelaunay = true , |
||
bool | bCellLabels = false |
||
) |
Draw the Voronoi diagram.
pVisualizer | is the Visualizer2 object to be used |
bVoronoi | draw the edges of the Voronoi diagram (default: true) |
bCellColors | use background colors for the Voronoi cells (default: true) |
bSites | draw the sites (default: true) |
bDelaunay | draw the Delaunay triangles (default: true) |
bCellLabels | show cell labels (or -1 if not assigned) (default: false) |