DGtal 2.0.0
|
Aim: represents a d-dimensional complex in a d-dimensional space with the following properties and restrictions: More...
#include <DGtal/geometry/volumes/ConvexCellComplex.h>
Public Types | |
typedef TPoint | Point |
typedef std::size_t | Index |
typedef std::size_t | Size |
typedef Index | Cell |
typedef std::pair< Index, bool > | Face |
typedef Index | Vertex |
typedef std::vector< Index > | IndexRange |
typedef std::vector< Vertex > | VertexRange |
typedef std::vector< Face > | FaceRange |
typedef Point::Coordinate | Scalar |
typedef PointVector< dimension, Scalar > | Vector |
typedef PointVector< dimension, double > | RealPoint |
typedef PointVector< dimension, double > | RealVector |
Public Member Functions | |
Standard services | |
ConvexCellComplex () | |
Defaut constructor. | |
void | clear () |
Clears the complex (as if it was just default constructed). | |
Size | nbCells () const |
Size | nbFaces () const |
Size | nbVertices () const |
Primal structure topology services | |
Cell | infiniteCell () const |
bool | isInfinite (const Cell c) const |
Face | opposite (const Face f) const |
const FaceRange & | cellFaces (const Cell c) const |
const VertexRange & | cellVertices (const Cell c) const |
const std::vector< VertexRange > & | allCellVertices () const |
VertexRange | faceVertices (const Face f) const |
Cell | faceCell (const Face f) const |
VertexRange | faceComplementVertices (const Face f) const |
Primal structure geometry services | |
std::vector< Point > | cellVertexPositions (const Cell c) const |
std::vector< Point > | faceVertexPositions (const Face f) const |
Point | position (const Vertex v) const |
RealPoint | toReal (const Point p) const |
template<typename LatticePoint> | |
LatticePoint | toLattice (const RealPoint p, double factor=1.0) const |
RealPoint | cellBarycenter (const Cell c) const |
template<typename LatticePolytope> | |
LatticePolytope | cellLatticePolytope (const Cell c, const double factor=1.0) const |
const Vector & | faceNormal (const Face f) const |
Scalar | faceIntercept (const Face f) const |
bool | hasFaceGeometry () const |
void | requireFaceGeometry () |
Forces the computation of face geometry. | |
void | unrequireFaceGeometry () |
Release ressources allocated to face geometry. | |
Interface | |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Data Fields | |
Data for primal structure | |
std::vector< FaceRange > | cell_faces |
Tells if the face geometry has been computed. | |
std::vector< VertexRange > | cell_vertices |
Tells if the face geometry has been computed. | |
std::vector< Cell > | true_face_cell |
Tells if the face geometry has been computed. | |
std::vector< Cell > | false_face_cell |
Tells if the face geometry has been computed. | |
std::vector< VertexRange > | true_face_vertices |
Tells if the face geometry has been computed. | |
std::vector< Point > | vertex_position |
Tells if the face geometry has been computed. | |
bool | has_face_geometry |
Tells if the face geometry has been computed. | |
std::vector< Vector > | true_face_normal |
Contains the outward oriented normal of each 'true' face. | |
std::vector< Scalar > | true_face_intercept |
Contains the intercept of each 'true' face. |
Static Public Attributes | |
static const Dimension | dimension = TPoint::dimension |
static const Index | INFINITE_CELL = (Index) -1 |
Protected Member Functions | |
Protected services | |
void | computeCellVertices (const Cell c) const |
void | computeFaceGeometry () |
Computes for each face its outward oriented normal vector. | |
std::pair< Vector, Scalar > | computeHalfSpace (const VertexRange &v) const |
void | reorderFaceVertices (Index f) |
Aim: represents a d-dimensional complex in a d-dimensional space with the following properties and restrictions:
Description of template class 'ConvexCellComplex'
- all cells (maximal and below) are convex
All cells are indexed per dimension, starting from 0, hence:
The ConvexCellComplex is used to represent the Delaunay decomposition into convex cells of a range of points. It is built with ConvexityHelper functions like ConvexityHelper::computeDelaunayCellComplex.
TPoint | an arbitrary model of Point. |
Definition at line 85 of file ConvexCellComplex.h.
typedef Index DGtal::ConvexCellComplex< TPoint >::Cell |
Definition at line 93 of file ConvexCellComplex.h.
typedef std::pair< Index, bool > DGtal::ConvexCellComplex< TPoint >::Face |
Definition at line 94 of file ConvexCellComplex.h.
typedef std::vector< Face > DGtal::ConvexCellComplex< TPoint >::FaceRange |
Definition at line 98 of file ConvexCellComplex.h.
typedef std::size_t DGtal::ConvexCellComplex< TPoint >::Index |
Definition at line 89 of file ConvexCellComplex.h.
typedef std::vector< Index > DGtal::ConvexCellComplex< TPoint >::IndexRange |
Definition at line 96 of file ConvexCellComplex.h.
typedef TPoint DGtal::ConvexCellComplex< TPoint >::Point |
Definition at line 88 of file ConvexCellComplex.h.
typedef PointVector< dimension, double > DGtal::ConvexCellComplex< TPoint >::RealPoint |
Definition at line 102 of file ConvexCellComplex.h.
typedef PointVector< dimension, double > DGtal::ConvexCellComplex< TPoint >::RealVector |
Definition at line 103 of file ConvexCellComplex.h.
typedef Point::Coordinate DGtal::ConvexCellComplex< TPoint >::Scalar |
Definition at line 100 of file ConvexCellComplex.h.
typedef std::size_t DGtal::ConvexCellComplex< TPoint >::Size |
Definition at line 90 of file ConvexCellComplex.h.
typedef PointVector< dimension, Scalar > DGtal::ConvexCellComplex< TPoint >::Vector |
Definition at line 101 of file ConvexCellComplex.h.
typedef Index DGtal::ConvexCellComplex< TPoint >::Vertex |
Definition at line 95 of file ConvexCellComplex.h.
typedef std::vector< Vertex > DGtal::ConvexCellComplex< TPoint >::VertexRange |
Definition at line 97 of file ConvexCellComplex.h.
|
inline |
Defaut constructor.
Definition at line 111 of file ConvexCellComplex.h.
References clear().
|
inline |
Definition at line 181 of file ConvexCellComplex.h.
References cell_vertices, computeCellVertices(), and nbCells().
|
inline |
[in] | c | any valid cell |
Definition at line 286 of file ConvexCellComplex.h.
References cellVertices(), isInfinite(), position(), DGtal::PointVector< dim, TEuclideanRing, TContainer >::size(), and toReal().
Referenced by main().
|
inline |
[in] | c | any valid cell |
Definition at line 161 of file ConvexCellComplex.h.
References cell_faces.
Referenced by cellLatticePolytope(), computeFaceGeometry(), and main().
|
inline |
[in] | c | any valid cell |
[in] | factor | the dilation applied to all points before integer conversion |
Definition at line 302 of file ConvexCellComplex.h.
References cellFaces(), cellVertices(), domain, faceIntercept(), faceNormal(), hasFaceGeometry(), isInfinite(), position(), and toLattice().
|
inline |
[in] | c | any valid cell (non infinite) |
Definition at line 233 of file ConvexCellComplex.h.
References cellVertices(), and isInfinite().
|
inline |
Lazy computation of cell vertices from face vertices if they were not given.
[in] | c | any (finite) cell |
Definition at line 169 of file ConvexCellComplex.h.
References cell_vertices, computeCellVertices(), INFINITE_CELL, and nbCells().
Referenced by cellBarycenter(), cellLatticePolytope(), cellVertexPositions(), faceComplementVertices(), and main().
|
inline |
Clears the complex (as if it was just default constructed).
Definition at line 115 of file ConvexCellComplex.h.
References cell_faces, cell_vertices, false_face_cell, has_face_geometry, true_face_cell, true_face_intercept, true_face_normal, true_face_vertices, and vertex_position.
Referenced by ConvexCellComplex().
|
inlineprotected |
computes the vertices of a given cell c upon request.
c | any valid cell |
Definition at line 432 of file ConvexCellComplex.h.
References cell_faces, cell_vertices, and true_face_vertices.
Referenced by allCellVertices(), and cellVertices().
|
inlineprotected |
Computes for each face its outward oriented normal vector.
Definition at line 442 of file ConvexCellComplex.h.
References cellFaces(), computeHalfSpace(), DGtal::PointVector< dim, TEuclideanRing, TContainer >::dot(), faceComplementVertices(), has_face_geometry, nbCells(), nbFaces(), position(), reorderFaceVertices(), DGtal::trace, true_face_intercept, true_face_normal, true_face_vertices, and DGtal::PointVector< dimension, Scalar >::zero.
Referenced by requireFaceGeometry().
|
inlineprotected |
v | a range of vertices of size() >= dimension |
Definition at line 480 of file ConvexCellComplex.h.
References dimension, DGtal::PointVector< dim, TEuclideanRing, TContainer >::dot(), and position().
Referenced by computeFaceGeometry().
|
inline |
[in] | f | any face |
Definition at line 202 of file ConvexCellComplex.h.
References false_face_cell, and true_face_cell.
Referenced by faceComplementVertices().
|
inline |
[in] | f | any face |
Definition at line 211 of file ConvexCellComplex.h.
References cellVertices(), faceCell(), isInfinite(), and true_face_vertices.
Referenced by computeFaceGeometry().
|
inline |
[in] | f | any face |
Definition at line 341 of file ConvexCellComplex.h.
References hasFaceGeometry(), nbFaces(), and true_face_intercept.
Referenced by cellLatticePolytope().
|
inline |
[in] | f | any face |
Definition at line 330 of file ConvexCellComplex.h.
References hasFaceGeometry(), nbFaces(), and true_face_normal.
Referenced by cellLatticePolytope().
|
inline |
[in] | f | any face |
Definition at line 245 of file ConvexCellComplex.h.
References faceVertices().
|
inline |
[in] | f | any face |
Definition at line 193 of file ConvexCellComplex.h.
References true_face_vertices.
Referenced by faceVertexPositions(), and main().
|
inline |
Definition at line 350 of file ConvexCellComplex.h.
References has_face_geometry.
Referenced by cellLatticePolytope(), faceIntercept(), faceNormal(), requireFaceGeometry(), and selfDisplay().
|
inline |
Definition at line 145 of file ConvexCellComplex.h.
References INFINITE_CELL.
|
inline |
[in] | c | any cell |
Definition at line 150 of file ConvexCellComplex.h.
References INFINITE_CELL.
Referenced by cellBarycenter(), cellLatticePolytope(), cellVertexPositions(), and faceComplementVertices().
|
inline |
Checks the validity/consistency of the object.
Definition at line 419 of file ConvexCellComplex.h.
References nbCells().
|
inline |
Definition at line 129 of file ConvexCellComplex.h.
References cell_faces.
Referenced by allCellVertices(), cellVertices(), computeFaceGeometry(), isValid(), main(), and selfDisplay().
|
inline |
Definition at line 132 of file ConvexCellComplex.h.
References true_face_cell.
Referenced by computeFaceGeometry(), faceIntercept(), faceNormal(), and selfDisplay().
|
inline |
Definition at line 135 of file ConvexCellComplex.h.
References vertex_position.
Referenced by selfDisplay().
|
inline |
[in] | f | any face |
Definition at line 156 of file ConvexCellComplex.h.
|
inline |
[in] | v | any vertex |
Definition at line 256 of file ConvexCellComplex.h.
References vertex_position.
Referenced by cellBarycenter(), cellLatticePolytope(), computeFaceGeometry(), computeHalfSpace(), and main().
|
inlineprotected |
Given a face index f, reorder all its vertices so that they are oriented consistently with respect to the normal.
f | any valid face index |
Definition at line 503 of file ConvexCellComplex.h.
References dimension, true_face_normal, and true_face_vertices.
Referenced by computeFaceGeometry().
|
inline |
Forces the computation of face geometry.
Definition at line 354 of file ConvexCellComplex.h.
References computeFaceGeometry(), and hasFaceGeometry().
Referenced by main().
|
inline |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Definition at line 405 of file ConvexCellComplex.h.
References dimension, hasFaceGeometry(), nbCells(), nbFaces(), and nbVertices().
|
inline |
[in] | p | any real point |
[in] | factor | the dilation applied to point p before integer conversion |
Definition at line 275 of file ConvexCellComplex.h.
References dimension.
Referenced by cellLatticePolytope().
|
inline |
[in] | p | any point |
Definition at line 263 of file ConvexCellComplex.h.
References dimension.
Referenced by cellBarycenter(), and main().
|
inline |
Release ressources allocated to face geometry.
Definition at line 361 of file ConvexCellComplex.h.
References has_face_geometry, true_face_intercept, and true_face_normal.
std::vector< FaceRange > DGtal::ConvexCellComplex< TPoint >::cell_faces |
Tells if the face geometry has been computed.
Definition at line 376 of file ConvexCellComplex.h.
Referenced by cellFaces(), clear(), computeCellVertices(), and nbCells().
|
mutable |
Tells if the face geometry has been computed.
Definition at line 378 of file ConvexCellComplex.h.
Referenced by allCellVertices(), cellVertices(), clear(), and computeCellVertices().
|
static |
Definition at line 86 of file ConvexCellComplex.h.
Referenced by computeHalfSpace(), reorderFaceVertices(), selfDisplay(), toLattice(), and toReal().
std::vector< Cell > DGtal::ConvexCellComplex< TPoint >::false_face_cell |
Tells if the face geometry has been computed.
Definition at line 382 of file ConvexCellComplex.h.
Referenced by clear(), and faceCell().
bool DGtal::ConvexCellComplex< TPoint >::has_face_geometry |
Tells if the face geometry has been computed.
Definition at line 389 of file ConvexCellComplex.h.
Referenced by clear(), computeFaceGeometry(), hasFaceGeometry(), and unrequireFaceGeometry().
|
static |
Definition at line 92 of file ConvexCellComplex.h.
Referenced by cellVertices(), infiniteCell(), and isInfinite().
std::vector< Cell > DGtal::ConvexCellComplex< TPoint >::true_face_cell |
Tells if the face geometry has been computed.
Definition at line 380 of file ConvexCellComplex.h.
Referenced by clear(), faceCell(), and nbFaces().
std::vector< Scalar > DGtal::ConvexCellComplex< TPoint >::true_face_intercept |
Contains the intercept of each 'true' face.
Definition at line 393 of file ConvexCellComplex.h.
Referenced by clear(), computeFaceGeometry(), faceIntercept(), and unrequireFaceGeometry().
std::vector< Vector > DGtal::ConvexCellComplex< TPoint >::true_face_normal |
Contains the outward oriented normal of each 'true' face.
Definition at line 391 of file ConvexCellComplex.h.
Referenced by clear(), computeFaceGeometry(), faceNormal(), reorderFaceVertices(), and unrequireFaceGeometry().
std::vector< VertexRange > DGtal::ConvexCellComplex< TPoint >::true_face_vertices |
Tells if the face geometry has been computed.
Definition at line 384 of file ConvexCellComplex.h.
Referenced by clear(), computeCellVertices(), computeFaceGeometry(), faceComplementVertices(), faceVertices(), and reorderFaceVertices().
std::vector< Point > DGtal::ConvexCellComplex< TPoint >::vertex_position |
Tells if the face geometry has been computed.
Definition at line 386 of file ConvexCellComplex.h.
Referenced by clear(), nbVertices(), and position().