DGtal 1.3.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. More... | |
void | clear () |
Clears the complex (as if it was just default constructed). More... | |
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. More... | |
void | unrequireFaceGeometry () |
Release ressources allocated to face geometry. More... | |
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. More... | |
std::vector< VertexRange > | cell_vertices |
Tells if the face geometry has been computed. More... | |
std::vector< Cell > | true_face_cell |
Tells if the face geometry has been computed. More... | |
std::vector< Cell > | false_face_cell |
Tells if the face geometry has been computed. More... | |
std::vector< VertexRange > | true_face_vertices |
Tells if the face geometry has been computed. More... | |
std::vector< Point > | vertex_position |
Tells if the face geometry has been computed. More... | |
bool | has_face_geometry |
Tells if the face geometry has been computed. More... | |
std::vector< Vector > | true_face_normal |
Contains the outward oriented normal of each 'true' face. More... | |
std::vector< Scalar > | true_face_intercept |
Contains the intercept of each 'true' face. More... | |
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. More... | |
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:
nbVertices()-1
nbFaces()-1
nbCells()-1
(the infinite cell is not in this range).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 DGtal::ConvexCellComplex< TPoint >::clear().
|
inline |
Definition at line 181 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::cell_vertices, DGtal::ConvexCellComplex< TPoint >::computeCellVertices(), and DGtal::ConvexCellComplex< TPoint >::nbCells().
|
inline |
[in] | c | any valid cell |
Definition at line 286 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::cellVertices(), DGtal::ConvexCellComplex< TPoint >::isInfinite(), DGtal::ConvexCellComplex< TPoint >::position(), and DGtal::ConvexCellComplex< TPoint >::toReal().
Referenced by main().
|
inline |
[in] | c | any valid cell |
Definition at line 161 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::cell_faces.
Referenced by DGtal::ConvexCellComplex< TPoint >::cellLatticePolytope(), DGtal::ConvexCellComplex< TPoint >::computeFaceGeometry(), and main().
|
inline |
hasFaceGeometry() == true
[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 DGtal::ConvexCellComplex< TPoint >::cellFaces(), DGtal::ConvexCellComplex< TPoint >::cellVertices(), domain, DGtal::ConvexCellComplex< TPoint >::faceIntercept(), DGtal::ConvexCellComplex< TPoint >::faceNormal(), DGtal::ConvexCellComplex< TPoint >::hasFaceGeometry(), DGtal::ConvexCellComplex< TPoint >::isInfinite(), and DGtal::ConvexCellComplex< TPoint >::position().
|
inline |
[in] | c | any valid cell (non infinite) |
Definition at line 233 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::cellVertices(), and DGtal::ConvexCellComplex< TPoint >::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 DGtal::ConvexCellComplex< TPoint >::cell_vertices, DGtal::ConvexCellComplex< TPoint >::computeCellVertices(), DGtal::ConvexCellComplex< TPoint >::INFINITE_CELL, and DGtal::ConvexCellComplex< TPoint >::nbCells().
Referenced by DGtal::ConvexCellComplex< TPoint >::cellBarycenter(), DGtal::ConvexCellComplex< TPoint >::cellLatticePolytope(), DGtal::ConvexCellComplex< TPoint >::cellVertexPositions(), DGtal::ConvexCellComplex< TPoint >::computeFaceGeometry(), DGtal::ConvexCellComplex< TPoint >::faceComplementVertices(), and main().
|
inline |
Clears the complex (as if it was just default constructed).
Definition at line 115 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::cell_faces, DGtal::ConvexCellComplex< TPoint >::cell_vertices, DGtal::ConvexCellComplex< TPoint >::false_face_cell, DGtal::ConvexCellComplex< TPoint >::has_face_geometry, DGtal::ConvexCellComplex< TPoint >::true_face_cell, DGtal::ConvexCellComplex< TPoint >::true_face_intercept, DGtal::ConvexCellComplex< TPoint >::true_face_normal, DGtal::ConvexCellComplex< TPoint >::true_face_vertices, and DGtal::ConvexCellComplex< TPoint >::vertex_position.
Referenced by DGtal::ConvexCellComplex< TPoint >::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 DGtal::ConvexCellComplex< TPoint >::cell_faces, DGtal::ConvexCellComplex< TPoint >::cell_vertices, and DGtal::ConvexCellComplex< TPoint >::true_face_vertices.
Referenced by DGtal::ConvexCellComplex< TPoint >::allCellVertices(), and DGtal::ConvexCellComplex< TPoint >::cellVertices().
|
inlineprotected |
Computes for each face its outward oriented normal vector.
Definition at line 442 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::cellFaces(), DGtal::ConvexCellComplex< TPoint >::cellVertices(), DGtal::ConvexCellComplex< TPoint >::computeHalfSpace(), DGtal::PointVector< dim, TEuclideanRing, TContainer >::dot(), DGtal::Trace::error(), DGtal::ConvexCellComplex< TPoint >::faceComplementVertices(), DGtal::ConvexCellComplex< TPoint >::has_face_geometry, DGtal::ConvexCellComplex< TPoint >::nbCells(), DGtal::ConvexCellComplex< TPoint >::nbFaces(), DGtal::ConvexCellComplex< TPoint >::position(), DGtal::ConvexCellComplex< TPoint >::reorderFaceVertices(), DGtal::trace, DGtal::ConvexCellComplex< TPoint >::true_face_intercept, DGtal::ConvexCellComplex< TPoint >::true_face_normal, DGtal::ConvexCellComplex< TPoint >::true_face_vertices, and DGtal::PointVector< dim, TEuclideanRing, TContainer >::zero.
Referenced by DGtal::ConvexCellComplex< TPoint >::requireFaceGeometry().
|
inlineprotected |
v | a range of vertices of size() >= dimension |
Definition at line 480 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::dimension, DGtal::PointVector< dim, TEuclideanRing, TContainer >::dot(), and DGtal::ConvexCellComplex< TPoint >::position().
Referenced by DGtal::ConvexCellComplex< TPoint >::computeFaceGeometry().
|
inline |
[in] | f | any face |
Definition at line 202 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::false_face_cell, and DGtal::ConvexCellComplex< TPoint >::true_face_cell.
Referenced by DGtal::ConvexCellComplex< TPoint >::faceComplementVertices().
|
inline |
[in] | f | any face |
Definition at line 211 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::cellVertices(), DGtal::ConvexCellComplex< TPoint >::faceCell(), DGtal::ConvexCellComplex< TPoint >::isInfinite(), and DGtal::ConvexCellComplex< TPoint >::true_face_vertices.
Referenced by DGtal::ConvexCellComplex< TPoint >::computeFaceGeometry().
|
inline |
hasFaceGeometry() == true
[in] | f | any face |
Definition at line 341 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::hasFaceGeometry(), DGtal::ConvexCellComplex< TPoint >::nbFaces(), and DGtal::ConvexCellComplex< TPoint >::true_face_intercept.
Referenced by DGtal::ConvexCellComplex< TPoint >::cellLatticePolytope().
|
inline |
hasFaceGeometry() == true
[in] | f | any face |
Definition at line 330 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::hasFaceGeometry(), DGtal::ConvexCellComplex< TPoint >::nbFaces(), and DGtal::ConvexCellComplex< TPoint >::true_face_normal.
Referenced by DGtal::ConvexCellComplex< TPoint >::cellLatticePolytope().
|
inline |
[in] | f | any face |
Definition at line 245 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::faceVertices().
|
inline |
[in] | f | any face |
Definition at line 193 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::true_face_vertices.
Referenced by DGtal::ConvexCellComplex< TPoint >::faceVertexPositions(), and main().
|
inline |
Definition at line 350 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::has_face_geometry.
Referenced by DGtal::ConvexCellComplex< TPoint >::cellLatticePolytope(), DGtal::ConvexCellComplex< TPoint >::faceIntercept(), DGtal::ConvexCellComplex< TPoint >::faceNormal(), DGtal::ConvexCellComplex< TPoint >::requireFaceGeometry(), and DGtal::ConvexCellComplex< TPoint >::selfDisplay().
|
inline |
Definition at line 145 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::INFINITE_CELL.
|
inline |
[in] | c | any cell |
Definition at line 150 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::INFINITE_CELL.
Referenced by DGtal::ConvexCellComplex< TPoint >::cellBarycenter(), DGtal::ConvexCellComplex< TPoint >::cellLatticePolytope(), DGtal::ConvexCellComplex< TPoint >::cellVertexPositions(), and DGtal::ConvexCellComplex< TPoint >::faceComplementVertices().
|
inline |
Checks the validity/consistency of the object.
Definition at line 419 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::nbCells().
|
inline |
Definition at line 129 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::cell_faces.
Referenced by DGtal::ConvexCellComplex< TPoint >::allCellVertices(), DGtal::ConvexCellComplex< TPoint >::cellVertices(), DGtal::ConvexCellComplex< TPoint >::computeFaceGeometry(), DGtal::ConvexCellComplex< TPoint >::isValid(), main(), and DGtal::ConvexCellComplex< TPoint >::selfDisplay().
|
inline |
Definition at line 132 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::true_face_cell.
Referenced by DGtal::ConvexCellComplex< TPoint >::computeFaceGeometry(), DGtal::ConvexCellComplex< TPoint >::faceIntercept(), DGtal::ConvexCellComplex< TPoint >::faceNormal(), and DGtal::ConvexCellComplex< TPoint >::selfDisplay().
|
inline |
Definition at line 135 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::vertex_position.
Referenced by DGtal::ConvexCellComplex< TPoint >::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 DGtal::ConvexCellComplex< TPoint >::vertex_position.
Referenced by DGtal::ConvexCellComplex< TPoint >::cellBarycenter(), DGtal::ConvexCellComplex< TPoint >::cellLatticePolytope(), DGtal::ConvexCellComplex< TPoint >::computeFaceGeometry(), DGtal::ConvexCellComplex< TPoint >::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 DGtal::ConvexCellComplex< TPoint >::dimension, DGtal::ConvexCellComplex< TPoint >::true_face_normal, and DGtal::ConvexCellComplex< TPoint >::true_face_vertices.
Referenced by DGtal::ConvexCellComplex< TPoint >::computeFaceGeometry().
|
inline |
Forces the computation of face geometry.
Definition at line 354 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::computeFaceGeometry(), and DGtal::ConvexCellComplex< TPoint >::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 DGtal::ConvexCellComplex< TPoint >::dimension, DGtal::ConvexCellComplex< TPoint >::hasFaceGeometry(), DGtal::ConvexCellComplex< TPoint >::nbCells(), DGtal::ConvexCellComplex< TPoint >::nbFaces(), and DGtal::ConvexCellComplex< TPoint >::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 DGtal::ConvexCellComplex< TPoint >::dimension.
|
inline |
[in] | p | any point |
Definition at line 263 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::dimension.
Referenced by DGtal::ConvexCellComplex< TPoint >::cellBarycenter(), and main().
|
inline |
Release ressources allocated to face geometry.
Definition at line 361 of file ConvexCellComplex.h.
References DGtal::ConvexCellComplex< TPoint >::has_face_geometry, DGtal::ConvexCellComplex< TPoint >::true_face_intercept, and DGtal::ConvexCellComplex< TPoint >::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 DGtal::ConvexCellComplex< TPoint >::cellFaces(), DGtal::ConvexCellComplex< TPoint >::clear(), DGtal::ConvexCellComplex< TPoint >::computeCellVertices(), and DGtal::ConvexCellComplex< TPoint >::nbCells().
|
mutable |
Tells if the face geometry has been computed.
Definition at line 378 of file ConvexCellComplex.h.
Referenced by DGtal::ConvexCellComplex< TPoint >::allCellVertices(), DGtal::ConvexCellComplex< TPoint >::cellVertices(), DGtal::ConvexCellComplex< TPoint >::clear(), and DGtal::ConvexCellComplex< TPoint >::computeCellVertices().
|
static |
Definition at line 86 of file ConvexCellComplex.h.
Referenced by DGtal::ConvexCellComplex< TPoint >::computeHalfSpace(), DGtal::ConvexCellComplex< TPoint >::reorderFaceVertices(), DGtal::ConvexCellComplex< TPoint >::selfDisplay(), DGtal::ConvexCellComplex< TPoint >::toLattice(), and DGtal::ConvexCellComplex< TPoint >::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 DGtal::ConvexCellComplex< TPoint >::clear(), and DGtal::ConvexCellComplex< TPoint >::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 DGtal::ConvexCellComplex< TPoint >::clear(), DGtal::ConvexCellComplex< TPoint >::computeFaceGeometry(), DGtal::ConvexCellComplex< TPoint >::hasFaceGeometry(), and DGtal::ConvexCellComplex< TPoint >::unrequireFaceGeometry().
|
static |
Definition at line 92 of file ConvexCellComplex.h.
Referenced by DGtal::ConvexCellComplex< TPoint >::cellVertices(), DGtal::ConvexCellComplex< TPoint >::infiniteCell(), and DGtal::ConvexCellComplex< TPoint >::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 DGtal::ConvexCellComplex< TPoint >::clear(), DGtal::ConvexCellComplex< TPoint >::faceCell(), and DGtal::ConvexCellComplex< TPoint >::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 DGtal::ConvexCellComplex< TPoint >::clear(), DGtal::ConvexCellComplex< TPoint >::computeFaceGeometry(), DGtal::ConvexCellComplex< TPoint >::faceIntercept(), and DGtal::ConvexCellComplex< TPoint >::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 DGtal::ConvexCellComplex< TPoint >::clear(), DGtal::ConvexCellComplex< TPoint >::computeFaceGeometry(), DGtal::ConvexCellComplex< TPoint >::faceNormal(), DGtal::ConvexCellComplex< TPoint >::reorderFaceVertices(), and DGtal::ConvexCellComplex< TPoint >::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 DGtal::ConvexCellComplex< TPoint >::clear(), DGtal::ConvexCellComplex< TPoint >::computeCellVertices(), DGtal::ConvexCellComplex< TPoint >::computeFaceGeometry(), DGtal::ConvexCellComplex< TPoint >::faceComplementVertices(), DGtal::ConvexCellComplex< TPoint >::faceVertices(), and DGtal::ConvexCellComplex< TPoint >::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 DGtal::ConvexCellComplex< TPoint >::clear(), DGtal::ConvexCellComplex< TPoint >::nbVertices(), and DGtal::ConvexCellComplex< TPoint >::position().