DGtal
1.0.beta
|
#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 |
typedef boost::DigitalSurface_graph_traversal_category | traversal_category |
typedef boost::disallow_parallel_edge_tag | edge_parallel_category |
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 ((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) 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, CConstSinglePassRange, boost::CopyConstructible, boost::Assignable.
TDigitalSurfaceContainer | any model of CDigitalSurfaceContainer: the concrete representation chosen for the digital surface. |
Definition at line 121 of file DigitalSurface.h.
typedef std::vector<Arc> DGtal::DigitalSurface< TDigitalSurfaceContainer >::ArcRange |
The range of arcs is defined as a vector.
Definition at line 282 of file DigitalSurface.h.
typedef DigitalSurfaceContainer::Cell DGtal::DigitalSurface< TDigitalSurfaceContainer >::Cell |
Definition at line 142 of file DigitalSurface.h.
typedef DigitalSurfaceContainer::SurfelConstIterator DGtal::DigitalSurface< TDigitalSurfaceContainer >::ConstIterator |
Definition at line 145 of file DigitalSurface.h.
typedef TDigitalSurfaceContainer DGtal::DigitalSurface< TDigitalSurfaceContainer >::DigitalSurfaceContainer |
Definition at line 124 of file DigitalSurface.h.
typedef DigitalSurfaceContainer::DigitalSurfaceTracker DGtal::DigitalSurface< TDigitalSurfaceContainer >::DigitalSurfaceTracker |
Definition at line 146 of file DigitalSurface.h.
typedef boost::undirected_tag DGtal::DigitalSurface< TDigitalSurfaceContainer >::directed_category |
the graph is undirected.
Definition at line 131 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 135 of file DigitalSurface.h.
typedef std::vector<Face> DGtal::DigitalSurface< TDigitalSurfaceContainer >::FaceRange |
The range of faces is defined as a vector.
Definition at line 284 of file DigitalSurface.h.
typedef std::set<Face> DGtal::DigitalSurface< TDigitalSurfaceContainer >::FaceSet |
The set of faces is defined as set.
Definition at line 288 of file DigitalSurface.h.
typedef DigitalSurfaceContainer::KSpace DGtal::DigitalSurface< TDigitalSurfaceContainer >::KSpace |
Definition at line 141 of file DigitalSurface.h.
typedef KSpace::Point DGtal::DigitalSurface< TDigitalSurfaceContainer >::Point |
Definition at line 147 of file DigitalSurface.h.
typedef DigitalSurfaceContainer::SCell DGtal::DigitalSurface< TDigitalSurfaceContainer >::SCell |
Definition at line 143 of file DigitalSurface.h.
typedef DigitalSurface<DigitalSurfaceContainer> DGtal::DigitalSurface< TDigitalSurfaceContainer >::Self |
Definition at line 140 of file DigitalSurface.h.
typedef KSpace::Size DGtal::DigitalSurface< TDigitalSurfaceContainer >::Size |
Defines how to represent a size (unsigned integral type).
Definition at line 160 of file DigitalSurface.h.
typedef DigitalSurfaceContainer::Surfel DGtal::DigitalSurface< TDigitalSurfaceContainer >::Surfel |
Definition at line 144 of file DigitalSurface.h.
typedef KSpace::SurfelSet DGtal::DigitalSurface< TDigitalSurfaceContainer >::SurfelSet |
Definition at line 148 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 133 of file DigitalSurface.h.
typedef UmbrellaComputer<DigitalSurfaceTracker> DGtal::DigitalSurface< TDigitalSurfaceContainer >::Umbrella |
This define a utility class for computing umbrellas.
Definition at line 212 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 215 of file DigitalSurface.h.
typedef Surfel DGtal::DigitalSurface< TDigitalSurfaceContainer >::Vertex |
Defines the type for a vertex.
Definition at line 158 of file DigitalSurface.h.
typedef std::vector<Vertex> DGtal::DigitalSurface< TDigitalSurfaceContainer >::VertexRange |
The range of vertices is defined as a vector.
Definition at line 286 of file DigitalSurface.h.
typedef KSpace::SurfelSet DGtal::DigitalSurface< TDigitalSurfaceContainer >::VertexSet |
Defines how to represent a set of vertex.
Definition at line 162 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.
FaceSet DGtal::DigitalSurface< TDigitalSurfaceContainer >::allFaces | ( | ) | const |
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(), and DGtal::Shortcuts< TKSpace >::makeLightDigitalSurfaces().
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. |
const DigitalSurfaceContainer& DGtal::DigitalSurface< TDigitalSurfaceContainer >::container | ( | ) | const |
DigitalSurfaceContainer& DGtal::DigitalSurface< TDigitalSurfaceContainer >::container | ( | ) |
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(), and DGtal::Shortcuts< TKSpace >::makeLightDigitalSurfaces().
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. |
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. |
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. |
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. |
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. |
FaceRange DGtal::DigitalSurface< TDigitalSurfaceContainer >::facesAroundVertex | ( | const Vertex & | v | ) | const |
v | any vertex (surfel) of the surface. |
Vertex DGtal::DigitalSurface< TDigitalSurfaceContainer >::head | ( | const Arc & | a | ) | const |
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) |
ArcRange DGtal::DigitalSurface< TDigitalSurfaceContainer >::outArcs | ( | const Vertex & | v | ) | const |
v | any vertex (surfel) of the surface. |
Referenced by boost::out_edges().
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. |
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. |
Size DGtal::DigitalSurface< TDigitalSurfaceContainer >::size | ( | ) | const |
Referenced by DGtal::Shortcuts< TKSpace >::makeLightDigitalSurface(), and boost::num_vertices().
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 ). |
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().
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 648 of file DigitalSurface.h.
|
mutableprivate |
a pointer on a tracker.
Definition at line 650 of file DigitalSurface.h.
|
mutableprivate |
This object is used to compute umbrellas over the surface.
Definition at line 652 of file DigitalSurface.h.