Fade2.5D Documentation pages v2.16.8
Delaunay Features
VoroCell2.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 // unclear to you.
14 //
15 // Support: https://www.geom.at/contact/
16 // Project: https://www.geom.at/fade2d/html/
17 
23 #pragma once
24 #include "common.h"
25 #include "Point2.h"
26 #include "Bbox2.h"
27 
28 #if GEOM_PSEUDO3D==GEOM_TRUE
29  namespace GEOM_FADE25D {
30 #elif GEOM_PSEUDO3D==GEOM_FALSE
31  namespace GEOM_FADE2D {
32 #else
33  #error GEOM_PSEUDO3D is not defined
34 #endif
35 
36 class Voronoi2Impl; // FWD
37 class VoroVertex2; // FWD
38 
44 class CLASS_DECLSPEC VoroCell2
45 {
46 public:
48  VoroCell2(Point2* pSite_,Voronoi2Impl* pOwner_);
59  void setCustomCellIndex(int customCellIndex_);
69  int getCustomCellIndex() const;
70 
81  bool getVoronoiVertices(std::vector<VoroVertex2*>& vVoroVertices) const;
82 
99  std::vector<Point2>& vPoints,
100  std::vector<Vector2>* pvInfiniteDirections=NULL
101  ) const;
102 
112  bool getIncidentTriangles(std::vector<Triangle2*>& vIncTriangles) const;
122  bool getNeighborSites(std::vector<Point2*>& vSites) const;
123 
133  bool getAdjacentVCells(std::vector<VoroCell2*>& vAdjacentCells) const;
134 
141  bool isFinite() const;
142 
150  Point2* getSite() const;
151 
162  double getCentroid(Point2& centroid) const;
163 
171  double getArea() const;
173  Voronoi2Impl* getOwner() const;
174 
175 protected:
177  Point2* pSite;
179  Voronoi2Impl* pOwner;
181  int customCellIndex;
182 
183 };
184 
185 
186 } // (namespace)
187 
188 
Represents a 2.5D point.
Definition: Point2.h:76
Voronoi cell.
Definition: VoroCell2.h:45
bool getVoronoiVertices(std::vector< VoroVertex2 * > &vVoroVertices) const
Point2 * getSite() const
Get site.
bool getAdjacentVCells(std::vector< VoroCell2 * > &vAdjacentCells) const
Get adjacent Voronoi cells.
double getCentroid(Point2 &centroid) const
Get the centroid and area.
bool getBoundaryPoints(std::vector< Point2 > &vPoints, std::vector< Vector2 > *pvInfiniteDirections=NULL) const
Get boundary points.
bool getIncidentTriangles(std::vector< Triangle2 * > &vIncTriangles) const
Get incident triangles.
int getCustomCellIndex() const
Get custom cell-index.
bool getNeighborSites(std::vector< Point2 * > &vSites) const
Get neighbor sites.
bool isFinite() const
Is finite cell.
double getArea() const
Get the area.
void setCustomCellIndex(int customCellIndex_)
Set custom cell-index.