DGtal 1.4.2
Loading...
Searching...
No Matches
DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer > Class Template Reference

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). More...

#include <DGtal/topology/IndexedDigitalSurface.h>

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 ()
 Clears everything.
 
bool build (ConstAlias< DigitalSurfaceContainer > surfContainer)
 
const DigitalSurfaceContainercontainer () const
 
const KSpacespace () const
 
const HalfEdgeDataStructureheds () 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
 Indicates if the half-edge structure has been created/updated.
 
HalfEdgeDataStructure myHEDS
 The half-edge data structure that stores the topology of the mesh.
 
CountedConstPtrOrConstPtr< DigitalSurfaceContainermyContainer
 The (secured or not) pointer to the associated digital surface container.
 
PositionsStorage myPositions
 Stores the information for each Vertex.
 
PolygonalFacesStorage myPolygonalFaces
 Stores the polygonal faces.
 
std::map< SCell, VertexIndexmySurfel2VertexIndex
 Mapping Surfel -> VertexIndex.
 
std::map< SCell, ArcmyLinel2Arc
 Mapping Linel -> Arc.
 
std::map< SCell, FaceIndexmyPointel2FaceIndex
 Mapping Pointel -> FaceIndex.
 
SCellStorage myVertexIndex2Surfel
 Mapping VertexIndex -> Surfel.
 
SCellStorage myArc2Linel
 Mapping Arc -> Linel.
 
SCellStorage myFaceIndex2Pointel
 Mapping FaceIndex -> Pointel.
 

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

◆ Arc

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

Definition at line 132 of file IndexedDigitalSurface.h.

◆ ArcRange

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

Definition at line 134 of file IndexedDigitalSurface.h.

◆ Cell

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

Definition at line 107 of file IndexedDigitalSurface.h.

◆ ConstIterator

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

Definition at line 129 of file IndexedDigitalSurface.h.

◆ DigitalSurfaceContainer

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

Definition at line 100 of file IndexedDigitalSurface.h.

◆ Edge

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

Definition at line 128 of file IndexedDigitalSurface.h.

◆ EdgeIndex

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

Definition at line 112 of file IndexedDigitalSurface.h.

◆ Face

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

Definition at line 133 of file IndexedDigitalSurface.h.

◆ FaceIndex

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

Definition at line 113 of file IndexedDigitalSurface.h.

◆ FaceRange

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

Definition at line 135 of file IndexedDigitalSurface.h.

◆ HalfEdge

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

Definition at line 235 of file IndexedDigitalSurface.h.

◆ Index

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

Definition at line 110 of file IndexedDigitalSurface.h.

◆ KSpace

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

Definition at line 103 of file IndexedDigitalSurface.h.

◆ PolygonalFace

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

Definition at line 115 of file IndexedDigitalSurface.h.

◆ PolygonalFacesStorage

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

Definition at line 117 of file IndexedDigitalSurface.h.

◆ PositionsMap

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

Definition at line 232 of file IndexedDigitalSurface.h.

◆ PositionsStorage

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

Definition at line 116 of file IndexedDigitalSurface.h.

◆ RealPoint

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

Definition at line 108 of file IndexedDigitalSurface.h.

◆ SCell

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

Definition at line 106 of file IndexedDigitalSurface.h.

◆ SCellStorage

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

Definition at line 118 of file IndexedDigitalSurface.h.

◆ Self

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

Definition at line 99 of file IndexedDigitalSurface.h.

◆ Size

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

Definition at line 109 of file IndexedDigitalSurface.h.

◆ Space

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

Definition at line 104 of file IndexedDigitalSurface.h.

◆ Surfel

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

Definition at line 105 of file IndexedDigitalSurface.h.

◆ Triangle

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

Definition at line 114 of file IndexedDigitalSurface.h.

◆ Vertex

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

Definition at line 121 of file IndexedDigitalSurface.h.

◆ VertexIndex

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

Definition at line 111 of file IndexedDigitalSurface.h.

◆ VertexRange

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

Definition at line 136 of file IndexedDigitalSurface.h.

◆ VertexSet

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

Definition at line 122 of file IndexedDigitalSurface.h.

Constructor & Destructor Documentation

◆ ~IndexedDigitalSurface()

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

Destructor.

Definition at line 243 of file IndexedDigitalSurface.h.

243{}

◆ IndexedDigitalSurface() [1/2]

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.

◆ IndexedDigitalSurface() [2/2]

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.

255 : isHEDSValid( false ), myContainer( 0 )
256 {
257 build( surfContainer );
258 }
bool build(ConstAlias< DigitalSurfaceContainer > surfContainer)

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

Member Function Documentation

◆ allArcs()

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.

◆ allBoundaryArcs()

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).

◆ allBoundaryVertices()

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).

◆ allFaces()

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.

◆ allVertices()

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.

◆ arc()

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)

◆ begin()

template<typename TDigitalSurfaceContainer >
ConstIterator DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::begin ( ) const
inline
Returns
a (non mutable) iterator pointing on the first vertex.

Definition at line 505 of file IndexedDigitalSurface.h.

506 { return ConstIterator( 0 ); }
IntegerSequenceIterator< VertexIndex > ConstIterator

◆ bestCapacity()

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.

◆ BOOST_CONCEPT_ASSERT()

template<typename TDigitalSurfaceContainer >
DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::BOOST_CONCEPT_ASSERT ( (concepts::CDigitalSurfaceContainer< DigitalSurfaceContainer >) )

◆ BOOST_STATIC_CONSTANT()

template<typename TDigitalSurfaceContainer >
DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::BOOST_STATIC_CONSTANT ( Face ,
INVALID_FACE = HALF_EDGE_INVALID_INDEX )

◆ build()

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().

◆ clear()

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

Clears everything.

◆ container()

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.

279 { return *myContainer; }

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

◆ degree()

template<typename TDigitalSurfaceContainer >
Size DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::degree ( const Vertex & v) const
Parameters
vany vertex
Returns
the number of neighbors of this vertex

◆ end()

template<typename TDigitalSurfaceContainer >
ConstIterator DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::end ( ) const
inline
Returns
a (non mutable) iterator pointing after the last vertex.

Definition at line 509 of file IndexedDigitalSurface.h.

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

◆ Euler()

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 306 of file IndexedDigitalSurface.h.

306{ return myHEDS.Euler(); }
HalfEdgeDataStructure myHEDS
The half-edge data structure that stores the topology of the mesh.

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

◆ faceAroundArc()

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.

◆ facesAroundArc()

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.

◆ facesAroundVertex()

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].

◆ getArc()

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 428 of file IndexedDigitalSurface.h.

429 {
430 auto it = myLinel2Arc.find( aLinel );
431 return it != myLinel2Arc.end() ? it->second : INVALID_FACE;
432 }
std::map< SCell, Arc > myLinel2Arc
Mapping Linel -> Arc.

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

◆ getFace()

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 438 of file IndexedDigitalSurface.h.

439 {
440 auto it = myPointel2FaceIndex.find( aPointel );
441 return it != myPointel2FaceIndex.end() ? it->second : INVALID_FACE;
442 }
std::map< SCell, FaceIndex > myPointel2FaceIndex
Mapping Pointel -> FaceIndex.

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

◆ getVertex()

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 418 of file IndexedDigitalSurface.h.

419 {
420 auto it = mySurfel2VertexIndex.find( aSurfel );
421 return it != mySurfel2VertexIndex.end() ? it->second : INVALID_FACE;
422 }
std::map< SCell, VertexIndex > mySurfel2VertexIndex
Mapping Surfel -> VertexIndex.

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

◆ head()

template<typename TDigitalSurfaceContainer >
Vertex DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::head ( const Arc & a) const
Parameters
aany arc (s,t)
Returns
the vertex t

◆ heds()

template<typename TDigitalSurfaceContainer >
const HalfEdgeDataStructure & DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::heds ( ) const
inline
Returns
a const reference to the half-edge data structure.

Definition at line 286 of file IndexedDigitalSurface.h.

287 { return myHEDS; }

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

◆ inArcs()

template<typename TDigitalSurfaceContainer >
ArcRange DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::inArcs ( const Vertex & v) const
Parameters
vany vertex of the surface.
Returns
the ingoing arcs to [v]

◆ isArcBoundary()

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

◆ isValid()

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.

◆ isVertexBoundary()

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

◆ linel()

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 400 of file IndexedDigitalSurface.h.

401 {
402 ASSERT( a < nbArcs() );
403 return myArc2Linel[ a ];
404 }
SCellStorage myArc2Linel
Mapping Arc -> Linel.

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

◆ linels()

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 324 of file IndexedDigitalSurface.h.

325 {
326 return IndexedPropertyMap< SCell >( *this, myArc2Linel );
327 }

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

◆ makeEdgeMap() [1/2]

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 353 of file IndexedDigitalSurface.h.

354 {
355 return IndexedPropertyMap< AnyData >( *this, nbEdges() );
356 }

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

◆ makeEdgeMap() [2/2]

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 361 of file IndexedDigitalSurface.h.

362 {
363 return IndexedPropertyMap< AnyData >( *this, nbEdges(), value );
364 }

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

◆ makeFaceMap() [1/2]

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 368 of file IndexedDigitalSurface.h.

369 {
370 return IndexedPropertyMap< AnyData >( *this, nbFaces() );
371 }

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

◆ makeFaceMap() [2/2]

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 376 of file IndexedDigitalSurface.h.

377 {
378 return IndexedPropertyMap< AnyData >( *this, nbFaces(), value );
379 }

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

◆ makeVertexMap() [1/2]

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 338 of file IndexedDigitalSurface.h.

339 {
340 return IndexedPropertyMap< AnyData >( *this, nbVertices() );
341 }

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

◆ makeVertexMap() [2/2]

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 346 of file IndexedDigitalSurface.h.

347 {
348 return IndexedPropertyMap< AnyData >( *this, nbVertices(), value );
349 }

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

◆ nbArcs()

template<typename TDigitalSurfaceContainer >
Size DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::nbArcs ( ) const
inline

◆ nbEdges()

template<typename TDigitalSurfaceContainer >
Size DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::nbEdges ( ) const
inline

◆ nbFaces()

◆ nbVertices()

◆ next()

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.

◆ opposite()

template<typename TDigitalSurfaceContainer >
Arc DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::opposite ( const Arc & a) const
Parameters
aany arc (s,t)
Returns
the arc (t,s)

◆ outArcs()

template<typename TDigitalSurfaceContainer >
ArcRange DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::outArcs ( const Vertex & v) const
Parameters
vany vertex of the surface.
Returns
the outgoing arcs from [v]

◆ pointel()

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 408 of file IndexedDigitalSurface.h.

409 {
410 ASSERT( f < nbFaces() );
411 return myFaceIndex2Pointel[ f ];
412 }
SCellStorage myFaceIndex2Pointel
Mapping FaceIndex -> Pointel.

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

◆ pointels()

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 331 of file IndexedDigitalSurface.h.

332 {
333 return IndexedPropertyMap< SCell >( *this, myFaceIndex2Pointel );
334 }

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

◆ position() [1/2]

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.

◆ position() [2/2]

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.

◆ positions()

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 310 of file IndexedDigitalSurface.h.

311 {
312 return PositionsMap( *this, myPositions );
313 }
IndexedPropertyMap< RealPoint > PositionsMap
PositionsStorage myPositions
Stores the information for each Vertex.

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

◆ selfDisplay()

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.

◆ size()

template<typename TDigitalSurfaceContainer >
Size DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::size ( ) const
Returns
the number of vertices of the surface.

◆ space()

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.

283 { return myContainer->space(); }

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

◆ surfel()

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 392 of file IndexedDigitalSurface.h.

393 {
394 ASSERT( v < nbVertices() );
395 return myVertexIndex2Surfel[ v ];
396 }
SCellStorage myVertexIndex2Surfel
Mapping VertexIndex -> Surfel.

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

◆ surfels()

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 317 of file IndexedDigitalSurface.h.

318 {
319 return IndexedPropertyMap< SCell >( *this, myVertexIndex2Surfel );
320 }

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

◆ tail()

template<typename TDigitalSurfaceContainer >
Vertex DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::tail ( const Arc & a) const
Parameters
aany arc (s,t)
Returns
the vertex s

◆ verticesAroundFace()

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).

◆ writeNeighbors() [1/2]

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

◆ writeNeighbors() [2/2]

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

◆ isHEDSValid

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

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

Definition at line 669 of file IndexedDigitalSurface.h.

◆ myArc2Linel

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

◆ myContainer

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

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

Definition at line 673 of file IndexedDigitalSurface.h.

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

◆ myFaceIndex2Pointel

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

◆ myHEDS

◆ myLinel2Arc

template<typename TDigitalSurfaceContainer >
std::map< SCell, Arc > DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::myLinel2Arc
protected

Mapping Linel -> Arc.

Definition at line 682 of file IndexedDigitalSurface.h.

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

◆ myPointel2FaceIndex

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

Mapping Pointel -> FaceIndex.

Definition at line 684 of file IndexedDigitalSurface.h.

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

◆ myPolygonalFaces

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

Stores the polygonal faces.

Definition at line 678 of file IndexedDigitalSurface.h.

◆ myPositions

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

Stores the information for each Vertex.

Definition at line 676 of file IndexedDigitalSurface.h.

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

◆ mySurfel2VertexIndex

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

Mapping Surfel -> VertexIndex.

Definition at line 680 of file IndexedDigitalSurface.h.

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

◆ myVertexIndex2Surfel

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

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