DGtal
0.6.devel
|
#include <DigitalSurface.h>
Data Structures | |
struct | Arc |
struct | Edge |
struct | Face |
struct | SurfelMap |
struct | VertexMap |
Public Types | |
typedef TDigitalSurfaceContainer | DigitalSurfaceContainer |
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::SurfelSet | SurfelSet |
typedef Surfel | Vertex |
typedef KSpace::Size | Size |
typedef KSpace::SurfelSet | VertexSet |
typedef UmbrellaComputer < DigitalSurfaceTracker > | Umbrella |
typedef Umbrella::State | UmbrellaState |
typedef std::vector< Arc > | ArcRange |
typedef std::vector< Face > | FaceRange |
typedef std::vector< Vertex > | VertexRange |
typedef std::set< Face > | FaceSet |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((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) 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 |
DigitalSurfaceTracker * | myTracker |
UmbrellaComputer < DigitalSurfaceTracker > | myUmbrellaComputer |
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, CSinglePassConstRange, boost::CopyConstructible, boost::Assignable.
TDigitalSurfaceContainer | any model of CDigitalSurfaceContainer: the concrete representation chosen for the digital surface. |
Definition at line 105 of file DigitalSurface.h.
typedef std::vector<Arc> DGtal::DigitalSurface< TDigitalSurfaceContainer >::ArcRange |
The range of arcs is defined as a vector.
Definition at line 245 of file DigitalSurface.h.
typedef DigitalSurfaceContainer::Cell DGtal::DigitalSurface< TDigitalSurfaceContainer >::Cell |
Definition at line 115 of file DigitalSurface.h.
typedef DigitalSurfaceContainer::SurfelConstIterator DGtal::DigitalSurface< TDigitalSurfaceContainer >::ConstIterator |
Definition at line 118 of file DigitalSurface.h.
typedef TDigitalSurfaceContainer DGtal::DigitalSurface< TDigitalSurfaceContainer >::DigitalSurfaceContainer |
Definition at line 108 of file DigitalSurface.h.
typedef DigitalSurfaceContainer::DigitalSurfaceTracker DGtal::DigitalSurface< TDigitalSurfaceContainer >::DigitalSurfaceTracker |
Definition at line 119 of file DigitalSurface.h.
typedef std::vector<Face> DGtal::DigitalSurface< TDigitalSurfaceContainer >::FaceRange |
The range of faces is defined as a vector.
Definition at line 247 of file DigitalSurface.h.
typedef std::set<Face> DGtal::DigitalSurface< TDigitalSurfaceContainer >::FaceSet |
The set of faces is defined as set.
Definition at line 251 of file DigitalSurface.h.
typedef DigitalSurfaceContainer::KSpace DGtal::DigitalSurface< TDigitalSurfaceContainer >::KSpace |
Definition at line 114 of file DigitalSurface.h.
typedef KSpace::Point DGtal::DigitalSurface< TDigitalSurfaceContainer >::Point |
Definition at line 120 of file DigitalSurface.h.
typedef DigitalSurfaceContainer::SCell DGtal::DigitalSurface< TDigitalSurfaceContainer >::SCell |
Definition at line 116 of file DigitalSurface.h.
typedef DigitalSurface<DigitalSurfaceContainer> DGtal::DigitalSurface< TDigitalSurfaceContainer >::Self |
Definition at line 113 of file DigitalSurface.h.
typedef KSpace::Size DGtal::DigitalSurface< TDigitalSurfaceContainer >::Size |
Defines how to represent a size (unsigned integral type).
Definition at line 133 of file DigitalSurface.h.
typedef DigitalSurfaceContainer::Surfel DGtal::DigitalSurface< TDigitalSurfaceContainer >::Surfel |
Definition at line 117 of file DigitalSurface.h.
typedef KSpace::SurfelSet DGtal::DigitalSurface< TDigitalSurfaceContainer >::SurfelSet |
Definition at line 121 of file DigitalSurface.h.
typedef UmbrellaComputer<DigitalSurfaceTracker> DGtal::DigitalSurface< TDigitalSurfaceContainer >::Umbrella |
This define a utility class for computing umbrellas.
Definition at line 185 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 188 of file DigitalSurface.h.
typedef Surfel DGtal::DigitalSurface< TDigitalSurfaceContainer >::Vertex |
Defines the type for a vertex.
Definition at line 131 of file DigitalSurface.h.
typedef std::vector<Vertex> DGtal::DigitalSurface< TDigitalSurfaceContainer >::VertexRange |
The range of vertices is defined as a vector.
Definition at line 249 of file DigitalSurface.h.
typedef KSpace::SurfelSet DGtal::DigitalSurface< TDigitalSurfaceContainer >::VertexSet |
Defines how to represent a set of vertex.
Definition at line 135 of file DigitalSurface.h.
|
inline |
Destructor.
Definition at line 46 of file DigitalSurface.ih.
|
inline |
Copy constructor.
other | the object to clone. |
Definition at line 54 of file DigitalSurface.ih.
|
inline |
Copy constructor from container.
container | the container to copy. |
Definition at line 64 of file DigitalSurface.ih.
|
inline |
Constructor from pointer on a dynamically allocated container.
containerPtr | the pointer to acquire. |
Definition at line 80 of file DigitalSurface.ih.
|
protected |
Constructor. Forbidden by default (protected to avoid g++ warnings).
|
inline |
This set of faces is sufficient for displaying the surface.
Definition at line 409 of file DigitalSurface.ih.
|
inline |
Definition at line 394 of file DigitalSurface.ih.
|
inline |
This set of faces is sufficient for displaying the boundary of the surface.
Definition at line 427 of file DigitalSurface.ih.
|
inline |
[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. |
Definition at line 337 of file DigitalSurface.ih.
|
inline |
Definition at line 128 of file DigitalSurface.ih.
|
inline |
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).
Definition at line 152 of file DigitalSurface.ih.
DGtal::DigitalSurface< TDigitalSurfaceContainer >::BOOST_CONCEPT_ASSERT | ( | (CDigitalSurfaceContainer< DigitalSurfaceContainer >) | ) |
|
inline |
state | any valid state (i.e. some pivot cell) on the surface. |
Definition at line 446 of file DigitalSurface.ih.
References DGtal::false, and DGtal::DigitalSurface< TDigitalSurfaceContainer >::Face::state.
|
inline |
Definition at line 112 of file DigitalSurface.ih.
|
inline |
Definition at line 120 of file DigitalSurface.ih.
|
inline |
v | any vertex of this graph |
Definition at line 161 of file DigitalSurface.ih.
|
inline |
Definition at line 136 of file DigitalSurface.ih.
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. |
Definition at line 756 of file DigitalSurface.ih.
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. |
Definition at line 836 of file DigitalSurface.ih.
References DGtal::PointVector< dim, TEuclideanRing >::norm().
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. |
Definition at line 675 of file DigitalSurface.ih.
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. |
Definition at line 609 of file DigitalSurface.ih.
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. |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Definition at line 547 of file DigitalSurface.ih.
|
inline |
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. |
Definition at line 357 of file DigitalSurface.ih.
References DGtal::DigitalSurface< TDigitalSurfaceContainer >::Arc::base, DGtal::DigitalSurface< TDigitalSurfaceContainer >::Arc::epsilon, and DGtal::DigitalSurface< TDigitalSurfaceContainer >::Arc::k.
|
inline |
v | any vertex (surfel) of the surface. |
Definition at line 271 of file DigitalSurface.ih.
|
inline |
Definition at line 294 of file DigitalSurface.ih.
References DGtal::DigitalSurface< TDigitalSurfaceContainer >::Arc::base, DGtal::DigitalSurface< TDigitalSurfaceContainer >::Arc::epsilon, and DGtal::DigitalSurface< TDigitalSurfaceContainer >::Arc::k.
|
inline |
v | any vertex (surfel) of the surface. |
Definition at line 249 of file DigitalSurface.ih.
|
inline |
Checks the validity/consistency of the object.
Definition at line 534 of file DigitalSurface.ih.
|
inline |
Assignment.
other | the object to copy. |
Definition at line 97 of file DigitalSurface.ih.
References DGtal::DigitalSurface< TDigitalSurfaceContainer >::myContainer, DGtal::DigitalSurface< TDigitalSurfaceContainer >::myTracker, and DGtal::DigitalSurface< TDigitalSurfaceContainer >::myUmbrellaComputer.
|
inline |
a | any arc (s,t) |
Definition at line 316 of file DigitalSurface.ih.
References DGtal::DigitalSurface< TDigitalSurfaceContainer >::Arc::base, DGtal::DigitalSurface< TDigitalSurfaceContainer >::Arc::epsilon, and DGtal::DigitalSurface< TDigitalSurfaceContainer >::Arc::k.
|
inline |
v | any vertex (surfel) of the surface. |
Definition at line 228 of file DigitalSurface.ih.
|
inline |
NB: there may be different faces with the same pivot (except on the boundary of well-composed pictures).
f | any face. |
Definition at line 503 of file DigitalSurface.ih.
References DGtal::DigitalSurface< TDigitalSurfaceContainer >::Face::state.
|
inline |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Definition at line 522 of file DigitalSurface.ih.
|
inline |
NB: there may be two arcs with the same separator.
a | any arc. |
Definition at line 484 of file DigitalSurface.ih.
References DGtal::DigitalSurface< TDigitalSurfaceContainer >::Arc::base, DGtal::DigitalSurface< TDigitalSurfaceContainer >::Arc::epsilon, and DGtal::DigitalSurface< TDigitalSurfaceContainer >::Arc::k.
|
inline |
Definition at line 144 of file DigitalSurface.ih.
|
inline |
Definition at line 307 of file DigitalSurface.ih.
References DGtal::DigitalSurface< TDigitalSurfaceContainer >::Arc::base.
|
inline |
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 ). |
Definition at line 378 of file DigitalSurface.ih.
References DGtal::DigitalSurface< TDigitalSurfaceContainer >::Face::nbVertices, and DGtal::DigitalSurface< TDigitalSurfaceContainer >::Face::state.
|
inline |
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 |
Definition at line 182 of file DigitalSurface.ih.
|
inline |
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. |
Definition at line 202 of file DigitalSurface.ih.
|
private |
a smart pointer on the container.
Definition at line 572 of file DigitalSurface.h.
Referenced by DGtal::DigitalSurface< TDigitalSurfaceContainer >::operator=().
|
mutableprivate |
a pointer on a tracker.
Definition at line 574 of file DigitalSurface.h.
Referenced by DGtal::DigitalSurface< TDigitalSurfaceContainer >::operator=().
|
mutableprivate |
This object is used to compute umbrellas over the surface.
Definition at line 576 of file DigitalSurface.h.
Referenced by DGtal::DigitalSurface< TDigitalSurfaceContainer >::operator=().