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

Aim: Represents a triangulated surface. 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 TriangulatedSurface::makeVertexMap). More...

#include <DGtal/shapes/TriangulatedSurface.h>

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

Data Structures

struct  IndexedPropertyMap
 
struct  VertexMap
 

Public Types

typedef TPoint Point
 
typedef TriangulatedSurface< 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 std::vector< PointPositionsStorage
 
typedef std::vector< TriangleTriangleStorage
 
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)
 
 ~TriangulatedSurface ()
 
 TriangulatedSurface ()
 
void clear ()
 Clears everything. More...
 
bool build ()
 
VertexIndex addVertex (const Point &vdata)
 
FaceIndex addTriangle (VertexIndex v0, VertexIndex v1, VertexIndex v2)
 
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
 
VertexRange verticesOfFacesAroundArc (const Arc a) const
 
bool isFlippable (const Arc a) const
 
void flip (const Arc a)
 
Vertex split (const Arc a, const Point &data)
 
bool isMergeable (const Arc a) const
 
Vertex merge (const Arc a, const Point &data)
 
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...
 
TriangleStorage myTriangles
 Stores the triangles. More...
 

Detailed Description

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

Aim: Represents a triangulated surface. 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 TriangulatedSurface::makeVertexMap).

Description of template class 'TriangulatedSurface'

Except for a few operations, this data structure is rather static. The user must add vertices and triangles, 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/viewMarchingCubes.cpp.

Definition at line 85 of file TriangulatedSurface.h.

Member Typedef Documentation

◆ Arc

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

Definition at line 111 of file TriangulatedSurface.h.

◆ ArcRange

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

Definition at line 113 of file TriangulatedSurface.h.

◆ ConstIterator

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

Definition at line 108 of file TriangulatedSurface.h.

◆ Edge

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

Definition at line 107 of file TriangulatedSurface.h.

◆ EdgeIndex

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

Definition at line 93 of file TriangulatedSurface.h.

◆ Face

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

Definition at line 112 of file TriangulatedSurface.h.

◆ FaceIndex

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

Definition at line 94 of file TriangulatedSurface.h.

◆ FaceRange

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

Definition at line 114 of file TriangulatedSurface.h.

◆ HalfEdge

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

Definition at line 214 of file TriangulatedSurface.h.

◆ Index

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

Definition at line 91 of file TriangulatedSurface.h.

◆ Point

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

Definition at line 88 of file TriangulatedSurface.h.

◆ PositionsMap

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

Definition at line 211 of file TriangulatedSurface.h.

◆ PositionsStorage

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

Definition at line 96 of file TriangulatedSurface.h.

◆ Self

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

Definition at line 89 of file TriangulatedSurface.h.

◆ Size

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

Definition at line 90 of file TriangulatedSurface.h.

◆ Triangle

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

Definition at line 95 of file TriangulatedSurface.h.

◆ TriangleStorage

template<typename TPoint >
typedef std::vector<Triangle> DGtal::TriangulatedSurface< TPoint >::TriangleStorage

Definition at line 97 of file TriangulatedSurface.h.

◆ Vertex

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

Definition at line 100 of file TriangulatedSurface.h.

◆ VertexIndex

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

Definition at line 92 of file TriangulatedSurface.h.

◆ VertexRange

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

Definition at line 115 of file TriangulatedSurface.h.

◆ VertexSet

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

Definition at line 101 of file TriangulatedSurface.h.

Constructor & Destructor Documentation

◆ ~TriangulatedSurface()

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

Destructor.

Definition at line 222 of file TriangulatedSurface.h.

222 {}

◆ TriangulatedSurface()

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

Constructor.

Definition at line 227 of file TriangulatedSurface.h.

227 : isHEDSValid( false ) {}

Member Function Documentation

◆ addTriangle()

template<typename TPoint >
FaceIndex DGtal::TriangulatedSurface< 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.

Referenced by makeTwoTriangles().

◆ addVertex()

template<typename TPoint >
VertexIndex DGtal::TriangulatedSurface< 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.

Referenced by makeTwoTriangles().

◆ allArcs()

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

◆ allBoundaryArcs()

template<typename TPoint >
ArcRange DGtal::TriangulatedSurface< 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).

Referenced by SCENARIO().

◆ allBoundaryVertices()

template<typename TPoint >
VertexRange DGtal::TriangulatedSurface< 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).

Referenced by SCENARIO().

◆ allFaces()

template<typename TPoint >
FaceRange DGtal::TriangulatedSurface< TPoint >::allFaces ( ) const
Returns
the range of all faces of the triangulated surface, i.e. an array containing 0, 1, 2, ..., nbVertices()-1.

◆ allVertices()

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

Referenced by laplacian().

◆ arc()

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

Referenced by SCENARIO().

◆ arcsAroundFace()

template<typename TPoint >
ArcRange DGtal::TriangulatedSurface< 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).

Referenced by SCENARIO().

◆ begin()

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

Definition at line 398 of file TriangulatedSurface.h.

399  { return ConstIterator( 0 ); }

Referenced by SCENARIO().

◆ bestCapacity()

template<typename TPoint >
Size DGtal::TriangulatedSurface< 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::TriangulatedSurface< TPoint >::BOOST_STATIC_CONSTANT ( Face  ,
INVALID_FACE  = HALF_EDGE_INVALID_INDEX 
)

◆ build()

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

Builds the half-edge data structure from the given triangles 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).

Referenced by makeTwoTriangles().

◆ clear()

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

Clears everything.

◆ degree()

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

Referenced by SCENARIO().

◆ end()

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

Definition at line 402 of file TriangulatedSurface.h.

403  { return ConstIterator( nbVertices() ); }

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

Referenced by SCENARIO().

◆ Euler()

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

Definition at line 274 of file TriangulatedSurface.h.

274 { return myHEDS.Euler(); }

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

Referenced by SCENARIO().

◆ faceAroundArc()

template<typename TPoint >
Face DGtal::TriangulatedSurface< 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 triangulated 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.

Referenced by SCENARIO().

◆ facesAroundArc()

template<typename TPoint >
FaceRange DGtal::TriangulatedSurface< TPoint >::facesAroundArc ( const Arc a) const

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

Referenced by laplacian().

◆ flip()

template<typename TPoint >
void DGtal::TriangulatedSurface< TPoint >::flip ( const Arc  a)

Flip the edge associated to arc a.

Parameters
aany valid arc.
Precondition
the edge must be flippable, isFlippable( a ) == true
See also
isFlippable
Postcondition
After flip the arc a corresponding to the flipped edge (if you reflip it you get your former triangulation).
Note
Time complexity is O(1).

Referenced by SCENARIO().

◆ head()

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

Referenced by laplacian(), and SCENARIO().

◆ heds() [1/2]

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

Definition at line 251 of file TriangulatedSurface.h.

251 { return myHEDS; }

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

◆ heds() [2/2]

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

Definition at line 255 of file TriangulatedSurface.h.

255 { return myHEDS; }

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

◆ inArcs()

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

◆ isArcBoundary()

template<typename TPoint >
bool DGtal::TriangulatedSurface< 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

◆ isFlippable()

template<typename TPoint >
bool DGtal::TriangulatedSurface< TPoint >::isFlippable ( const Arc  a) const

An edge is (topologically) flippable iff: (1) it does not lie on the boundary, (2) it is bordered by two triangles, (3) the two other vertices of the quad are not already neighbors. (2) is always true for a triangulated surface.

Parameters
aany arc.
Returns
'true' if the edge containing a is topologically flippable.
Note
Time complexity is O(1).

Referenced by SCENARIO().

◆ isMergeable()

template<typename TPoint >
bool DGtal::TriangulatedSurface< TPoint >::isMergeable ( const Arc  a) const

An edge is (topologically) mergeable iff: (1) it is bordered by two triangles, (2) there is no boundary vertex in the two triangles bordering the edge.

Parameters
aany arc.
Returns
'true' if the edge containing a is topologically mergeable.
Note
Time complexity is O(1).

◆ isValid()

template<typename TPoint >
bool DGtal::TriangulatedSurface< 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::TriangulatedSurface< 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::TriangulatedSurface< TPoint >::makeEdgeMap ( ) const
inline
Returns
an edge property map that associates some data to any edge.

Definition at line 300 of file TriangulatedSurface.h.

301  {
302  return IndexedPropertyMap< AnyData >( *this, nbEdges() );
303  }

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

◆ makeEdgeMap() [2/2]

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

309  {
310  return IndexedPropertyMap< AnyData >( *this, nbEdges(), value );
311  }

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

◆ makeFaceMap() [1/2]

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

Definition at line 315 of file TriangulatedSurface.h.

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

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

◆ makeFaceMap() [2/2]

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

324  {
325  return IndexedPropertyMap< AnyData >( *this, nbFaces(), value );
326  }

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

◆ makeVertexMap() [1/2]

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

Definition at line 285 of file TriangulatedSurface.h.

286  {
287  return IndexedPropertyMap< AnyData >( *this, nbVertices() );
288  }

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

◆ makeVertexMap() [2/2]

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

294  {
295  return IndexedPropertyMap< AnyData >( *this, nbVertices(), value );
296  }

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

◆ merge()

template<typename TPoint >
Vertex DGtal::TriangulatedSurface< TPoint >::merge ( const Arc  a,
const Point data 
)

Merges the edge specified by the arc a.

Parameters
aany valid arc.
datathe position for the merged vertex.
Returns
the index of the merged vertex (which is the tail of the arc a)..
Precondition
the edge must be mergeable, isMergeable( a ) == true
See also
isMergeable
Note
Time complexity is O(1).
Todo:
We could also merge boundary triangles.
Note
All the underlying data-structure is renumbered so that vertex, edge, face and half-edge indices are consecutive. In other words, since 1 vertex, 3 edges, 2 faces and 6 half-edges have been deleted, then the last vertices, edges, faces, half-edges have been renumbered into the freed indices. For instance, the vertex head(a) does not exist anymore (but has been replaced by a renumbered vertex).

◆ nbArcs()

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

Definition at line 260 of file TriangulatedSurface.h.

260 { return myHEDS.nbHalfEdges(); }

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

Referenced by SCENARIO().

◆ nbEdges()

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

Definition at line 266 of file TriangulatedSurface.h.

266 { return myHEDS.nbEdges(); }

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

Referenced by DGtal::TriangulatedSurface< TPoint >::makeEdgeMap(), and SCENARIO().

◆ nbFaces()

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

Definition at line 269 of file TriangulatedSurface.h.

269 { return myHEDS.nbFaces(); }

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

Referenced by laplacian(), DGtal::TriangulatedSurface< TPoint >::makeFaceMap(), and SCENARIO().

◆ nbVertices()

template<typename TPoint >
Size DGtal::TriangulatedSurface< TPoint >::nbVertices ( ) const
inline

◆ next()

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

Constant-time access to the next arc

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

Referenced by laplacian().

◆ opposite()

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

Referenced by laplacian().

◆ outArcs()

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

Referenced by laplacian().

◆ position() [1/2]

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

Mutable accessor to vertex data.

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

Referenced by laplacian().

◆ position() [2/2]

template<typename TPoint >
const Point& DGtal::TriangulatedSurface< 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::TriangulatedSurface< 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 278 of file TriangulatedSurface.h.

279  {
280  return PositionsMap( *this, myPositions );
281  }

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

Referenced by SCENARIO().

◆ selfDisplay()

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

Referenced by SCENARIO().

◆ split()

template<typename TPoint >
Vertex DGtal::TriangulatedSurface< TPoint >::split ( const Arc  a,
const Point data 
)

Splits the edge specified by the arc a. The two faces incident to a are split into four faces.

Parameters
aany valid arc.
datathe position for the newly created vertex.
Returns
the index of the created vertex.
Precondition
the edge must be flippable, isFlippable( a ) == true
See also
isFlippable
Note
Time complexity is O(1).

◆ tail()

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

◆ verticesAroundFace()

template<typename TPoint >
VertexRange DGtal::TriangulatedSurface< 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 should be 3).

Referenced by laplacian(), and SCENARIO().

◆ verticesOfFacesAroundArc()

template<typename TPoint >
VertexRange DGtal::TriangulatedSurface< TPoint >::verticesOfFacesAroundArc ( const Arc  a) const
Parameters
aany arc.
Returns
either the four vertices of the two triangles bordering a, or the three vertices if this is an edge on the boundary.
Note
O(1) operation
Order is, if arc a is (s,t), and a belongs to triangle (s,t,u) and opposite arc belongs to triangle (t,s,v): (t,u,s,v), (t,u,s), (t,s,v)

Referenced by SCENARIO().

◆ writeNeighbors() [1/2]

template<typename TPoint >
template<typename OutputIterator >
void DGtal::TriangulatedSurface< 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::TriangulatedSurface< 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::TriangulatedSurface< TPoint >::isHEDSValid
protected

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

Definition at line 660 of file TriangulatedSurface.h.

◆ myHEDS

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

◆ myPositions

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

Stores the information for each Vertex.

Definition at line 664 of file TriangulatedSurface.h.

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

◆ myTriangles

template<typename TPoint >
TriangleStorage DGtal::TriangulatedSurface< TPoint >::myTriangles
protected

Stores the triangles.

Definition at line 666 of file TriangulatedSurface.h.


The documentation for this class was generated from the following file:
DGtal::HalfEdgeDataStructure::nbEdges
Size nbEdges() const
Definition: HalfEdgeDataStructure.h:373
DGtal::TriangulatedSurface::PositionsMap
IndexedPropertyMap< Point > PositionsMap
Definition: TriangulatedSurface.h:211
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::TriangulatedSurface::nbEdges
Size nbEdges() const
Definition: TriangulatedSurface.h:266
DGtal::TriangulatedSurface::nbFaces
Size nbFaces() const
Definition: TriangulatedSurface.h:269
DGtal::TriangulatedSurface::myHEDS
HalfEdgeDataStructure myHEDS
The half-edge data structure that stores the topology of the mesh.
Definition: TriangulatedSurface.h:662
DGtal::TriangulatedSurface::isHEDSValid
bool isHEDSValid
Indicates if the half-edge structure has been created/updated.
Definition: TriangulatedSurface.h:660
DGtal::TriangulatedSurface::nbVertices
Size nbVertices() const
Definition: TriangulatedSurface.h:263
DGtal::HalfEdgeDataStructure::nbFaces
Size nbFaces() const
Definition: HalfEdgeDataStructure.h:376
DGtal::TriangulatedSurface::ConstIterator
IntegerSequenceIterator< VertexIndex > ConstIterator
Definition: TriangulatedSurface.h:108
DGtal::TriangulatedSurface::myPositions
PositionsStorage myPositions
Stores the information for each Vertex.
Definition: TriangulatedSurface.h:664