DGtal 1.4.0
|
Aim: Represents a set of n-1-cells in a nD space, together with adjacency relation between these cells. Therefore, a digital surface is a pure cubical complex (model of CCubicalComplex), made of k-cells, 0 <= k < n. This complex is generally not a manifold (i.e. a kind of surface), except when it has the property of being well-composed. More...
#include <DGtal/topology/DigitalSurface.h>
Data Structures | |
struct | Arc |
struct | Edge |
struct | Face |
struct | SurfelMap |
struct | VertexMap |
Public Types | |
typedef TDigitalSurfaceContainer | DigitalSurfaceContainer |
typedef boost::undirected_tag | directed_category |
the graph is undirected. | |
typedef boost::DigitalSurface_graph_traversal_category | traversal_category |
the graph satisfies AdjacencyListGraph and VertexListGraph concepts. | |
typedef boost::disallow_parallel_edge_tag | edge_parallel_category |
the graph does not allow parallel edges. | |
typedef DigitalSurface< DigitalSurfaceContainer > | Self |
typedef DigitalSurfaceContainer::KSpace | KSpace |
typedef DigitalSurfaceContainer::Cell | Cell |
typedef DigitalSurfaceContainer::SCell | SCell |
typedef DigitalSurfaceContainer::Surfel | Surfel |
typedef DigitalSurfaceContainer::SurfelConstIterator | ConstIterator |
typedef DigitalSurfaceContainer::DigitalSurfaceTracker | DigitalSurfaceTracker |
typedef KSpace::Point | Point |
typedef KSpace::Vector | Vector |
typedef KSpace::SurfelSet | SurfelSet |
typedef Surfel | Vertex |
Defines the type for a vertex. | |
typedef KSpace::Size | Size |
Defines how to represent a size (unsigned integral type). | |
typedef KSpace::SurfelSet | VertexSet |
Defines how to represent a set of vertex. | |
typedef UmbrellaComputer< DigitalSurfaceTracker > | Umbrella |
This define a utility class for computing umbrellas. | |
typedef Umbrella::State | UmbrellaState |
typedef std::vector< Arc > | ArcRange |
The range of arcs is defined as a vector. | |
typedef std::vector< Face > | FaceRange |
The range of faces is defined as a vector. | |
typedef std::vector< Vertex > | VertexRange |
The range of vertices is defined as a vector. | |
typedef std::set< Face > | FaceSet |
The set of faces is defined as set. | |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((concepts::CDigitalSurfaceContainer< DigitalSurfaceContainer >)) | |
~DigitalSurface () | |
DigitalSurface (const DigitalSurface &other) | |
DigitalSurface (const DigitalSurfaceContainer &container) | |
DigitalSurface (DigitalSurfaceContainer *containerPtr) | |
DigitalSurface & | operator= (const DigitalSurface &other) |
const DigitalSurfaceContainer & | container () const |
DigitalSurfaceContainer & | container () |
ConstIterator | begin () const |
ConstIterator | end () const |
Size | size () const |
Size | degree (const Vertex &v) const |
Size | bestCapacity () const |
template<typename OutputIterator > | |
void | writeNeighbors (OutputIterator &it, const Vertex &v) const |
template<typename OutputIterator , typename VertexPredicate > | |
void | writeNeighbors (OutputIterator &it, const Vertex &v, const VertexPredicate &pred) const |
ArcRange | outArcs (const Vertex &v) const |
ArcRange | inArcs (const Vertex &v) const |
FaceRange | facesAroundVertex (const Vertex &v, bool order_ccw_in_3d=false) const |
Vertex | head (const Arc &a) const |
Vertex | tail (const Arc &a) const |
Arc | opposite (const Arc &a) const |
Arc | arc (const Vertex &tail, const Vertex &head) const |
FaceRange | facesAroundArc (const Arc &a) const |
VertexRange | verticesAroundFace (const Face &f) const |
FaceSet | allFaces () const |
FaceSet | allClosedFaces () const |
FaceSet | allOpenFaces () const |
Face | computeFace (UmbrellaState state) const |
SCell | separator (const Arc &a) const |
SCell | pivot (const Face &f) const |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
void | exportSurfaceAs3DOFF (std::ostream &out) const |
template<typename CellEmbedder > | |
void | exportEmbeddedSurfaceAs3DOFF (std::ostream &out, const CellEmbedder &cembedder) const |
template<typename CellEmbedder > | |
void | exportEmbeddedSurfaceAs3DNOFF (std::ostream &out, const CellEmbedder &cembedder) const |
template<typename SCellEmbedderWithGradientMap > | |
void | exportAs3DNOFF (std::ostream &out, const SCellEmbedderWithGradientMap &scembedder) const |
template<typename CellEmbedder > | |
void | exportEmbeddedIteratedSurfaceAs3DNOFF (std::ostream &out, const CellEmbedder &cembedder) const |
Protected Member Functions | |
DigitalSurface () | |
Private Attributes | |
CountedPtr< DigitalSurfaceContainer > | myContainer |
a smart pointer on the container. | |
DigitalSurfaceTracker * | myTracker |
a pointer on a tracker. | |
UmbrellaComputer< DigitalSurfaceTracker > | myUmbrellaComputer |
This object is used to compute umbrellas over the surface. | |
Aim: Represents a set of n-1-cells in a nD space, together with adjacency relation between these cells. Therefore, a digital surface is a pure cubical complex (model of CCubicalComplex), made of k-cells, 0 <= k < n. This complex is generally not a manifold (i.e. a kind of surface), except when it has the property of being well-composed.
Description of template class 'DigitalSurface'
For geometric analysis or visualization, it is often interesting to look at the "dual" of the digital surface. n-1-cells form now vertices, n-2-cells are edges, n-3-cells are faces, and so on. A digital surface is thus a model of CUndirectedSimpleGraph, henceforth of CUndirectedSimpleLocalGraph. The n-1-cells are then seen as the vertices of the graph, while their adjacencies constitutes the edges of the graph.
Furthermore, starting from 3D, a digital surface is in some sense a model of combinatorial surface (closed or open). You may obtain arcs (which are oriented edges) and faces (which are sequences of oriented arcs turning around some pivot cell). In 3D, this dual digital surface is a combinatorial 2-manifold, open or not depending whether the digital surface is open or closed. For instance, arcs may have 0 or 1 incident face.
We construct this dual digital surface with umbrellas, which are sequences of adjacent n-1-cells turning around a n-3-cell, called the pivot of the umbrella. Faces or umbrellas are computed with UmbrellaComputer class.
Proxy class to a DigitalSurfaceContainer.
DigitalSurface is a model of the concept CUndirectedSimpleGraph, CUndirectedSimpleLocalGraph, CConstSinglePassRange, boost::CopyConstructible, boost::Assignable.
TDigitalSurfaceContainer | any model of CDigitalSurfaceContainer: the concrete representation chosen for the digital surface. |
Definition at line 139 of file DigitalSurface.h.
typedef std::vector<Arc> DGtal::DigitalSurface< TDigitalSurfaceContainer >::ArcRange |
The range of arcs is defined as a vector.
Definition at line 301 of file DigitalSurface.h.
typedef DigitalSurfaceContainer::Cell DGtal::DigitalSurface< TDigitalSurfaceContainer >::Cell |
Definition at line 160 of file DigitalSurface.h.
typedef DigitalSurfaceContainer::SurfelConstIterator DGtal::DigitalSurface< TDigitalSurfaceContainer >::ConstIterator |
Definition at line 163 of file DigitalSurface.h.
typedef TDigitalSurfaceContainer DGtal::DigitalSurface< TDigitalSurfaceContainer >::DigitalSurfaceContainer |
Definition at line 142 of file DigitalSurface.h.
typedef DigitalSurfaceContainer::DigitalSurfaceTracker DGtal::DigitalSurface< TDigitalSurfaceContainer >::DigitalSurfaceTracker |
Definition at line 164 of file DigitalSurface.h.
typedef boost::undirected_tag DGtal::DigitalSurface< TDigitalSurfaceContainer >::directed_category |
the graph is undirected.
Definition at line 149 of file DigitalSurface.h.
typedef boost::disallow_parallel_edge_tag DGtal::DigitalSurface< TDigitalSurfaceContainer >::edge_parallel_category |
the graph does not allow parallel edges.
Definition at line 153 of file DigitalSurface.h.
typedef std::vector<Face> DGtal::DigitalSurface< TDigitalSurfaceContainer >::FaceRange |
The range of faces is defined as a vector.
Definition at line 303 of file DigitalSurface.h.
typedef std::set<Face> DGtal::DigitalSurface< TDigitalSurfaceContainer >::FaceSet |
The set of faces is defined as set.
Definition at line 307 of file DigitalSurface.h.
typedef DigitalSurfaceContainer::KSpace DGtal::DigitalSurface< TDigitalSurfaceContainer >::KSpace |
Definition at line 159 of file DigitalSurface.h.
typedef KSpace::Point DGtal::DigitalSurface< TDigitalSurfaceContainer >::Point |
Definition at line 165 of file DigitalSurface.h.
typedef DigitalSurfaceContainer::SCell DGtal::DigitalSurface< TDigitalSurfaceContainer >::SCell |
Definition at line 161 of file DigitalSurface.h.
typedef DigitalSurface<DigitalSurfaceContainer> DGtal::DigitalSurface< TDigitalSurfaceContainer >::Self |
Definition at line 158 of file DigitalSurface.h.
typedef KSpace::Size DGtal::DigitalSurface< TDigitalSurfaceContainer >::Size |
Defines how to represent a size (unsigned integral type).
Definition at line 179 of file DigitalSurface.h.
typedef DigitalSurfaceContainer::Surfel DGtal::DigitalSurface< TDigitalSurfaceContainer >::Surfel |
Definition at line 162 of file DigitalSurface.h.
typedef KSpace::SurfelSet DGtal::DigitalSurface< TDigitalSurfaceContainer >::SurfelSet |
Definition at line 167 of file DigitalSurface.h.
typedef boost::DigitalSurface_graph_traversal_category DGtal::DigitalSurface< TDigitalSurfaceContainer >::traversal_category |
the graph satisfies AdjacencyListGraph and VertexListGraph concepts.
Definition at line 151 of file DigitalSurface.h.
typedef UmbrellaComputer<DigitalSurfaceTracker> DGtal::DigitalSurface< TDigitalSurfaceContainer >::Umbrella |
This define a utility class for computing umbrellas.
Definition at line 231 of file DigitalSurface.h.
typedef Umbrella::State DGtal::DigitalSurface< TDigitalSurfaceContainer >::UmbrellaState |
The state of an umbrella is a triplet (surfel, separator, pivot). Given a state, the whole umbrella can be computed.
Definition at line 234 of file DigitalSurface.h.
typedef KSpace::Vector DGtal::DigitalSurface< TDigitalSurfaceContainer >::Vector |
Definition at line 166 of file DigitalSurface.h.
typedef Surfel DGtal::DigitalSurface< TDigitalSurfaceContainer >::Vertex |
Defines the type for a vertex.
Definition at line 177 of file DigitalSurface.h.
typedef std::vector<Vertex> DGtal::DigitalSurface< TDigitalSurfaceContainer >::VertexRange |
The range of vertices is defined as a vector.
Definition at line 305 of file DigitalSurface.h.
typedef KSpace::SurfelSet DGtal::DigitalSurface< TDigitalSurfaceContainer >::VertexSet |
Defines how to represent a set of vertex.
Definition at line 181 of file DigitalSurface.h.
DGtal::DigitalSurface< TDigitalSurfaceContainer >::~DigitalSurface | ( | ) |
Destructor.
DGtal::DigitalSurface< TDigitalSurfaceContainer >::DigitalSurface | ( | const DigitalSurface< TDigitalSurfaceContainer > & | other | ) |
Copy constructor.
other | the object to clone. |
DGtal::DigitalSurface< TDigitalSurfaceContainer >::DigitalSurface | ( | const DigitalSurfaceContainer & | container | ) |
Copy constructor from container.
container | the container to copy. |
DGtal::DigitalSurface< TDigitalSurfaceContainer >::DigitalSurface | ( | DigitalSurfaceContainer * | containerPtr | ) |
Constructor from pointer on a dynamically allocated container.
containerPtr | the pointer to acquire. |
|
protected |
Constructor. Forbidden by default (protected to avoid g++ warnings).
FaceSet DGtal::DigitalSurface< TDigitalSurfaceContainer >::allClosedFaces | ( | ) | const |
This set of faces is sufficient for displaying the surface.
Referenced by main().
FaceSet DGtal::DigitalSurface< TDigitalSurfaceContainer >::allFaces | ( | ) | const |
Referenced by testCombinatorialSurface().
FaceSet DGtal::DigitalSurface< TDigitalSurfaceContainer >::allOpenFaces | ( | ) | const |
This set of faces is sufficient for displaying the boundary of the surface.
Arc DGtal::DigitalSurface< TDigitalSurfaceContainer >::arc | ( | const Vertex & | tail, |
const Vertex & | head ) const |
[tail] and [head] should be adjacent surfel.
tail | the vertex at the tail of the arc. |
head | the vertex at the head of the arc. |
ConstIterator DGtal::DigitalSurface< TDigitalSurfaceContainer >::begin | ( | ) | const |
You may use this range only once ! This is because the iterators are only single pass. If you wish to visit twice the range, you must indeed creates two ranges by calling begin() twice (end() is not compulsory here, but advised).
Referenced by boost::edges(), laplace_sphere(), main(), testCurvature2d(), testDigitalSurfaceBoostGraphInterface(), testEstimatorCache(), testGaussianCurvature3d(), testLocalConvolutionNormalVectorEstimator(), testLocalConvolutionNormalVectorEstimator(), testMeanCurvature3d(), testPrincipalCurvatures3d(), and testRaySurface().
Size DGtal::DigitalSurface< TDigitalSurfaceContainer >::bestCapacity | ( | ) | const |
Should return a reasonable estimation of the number of neighbors for all vertices. For instance a planar triangulation should return 6-8, a quad-mesh should return 4, digital surface is 2*(K::dimension-1).
DGtal::DigitalSurface< TDigitalSurfaceContainer >::BOOST_CONCEPT_ASSERT | ( | (concepts::CDigitalSurfaceContainer< DigitalSurfaceContainer >) | ) |
Face DGtal::DigitalSurface< TDigitalSurfaceContainer >::computeFace | ( | UmbrellaState | state | ) | const |
state | any valid state (i.e. some pivot cell) on the surface. |
DigitalSurfaceContainer & DGtal::DigitalSurface< TDigitalSurfaceContainer >::container | ( | ) |
const DigitalSurfaceContainer & DGtal::DigitalSurface< TDigitalSurfaceContainer >::container | ( | ) | const |
Referenced by main().
Size DGtal::DigitalSurface< TDigitalSurfaceContainer >::degree | ( | const Vertex & | v | ) | const |
v | any vertex of this graph |
Referenced by boost::out_degree().
ConstIterator DGtal::DigitalSurface< TDigitalSurfaceContainer >::end | ( | ) | const |
Referenced by boost::edges(), laplace_sphere(), main(), testEstimatorCache(), testLocalConvolutionNormalVectorEstimator(), and testRaySurface().
void DGtal::DigitalSurface< TDigitalSurfaceContainer >::exportAs3DNOFF | ( | std::ostream & | out, |
const SCellEmbedderWithGradientMap & | scembedder ) const |
Writes/Displays the object on an output stream in NOFF file format. Cells are embedded by [scembedder]. Normals are also computed by the embedder.
out | the output stream where the object is written. |
scembedder | any embedder of signed cellular grid elements. |
SCellEmbedderWithGradientMap | any model of CSCellEmbedder and CWithGradientMap. |
Referenced by testLocalConvolutionNormalVectorEstimator().
void DGtal::DigitalSurface< TDigitalSurfaceContainer >::exportEmbeddedIteratedSurfaceAs3DNOFF | ( | std::ostream & | out, |
const CellEmbedder & | cembedder ) const |
Writes/Displays the object on an output stream in NOFF file format. Surface spels are embedded by [cembedder]. Normals are also computed by the embedder.
out | the output stream where the object is written. |
cembedder | any embedder of digital surface spels. |
void DGtal::DigitalSurface< TDigitalSurfaceContainer >::exportEmbeddedSurfaceAs3DNOFF | ( | std::ostream & | out, |
const CellEmbedder & | cembedder ) const |
Writes/Displays the object on an output stream in NOFF file format. Cells are embedded by [cembedder]. Normals are also computed by the embedder.
out | the output stream where the object is written. |
cembedder | any embedder of cellular grid elements. |
CellEmbedder | any model of CCellEmbedder and CWithGradientMap. |
Referenced by main().
void DGtal::DigitalSurface< TDigitalSurfaceContainer >::exportEmbeddedSurfaceAs3DOFF | ( | std::ostream & | out, |
const CellEmbedder & | cembedder ) const |
Writes/Displays the object on an output stream in OFF file format. Cells are embedded by [cembedder]. Normals are not computed.
out | the output stream where the object is written. |
cembedder | any embedder of cellular grid elements. |
CellEmbedder | any model of CCellEmbedder. |
Referenced by main().
void DGtal::DigitalSurface< TDigitalSurfaceContainer >::exportSurfaceAs3DOFF | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream in OFF file format. Cells are embbeded onto their default centroid.
out | the output stream where the object is written. |
Referenced by main(), and testCombinatorialSurface().
FaceRange DGtal::DigitalSurface< TDigitalSurfaceContainer >::facesAroundArc | ( | const Arc & | a | ) | const |
Computes the faces incident to a given arc. Empty in 2D. 1 face in 3D, 2 in 4D and so one, n-2 in nD. Returned faces may be open.
a | any arc on the surface. |
Referenced by testCombinatorialSurface().
FaceRange DGtal::DigitalSurface< TDigitalSurfaceContainer >::facesAroundVertex | ( | const Vertex & | v, |
bool | order_ccw_in_3d = false ) const |
v | any vertex (surfel) of the surface. |
order_ccw_in_3d | when 'true', orders faces counterclockwise around vertex (solely in 3d). It corresponds to ordering the pointels counterclockwise around the given surfel v, seen from the exterior side of the surfel. |
Vertex DGtal::DigitalSurface< TDigitalSurfaceContainer >::head | ( | const Arc & | a | ) | const |
a | any arc (s,t) |
Referenced by boost::target(), and testCombinatorialSurface().
ArcRange DGtal::DigitalSurface< TDigitalSurfaceContainer >::inArcs | ( | const Vertex & | v | ) | const |
v | any vertex (surfel) of the surface. |
bool DGtal::DigitalSurface< TDigitalSurfaceContainer >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
DigitalSurface & DGtal::DigitalSurface< TDigitalSurfaceContainer >::operator= | ( | const DigitalSurface< TDigitalSurfaceContainer > & | other | ) |
Assignment.
other | the object to copy. |
Arc DGtal::DigitalSurface< TDigitalSurfaceContainer >::opposite | ( | const Arc & | a | ) | const |
a | any arc (s,t) |
Referenced by testDigitalSurfaceBoostGraphInterface().
ArcRange DGtal::DigitalSurface< TDigitalSurfaceContainer >::outArcs | ( | const Vertex & | v | ) | const |
v | any vertex (surfel) of the surface. |
Referenced by boost::out_edges(), and testCombinatorialSurface().
SCell DGtal::DigitalSurface< TDigitalSurfaceContainer >::pivot | ( | const Face & | f | ) | const |
NB: there may be different faces with the same pivot (except on the boundary of well-composed pictures).
f | any face. |
Referenced by testCombinatorialSurface().
void DGtal::DigitalSurface< TDigitalSurfaceContainer >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
SCell DGtal::DigitalSurface< TDigitalSurfaceContainer >::separator | ( | const Arc & | a | ) | const |
NB: there may be two arcs with the same separator.
a | any arc. |
Referenced by testDigitalSurfaceBoostGraphInterface().
Size DGtal::DigitalSurface< TDigitalSurfaceContainer >::size | ( | ) | const |
Referenced by laplacian(), main(), boost::num_vertices(), and testDigitalSurfaceBoostGraphInterface().
Vertex DGtal::DigitalSurface< TDigitalSurfaceContainer >::tail | ( | const Arc & | a | ) | const |
VertexRange DGtal::DigitalSurface< TDigitalSurfaceContainer >::verticesAroundFace | ( | const Face & | f | ) | const |
If f is incident to the arcs (s,t) and (t,u) (say), then (s,t,u) is a subsequence of the returned sequence.
f | any valid face on the digital surface (open or closed ). |
Referenced by main(), and testCombinatorialSurface().
void DGtal::DigitalSurface< TDigitalSurfaceContainer >::writeNeighbors | ( | OutputIterator & | it, |
const Vertex & | v ) const |
Writes the neighbors of [v] in the output iterator [it]. Neighbors are given in no specific order.
OutputIterator | the type for the output iterator (e.g. back_insert_iterator<std::vector<Vertex> >). |
[in,out] | it | any output iterator on Vertex (*it++ should be allowed), which specifies where neighbors are written. |
[in] | v | any vertex of this graph |
Referenced by boost::adjacent_vertices(), and main().
void DGtal::DigitalSurface< TDigitalSurfaceContainer >::writeNeighbors | ( | OutputIterator & | it, |
const Vertex & | v, | ||
const VertexPredicate & | pred ) const |
Writes the neighbors of [v], verifying the predicate [pred] in the output iterator [it]. Neighbors are given in no specific order.
OutputIterator | the type for the output iterator (e.g. back_insert_iterator<std::vector<Vertex> >). |
VertexPredicate | any type of predicate taking a Vertex as input. |
[in,out] | it | any output iterator on Vertex (*it++ should be allowed), which specifies where neighbors are written. |
[in] | v | any vertex of this graph |
[in] | pred | the predicate for selecting neighbors. |
|
private |
a smart pointer on the container.
Definition at line 679 of file DigitalSurface.h.
|
mutableprivate |
a pointer on a tracker.
Definition at line 681 of file DigitalSurface.h.
|
mutableprivate |
This object is used to compute umbrellas over the surface.
Definition at line 683 of file DigitalSurface.h.