Voronoi diagram.
More...
#include <Voronoi2.h>
|
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...
|
|
This class represents a Voronoi diagram. A Voronoi diagram is the dual graph of a Delaunay triangulation i.e.,
- Each Voronoi cell contains the area closest to its site which is a Delaunay vertex
- Each Voronoi edge has a dual edge in the Delaunay triangulation at an angle of 90 degrees to it.
- Each Voronoi vertex is the circumcenter of a Delaunay triangle
- See also
- https://en.wikipedia.org/wiki/Voronoi_diagram
◆ getVCellsAtVEdge()
- Parameters
-
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. |
- Returns
- true when the command succeeds or false otherwise i.e., when (pVoroVtx0,pVoroVtx1) is not an edge of the Voronoi diagram.
◆ getVoronoiCell()
Use this method to retrieve the Voronoi cell of a specific site.
- Parameters
-
- Returns
- the VoroCell2 of
pSite
.
◆ getVoronoiCells()
void GEOM_FADE2D::Voronoi2::getVoronoiCells |
( |
std::vector< VoroCell2 * > & |
vVoronoiCells | ) |
|
Use this method to retrieve all finite and infinite Voronoi cells.
- Parameters
-
◆ getVoronoiVertex()
Get the Voronoi vertex of a certain dual Delaunay triangle pT
- Parameters
-
- Returns
- the Voronoi vertex that corresponds to
pT
◆ isValid()
bool GEOM_FADE2D::Voronoi2::isValid |
( |
| ) |
const |
- Returns
- whether the Voronoi diagram is ready for use. This is the case as soon 3 sites exist which are not collinear.
◆ locateVoronoiCell()
VoroCell2* GEOM_FADE2D::Voronoi2::locateVoronoiCell |
( |
const Point2 & |
queryPoint | ) |
|
This is a high performance method to locate the Voronoi cell of an arbitrary queryPoint
- Parameters
-
- Returns
- the Voronoi cell that contains
queryPoint
or NULL if the Voronoi diagram is invalid.
◆ show() [1/2]
void GEOM_FADE2D::Voronoi2::show |
( |
const char * |
filename, |
|
|
bool |
bVoronoi = true , |
|
|
bool |
bCellColors = true , |
|
|
bool |
bSites = true , |
|
|
bool |
bDelaunay = true , |
|
|
bool |
bCellLabels = false |
|
) |
| |
- Parameters
-
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.
◆ show() [2/2]
void GEOM_FADE2D::Voronoi2::show |
( |
Visualizer2 * |
pVisualizer, |
|
|
bool |
bVoronoi = true , |
|
|
bool |
bCellColors = true , |
|
|
bool |
bSites = true , |
|
|
bool |
bDelaunay = true , |
|
|
bool |
bCellLabels = false |
|
) |
| |
- Parameters
-
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) |
- Note
- This method only clips infinite cells. But finite cells can also be very large. Call Visualizer2::setLimit() to specify the range of interest.
The documentation for this class was generated from the following file: