DGtal  1.1.0
Data Structures | Public Types | Public Member Functions | Protected Types | Protected Attributes
DGtal::PolygonalSurface< TPoint > Class Template Reference

Aim: Represents a polygon mesh, i.e. a 2-dimensional combinatorial surface whose faces are (topologically at least) simple polygons. The topology is stored with a half-edge data structure. This object stored the positions of vertices in space. If you need further data attached to the surface, you may use property maps (see PolygonalSurface::makeVertexMap). More...

#include <DGtal/shapes/PolygonalSurface.h>

Collaboration diagram for DGtal::PolygonalSurface< TPoint >:
[legend]

Data Structures

struct  IndexedPropertyMap
 
struct  VertexMap
 

Public Types

typedef TPoint Point
 
typedef PolygonalSurface< TPoint > Self
 
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< PointPositionsStorage
 
typedef std::vector< PolygonalFacePolygonalFacesStorage
 
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< PointPositionsMap
 

Public Member Functions

 BOOST_STATIC_CONSTANT (Face, INVALID_FACE=HALF_EDGE_INVALID_INDEX)
 
 ~PolygonalSurface ()
 
 PolygonalSurface ()
 
 PolygonalSurface (Clone< HalfEdgeDataStructure > aHeds, Clone< PositionsStorage > pos)
 
void clear ()
 Clears everything. More...
 
bool build ()
 
VertexIndex addVertex (const Point &vdata)
 
FaceIndex addTriangle (VertexIndex v0, VertexIndex v1, VertexIndex v2)
 
FaceIndex addQuadrangle (VertexIndex v0, VertexIndex v1, VertexIndex v2, VertexIndex v3)
 
FaceIndex addPolygonalFace (const PolygonalFace &f)
 
HalfEdgeDataStructureheds ()
 
const HalfEdgeDataStructureheds () const
 
Size nbArcs () const
 
Size nbVertices () const
 
Size nbEdges () const
 
Size nbFaces () const
 
long Euler () const
 
PositionsMap positions ()
 
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
 
Pointposition (Vertex v)
 
const Pointposition (Vertex v) 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
 
ArcRange arcsAroundFace (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. More...
 
HalfEdgeDataStructure myHEDS
 The half-edge data structure that stores the topology of the mesh. More...
 
PositionsStorage myPositions
 Stores the information for each Vertex. More...
 
PolygonalFacesStorage myPolygonalFaces
 Stores the polygonal faces. More...
 

Detailed Description

template<typename TPoint>
class DGtal::PolygonalSurface< TPoint >

Aim: Represents a polygon mesh, i.e. a 2-dimensional combinatorial surface whose faces are (topologically at least) simple polygons. The topology is stored with a half-edge data structure. This object stored the positions of vertices in space. If you need further data attached to the surface, you may use property maps (see PolygonalSurface::makeVertexMap).

Description of template class 'PolygonalSurface'

For now, the user must add vertices and faces (triangles, quadrangles, polygones), and when finished, call 'build()'.

Model of CUndirectedSimpleGraph: the vertices and edges of the triangulated 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
TPointa type defining the position in space of vertices.
See also
HalfEdgeDataStructure
Note
You may access the underlying half-edge data structure through PolygonalSurface::heds method.
Examples
shapes/viewPolygonalMarchingCubes.cpp.

Definition at line 86 of file PolygonalSurface.h.

Member Typedef Documentation

◆ Arc

template<typename TPoint >
typedef HalfEdgeDataStructure::HalfEdgeIndex DGtal::PolygonalSurface< TPoint >::Arc

Definition at line 113 of file PolygonalSurface.h.

◆ ArcRange

template<typename TPoint >
typedef std::vector<Arc> DGtal::PolygonalSurface< TPoint >::ArcRange

Definition at line 115 of file PolygonalSurface.h.

◆ ConstIterator

template<typename TPoint >
typedef IntegerSequenceIterator<VertexIndex> DGtal::PolygonalSurface< TPoint >::ConstIterator

Definition at line 110 of file PolygonalSurface.h.

◆ Edge

template<typename TPoint >
typedef EdgeIndex DGtal::PolygonalSurface< TPoint >::Edge

Definition at line 109 of file PolygonalSurface.h.

◆ EdgeIndex

template<typename TPoint >
typedef HalfEdgeDataStructure::EdgeIndex DGtal::PolygonalSurface< TPoint >::EdgeIndex

Definition at line 94 of file PolygonalSurface.h.

◆ Face

template<typename TPoint >
typedef HalfEdgeDataStructure::FaceIndex DGtal::PolygonalSurface< TPoint >::Face

Definition at line 114 of file PolygonalSurface.h.

◆ FaceIndex

template<typename TPoint >
typedef HalfEdgeDataStructure::FaceIndex DGtal::PolygonalSurface< TPoint >::FaceIndex

Definition at line 95 of file PolygonalSurface.h.

◆ FaceRange

template<typename TPoint >
typedef std::vector<Face> DGtal::PolygonalSurface< TPoint >::FaceRange

Definition at line 116 of file PolygonalSurface.h.

◆ HalfEdge

template<typename TPoint >
typedef HalfEdgeDataStructure::HalfEdge DGtal::PolygonalSurface< TPoint >::HalfEdge
protected

Definition at line 216 of file PolygonalSurface.h.

◆ Index

template<typename TPoint >
typedef HalfEdgeDataStructure::Index DGtal::PolygonalSurface< TPoint >::Index

Definition at line 92 of file PolygonalSurface.h.

◆ Point

template<typename TPoint >
typedef TPoint DGtal::PolygonalSurface< TPoint >::Point

Definition at line 89 of file PolygonalSurface.h.

◆ PolygonalFace

template<typename TPoint >
typedef HalfEdgeDataStructure::PolygonalFace DGtal::PolygonalSurface< TPoint >::PolygonalFace

Definition at line 97 of file PolygonalSurface.h.

◆ PolygonalFacesStorage

template<typename TPoint >
typedef std::vector<PolygonalFace> DGtal::PolygonalSurface< TPoint >::PolygonalFacesStorage

Definition at line 99 of file PolygonalSurface.h.

◆ PositionsMap

template<typename TPoint >
typedef IndexedPropertyMap< Point > DGtal::PolygonalSurface< TPoint >::PositionsMap

Definition at line 213 of file PolygonalSurface.h.

◆ PositionsStorage

template<typename TPoint >
typedef std::vector<Point> DGtal::PolygonalSurface< TPoint >::PositionsStorage

Definition at line 98 of file PolygonalSurface.h.

◆ Self

template<typename TPoint >
typedef PolygonalSurface<TPoint> DGtal::PolygonalSurface< TPoint >::Self

Definition at line 90 of file PolygonalSurface.h.

◆ Size

template<typename TPoint >
typedef HalfEdgeDataStructure::Size DGtal::PolygonalSurface< TPoint >::Size

Definition at line 91 of file PolygonalSurface.h.

◆ Triangle

template<typename TPoint >
typedef HalfEdgeDataStructure::Triangle DGtal::PolygonalSurface< TPoint >::Triangle

Definition at line 96 of file PolygonalSurface.h.

◆ Vertex

template<typename TPoint >
typedef VertexIndex DGtal::PolygonalSurface< TPoint >::Vertex

Definition at line 102 of file PolygonalSurface.h.

◆ VertexIndex

template<typename TPoint >
typedef HalfEdgeDataStructure::VertexIndex DGtal::PolygonalSurface< TPoint >::VertexIndex

Definition at line 93 of file PolygonalSurface.h.

◆ VertexRange

template<typename TPoint >
typedef std::vector<Vertex> DGtal::PolygonalSurface< TPoint >::VertexRange

Definition at line 117 of file PolygonalSurface.h.

◆ VertexSet

template<typename TPoint >
typedef std::set<Vertex> DGtal::PolygonalSurface< TPoint >::VertexSet

Definition at line 103 of file PolygonalSurface.h.

Constructor & Destructor Documentation

◆ ~PolygonalSurface()

template<typename TPoint >
DGtal::PolygonalSurface< TPoint >::~PolygonalSurface ( )
inline

Destructor.

Definition at line 224 of file PolygonalSurface.h.

224 {}

◆ PolygonalSurface() [1/2]

template<typename TPoint >
DGtal::PolygonalSurface< TPoint >::PolygonalSurface ( )
inline

Constructor.

Definition at line 229 of file PolygonalSurface.h.

229 : isHEDSValid( false ) {}

◆ PolygonalSurface() [2/2]

template<typename TPoint >
DGtal::PolygonalSurface< TPoint >::PolygonalSurface ( Clone< HalfEdgeDataStructure aHeds,
Clone< PositionsStorage pos 
)

Constructor from half-edge data structure and vector of positions.

Parameters
aHedsany valid half-edge data structure (cloned).
posany vector of point giving the positions of all vertices (its size should match the number of vertices in heds).

Member Function Documentation

◆ addPolygonalFace()

template<typename TPoint >
FaceIndex DGtal::PolygonalSurface< TPoint >::addPolygonalFace ( const PolygonalFace f)

Adds a new polygonal face f to the surface.

Returns
the corresponding index of the polygonal face.

◆ addQuadrangle()

template<typename TPoint >
FaceIndex DGtal::PolygonalSurface< TPoint >::addQuadrangle ( VertexIndex  v0,
VertexIndex  v1,
VertexIndex  v2,
VertexIndex  v3 
)

Adds a new quadrangle of vertices v0, v1, v2, v3 to the surface.

Returns
the corresponding index of the triangle.

◆ addTriangle()

template<typename TPoint >
FaceIndex DGtal::PolygonalSurface< TPoint >::addTriangle ( VertexIndex  v0,
VertexIndex  v1,
VertexIndex  v2 
)

Adds a new triangle of vertices v0, v1, v2 to the surface.

Returns
the corresponding index of the triangle.

◆ addVertex()

template<typename TPoint >
VertexIndex DGtal::PolygonalSurface< TPoint >::addVertex ( const Point vdata)

Adds a new vertex to the surface with data vdata.

Parameters
vdatathe data associated to this new vertex.
Returns
the new index given to this vertex.

◆ allArcs()

template<typename TPoint >
ArcRange DGtal::PolygonalSurface< TPoint >::allArcs ( ) const
Returns
the range of all arcs of the polygonal surface, i.e. an array containing 0, 1, 2, ..., nbArcs()-1.

◆ allBoundaryArcs()

template<typename TPoint >
ArcRange DGtal::PolygonalSurface< TPoint >::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 TPoint >
VertexRange DGtal::PolygonalSurface< TPoint >::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 TPoint >
FaceRange DGtal::PolygonalSurface< TPoint >::allFaces ( ) const
Returns
the range of all faces of the polygonal surface, i.e. an array containing 0, 1, 2, ..., nbVertices()-1.

◆ allVertices()

template<typename TPoint >
VertexRange DGtal::PolygonalSurface< TPoint >::allVertices ( ) const
Returns
the range of all vertices of the polygonal surface, i.e. an array containing 0, 1, 2, ..., nbVertices()-1.

◆ arc()

template<typename TPoint >
Arc DGtal::PolygonalSurface< TPoint >::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)

◆ arcsAroundFace()

template<typename TPoint >
ArcRange DGtal::PolygonalSurface< TPoint >::arcsAroundFace ( const Face f) const
Parameters
fany valid face on the surface. (open or closed ).
Note
By construction, each anArc returned by the method on a face f is such that this->faceAroundArc(anArc) == f.
Returns
the sequence of arcs that touches this face in their natural order (the range size should be 3).

◆ begin()

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

Definition at line 420 of file PolygonalSurface.h.

421  { return ConstIterator( 0 ); }

◆ bestCapacity()

template<typename TPoint >
Size DGtal::PolygonalSurface< TPoint >::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_STATIC_CONSTANT()

template<typename TPoint >
DGtal::PolygonalSurface< TPoint >::BOOST_STATIC_CONSTANT ( Face  ,
INVALID_FACE  = HALF_EDGE_INVALID_INDEX 
)

◆ build()

template<typename TPoint >
bool DGtal::PolygonalSurface< TPoint >::build ( )

Builds the half-edge data structure from the given polygonal faces and vertices. After that, the surface is valid.

Returns
true if everything went allright, false if it was not possible to build a consistent data structure (e.g., butterfly neighborhoods).

◆ clear()

template<typename TPoint >
void DGtal::PolygonalSurface< TPoint >::clear ( )

Clears everything.

◆ degree()

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

◆ end()

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

Definition at line 424 of file PolygonalSurface.h.

425  { return ConstIterator( nbVertices() ); }

References DGtal::PolygonalSurface< TPoint >::nbVertices().

◆ Euler()

template<typename TPoint >
long DGtal::PolygonalSurface< TPoint >::Euler ( ) const
inline
Returns
the euler characteristic of the polygonal surface (a famous topological invariant that is the number of vertices minus the number of edges plus the number of faces).

Definition at line 296 of file PolygonalSurface.h.

296 { return myHEDS.Euler(); }

References DGtal::HalfEdgeDataStructure::Euler(), and DGtal::PolygonalSurface< TPoint >::myHEDS.

◆ faceAroundArc()

template<typename TPoint >
Face DGtal::PolygonalSurface< TPoint >::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 polygonal 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 TPoint >
FaceRange DGtal::PolygonalSurface< TPoint >::facesAroundArc ( const Arc a) const

Computes the faces incident to a given arc. There is only one for polygonal 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 TPoint >
FaceRange DGtal::PolygonalSurface< TPoint >::facesAroundVertex ( const Vertex v) const
Parameters
vany vertex of the surface.
Returns
the faces containing this vertex [v].

◆ head()

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

◆ heds() [1/2]

template<typename TPoint >
HalfEdgeDataStructure& DGtal::PolygonalSurface< TPoint >::heds ( )
inline
Returns
(setter) a reference to the topological structure of the polygonal surface (an half-edge data structure).

Definition at line 273 of file PolygonalSurface.h.

273 { return myHEDS; }

References DGtal::PolygonalSurface< TPoint >::myHEDS.

◆ heds() [2/2]

template<typename TPoint >
const HalfEdgeDataStructure& DGtal::PolygonalSurface< TPoint >::heds ( ) const
inline
Returns
(getter) a const reference to the topological structure of the polygonal surface (an half-edge data structure).

Definition at line 277 of file PolygonalSurface.h.

277 { return myHEDS; }

References DGtal::PolygonalSurface< TPoint >::myHEDS.

◆ inArcs()

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

◆ isArcBoundary()

template<typename TPoint >
bool DGtal::PolygonalSurface< TPoint >::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 TPoint >
bool DGtal::PolygonalSurface< TPoint >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ isVertexBoundary()

template<typename TPoint >
bool DGtal::PolygonalSurface< TPoint >::isVertexBoundary ( const Vertex v) const
Parameters
vany vertex.
Returns
'true' if and only if vertex v lies on a boundary.
Note
O(1) operation

◆ makeEdgeMap() [1/2]

template<typename TPoint >
template<typename AnyData >
IndexedPropertyMap< AnyData > DGtal::PolygonalSurface< TPoint >::makeEdgeMap ( ) const
inline
Returns
an edge property map that associates some data to any edge.

Definition at line 322 of file PolygonalSurface.h.

323  {
324  return IndexedPropertyMap< AnyData >( *this, nbEdges() );
325  }

References DGtal::PolygonalSurface< TPoint >::nbEdges().

◆ makeEdgeMap() [2/2]

template<typename TPoint >
template<typename AnyData >
IndexedPropertyMap< AnyData > DGtal::PolygonalSurface< TPoint >::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 330 of file PolygonalSurface.h.

331  {
332  return IndexedPropertyMap< AnyData >( *this, nbEdges(), value );
333  }

References DGtal::PolygonalSurface< TPoint >::nbEdges().

◆ makeFaceMap() [1/2]

template<typename TPoint >
template<typename AnyData >
IndexedPropertyMap< AnyData > DGtal::PolygonalSurface< TPoint >::makeFaceMap ( ) const
inline
Returns
a face property map that associates some data to any face.

Definition at line 337 of file PolygonalSurface.h.

338  {
339  return IndexedPropertyMap< AnyData >( *this, nbFaces() );
340  }

References DGtal::PolygonalSurface< TPoint >::nbFaces().

◆ makeFaceMap() [2/2]

template<typename TPoint >
template<typename AnyData >
IndexedPropertyMap< AnyData > DGtal::PolygonalSurface< TPoint >::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 345 of file PolygonalSurface.h.

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

References DGtal::PolygonalSurface< TPoint >::nbFaces().

◆ makeVertexMap() [1/2]

template<typename TPoint >
template<typename AnyData >
IndexedPropertyMap< AnyData > DGtal::PolygonalSurface< TPoint >::makeVertexMap ( ) const
inline
Returns
a vertex property map that associates some data to any vertex.

Definition at line 307 of file PolygonalSurface.h.

308  {
309  return IndexedPropertyMap< AnyData >( *this, nbVertices() );
310  }

References DGtal::PolygonalSurface< TPoint >::nbVertices().

◆ makeVertexMap() [2/2]

template<typename TPoint >
template<typename AnyData >
IndexedPropertyMap< AnyData > DGtal::PolygonalSurface< TPoint >::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 315 of file PolygonalSurface.h.

316  {
317  return IndexedPropertyMap< AnyData >( *this, nbVertices(), value );
318  }

References DGtal::PolygonalSurface< TPoint >::nbVertices().

◆ nbArcs()

template<typename TPoint >
Size DGtal::PolygonalSurface< TPoint >::nbArcs ( ) const
inline
Returns
the number of half edges in the structure.

Definition at line 282 of file PolygonalSurface.h.

282 { return myHEDS.nbHalfEdges(); }

References DGtal::PolygonalSurface< TPoint >::myHEDS, and DGtal::HalfEdgeDataStructure::nbHalfEdges().

◆ nbEdges()

template<typename TPoint >
Size DGtal::PolygonalSurface< TPoint >::nbEdges ( ) const
inline
Returns
the number of unoriented edges in the structure.

Definition at line 288 of file PolygonalSurface.h.

288 { return myHEDS.nbEdges(); }

References DGtal::PolygonalSurface< TPoint >::myHEDS, and DGtal::HalfEdgeDataStructure::nbEdges().

Referenced by DGtal::PolygonalSurface< TPoint >::makeEdgeMap().

◆ nbFaces()

template<typename TPoint >
Size DGtal::PolygonalSurface< TPoint >::nbFaces ( ) const
inline
Returns
the number of faces in the structure.

Definition at line 291 of file PolygonalSurface.h.

291 { return myHEDS.nbFaces(); }

References DGtal::PolygonalSurface< TPoint >::myHEDS, and DGtal::HalfEdgeDataStructure::nbFaces().

Referenced by DGtal::PolygonalSurface< TPoint >::makeFaceMap().

◆ nbVertices()

template<typename TPoint >
Size DGtal::PolygonalSurface< TPoint >::nbVertices ( ) const
inline
Returns
the number of vertices in the structure.

Definition at line 285 of file PolygonalSurface.h.

285 { return myHEDS.nbVertices(); }

References DGtal::PolygonalSurface< TPoint >::myHEDS, and DGtal::HalfEdgeDataStructure::nbVertices().

Referenced by DGtal::PolygonalSurface< TPoint >::end(), and DGtal::PolygonalSurface< TPoint >::makeVertexMap().

◆ next()

template<typename TPoint >
Arc DGtal::PolygonalSurface< TPoint >::next ( const Arc a) const

Constant-time access to the next arc

Parameters
aany arc (s,t)
Returns
the next arc

◆ opposite()

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

◆ outArcs()

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

◆ position() [1/2]

template<typename TPoint >
Point& DGtal::PolygonalSurface< TPoint >::position ( Vertex  v)

Mutable accessor to vertex data.

Parameters
vany vertex.
Returns
the mutable data associated to v.

◆ position() [2/2]

template<typename TPoint >
const Point& DGtal::PolygonalSurface< TPoint >::position ( Vertex  v) const

Const accessor to vertex data.

Parameters
vany vertex.
Returns
the non-mutable data associated to v.

◆ positions()

template<typename TPoint >
PositionsMap DGtal::PolygonalSurface< TPoint >::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 300 of file PolygonalSurface.h.

301  {
302  return PositionsMap( *this, myPositions );
303  }

References DGtal::PolygonalSurface< TPoint >::myPositions.

◆ selfDisplay()

template<typename TPoint >
void DGtal::PolygonalSurface< TPoint >::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 TPoint >
Size DGtal::PolygonalSurface< TPoint >::size ( ) const
Returns
the number of vertices of the surface.

◆ tail()

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

◆ verticesAroundFace()

template<typename TPoint >
VertexRange DGtal::PolygonalSurface< TPoint >::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 TPoint >
template<typename OutputIterator >
void DGtal::PolygonalSurface< TPoint >::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 TPoint >
template<typename OutputIterator , typename VertexPredicate >
void DGtal::PolygonalSurface< TPoint >::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 TPoint >
bool DGtal::PolygonalSurface< TPoint >::isHEDSValid
protected

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

Definition at line 595 of file PolygonalSurface.h.

◆ myHEDS

template<typename TPoint >
HalfEdgeDataStructure DGtal::PolygonalSurface< TPoint >::myHEDS
protected

◆ myPolygonalFaces

template<typename TPoint >
PolygonalFacesStorage DGtal::PolygonalSurface< TPoint >::myPolygonalFaces
protected

Stores the polygonal faces.

Definition at line 601 of file PolygonalSurface.h.

◆ myPositions

template<typename TPoint >
PositionsStorage DGtal::PolygonalSurface< TPoint >::myPositions
protected

Stores the information for each Vertex.

Definition at line 599 of file PolygonalSurface.h.

Referenced by DGtal::PolygonalSurface< TPoint >::positions().


The documentation for this class was generated from the following file:
DGtal::PolygonalSurface::nbEdges
Size nbEdges() const
Definition: PolygonalSurface.h:288
DGtal::PolygonalSurface::nbVertices
Size nbVertices() const
Definition: PolygonalSurface.h:285
DGtal::HalfEdgeDataStructure::nbEdges
Size nbEdges() const
Definition: HalfEdgeDataStructure.h:373
DGtal::PolygonalSurface::PositionsMap
IndexedPropertyMap< Point > PositionsMap
Definition: PolygonalSurface.h:213
DGtal::PolygonalSurface::nbFaces
Size nbFaces() const
Definition: PolygonalSurface.h:291
DGtal::HalfEdgeDataStructure::nbHalfEdges
Size nbHalfEdges() const
Definition: HalfEdgeDataStructure.h:367
DGtal::HalfEdgeDataStructure::Euler
long Euler() const
Definition: HalfEdgeDataStructure.h:379
DGtal::HalfEdgeDataStructure::nbVertices
Size nbVertices() const
Definition: HalfEdgeDataStructure.h:370
DGtal::PolygonalSurface::isHEDSValid
bool isHEDSValid
Indicates if the half-edge structure has been created/updated.
Definition: PolygonalSurface.h:595
DGtal::PolygonalSurface::myPositions
PositionsStorage myPositions
Stores the information for each Vertex.
Definition: PolygonalSurface.h:599
DGtal::PolygonalSurface::myHEDS
HalfEdgeDataStructure myHEDS
The half-edge data structure that stores the topology of the mesh.
Definition: PolygonalSurface.h:597
DGtal::PolygonalSurface::ConstIterator
IntegerSequenceIterator< VertexIndex > ConstIterator
Definition: PolygonalSurface.h:110
DGtal::HalfEdgeDataStructure::nbFaces
Size nbFaces() const
Definition: HalfEdgeDataStructure.h:376