Fade2D Documentation pages v2.16.7
Delaunay Features
Voronoi2.h
Go to the documentation of this file.
1 // Copyright (C) Geom Software e.U, Bernhard Kornberger, Graz/Austria
2 //
3 // This file is part of the Fade2D library. The student license is free
4 // of charge and covers personal non-commercial research. Licensees
5 // holding a commercial license may use this file in accordance with
6 // the Commercial License Agreement.
7 //
8 // This software is provided AS IS with NO WARRANTY OF ANY KIND,
9 // INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
10 // FOR A PARTICULAR PURPOSE.
11 //
12 // Please contact the author if any conditions of this licensing are
13 // not clear to you.
14 //
15 // Author: Bernhard Kornberger, bkorn (at) geom.at
16 // http://www.geom.at
17 
18 
19 
25 #pragma once
26 #include "common.h"
27 #include "VoroVertex2.h"
28 #include "VoroCell2.h"
29 
30 
31 #if GEOM_PSEUDO3D==GEOM_TRUE
32  namespace GEOM_FADE25D {
33 #elif GEOM_PSEUDO3D==GEOM_FALSE
34  namespace GEOM_FADE2D {
35 #else
36  #error GEOM_PSEUDO3D is not defined
37 #endif
38 
39 
40 class Dt2; // FWD
41 class Voronoi2Impl; // FWD
42 class Visualizer2; // FWD
43 
62 class CLASS_DECLSPEC Voronoi2
63 {
64 public:
66  explicit Voronoi2(Dt2* pDt);
68  ~Voronoi2();
79  bool getVCellsAtVEdge(VoroVertex2* pVoroVtx0,VoroVertex2* pVoroVtx1,VoroCell2*& pCell0,VoroCell2*& pCell1);
88  bool isValid() const;
98  void getVoronoiCells(std::vector<VoroCell2*>& vVoronoiCells);
99 
111 
129  void show(
130  const char* filename,
131  bool bVoronoi=true,
132  bool bCellColors=true,
133  bool bSites=true,
134  bool bDelaunay=true,
135  bool bCellLabels=false
136  );
137 
138 
158  void show(
159  Visualizer2* pVisualizer,
160  bool bVoronoi=true,
161  bool bCellColors=true,
162  bool bSites=true,
163  bool bDelaunay=true,
164  bool bCellLabels=false
165  );
176  VoroCell2* locateVoronoiCell(const Point2& queryPoint);
188 protected:
189  Voronoi2Impl* pImpl;
190 private:
191  Voronoi2(Voronoi2&);
192  Voronoi2& operator=(Voronoi2&);
193 
194 };
195 
196 
197 } // (namespace)
Represents a 2D point.
Definition: Point2.h:61
Represents a triangle in a triangulation.
Definition: Triangle2.h:59
A PDF and Postscript Writer for 2D Visualization.
Definition: Visualizer2.h:60
Voronoi cell.
Definition: VoroCell2.h:45
Voronoi vertex.
Definition: VoroVertex2.h:43
Voronoi diagram.
Definition: Voronoi2.h:63
VoroCell2 * locateVoronoiCell(const Point2 &queryPoint)
Locate a Voronoi Cell.
VoroCell2 * getVoronoiCell(Point2 *pSite)
Retrieve the Voronoi cell of a specific site.
bool getVCellsAtVEdge(VoroVertex2 *pVoroVtx0, VoroVertex2 *pVoroVtx1, VoroCell2 *&pCell0, VoroCell2 *&pCell1)
Get the Voronoi cells adjacent to a Voronoi edge.
bool isValid() const
Check if the Voronoi diagram is valid.
VoroVertex2 * getVoronoiVertex(Triangle2 *pT)
Get the Voronoi vertex of a triangle.
void getVoronoiCells(std::vector< VoroCell2 * > &vVoronoiCells)
Retrieve all Voronoi cells.
void show(const char *filename, bool bVoronoi=true, bool bCellColors=true, bool bSites=true, bool bDelaunay=true, bool bCellLabels=false)
Draw the Voronoi diagram.
void show(Visualizer2 *pVisualizer, bool bVoronoi=true, bool bCellColors=true, bool bSites=true, bool bDelaunay=true, bool bCellLabels=false)
Draw the Voronoi diagram.