DGtal  0.9.4beta
Data Structures | Public Types | Public Member Functions | Protected Types | Protected Attributes
DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer > Class Template Reference

#include <DGtal/topology/IndexedDigitalSurface.h>

Collaboration diagram for DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >:
[legend]

Data Structures

struct  IndexedPropertyMap
 
struct  VertexMap
 

Public Types

typedef IndexedDigitalSurface< TDigitalSurfaceContainer > Self
 
typedef TDigitalSurfaceContainer DigitalSurfaceContainer
 
typedef DigitalSurfaceContainer::KSpace KSpace
 
typedef KSpace::Space Space
 
typedef KSpace::Surfel Surfel
 
typedef KSpace::SCell SCell
 
typedef KSpace::Cell Cell
 
typedef Space::RealPoint RealPoint
 
typedef HalfEdgeDataStructure::Size Size
 
typedef HalfEdgeDataStructure::Index Index
 
typedef HalfEdgeDataStructure::VertexIndex VertexIndex
 
typedef HalfEdgeDataStructure::EdgeIndex EdgeIndex
 
typedef HalfEdgeDataStructure::FaceIndex FaceIndex
 
typedef HalfEdgeDataStructure::Triangle Triangle
 
typedef HalfEdgeDataStructure::PolygonalFace PolygonalFace
 
typedef std::vector< RealPointPositionsStorage
 
typedef std::vector< PolygonalFacePolygonalFacesStorage
 
typedef std::vector< SCellSCellStorage
 
typedef VertexIndex Vertex
 
typedef std::set< VertexVertexSet
 
typedef EdgeIndex Edge
 
typedef IntegerSequenceIterator< VertexIndexConstIterator
 
typedef HalfEdgeDataStructure::HalfEdgeIndex Arc
 
typedef HalfEdgeDataStructure::FaceIndex Face
 
typedef std::vector< ArcArcRange
 
typedef std::vector< FaceFaceRange
 
typedef std::vector< VertexVertexRange
 
typedef IndexedPropertyMap< RealPointPositionsMap
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CDigitalSurfaceContainer< DigitalSurfaceContainer >))
 
 BOOST_STATIC_CONSTANT (Face, INVALID_FACE=HALF_EDGE_INVALID_INDEX)
 
 ~IndexedDigitalSurface ()
 
 IndexedDigitalSurface ()
 
 IndexedDigitalSurface (ConstAlias< DigitalSurfaceContainer > surfContainer)
 
void clear ()
 
bool build (ConstAlias< DigitalSurfaceContainer > surfContainer)
 
const DigitalSurfaceContainercontainer () const
 
const KSpacespace () const
 
Size nbArcs () const
 
Size nbVertices () const
 
Size nbEdges () const
 
Size nbFaces () const
 
long Euler () const
 
PositionsMap positions ()
 
IndexedPropertyMap< SCellsurfels ()
 
IndexedPropertyMap< SCelllinels ()
 
IndexedPropertyMap< SCellpointels ()
 
template<typename AnyData >
IndexedPropertyMap< AnyData > makeVertexMap () const
 
template<typename AnyData >
IndexedPropertyMap< AnyData > makeVertexMap (AnyData value) const
 
template<typename AnyData >
IndexedPropertyMap< AnyData > makeEdgeMap () const
 
template<typename AnyData >
IndexedPropertyMap< AnyData > makeEdgeMap (AnyData value) const
 
template<typename AnyData >
IndexedPropertyMap< AnyData > makeFaceMap () const
 
template<typename AnyData >
IndexedPropertyMap< AnyData > makeFaceMap (AnyData value) const
 
RealPointposition (Vertex v)
 
const RealPointposition (Vertex v) const
 
const SCellsurfel (Vertex v) const
 
const SCelllinel (Arc a) const
 
const SCellpointel (Face f) const
 
Vertex getVertex (const SCell &aSurfel) const
 
Arc getArc (const SCell &aLinel) const
 
Face getFace (const SCell &aPointel) const
 
Size size () const
 
Size bestCapacity () const
 
Size degree (const Vertex &v) 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
 
ConstIterator begin () const
 
ConstIterator end () 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 next (const Arc &a) const
 
Arc arc (const Vertex &t, const Vertex &h) const
 
Face faceAroundArc (const Arc &a) const
 
FaceRange facesAroundArc (const Arc &a) const
 
VertexRange verticesAroundFace (const Face &f) const
 
bool isVertexBoundary (const Vertex &v) const
 
bool isArcBoundary (const Arc &v) const
 
FaceRange allFaces () const
 
ArcRange allArcs () const
 
VertexRange allVertices () const
 
ArcRange allBoundaryArcs () const
 
VertexRange allBoundaryVertices () const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Protected Types

typedef HalfEdgeDataStructure::HalfEdge HalfEdge
 

Protected Attributes

bool isHEDSValid
 
HalfEdgeDataStructure myHEDS
 
CountedConstPtrOrConstPtr< DigitalSurfaceContainermyContainer
 
PositionsStorage myPositions
 
PolygonalFacesStorage myPolygonalFaces
 
std::map< SCell, VertexIndexmySurfel2VertexIndex
 
std::map< SCell, ArcmyLinel2Arc
 
std::map< SCell, FaceIndexmyPointel2FaceIndex
 
SCellStorage myVertexIndex2Surfel
 
SCellStorage myArc2Linel
 
SCellStorage myFaceIndex2Pointel
 

Detailed Description

template<typename TDigitalSurfaceContainer>
class DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >

Aim: Represents a digital surface with the topology of its dual surface. Its aim is to mimick the standard DigitalSurface, but to optimize its traversal and topology services. The idea is simply to number all its vertices (ie surfels), arcs, and faces and to store its topology with an half-edge data structure. It is essentially a PolygonalSurface but with services specific to DigitalSurface, like a tracker, a DigitalSurfaceContainer, etc. In theory, it can replace a DigitalSurface in many algorithms, and is more efficient if you need to do a lot of traversal on it (like many k-ring operations).

Description of template class 'IndexedDigitalSurface'

This object stores the positions of vertices in space. If you need further data attached to the surface, you may use property maps (see IndexedDigitalSurface::makeVertexMap).

The user instantiates the object with a model of concepts::CDigitalSurfaceContainer or a DigitalSurface.

Model of concepts::CUndirectedSimpleGraph: the vertices and edges of the digital surface form indeed a graph structure.

Note
Vertices, Arcs, and Faces are all integer ranging from 0 to one less than the total number of the respective elements. You may thus iterate on them by just looping on integers. The index INVALID_FACE is an invalid element (equal to HALF_EDGE_INVALID_INDEX).
Template Parameters
TDigitalSurfaceContainerthe type of container from which the object is built (a model of concepts::CDigitalSurfaceContainer), e.g. SetOfSurfels, ImplicitDigitalSurface, ExplicitDigitalSurface, DigitalSetBoundary, etc.

See Models of digital surface containers and HalfEdgeDataStructure.

Examples:
topology/area-estimation-with-indexed-digital-surface.cpp.

Definition at line 96 of file IndexedDigitalSurface.h.

Member Typedef Documentation

template<typename TDigitalSurfaceContainer>
typedef HalfEdgeDataStructure::HalfEdgeIndex DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::Arc

Definition at line 132 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef std::vector<Arc> DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::ArcRange

Definition at line 134 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef KSpace::Cell DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::Cell

Definition at line 107 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef IntegerSequenceIterator<VertexIndex> DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::ConstIterator

Definition at line 129 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef TDigitalSurfaceContainer DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::DigitalSurfaceContainer

Definition at line 100 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef EdgeIndex DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::Edge

Definition at line 128 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef HalfEdgeDataStructure::EdgeIndex DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::EdgeIndex

Definition at line 112 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef HalfEdgeDataStructure::FaceIndex DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::Face

Definition at line 133 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef HalfEdgeDataStructure::FaceIndex DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::FaceIndex

Definition at line 113 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef std::vector<Face> DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::FaceRange

Definition at line 135 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef HalfEdgeDataStructure::HalfEdge DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::HalfEdge
protected

Definition at line 235 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef HalfEdgeDataStructure::Index DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::Index

Definition at line 110 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef DigitalSurfaceContainer::KSpace DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::KSpace

Definition at line 103 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef HalfEdgeDataStructure::PolygonalFace DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::PolygonalFace

Definition at line 115 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef std::vector<PolygonalFace> DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::PolygonalFacesStorage

Definition at line 117 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef IndexedPropertyMap< RealPoint > DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::PositionsMap

Definition at line 232 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef std::vector<RealPoint> DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::PositionsStorage

Definition at line 116 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef Space::RealPoint DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::RealPoint

Definition at line 108 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef KSpace::SCell DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::SCell

Definition at line 106 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef std::vector<SCell> DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::SCellStorage

Definition at line 118 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef IndexedDigitalSurface<TDigitalSurfaceContainer> DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::Self

Definition at line 99 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef HalfEdgeDataStructure::Size DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::Size

Definition at line 109 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef KSpace::Space DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::Space

Definition at line 104 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef KSpace::Surfel DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::Surfel

Definition at line 105 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef HalfEdgeDataStructure::Triangle DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::Triangle

Definition at line 114 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef VertexIndex DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::Vertex

Definition at line 121 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef HalfEdgeDataStructure::VertexIndex DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::VertexIndex

Definition at line 111 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef std::vector<Vertex> DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::VertexRange

Definition at line 136 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
typedef std::set<Vertex> DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::VertexSet

Definition at line 122 of file IndexedDigitalSurface.h.

Constructor & Destructor Documentation

template<typename TDigitalSurfaceContainer>
DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::~IndexedDigitalSurface ( )
inline

Destructor.

Definition at line 243 of file IndexedDigitalSurface.h.

243 {}
template<typename TDigitalSurfaceContainer>
DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::IndexedDigitalSurface ( )
inline

Constructor.

Definition at line 248 of file IndexedDigitalSurface.h.

248 : isHEDSValid( false ), myContainer( 0 ) {}
CountedConstPtrOrConstPtr< DigitalSurfaceContainer > myContainer
The (secured or not) pointer to the associated digital surface container.
bool isHEDSValid
Indicates if the half-edge structure has been created/updated.
template<typename TDigitalSurfaceContainer>
DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::IndexedDigitalSurface ( ConstAlias< DigitalSurfaceContainer surfContainer)
inline

Constructor from digital surface container.

Parameters
surfContainerany instance of digital surface container. Pass a CountedPtr or any variant if you wish to secure its aliasing.

Definition at line 254 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::build().

255  : isHEDSValid( false ), myContainer( 0 )
256  {
257  build( surfContainer );
258  }
CountedConstPtrOrConstPtr< DigitalSurfaceContainer > myContainer
The (secured or not) pointer to the associated digital surface container.
bool build(ConstAlias< DigitalSurfaceContainer > surfContainer)
bool isHEDSValid
Indicates if the half-edge structure has been created/updated.

Member Function Documentation

template<typename TDigitalSurfaceContainer>
ArcRange DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::allArcs ( ) const
Returns
the range of all arcs of the indexed digital surface, i.e. an array containing 0, 1, 2, ..., nbArcs()-1.
template<typename TDigitalSurfaceContainer>
ArcRange DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::allBoundaryArcs ( ) const

This set of arcs is sufficient for displaying the boundary of the surface.

Returns
the array of all arcs (oriented edges) lying on the boundary of the surface (in no particular order).
template<typename TDigitalSurfaceContainer>
VertexRange DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::allBoundaryVertices ( ) const

This set of arcs is sufficient for displaying the boundary of the surface.

Returns
the array of vertices lying on the boundary of the surface (in no particular order).
template<typename TDigitalSurfaceContainer>
FaceRange DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::allFaces ( ) const
Returns
the range of all faces of the indexed digital surface, i.e. an array containing 0, 1, 2, ..., nbFaces()-1.
template<typename TDigitalSurfaceContainer>
VertexRange DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::allVertices ( ) const
Returns
the range of all vertices of the indexed digital surface, i.e. an array containing 0, 1, 2, ..., nbVertices()-1.
template<typename TDigitalSurfaceContainer>
Arc DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::arc ( const Vertex t,
const Vertex h 
) const

[t] and [h] should be adjacent vertices.

Parameters
tthe vertex at the tail of the arc.
hthe vertex at the head of the arc.
Returns
the arc (tail, head)
template<typename TDigitalSurfaceContainer>
ConstIterator DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::begin ( ) const
inline
Returns
a (non mutable) iterator pointing on the first vertex.

Definition at line 501 of file IndexedDigitalSurface.h.

502  { return ConstIterator( 0 ); }
IntegerSequenceIterator< VertexIndex > ConstIterator
template<typename TDigitalSurfaceContainer>
Size DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::bestCapacity ( ) const
Returns
an estimate of the maximum number of neighbors for this adjacency
Note
chosen here to be 8. Number of neighbors is 6 on average for planar triangulations.
template<typename TDigitalSurfaceContainer>
DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::BOOST_CONCEPT_ASSERT ( (concepts::CDigitalSurfaceContainer< DigitalSurfaceContainer >)  )
template<typename TDigitalSurfaceContainer>
DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::BOOST_STATIC_CONSTANT ( Face  ,
INVALID_FACE  = HALF_EDGE_INVALID_INDEX 
)
template<typename TDigitalSurfaceContainer>
bool DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::build ( ConstAlias< DigitalSurfaceContainer surfContainer)

Builds the half-edge data structure from the given digital surface container. After that, the surface is valid.

Parameters
surfContainerany instance of digital surface container. Pass a CountedPtr or any variant if you wish to secure its aliasing.
Returns
true if everything went allright, false if it was not possible to build a consistent data structure (e.g., butterfly neighborhoods).

Referenced by DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::IndexedDigitalSurface().

template<typename TDigitalSurfaceContainer>
void DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::clear ( )

Clears everything.

template<typename TDigitalSurfaceContainer>
const DigitalSurfaceContainer& DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::container ( ) const
inline
Returns
a const reference to the stored container.

Definition at line 278 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myContainer.

279  { return *myContainer; }
CountedConstPtrOrConstPtr< DigitalSurfaceContainer > myContainer
The (secured or not) pointer to the associated digital surface container.
template<typename TDigitalSurfaceContainer>
Size DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::degree ( const Vertex v) const
Parameters
vany vertex
Returns
the number of neighbors of this vertex
template<typename TDigitalSurfaceContainer>
ConstIterator DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::end ( ) const
inline
Returns
a (non mutable) iterator pointing after the last vertex.

Definition at line 505 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::nbVertices().

506  { return ConstIterator( nbVertices() ); }
IntegerSequenceIterator< VertexIndex > ConstIterator
template<typename TDigitalSurfaceContainer>
long DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::Euler ( ) const
inline
Returns
the euler characteristic of the indexed digital surface (a famous topological invariant that is the number of vertices minus the number of edges plus the number of faces).

Definition at line 302 of file IndexedDigitalSurface.h.

References DGtal::HalfEdgeDataStructure::Euler(), and DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myHEDS.

302 { return myHEDS.Euler(); }
HalfEdgeDataStructure myHEDS
The half-edge data structure that stores the topology of the mesh.
template<typename TDigitalSurfaceContainer>
Face DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::faceAroundArc ( const Arc a) const

Convenience method for computing the face incident to a given arc. There is at most one face that borders an arc for indexed digital surface since it is a combinatorial 2-manifold.

Parameters
aany arc on the surface.
Returns
the face around the given arc or the InvalidFace if the arc was a boundary arc.
template<typename TDigitalSurfaceContainer>
FaceRange DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::facesAroundArc ( const Arc a) const

Computes the faces incident to a given arc. There is only one for indexed digital surface since it is a combinatorial 2-manifold.

Parameters
aany arc on the surface.
Returns
a vector containing the faces incident to this arc.
template<typename TDigitalSurfaceContainer>
FaceRange DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::facesAroundVertex ( const Vertex v) const
Parameters
vany vertex of the surface.
Returns
the faces containing this vertex [v].
template<typename TDigitalSurfaceContainer>
Arc DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::getArc ( const SCell aLinel) const
inline
Parameters
[in]aLinelany linel that is a separator on the surface (orientation is important).
Returns
the arc (ie an index) corresponding to this separator linel, or INVALID_FACE if it does not exist.

Definition at line 424 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myLinel2Arc.

425  {
426  auto it = myLinel2Arc.find( aLinel );
427  return it != myLinel2Arc.end() ? it->second : INVALID_FACE;
428  }
std::map< SCell, Arc > myLinel2Arc
Mapping Linel -> Arc.
template<typename TDigitalSurfaceContainer>
Face DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::getFace ( const SCell aPointel) const
inline
Parameters
[in]aPointelany pointel that is a pivot on the surface (orientation is positive).
Returns
the face (ie an index) corresponding to this pivot pointel, or INVALID_FACE if it does not exist.

Definition at line 434 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myPointel2FaceIndex.

435  {
436  auto it = myPointel2FaceIndex.find( aPointel );
437  return it != myPointel2FaceIndex.end() ? it->second : INVALID_FACE;
438  }
std::map< SCell, FaceIndex > myPointel2FaceIndex
Mapping Pointel -> FaceIndex.
template<typename TDigitalSurfaceContainer>
Vertex DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::getVertex ( const SCell aSurfel) const
inline
Parameters
[in]aSurfelany surfel of the surface
Returns
the vertex (ie an index) corresponding to this surfel, or INVALID_FACE if it does not exist.

Definition at line 414 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::mySurfel2VertexIndex.

415  {
416  auto it = mySurfel2VertexIndex.find( aSurfel );
417  return it != mySurfel2VertexIndex.end() ? it->second : INVALID_FACE;
418  }
std::map< SCell, VertexIndex > mySurfel2VertexIndex
Mapping Surfel -> VertexIndex.
template<typename TDigitalSurfaceContainer>
Vertex DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::head ( const Arc a) const
Parameters
aany arc (s,t)
Returns
the vertex t
template<typename TDigitalSurfaceContainer>
ArcRange DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::inArcs ( const Vertex v) const
Parameters
vany vertex of the surface.
Returns
the ingoing arcs to [v]
template<typename TDigitalSurfaceContainer>
bool DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::isArcBoundary ( const Arc v) const
Parameters
vany arc.
Returns
'true' if and only if arc v lies on a boundary (note that the opposite arc does not lie on the boundary).
Note
O(1) operation
template<typename TDigitalSurfaceContainer>
bool DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.
template<typename TDigitalSurfaceContainer>
bool DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::isVertexBoundary ( const Vertex v) const
Parameters
vany vertex.
Returns
'true' if and only if vertex v lies on a boundary.
Note
O(1) operation
template<typename TDigitalSurfaceContainer>
const SCell& DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::linel ( Arc  a) const
inline
Parameters
[in]aany arc (index).
Returns
the corresponding separator linel.

Definition at line 396 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myArc2Linel, and DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::nbArcs().

397  {
398  ASSERT( a < nbArcs() );
399  return myArc2Linel[ a ];
400  }
SCellStorage myArc2Linel
Mapping Arc -> Linel.
template<typename TDigitalSurfaceContainer>
IndexedPropertyMap< SCell > DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::linels ( )
inline
Returns
the property map stored in the surface that defines the mapping arc -> Linel
Note
The returned map only references what is stored in the surface.

Definition at line 320 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myArc2Linel.

321  {
322  return IndexedPropertyMap< SCell >( *this, myArc2Linel );
323  }
SCellStorage myArc2Linel
Mapping Arc -> Linel.
template<typename TDigitalSurfaceContainer>
template<typename AnyData >
IndexedPropertyMap< AnyData > DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::makeEdgeMap ( ) const
inline
Returns
an edge property map that associates some data to any edge.

Definition at line 349 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::nbEdges().

350  {
351  return IndexedPropertyMap< AnyData >( *this, nbEdges() );
352  }
template<typename TDigitalSurfaceContainer>
template<typename AnyData >
IndexedPropertyMap< AnyData > DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::makeEdgeMap ( AnyData  value) const
inline
Parameters
valuethe value that is given to all edges at initialization.
Returns
an edge property map that associates some data to any edge.

Definition at line 357 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::nbEdges().

358  {
359  return IndexedPropertyMap< AnyData >( *this, nbEdges(), value );
360  }
template<typename TDigitalSurfaceContainer>
template<typename AnyData >
IndexedPropertyMap< AnyData > DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::makeFaceMap ( ) const
inline
Returns
a face property map that associates some data to any face.

Definition at line 364 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::nbFaces().

365  {
366  return IndexedPropertyMap< AnyData >( *this, nbFaces() );
367  }
template<typename TDigitalSurfaceContainer>
template<typename AnyData >
IndexedPropertyMap< AnyData > DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::makeFaceMap ( AnyData  value) const
inline
Parameters
valuethe value that is given to all faces at initialization.
Returns
a face property map that associates some data to any face.

Definition at line 372 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::nbFaces().

373  {
374  return IndexedPropertyMap< AnyData >( *this, nbFaces(), value );
375  }
template<typename TDigitalSurfaceContainer>
template<typename AnyData >
IndexedPropertyMap< AnyData > DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::makeVertexMap ( ) const
inline
Returns
a vertex property map that associates some data to any vertex.

Definition at line 334 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::nbVertices().

335  {
336  return IndexedPropertyMap< AnyData >( *this, nbVertices() );
337  }
template<typename TDigitalSurfaceContainer>
template<typename AnyData >
IndexedPropertyMap< AnyData > DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::makeVertexMap ( AnyData  value) const
inline
Parameters
valuethe value that is given to all vertices at initialization.
Returns
a vertex property map that associates some data to any vertex.

Definition at line 342 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::nbVertices().

343  {
344  return IndexedPropertyMap< AnyData >( *this, nbVertices(), value );
345  }
template<typename TDigitalSurfaceContainer>
Size DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::nbArcs ( ) const
inline
Returns
the number of half edges in the structure.

Definition at line 288 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myHEDS, and DGtal::HalfEdgeDataStructure::nbHalfEdges().

Referenced by DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::linel().

288 { return myHEDS.nbHalfEdges(); }
HalfEdgeDataStructure myHEDS
The half-edge data structure that stores the topology of the mesh.
template<typename TDigitalSurfaceContainer>
Size DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::nbEdges ( ) const
inline
Returns
the number of unoriented edges in the structure.

Definition at line 294 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myHEDS, and DGtal::HalfEdgeDataStructure::nbEdges().

Referenced by DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::makeEdgeMap().

294 { return myHEDS.nbEdges(); }
HalfEdgeDataStructure myHEDS
The half-edge data structure that stores the topology of the mesh.
template<typename TDigitalSurfaceContainer>
Size DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::nbFaces ( ) const
inline
Returns
the number of faces in the structure.

Definition at line 297 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myHEDS, and DGtal::HalfEdgeDataStructure::nbFaces().

Referenced by DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::makeFaceMap(), and DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::pointel().

297 { return myHEDS.nbFaces(); }
HalfEdgeDataStructure myHEDS
The half-edge data structure that stores the topology of the mesh.
template<typename TDigitalSurfaceContainer>
Size DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::nbVertices ( ) const
inline
template<typename TDigitalSurfaceContainer>
Arc DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::next ( const Arc a) const

Constant-time access to the next arc along the face.

Parameters
aany arc (s,t)
Returns
the next arc along the face.
template<typename TDigitalSurfaceContainer>
Arc DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::opposite ( const Arc a) const
Parameters
aany arc (s,t)
Returns
the arc (t,s)
template<typename TDigitalSurfaceContainer>
ArcRange DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::outArcs ( const Vertex v) const
Parameters
vany vertex of the surface.
Returns
the outgoing arcs from [v]
template<typename TDigitalSurfaceContainer>
const SCell& DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::pointel ( Face  f) const
inline
Parameters
[in]fany face index.
Returns
the corresponding pivot pointel.

Definition at line 404 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myFaceIndex2Pointel, and DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::nbFaces().

405  {
406  ASSERT( f < nbFaces() );
407  return myFaceIndex2Pointel[ f ];
408  }
SCellStorage myFaceIndex2Pointel
Mapping FaceIndex -> Pointel.
template<typename TDigitalSurfaceContainer>
IndexedPropertyMap< SCell > DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::pointels ( )
inline
Returns
the property map stored in the surface that defines the mapping face index -> Pointel
Note
The returned map only references what is stored in the surface.

Definition at line 327 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myFaceIndex2Pointel.

328  {
329  return IndexedPropertyMap< SCell >( *this, myFaceIndex2Pointel );
330  }
SCellStorage myFaceIndex2Pointel
Mapping FaceIndex -> Pointel.
template<typename TDigitalSurfaceContainer>
RealPoint& DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::position ( Vertex  v)

Mutable accessor to vertex data.

Parameters
vany vertex.
Returns
the mutable data associated to v.
template<typename TDigitalSurfaceContainer>
const RealPoint& DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::position ( Vertex  v) const

Const accessor to vertex data.

Parameters
vany vertex.
Returns
the non-mutable data associated to v.
template<typename TDigitalSurfaceContainer>
PositionsMap DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::positions ( )
inline
Returns
the property map stored in the surface that defines vertex positions.
Note
The returned map only references what is stored in the surface.

Definition at line 306 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myPositions.

307  {
308  return PositionsMap( *this, myPositions );
309  }
PositionsStorage myPositions
Stores the information for each Vertex.
IndexedPropertyMap< RealPoint > PositionsMap
template<typename TDigitalSurfaceContainer>
void DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.
template<typename TDigitalSurfaceContainer>
Size DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::size ( ) const
Returns
the number of vertices of the surface.
template<typename TDigitalSurfaceContainer>
const KSpace& DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::space ( ) const
inline
Returns
a const reference to the digital space containing the digital surface.

Definition at line 282 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myContainer.

283  { return myContainer->space(); }
CountedConstPtrOrConstPtr< DigitalSurfaceContainer > myContainer
The (secured or not) pointer to the associated digital surface container.
template<typename TDigitalSurfaceContainer>
const SCell& DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::surfel ( Vertex  v) const
inline
Parameters
[in]vany vertex index.
Returns
the corresponding surfel.

Definition at line 388 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myVertexIndex2Surfel, and DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::nbVertices().

389  {
390  ASSERT( v < nbVertices() );
391  return myVertexIndex2Surfel[ v ];
392  }
SCellStorage myVertexIndex2Surfel
Mapping VertexIndex -> Surfel.
template<typename TDigitalSurfaceContainer>
IndexedPropertyMap< SCell > DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::surfels ( )
inline
Returns
the property map stored in the surface that defines the mapping vertex index -> Surfel
Note
The returned map only references what is stored in the surface.

Definition at line 313 of file IndexedDigitalSurface.h.

References DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myVertexIndex2Surfel.

314  {
315  return IndexedPropertyMap< SCell >( *this, myVertexIndex2Surfel );
316  }
SCellStorage myVertexIndex2Surfel
Mapping VertexIndex -> Surfel.
template<typename TDigitalSurfaceContainer>
Vertex DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::tail ( const Arc a) const
Parameters
aany arc (s,t)
Returns
the vertex s
template<typename TDigitalSurfaceContainer>
VertexRange DGtal::IndexedDigitalSurface< 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.

Parameters
fany valid face on the surface (open or closed ).
Returns
the sequence of vertices that touches this face. The order follows the order of incident arcs (the range size is the number of vertices of the polygonal face).
template<typename TDigitalSurfaceContainer>
template<typename OutputIterator >
void DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::writeNeighbors ( OutputIterator &  it,
const Vertex v 
) const

Writes the neighbors of a vertex using an output iterator

Template Parameters
OutputIteratorthe type of an output iterator writing in a container of vertices.
Parameters
itthe output iterator
vthe vertex whose neighbors will be writen
template<typename TDigitalSurfaceContainer>
template<typename OutputIterator , typename VertexPredicate >
void DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::writeNeighbors ( OutputIterator &  it,
const Vertex v,
const VertexPredicate &  pred 
) const

Writes the neighbors of a vertex which satisfy a predicate using an output iterator

Template Parameters
OutputIteratorthe type of an output iterator writing in a container of vertices.
VertexPredicatethe type of the predicate
Parameters
itthe output iterator
vthe vertex whose neighbors will be written
predthe predicate that must be satisfied

Field Documentation

template<typename TDigitalSurfaceContainer>
bool DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::isHEDSValid
protected

Indicates if the half-edge structure has been created/updated.

Definition at line 665 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
SCellStorage DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myArc2Linel
protected
template<typename TDigitalSurfaceContainer>
CountedConstPtrOrConstPtr< DigitalSurfaceContainer > DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myContainer
protected

The (secured or not) pointer to the associated digital surface container.

Definition at line 669 of file IndexedDigitalSurface.h.

Referenced by DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::container(), and DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::space().

template<typename TDigitalSurfaceContainer>
SCellStorage DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myFaceIndex2Pointel
protected
template<typename TDigitalSurfaceContainer>
HalfEdgeDataStructure DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myHEDS
protected
template<typename TDigitalSurfaceContainer>
std::map< SCell, Arc > DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myLinel2Arc
protected

Mapping Linel -> Arc.

Definition at line 678 of file IndexedDigitalSurface.h.

Referenced by DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::getArc().

template<typename TDigitalSurfaceContainer>
std::map< SCell, FaceIndex > DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myPointel2FaceIndex
protected

Mapping Pointel -> FaceIndex.

Definition at line 680 of file IndexedDigitalSurface.h.

Referenced by DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::getFace().

template<typename TDigitalSurfaceContainer>
PolygonalFacesStorage DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myPolygonalFaces
protected

Stores the polygonal faces.

Definition at line 674 of file IndexedDigitalSurface.h.

template<typename TDigitalSurfaceContainer>
PositionsStorage DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myPositions
protected

Stores the information for each Vertex.

Definition at line 672 of file IndexedDigitalSurface.h.

Referenced by DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::positions().

template<typename TDigitalSurfaceContainer>
std::map< SCell, VertexIndex > DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::mySurfel2VertexIndex
protected

Mapping Surfel -> VertexIndex.

Definition at line 676 of file IndexedDigitalSurface.h.

Referenced by DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::getVertex().

template<typename TDigitalSurfaceContainer>
SCellStorage DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myVertexIndex2Surfel
protected

The documentation for this class was generated from the following file: