Fade2D Documentation pages v2.12
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 
55 class CLASS_DECLSPEC Voronoi2
56 {
57 public:
59  explicit Voronoi2(Dt2* pDt);
61  ~Voronoi2();
62 
72  bool getVCellsAtVEdge(VoroVertex2* pVoroVtx0,VoroVertex2* pVoroVtx1,VoroCell2*& pCell0,VoroCell2*& pCell1);
73 
79  bool isValid() const;
80 
81 
82 
90  void getVoronoiCells(std::vector<VoroCell2*>& vVoronoiCells);
91 
103 
117  void show(
118  const char* filename,
119  bool bVoronoi=true,
120  bool bCellColors=true,
121  bool bSites=true,
122  bool bDelaunay=true,
123  bool bCellLabels=false
124  );
125 
139  void show(
140  Visualizer2* pVisualizer,
141  bool bVoronoi=true,
142  bool bCellColors=true,
143  bool bSites=true,
144  bool bDelaunay=true,
145  bool bCellLabels=false
146  );
147 
158  VoroCell2* locateVoronoiCell(const Point2& queryPoint);
159 
169 protected:
170  Voronoi2Impl* pImpl;
171 private:
172  Voronoi2(Voronoi2&);
173  Voronoi2& operator=(Voronoi2&);
174 
175 };
176 
177 
178 } // (namespace)
Point.
Definition: Point2.h:52
Triangle.
Definition: Triangle2.h:60
Visualizer2 is a general Postscript writer. It draws the objects Point2, Segment2,...
Definition: Visualizer2.h:57
Voronoi cell.
Definition: VoroCell2.h:45
Voronoi vertex.
Definition: VoroVertex2.h:44
Voronoi diagram.
Definition: Voronoi2.h:56
VoroCell2 * locateVoronoiCell(const Point2 &queryPoint)
Locate a Voronoi Cell.
VoroCell2 * getVoronoiCell(Point2 *pSite)
Get Voronoi cell.
bool getVCellsAtVEdge(VoroVertex2 *pVoroVtx0, VoroVertex2 *pVoroVtx1, VoroCell2 *&pCell0, VoroCell2 *&pCell1)
Get the Voronoi cells adjacent to a Voronoi edge.
bool isValid() const
Is valid.
VoroVertex2 * getVoronoiVertex(Triangle2 *pT)
Get the Voronoi vertex of a triangle.
void getVoronoiCells(std::vector< VoroCell2 * > &vVoronoiCells)
Get 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.