DGtal  1.1.0
Data Structures | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes
DGtal::SurfaceMesh< TRealPoint, TRealVector > Struct Template Reference

Aim: Represents an embedded mesh as faces and a list of vertices. Vertices may be shared among faces but no specific topology is required. However, you also have methods to navigate between neighbor vertices, faces, etc. The mesh can be equipped with normals at faces and/or vertices. More...

#include <DGtal/shapes/SurfaceMesh.h>

Collaboration diagram for DGtal::SurfaceMesh< TRealPoint, TRealVector >:
[legend]

Data Structures

struct  VertexMap
 

Public Types

typedef TRealPoint RealPoint
 
typedef TRealVector RealVector
 
typedef SurfaceMesh< RealPoint, RealVectorSelf
 
typedef RealVector::Component Scalar
 
typedef std::vector< ScalarScalars
 
typedef std::size_t Size
 The type for counting elements. More...
 
typedef std::size_t Index
 The type used for numbering vertices and faces. More...
 
typedef Index Face
 
typedef Index Edge
 
typedef Index Vertex
 
typedef std::pair< Edge, ScalarWeightedEdge
 
typedef std::pair< Face, ScalarWeightedFace
 
typedef std::vector< VertexVertices
 The type that defines a list/range of vertices (e.g. to define faces) More...
 
typedef std::vector< EdgeEdges
 The type that defines a list/range of faces. More...
 
typedef std::vector< WeightedEdgeWeightedEdges
 
typedef std::vector< FaceFaces
 
typedef std::vector< WeightedFaceWeightedFaces
 
typedef std::pair< Vertex, VertexVertexPair
 
typedef std::set< VertexVertexSet
 
typedef IntegerSequenceIterator< VertexConstIterator
 Non mutable iterator for visiting vertices. More...
 

Public Member Functions

 BOOST_STATIC_ASSERT ((dimension==3))
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 
Standard services
 ~SurfaceMesh ()=default
 Default destructor. More...
 
 SurfaceMesh ()=default
 
 SurfaceMesh (const Self &other)=default
 
 SurfaceMesh (Self &&other)=default
 
Selfoperator= (const Self &other)=default
 
template<typename RealPointIterator , typename VerticesIterator >
 SurfaceMesh (RealPointIterator itPos, RealPointIterator itPosEnd, VerticesIterator itVertices, VerticesIterator itVerticesEnd)
 
template<typename RealPointIterator , typename VerticesIterator >
bool init (RealPointIterator itPos, RealPointIterator itPosEnd, VerticesIterator itVertices, VerticesIterator itVerticesEnd)
 
void clear ()
 Clears everything. The object is empty. More...
 
Vertex and face vectors initialization and conversion services
template<typename RealVectorIterator >
bool setVertexNormals (RealVectorIterator itN, RealVectorIterator itNEnd)
 
template<typename RealVectorIterator >
bool setFaceNormals (RealVectorIterator itN, RealVectorIterator itNEnd)
 
void computeFaceNormalsFromPositions ()
 
void computeFaceNormalsFromVertexNormals ()
 
void computeVertexNormalsFromFaceNormals ()
 
void computeVertexNormalsFromFaceNormalsWithMaxWeights ()
 
template<typename AnyRing >
std::vector< AnyRing > computeFaceValuesFromVertexValues (const std::vector< AnyRing > &vvalues) const
 
template<typename AnyRing >
std::vector< AnyRing > computeVertexValuesFromFaceValues (const std::vector< AnyRing > &fvalues) const
 
std::vector< RealVectorcomputeFaceUnitVectorsFromVertexUnitVectors (const std::vector< RealVector > &vuvectors) const
 
std::vector< RealVectorcomputeVertexUnitVectorsFromFaceUnitVectors (const std::vector< RealVector > &fuvectors) const
 
Accessors
Size nbVertices () const
 
Size nbEdges () const
 
Size nbFaces () const
 
long Euler () const
 
Edge makeEdge (Vertex i, Vertex j) const
 
const VerticesincidentVertices (Face f) const
 
const FacesincidentFaces (Vertex v) const
 
const FacesneighborFaces (Face f) const
 
const VerticesneighborVertices (Vertex v) const
 
const VertexPairedgeVertices (Edge e) const
 
const FacesedgeFaces (Edge e) const
 
const FacesedgeRightFaces (Edge e) const
 
const FacesedgeLeftFaces (Edge e) const
 
const std::vector< Vertices > & allIncidentVertices () const
 
const std::vector< Faces > & allIncidentFaces () const
 
const std::vector< Faces > & allNeighborFaces () const
 
const std::vector< Vertices > & allNeighborVertices () const
 
const std::vector< VertexPair > & allEdgeVertices () const
 
const std::vector< Faces > & allEdgeFaces () const
 
const std::vector< Faces > & allEdgeRightFaces () const
 
const std::vector< Faces > & allEdgeLeftFaces () const
 
Other topological services
Edges computeManifoldBoundaryEdges () const
 
Edges computeManifoldInnerEdges () const
 
Edges computeManifoldInnerConsistentEdges () const
 
Edges computeManifoldInnerUnconsistentEdges () const
 
Edges computeNonManifoldEdges () const
 
Undirected simple graph services
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
 
Geometric services
const std::vector< RealPoint > & positions () const
 
RealPointposition (Vertex v)
 
const RealPointposition (Vertex v) const
 
const std::vector< RealVector > & vertexNormals () const
 
std::vector< RealVector > & vertexNormals ()
 
RealVectorvertexNormal (Vertex v)
 
const RealVectorvertexNormal (Vertex v) const
 
const std::vector< RealVector > & faceNormals () const
 
std::vector< RealVector > & faceNormals ()
 
RealVectorfaceNormal (Face f)
 
const RealVectorfaceNormal (Face f) const
 
Scalar averageEdgeLength () const
 
Scalar localWindow (Face f) const
 
void perturbateWithUniformRandomNoise (Scalar p)
 
void perturbateWithAdaptiveUniformRandomNoise (Scalar p)
 
RealPoint edgeCentroid (Index e) const
 
RealPoint faceCentroid (Index f) const
 
Scalar faceArea (Index f) const
 
Scalars getMaxWeights (Index v) const
 
WeightedFaces computeFacesInclusionsInBall (Scalar r, Index f) const
 
std::tuple< Vertices, WeightedEdges, WeightedFacescomputeCellsInclusionsInBall (Scalar r, Index f) const
 
Scalar faceInclusionRatio (RealPoint p, Scalar r, Index f) const
 
Scalar edgeInclusionRatio (RealPoint p, Scalar r, Index e) const
 
Scalar vertexInclusionRatio (RealPoint p, Scalar r, Index v) const
 

Static Public Attributes

static const Dimension dimension = RealPoint::dimension
 

Protected Member Functions

void computeNeighbors ()
 Computes neighboring information. More...
 
void computeEdges ()
 Computes edge information. More...
 

Static Protected Member Functions

static Scalar rand01 ()
 

Protected Attributes

std::vector< VerticesmyIncidentVertices
 For each face, its range of incident vertices. More...
 
std::vector< FacesmyIncidentFaces
 For each vertex, its range of incident faces. More...
 
std::vector< RealPointmyPositions
 For each vertex, its position. More...
 
std::vector< RealVectormyVertexNormals
 For each vertex, its normal vector. More...
 
std::vector< RealVectormyFaceNormals
 For each face, its normal vector. More...
 
std::vector< FacesmyNeighborFaces
 For each face, its range of neighbor faces (no particular order) More...
 
std::vector< VerticesmyNeighborVertices
 For each vertex, its range of neighbor vertices (no particular order) More...
 
std::vector< VertexPairmyEdgeVertices
 For each edge, its two vertices. More...
 
std::vector< FacesmyEdgeFaces
 For each edge, its faces (one, two, or more if non manifold) More...
 
std::vector< FacesmyEdgeRightFaces
 
std::vector< FacesmyEdgeLeftFaces
 

Detailed Description

template<typename TRealPoint, typename TRealVector>
struct DGtal::SurfaceMesh< TRealPoint, TRealVector >

Aim: Represents an embedded mesh as faces and a list of vertices. Vertices may be shared among faces but no specific topology is required. However, you also have methods to navigate between neighbor vertices, faces, etc. The mesh can be equipped with normals at faces and/or vertices.

Description of template class 'SurfaceMesh'

We sum up below the possible classes for representing meshes:

See also SurfaceMeshReader and SurfaceMeshWriter for input/output operations for SurfaceMesh.

Template Parameters
TRealPointan arbitrary model of 3D RealPoint.
TRealVectoran arbitrary model of 3D RealVector.
Examples
shapes/exampleSurfaceMesh.cpp.

Definition at line 91 of file SurfaceMesh.h.

Member Typedef Documentation

◆ ConstIterator

template<typename TRealPoint , typename TRealVector >
typedef IntegerSequenceIterator< Vertex > DGtal::SurfaceMesh< TRealPoint, TRealVector >::ConstIterator

Non mutable iterator for visiting vertices.

Definition at line 129 of file SurfaceMesh.h.

◆ Edge

template<typename TRealPoint , typename TRealVector >
typedef Index DGtal::SurfaceMesh< TRealPoint, TRealVector >::Edge

Definition at line 107 of file SurfaceMesh.h.

◆ Edges

template<typename TRealPoint , typename TRealVector >
typedef std::vector< Edge > DGtal::SurfaceMesh< TRealPoint, TRealVector >::Edges

The type that defines a list/range of faces.

Definition at line 114 of file SurfaceMesh.h.

◆ Face

template<typename TRealPoint , typename TRealVector >
typedef Index DGtal::SurfaceMesh< TRealPoint, TRealVector >::Face

Definition at line 106 of file SurfaceMesh.h.

◆ Faces

template<typename TRealPoint , typename TRealVector >
typedef std::vector< Face > DGtal::SurfaceMesh< TRealPoint, TRealVector >::Faces

Definition at line 116 of file SurfaceMesh.h.

◆ Index

template<typename TRealPoint , typename TRealVector >
typedef std::size_t DGtal::SurfaceMesh< TRealPoint, TRealVector >::Index

The type used for numbering vertices and faces.

Definition at line 105 of file SurfaceMesh.h.

◆ RealPoint

template<typename TRealPoint , typename TRealVector >
typedef TRealPoint DGtal::SurfaceMesh< TRealPoint, TRealVector >::RealPoint

Definition at line 93 of file SurfaceMesh.h.

◆ RealVector

template<typename TRealPoint , typename TRealVector >
typedef TRealVector DGtal::SurfaceMesh< TRealPoint, TRealVector >::RealVector

Definition at line 94 of file SurfaceMesh.h.

◆ Scalar

template<typename TRealPoint , typename TRealVector >
typedef RealVector::Component DGtal::SurfaceMesh< TRealPoint, TRealVector >::Scalar

Definition at line 100 of file SurfaceMesh.h.

◆ Scalars

template<typename TRealPoint , typename TRealVector >
typedef std::vector<Scalar> DGtal::SurfaceMesh< TRealPoint, TRealVector >::Scalars

Definition at line 101 of file SurfaceMesh.h.

◆ Self

template<typename TRealPoint , typename TRealVector >
typedef SurfaceMesh< RealPoint, RealVector > DGtal::SurfaceMesh< TRealPoint, TRealVector >::Self

Definition at line 95 of file SurfaceMesh.h.

◆ Size

template<typename TRealPoint , typename TRealVector >
typedef std::size_t DGtal::SurfaceMesh< TRealPoint, TRealVector >::Size

The type for counting elements.

Definition at line 103 of file SurfaceMesh.h.

◆ Vertex

template<typename TRealPoint , typename TRealVector >
typedef Index DGtal::SurfaceMesh< TRealPoint, TRealVector >::Vertex

Definition at line 108 of file SurfaceMesh.h.

◆ VertexPair

template<typename TRealPoint , typename TRealVector >
typedef std::pair< Vertex, Vertex > DGtal::SurfaceMesh< TRealPoint, TRealVector >::VertexPair

Definition at line 118 of file SurfaceMesh.h.

◆ VertexSet

template<typename TRealPoint , typename TRealVector >
typedef std::set<Vertex> DGtal::SurfaceMesh< TRealPoint, TRealVector >::VertexSet

Definition at line 121 of file SurfaceMesh.h.

◆ Vertices

template<typename TRealPoint , typename TRealVector >
typedef std::vector< Vertex > DGtal::SurfaceMesh< TRealPoint, TRealVector >::Vertices

The type that defines a list/range of vertices (e.g. to define faces)

Definition at line 112 of file SurfaceMesh.h.

◆ WeightedEdge

template<typename TRealPoint , typename TRealVector >
typedef std::pair< Edge, Scalar > DGtal::SurfaceMesh< TRealPoint, TRealVector >::WeightedEdge

Definition at line 109 of file SurfaceMesh.h.

◆ WeightedEdges

template<typename TRealPoint , typename TRealVector >
typedef std::vector< WeightedEdge > DGtal::SurfaceMesh< TRealPoint, TRealVector >::WeightedEdges

Definition at line 115 of file SurfaceMesh.h.

◆ WeightedFace

template<typename TRealPoint , typename TRealVector >
typedef std::pair< Face, Scalar > DGtal::SurfaceMesh< TRealPoint, TRealVector >::WeightedFace

Definition at line 110 of file SurfaceMesh.h.

◆ WeightedFaces

template<typename TRealPoint , typename TRealVector >
typedef std::vector< WeightedFace > DGtal::SurfaceMesh< TRealPoint, TRealVector >::WeightedFaces

Definition at line 117 of file SurfaceMesh.h.

Constructor & Destructor Documentation

◆ ~SurfaceMesh()

template<typename TRealPoint , typename TRealVector >
DGtal::SurfaceMesh< TRealPoint, TRealVector >::~SurfaceMesh ( )
default

Default destructor.

◆ SurfaceMesh() [1/4]

template<typename TRealPoint , typename TRealVector >
DGtal::SurfaceMesh< TRealPoint, TRealVector >::SurfaceMesh ( )
default

Default constructor.

A typical construction usage is

std::vector< RealPoint > positions = { { 0, 0, 5 }, { 1, 1, 3 }, { -1, 1, 3 }, { -1, -1, 3 }, { 1, -1, 3 } };
std::vector< Vertices > faces = { { 0, 1, 2 }, { 0, 2, 3 }, { 0, 3, 4 }, { 0, 4, 1 }, { 4, 3, 2, 1 } };
SurfMesh pyramid_mesh;
pyramid_mesh.init( positions.cbegin(), positions.cend(), faces.cbegin(), faces.cend() );

◆ SurfaceMesh() [2/4]

template<typename TRealPoint , typename TRealVector >
DGtal::SurfaceMesh< TRealPoint, TRealVector >::SurfaceMesh ( const Self other)
default

Default copy constructor.

Parameters
otherthe object to clone

◆ SurfaceMesh() [3/4]

template<typename TRealPoint , typename TRealVector >
DGtal::SurfaceMesh< TRealPoint, TRealVector >::SurfaceMesh ( Self &&  other)
default

Default move constructor.

Parameters
otherthe object to move

◆ SurfaceMesh() [4/4]

template<typename TRealPoint , typename TRealVector >
template<typename RealPointIterator , typename VerticesIterator >
DGtal::SurfaceMesh< TRealPoint, TRealVector >::SurfaceMesh ( RealPointIterator  itPos,
RealPointIterator  itPosEnd,
VerticesIterator  itVertices,
VerticesIterator  itVerticesEnd 
)

Builds a mesh from vertex positions and polygonal faces.

Template Parameters
RealPointIteratorany forward iterator on RealPoint.
VerticesIteratorany forward iterator on the range of vertices defining a face.
Parameters
itPos,itPosEnda range of iterators pointing on the positions of all the vertices of the mesh.
itVertices,itVerticesEnda range of iterators pointing on the (oriented) faces of the mesh, each face being a range of vertex indices.

A typical construction usage is

std::vector< RealPoint > positions = { { 0, 0, 5 }, { 1, 1, 3 }, { -1, 1, 3 }, { -1, -1, 3 }, { 1, -1, 3 } };
std::vector< Vertices > faces = { { 0, 1, 2 }, { 0, 2, 3 }, { 0, 3, 4 }, { 0, 4, 1 }, { 4, 3, 2, 1 } };
auto pyramid_mesh = SurfMesh( positions.cbegin(), positions.cend(), faces.cbegin(), faces.cend() );

Member Function Documentation

◆ allEdgeFaces()

template<typename TRealPoint , typename TRealVector >
const std::vector< Faces >& DGtal::SurfaceMesh< TRealPoint, TRealVector >::allEdgeFaces ( ) const
inline
Returns
a const reference to the vector giving for each edge its incident faces (one, two, or more if non manifold)

Definition at line 384 of file SurfaceMesh.h.

385  { return myEdgeFaces; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeFaces.

◆ allEdgeLeftFaces()

template<typename TRealPoint , typename TRealVector >
const std::vector< Faces >& DGtal::SurfaceMesh< TRealPoint, TRealVector >::allEdgeLeftFaces ( ) const
inline
Returns
a const reference to the vector giving for each edge its incident faces to its left (zero if open, one, or more if non manifold).
Note
an edge is stored as a vertex pair (i,j), i < j. So a face to its left, being defined ccw, means that the face is some (..., i, j, ... ).

Definition at line 404 of file SurfaceMesh.h.

405  { return myEdgeLeftFaces; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeLeftFaces.

◆ allEdgeRightFaces()

template<typename TRealPoint , typename TRealVector >
const std::vector< Faces >& DGtal::SurfaceMesh< TRealPoint, TRealVector >::allEdgeRightFaces ( ) const
inline
Returns
a const reference to the vector giving for each edge its incident faces to its right (zero if open, one, or more if non manifold).
Note
an edge is stored as a vertex pair (i,j), i < j. So a face to its right, being defined ccw, means that the face is some (..., j, i, ... ).

Definition at line 394 of file SurfaceMesh.h.

395  { return myEdgeRightFaces; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeRightFaces.

◆ allEdgeVertices()

template<typename TRealPoint , typename TRealVector >
const std::vector< VertexPair >& DGtal::SurfaceMesh< TRealPoint, TRealVector >::allEdgeVertices ( ) const
inline
Returns
a const reference to the vector giving for each edge its two vertices (as a pair (i,j), i<j).
Note
edges are sorted in increasing order.

Definition at line 379 of file SurfaceMesh.h.

380  { return myEdgeVertices; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeVertices.

◆ allIncidentFaces()

template<typename TRealPoint , typename TRealVector >
const std::vector< Faces >& DGtal::SurfaceMesh< TRealPoint, TRealVector >::allIncidentFaces ( ) const
inline
Returns
a const reference to the vector giving for each vertex its incident faces.

Definition at line 365 of file SurfaceMesh.h.

366  { return myIncidentFaces; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myIncidentFaces.

◆ allIncidentVertices()

template<typename TRealPoint , typename TRealVector >
const std::vector< Vertices >& DGtal::SurfaceMesh< TRealPoint, TRealVector >::allIncidentVertices ( ) const
inline
Returns
a const reference to the vector giving for each face its incident vertices.

Definition at line 360 of file SurfaceMesh.h.

361  { return myIncidentVertices; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myIncidentVertices.

◆ allNeighborFaces()

template<typename TRealPoint , typename TRealVector >
const std::vector< Faces >& DGtal::SurfaceMesh< TRealPoint, TRealVector >::allNeighborFaces ( ) const
inline
Returns
a const reference to the vector of neighbor faces for each face.

Definition at line 369 of file SurfaceMesh.h.

370  { return myNeighborFaces; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myNeighborFaces.

◆ allNeighborVertices()

template<typename TRealPoint , typename TRealVector >
const std::vector< Vertices >& DGtal::SurfaceMesh< TRealPoint, TRealVector >::allNeighborVertices ( ) const
inline
Returns
a const reference to the vector of neighbor vertices for each vertex.

Definition at line 373 of file SurfaceMesh.h.

374  { return myNeighborVertices; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myNeighborVertices.

◆ averageEdgeLength()

template<typename TRealPoint , typename TRealVector >
Scalar DGtal::SurfaceMesh< TRealPoint, TRealVector >::averageEdgeLength ( ) const
Returns
the average of the length of edges.

◆ begin()

template<typename TRealPoint , typename TRealVector >
ConstIterator DGtal::SurfaceMesh< TRealPoint, TRealVector >::begin ( ) const
inline
Returns
a (non mutable) iterator pointing on the first vertex.

Definition at line 513 of file SurfaceMesh.h.

514  { return ConstIterator( 0 ); }

◆ bestCapacity()

template<typename TRealPoint , typename TRealVector >
Size DGtal::SurfaceMesh< TRealPoint, TRealVector >::bestCapacity ( ) const
inline
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.

Definition at line 456 of file SurfaceMesh.h.

457  { return 8; }

◆ BOOST_STATIC_ASSERT()

template<typename TRealPoint , typename TRealVector >
DGtal::SurfaceMesh< TRealPoint, TRealVector >::BOOST_STATIC_ASSERT ( (dimension==3)  )

◆ clear()

template<typename TRealPoint , typename TRealVector >
void DGtal::SurfaceMesh< TRealPoint, TRealVector >::clear ( )

Clears everything. The object is empty.

◆ computeCellsInclusionsInBall()

template<typename TRealPoint , typename TRealVector >
std::tuple< Vertices, WeightedEdges, WeightedFaces > DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeCellsInclusionsInBall ( Scalar  r,
Index  f 
) const

Given a ball of radius r centered on the centroid of face f, return the vertices/edges/faces having an non empty intersection with this ball, each edge/face weighted by its ratio of inclusion (in the range [0,1] where 0 is empty intersection and 1 is completely included).

Parameters
rthe radius of the ball.
fthe face where the ball is centered.
Returns
the range of vertices/edges/faces having an non empty intersection with this ball, each edge/face weighted by its ratio of inclusion (in the range [0,1] where 0 is empty intersection and 1 is completely included).
Note
a vertex is either included or not, so no weight is necessary.

◆ computeEdges()

template<typename TRealPoint , typename TRealVector >
void DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeEdges ( )
protected

Computes edge information.

◆ computeFaceNormalsFromPositions()

template<typename TRealPoint , typename TRealVector >
void DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeFaceNormalsFromPositions ( )

Uses the positions of vertices to compute a normal vector to each face of the mesh. It computes the barycenter, triangulates implicitly the face to build the normal vector from the average of implicit triangle normals.

◆ computeFaceNormalsFromVertexNormals()

template<typename TRealPoint , typename TRealVector >
void DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeFaceNormalsFromVertexNormals ( )

Uses the normals associated with vertices to compute a normal vector to each face of the mesh. It simply averages the normals at every incident vertex.

◆ computeFacesInclusionsInBall()

template<typename TRealPoint , typename TRealVector >
WeightedFaces DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeFacesInclusionsInBall ( Scalar  r,
Index  f 
) const

Given a ball of radius r centered on the centroid of face f, return the faces having a non empty intersection with this ball, each one weighted by its ratio of inclusion (in the range [0,1] where 0 is empty intersection and 1 is completely included).

Parameters
rthe radius of the ball.
fthe face where the ball is centered.
Returns
the range of faces having an non empty intersection with this ball, each one weighted by its ratio of inclusion (in the range [0,1] where 0 is empty intersection and 1 is completely included).
Note
For edges, the ratio is the length of the part of the edge included in the ball and the total edge length. For faces, the ratio is the approximated area of the face part inside the ball and the face area. The approximation is estimated by computing the distance of face vertices and face barycenter to the ball center and by linear interpolation of the results.

◆ computeFaceUnitVectorsFromVertexUnitVectors()

template<typename TRealPoint , typename TRealVector >
std::vector<RealVector> DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeFaceUnitVectorsFromVertexUnitVectors ( const std::vector< RealVector > &  vuvectors) const
Parameters
vuvectorsany vector of unit vectors on vertices.
Returns
a vector of unit vectors on faces approximating vuvectors.

◆ computeFaceValuesFromVertexValues()

template<typename TRealPoint , typename TRealVector >
template<typename AnyRing >
std::vector<AnyRing> DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeFaceValuesFromVertexValues ( const std::vector< AnyRing > &  vvalues) const
Parameters
vvaluesany vector of vertex values.
Returns
a vector of face values approximating vvalues.
Template Parameters
AnyRingany summable and averagable type.

◆ computeManifoldBoundaryEdges()

template<typename TRealPoint , typename TRealVector >
Edges DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeManifoldBoundaryEdges ( ) const
Returns
the edges that lie on the boundary of the mesh, i.e. they have only one incident face.

◆ computeManifoldInnerConsistentEdges()

template<typename TRealPoint , typename TRealVector >
Edges DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeManifoldInnerConsistentEdges ( ) const
Returns
the edges that lie on the inside of the mesh, with consistent local orientation, i.e. they have one left incident face, and one right incident face.

◆ computeManifoldInnerEdges()

template<typename TRealPoint , typename TRealVector >
Edges DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeManifoldInnerEdges ( ) const
Returns
the edges that lie on the inside of the mesh, with two incident faces, consistently oriented or not.
Note
union of computeManifoldInnerConsistentEdges and computeManifoldInnerUnconsistentEdges

◆ computeManifoldInnerUnconsistentEdges()

template<typename TRealPoint , typename TRealVector >
Edges DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeManifoldInnerUnconsistentEdges ( ) const
Returns
the edges that have two incident faces, but not correctly oriented, i.e. they may have two left incident faces and no right incident face, or two right incident faces and no left incident face.

◆ computeNeighbors()

template<typename TRealPoint , typename TRealVector >
void DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeNeighbors ( )
protected

Computes neighboring information.

◆ computeNonManifoldEdges()

template<typename TRealPoint , typename TRealVector >
Edges DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeNonManifoldEdges ( ) const
Returns
the edges that are non manifold, i.e. neither boundary or inner edges: they may have more than two incident faces, or two left incident faces for instance.

◆ computeVertexNormalsFromFaceNormals()

template<typename TRealPoint , typename TRealVector >
void DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeVertexNormalsFromFaceNormals ( )

Uses the normals associated with faces to compute a normal vector to each vertex of the mesh. It simply averages the normals of every incident face.

◆ computeVertexNormalsFromFaceNormalsWithMaxWeights()

template<typename TRealPoint , typename TRealVector >
void DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeVertexNormalsFromFaceNormalsWithMaxWeights ( )

Uses the normals associated with faces to compute a normal vector to each vertex of the mesh. It uses the weights proposed by [67] for combining face information into vertex information.

◆ computeVertexUnitVectorsFromFaceUnitVectors()

template<typename TRealPoint , typename TRealVector >
std::vector<RealVector> DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeVertexUnitVectorsFromFaceUnitVectors ( const std::vector< RealVector > &  fuvectors) const
Parameters
fuvectorsany vector of unit vectors on faces.
Returns
a vector of unit vectors on vertices approximating fuvectors.

◆ computeVertexValuesFromFaceValues()

template<typename TRealPoint , typename TRealVector >
template<typename AnyRing >
std::vector<AnyRing> DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeVertexValuesFromFaceValues ( const std::vector< AnyRing > &  fvalues) const
Parameters
fvaluesany vector of vertex values.
Returns
a vector of vertex values approximating fvalues.
Template Parameters
AnyRingany summable and averagable type.

◆ degree()

template<typename TRealPoint , typename TRealVector >
Size DGtal::SurfaceMesh< TRealPoint, TRealVector >::degree ( const Vertex v) const
inline
Parameters
vany vertex
Returns
the number of neighbors of this vertex

Definition at line 464 of file SurfaceMesh.h.

465  { return myNeighborVertices[ v ].size(); }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myNeighborVertices.

◆ edgeCentroid()

template<typename TRealPoint , typename TRealVector >
RealPoint DGtal::SurfaceMesh< TRealPoint, TRealVector >::edgeCentroid ( Index  e) const
Parameters
eany valid edge index.
Returns
the centroid (or barycenter) of edge f.

◆ edgeFaces()

template<typename TRealPoint , typename TRealVector >
const Faces& DGtal::SurfaceMesh< TRealPoint, TRealVector >::edgeFaces ( Edge  e) const
inline
Parameters
eany edge
Returns
a const reference to the range giving for edge e its incident faces (one, two, or more if non manifold)

Definition at line 333 of file SurfaceMesh.h.

334  { return myEdgeFaces[ e ]; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeFaces.

◆ edgeInclusionRatio()

template<typename TRealPoint , typename TRealVector >
Scalar DGtal::SurfaceMesh< TRealPoint, TRealVector >::edgeInclusionRatio ( RealPoint  p,
Scalar  r,
Index  e 
) const

Computes an approximation of the inclusion ratio of a given edge e with a ball of radius r and center p.

Parameters
pthe center of the ball.
rthe radius of the ball.
eany index of edge.
Returns
the inclusion ratio as a scalar between 0 (no intersection) and 1 (inclusion).
Note
The approximation is estimated by computing the distance of edge vertices and edge midpoint to the ball center and by linear interpolation of the results.

◆ edgeLeftFaces()

template<typename TRealPoint , typename TRealVector >
const Faces& DGtal::SurfaceMesh< TRealPoint, TRealVector >::edgeLeftFaces ( Edge  e) const
inline
Parameters
eany edge
Returns
a const reference to the range giving for edge e its incident faces to its left (zero if open, one, or more if non manifold).
Note
an edge is stored as a vertex pair (i,j), i < j. So a face to its left, being defined ccw, means that the face is some (..., i, j, ... ).

Definition at line 355 of file SurfaceMesh.h.

356  { return myEdgeLeftFaces[ e ]; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeLeftFaces.

◆ edgeRightFaces()

template<typename TRealPoint , typename TRealVector >
const Faces& DGtal::SurfaceMesh< TRealPoint, TRealVector >::edgeRightFaces ( Edge  e) const
inline
Parameters
eany edge
Returns
a const reference to the range giving for edge e its incident faces to its right (zero if open, one, or more if non manifold).
Note
an edge is stored as a vertex pair (i,j), i < j. So a face to its right, being defined ccw, means that the face is some (..., j, i, ... ).

Definition at line 344 of file SurfaceMesh.h.

345  { return myEdgeRightFaces[ e ]; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeRightFaces.

◆ edgeVertices()

template<typename TRealPoint , typename TRealVector >
const VertexPair& DGtal::SurfaceMesh< TRealPoint, TRealVector >::edgeVertices ( Edge  e) const
inline
Parameters
eany edge
Returns
a const reference to the vector giving for edge e its two vertices (as a pair (i,j), i<j).

Definition at line 327 of file SurfaceMesh.h.

328  { return myEdgeVertices[ e ]; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeVertices.

◆ end()

template<typename TRealPoint , typename TRealVector >
ConstIterator DGtal::SurfaceMesh< TRealPoint, TRealVector >::end ( ) const
inline
Returns
a (non mutable) iterator pointing after the last vertex.

Definition at line 517 of file SurfaceMesh.h.

518  { return ConstIterator( nbVertices() ); }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::nbVertices().

◆ Euler()

template<typename TRealPoint , typename TRealVector >
long DGtal::SurfaceMesh< TRealPoint, TRealVector >::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 292 of file SurfaceMesh.h.

293  { return nbVertices() - nbEdges() + nbFaces(); }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::nbEdges(), DGtal::SurfaceMesh< TRealPoint, TRealVector >::nbFaces(), and DGtal::SurfaceMesh< TRealPoint, TRealVector >::nbVertices().

◆ faceArea()

template<typename TRealPoint , typename TRealVector >
Scalar DGtal::SurfaceMesh< TRealPoint, TRealVector >::faceArea ( Index  f) const
Parameters
fany valid face index.
Returns
the area of face f.

◆ faceCentroid()

template<typename TRealPoint , typename TRealVector >
RealPoint DGtal::SurfaceMesh< TRealPoint, TRealVector >::faceCentroid ( Index  f) const
Parameters
fany valid face index.
Returns
the centroid (or barycenter) of face f.

◆ faceInclusionRatio()

template<typename TRealPoint , typename TRealVector >
Scalar DGtal::SurfaceMesh< TRealPoint, TRealVector >::faceInclusionRatio ( RealPoint  p,
Scalar  r,
Index  f 
) const

Computes an approximation of the inclusion ratio of a given face f with a ball of radius r and center p.

Parameters
pthe center of the ball.
rthe radius of the ball.
fany index of face.
Returns
the inclusion ratio as a scalar between 0 (no intersection) and 1 (inclusion).
Note
The approximation is estimated by computing the distance of face vertices and face barycenter to the ball center and by linear interpolation of the results.

◆ faceNormal() [1/2]

template<typename TRealPoint , typename TRealVector >
RealVector& DGtal::SurfaceMesh< TRealPoint, TRealVector >::faceNormal ( Face  f)
inline

Mutable accessor to face normal.

Parameters
fany face.
Returns
the mutable normal associated to f.

Definition at line 574 of file SurfaceMesh.h.

575  { return myFaceNormals[ f ]; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myFaceNormals.

◆ faceNormal() [2/2]

template<typename TRealPoint , typename TRealVector >
const RealVector& DGtal::SurfaceMesh< TRealPoint, TRealVector >::faceNormal ( Face  f) const
inline

Const accessor to face normal.

Parameters
fany face.
Returns
the non-mutable normal associated to f.

Definition at line 580 of file SurfaceMesh.h.

581  { return myFaceNormals[ f ]; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myFaceNormals.

◆ faceNormals() [1/2]

template<typename TRealPoint , typename TRealVector >
std::vector< RealVector >& DGtal::SurfaceMesh< TRealPoint, TRealVector >::faceNormals ( )
inline
Returns
a reference to the vector of normals to faces.

Definition at line 568 of file SurfaceMesh.h.

569  { return myFaceNormals; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myFaceNormals.

◆ faceNormals() [2/2]

template<typename TRealPoint , typename TRealVector >
const std::vector< RealVector >& DGtal::SurfaceMesh< TRealPoint, TRealVector >::faceNormals ( ) const
inline
Returns
a const reference to the vector of normals to faces.

Definition at line 564 of file SurfaceMesh.h.

565  { return myFaceNormals; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myFaceNormals.

◆ getMaxWeights()

template<typename TRealPoint , typename TRealVector >
Scalars DGtal::SurfaceMesh< TRealPoint, TRealVector >::getMaxWeights ( Index  v) const
Parameters
vany valid vertex index.
Returns
the Max's weights for each incident face to v, in the same order as myIncidentFaces[ v ].
Note
Used in computeVertexNormalsFromFaceNormalsWithMaxWeights, see [67]

◆ incidentFaces()

template<typename TRealPoint , typename TRealVector >
const Faces& DGtal::SurfaceMesh< TRealPoint, TRealVector >::incidentFaces ( Vertex  v) const
inline
Parameters
vany vertex
Returns
a const reference to the range giving for vertex v its incident faces.

Definition at line 311 of file SurfaceMesh.h.

312  { return myIncidentFaces[ v ]; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myIncidentFaces.

◆ incidentVertices()

template<typename TRealPoint , typename TRealVector >
const Vertices& DGtal::SurfaceMesh< TRealPoint, TRealVector >::incidentVertices ( Face  f) const
inline
Parameters
fany face
Returns
a const reference to the range giving for face f its incident vertices.

Definition at line 305 of file SurfaceMesh.h.

306  { return myIncidentVertices[ f ]; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myIncidentVertices.

◆ init()

template<typename TRealPoint , typename TRealVector >
template<typename RealPointIterator , typename VerticesIterator >
bool DGtal::SurfaceMesh< TRealPoint, TRealVector >::init ( RealPointIterator  itPos,
RealPointIterator  itPosEnd,
VerticesIterator  itVertices,
VerticesIterator  itVerticesEnd 
)

Initializes a mesh from vertex positions and polygonal faces (clears everything before).

Template Parameters
RealPointIteratorany forward iterator on RealPoint.
VerticesIteratorany forward iterator on a range of vertices.
Parameters
itPos,itPosEnda range of iterators pointing on the positions of all the vertices of the mesh.
itVertices,itVerticesEnda range of iterators pointing on the (oriented) faces of the mesh, each face being a range of vertex indices.

A typical construction usage is

std::vector< RealPoint > positions = { { 0, 0, 5 }, { 1, 1, 3 }, { -1, 1, 3 }, { -1, -1, 3 }, { 1, -1, 3 } };
std::vector< Vertices > faces = { { 0, 1, 2 }, { 0, 2, 3 }, { 0, 3, 4 }, { 0, 4, 1 }, { 4, 3, 2, 1 } };
SurfMesh pyramid_mesh;
pyramid_mesh.init( positions.cbegin(), positions.cend(), faces.cbegin(), faces.cend() );

◆ isValid()

template<typename TRealPoint , typename TRealVector >
bool DGtal::SurfaceMesh< TRealPoint, TRealVector >::isValid ( ) const

Checks the validity/consistency of the object.

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

◆ localWindow()

template<typename TRealPoint , typename TRealVector >
Scalar DGtal::SurfaceMesh< TRealPoint, TRealVector >::localWindow ( Face  f) const
Parameters
fany valid face index
Returns
the average distance between the centroid of face f and its vertices.

◆ makeEdge()

template<typename TRealPoint , typename TRealVector >
Edge DGtal::SurfaceMesh< TRealPoint, TRealVector >::makeEdge ( Vertex  i,
Vertex  j 
) const
Parameters
iany vertex of the mesh
jany vertex of the mesh
Returns
the edge index of edge (i,j) or nbEdges() if this edge does not exist.
Note
O(log E) time complexity.

◆ nbEdges()

template<typename TRealPoint , typename TRealVector >
Size DGtal::SurfaceMesh< TRealPoint, TRealVector >::nbEdges ( ) const
inline
Returns
the number of (unordered) edges of the mesh.

Definition at line 282 of file SurfaceMesh.h.

283  { return myEdgeVertices.size(); }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeVertices.

Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::Euler().

◆ nbFaces()

template<typename TRealPoint , typename TRealVector >
Size DGtal::SurfaceMesh< TRealPoint, TRealVector >::nbFaces ( ) const
inline
Returns
the number of faces of the mesh.

Definition at line 286 of file SurfaceMesh.h.

287  { return myIncidentVertices.size(); }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myIncidentVertices.

Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::Euler().

◆ nbVertices()

template<typename TRealPoint , typename TRealVector >
Size DGtal::SurfaceMesh< TRealPoint, TRealVector >::nbVertices ( ) const
inline

◆ neighborFaces()

template<typename TRealPoint , typename TRealVector >
const Faces& DGtal::SurfaceMesh< TRealPoint, TRealVector >::neighborFaces ( Face  f) const
inline
Parameters
fany face
Returns
a const reference to the range of neighbor faces for face f.

Definition at line 316 of file SurfaceMesh.h.

317  { return myNeighborFaces[ f ]; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myNeighborFaces.

◆ neighborVertices()

template<typename TRealPoint , typename TRealVector >
const Vertices& DGtal::SurfaceMesh< TRealPoint, TRealVector >::neighborVertices ( Vertex  v) const
inline
Parameters
vany vertex
Returns
a const reference to the range of neighbor vertices for vertex v.

Definition at line 321 of file SurfaceMesh.h.

322  { return myNeighborVertices[ v ]; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myNeighborVertices.

◆ operator=()

template<typename TRealPoint , typename TRealVector >
Self& DGtal::SurfaceMesh< TRealPoint, TRealVector >::operator= ( const Self other)
default

Default assignment constructor.

Parameters
otherthe object to clone
Returns
a reference to 'this'.

◆ perturbateWithAdaptiveUniformRandomNoise()

template<typename TRealPoint , typename TRealVector >
void DGtal::SurfaceMesh< TRealPoint, TRealVector >::perturbateWithAdaptiveUniformRandomNoise ( Scalar  p)

Perturbate the positions with a uniform random noise of 'p * averageLocalEdgeLength' along arbitrary directions.

Parameters
pany positive real value.

◆ perturbateWithUniformRandomNoise()

template<typename TRealPoint , typename TRealVector >
void DGtal::SurfaceMesh< TRealPoint, TRealVector >::perturbateWithUniformRandomNoise ( Scalar  p)

Perturbate the positions with a uniform random noise of 'p * averageEdgeLength' along arbitrary directions.

Parameters
pany positive real value.

◆ position() [1/2]

template<typename TRealPoint , typename TRealVector >
RealPoint& DGtal::SurfaceMesh< TRealPoint, TRealVector >::position ( Vertex  v)
inline

Mutable accessor to vertex position.

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

Definition at line 534 of file SurfaceMesh.h.

535  { return myPositions[ v ]; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myPositions.

◆ position() [2/2]

template<typename TRealPoint , typename TRealVector >
const RealPoint& DGtal::SurfaceMesh< TRealPoint, TRealVector >::position ( Vertex  v) const
inline

Const accessor to vertex position.

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

Definition at line 540 of file SurfaceMesh.h.

541  { return myPositions[ v ]; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myPositions.

◆ positions()

template<typename TRealPoint , typename TRealVector >
const std::vector< RealPoint >& DGtal::SurfaceMesh< TRealPoint, TRealVector >::positions ( ) const
inline
Returns
a const reference to the vector of positions (of vertices).

Definition at line 528 of file SurfaceMesh.h.

529  { return myPositions; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myPositions.

◆ rand01()

template<typename TRealPoint , typename TRealVector >
static Scalar DGtal::SurfaceMesh< TRealPoint, TRealVector >::rand01 ( )
inlinestaticprotected
Returns
a random number between 0.0 and 1.0

Definition at line 764 of file SurfaceMesh.h.

765  { return (Scalar) rand() / (Scalar) RAND_MAX; }

◆ selfDisplay()

template<typename TRealPoint , typename TRealVector >
void DGtal::SurfaceMesh< TRealPoint, TRealVector >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ setFaceNormals()

template<typename TRealPoint , typename TRealVector >
template<typename RealVectorIterator >
bool DGtal::SurfaceMesh< TRealPoint, TRealVector >::setFaceNormals ( RealVectorIterator  itN,
RealVectorIterator  itNEnd 
)

Given a range of real vectors, sets the normals of every face to the given vectors.

◆ setVertexNormals()

template<typename TRealPoint , typename TRealVector >
template<typename RealVectorIterator >
bool DGtal::SurfaceMesh< TRealPoint, TRealVector >::setVertexNormals ( RealVectorIterator  itN,
RealVectorIterator  itNEnd 
)

Given a range of real vectors, sets the normals of every vertex to the given vectors.

◆ size()

template<typename TRealPoint , typename TRealVector >
Size DGtal::SurfaceMesh< TRealPoint, TRealVector >::size ( ) const
inline
Returns
the number of vertices of the surface.

Definition at line 447 of file SurfaceMesh.h.

448  { return nbVertices(); }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::nbVertices().

◆ vertexInclusionRatio()

template<typename TRealPoint , typename TRealVector >
Scalar DGtal::SurfaceMesh< TRealPoint, TRealVector >::vertexInclusionRatio ( RealPoint  p,
Scalar  r,
Index  v 
) const

Computes the inclusion ratio of a given vertex v with a ball of radius r and center p.

Parameters
pthe center of the ball.
rthe radius of the ball.
vany index of vertex.
Returns
the inclusion ratio as a scalar, either 0 (no intersection) or 1 (inclusion).

◆ vertexNormal() [1/2]

template<typename TRealPoint , typename TRealVector >
RealVector& DGtal::SurfaceMesh< TRealPoint, TRealVector >::vertexNormal ( Vertex  v)
inline

Mutable accessor to vertex normal.

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

Definition at line 554 of file SurfaceMesh.h.

555  { return myVertexNormals[ v ]; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myVertexNormals.

◆ vertexNormal() [2/2]

template<typename TRealPoint , typename TRealVector >
const RealVector& DGtal::SurfaceMesh< TRealPoint, TRealVector >::vertexNormal ( Vertex  v) const
inline

Const accessor to vertex normal.

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

Definition at line 560 of file SurfaceMesh.h.

561  { return myVertexNormals[ v ]; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myVertexNormals.

◆ vertexNormals() [1/2]

template<typename TRealPoint , typename TRealVector >
std::vector< RealVector >& DGtal::SurfaceMesh< TRealPoint, TRealVector >::vertexNormals ( )
inline
Returns
a reference to the vector of normals to vertices.

Definition at line 548 of file SurfaceMesh.h.

549  { return myVertexNormals; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myVertexNormals.

◆ vertexNormals() [2/2]

template<typename TRealPoint , typename TRealVector >
const std::vector< RealVector >& DGtal::SurfaceMesh< TRealPoint, TRealVector >::vertexNormals ( ) const
inline
Returns
a const reference to the vector of normals to vertices.

Definition at line 544 of file SurfaceMesh.h.

545  { return myVertexNormals; }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myVertexNormals.

◆ writeNeighbors() [1/2]

template<typename TRealPoint , typename TRealVector >
template<typename OutputIterator >
void DGtal::SurfaceMesh< TRealPoint, TRealVector >::writeNeighbors ( OutputIterator &  it,
const Vertex v 
) const
inline

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

Definition at line 479 of file SurfaceMesh.h.

481  {
482  for ( auto&& nv : myNeighborVertices[ v ] )
483  *it++ = nv;
484  }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myNeighborVertices.

◆ writeNeighbors() [2/2]

template<typename TRealPoint , typename TRealVector >
template<typename OutputIterator , typename VertexPredicate >
void DGtal::SurfaceMesh< TRealPoint, TRealVector >::writeNeighbors ( OutputIterator &  it,
const Vertex v,
const VertexPredicate &  pred 
) const
inline

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

Definition at line 504 of file SurfaceMesh.h.

507  {
508  for ( auto&& nv : myNeighborVertices[ v ] )
509  if ( pred( nv ) ) *it++ = nv;
510  }

References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myNeighborVertices.

Field Documentation

◆ dimension

template<typename TRealPoint , typename TRealVector >
const Dimension DGtal::SurfaceMesh< TRealPoint, TRealVector >::dimension = RealPoint::dimension
static

Definition at line 97 of file SurfaceMesh.h.

◆ myEdgeFaces

template<typename TRealPoint , typename TRealVector >
std::vector< Faces > DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeFaces
protected

For each edge, its faces (one, two, or more if non manifold)

Definition at line 737 of file SurfaceMesh.h.

Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::allEdgeFaces(), and DGtal::SurfaceMesh< TRealPoint, TRealVector >::edgeFaces().

◆ myEdgeLeftFaces

template<typename TRealPoint , typename TRealVector >
std::vector< Faces > DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeLeftFaces
protected

For each edge, its faces to its left (zero if open, one, or more if non manifold).

Note
an edge is stored as a vertex pair (i,j), i < j. So a face to its left, being defined ccw, means that the face is some (..., i, j, ... ).

Definition at line 749 of file SurfaceMesh.h.

Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::allEdgeLeftFaces(), and DGtal::SurfaceMesh< TRealPoint, TRealVector >::edgeLeftFaces().

◆ myEdgeRightFaces

template<typename TRealPoint , typename TRealVector >
std::vector< Faces > DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeRightFaces
protected

For each edge, its faces to its right (zero if open, one, or more if non manifold).

Note
an edge is stored as a vertex pair (i,j), i < j. So a face to its right, being defined ccw, means that the face is some (..., j, i, ... ).

Definition at line 743 of file SurfaceMesh.h.

Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::allEdgeRightFaces(), and DGtal::SurfaceMesh< TRealPoint, TRealVector >::edgeRightFaces().

◆ myEdgeVertices

template<typename TRealPoint , typename TRealVector >
std::vector< VertexPair > DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeVertices
protected

◆ myFaceNormals

template<typename TRealPoint , typename TRealVector >
std::vector< RealVector > DGtal::SurfaceMesh< TRealPoint, TRealVector >::myFaceNormals
protected

◆ myIncidentFaces

template<typename TRealPoint , typename TRealVector >
std::vector< Faces > DGtal::SurfaceMesh< TRealPoint, TRealVector >::myIncidentFaces
protected

◆ myIncidentVertices

template<typename TRealPoint , typename TRealVector >
std::vector< Vertices > DGtal::SurfaceMesh< TRealPoint, TRealVector >::myIncidentVertices
protected

◆ myNeighborFaces

template<typename TRealPoint , typename TRealVector >
std::vector< Faces > DGtal::SurfaceMesh< TRealPoint, TRealVector >::myNeighborFaces
protected

For each face, its range of neighbor faces (no particular order)

Definition at line 731 of file SurfaceMesh.h.

Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::allNeighborFaces(), and DGtal::SurfaceMesh< TRealPoint, TRealVector >::neighborFaces().

◆ myNeighborVertices

template<typename TRealPoint , typename TRealVector >
std::vector< Vertices > DGtal::SurfaceMesh< TRealPoint, TRealVector >::myNeighborVertices
protected

◆ myPositions

template<typename TRealPoint , typename TRealVector >
std::vector< RealPoint > DGtal::SurfaceMesh< TRealPoint, TRealVector >::myPositions
protected

◆ myVertexNormals

template<typename TRealPoint , typename TRealVector >
std::vector< RealVector > DGtal::SurfaceMesh< TRealPoint, TRealVector >::myVertexNormals
protected

The documentation for this struct was generated from the following file:
DGtal::SurfaceMesh::Scalar
RealVector::Component Scalar
Definition: SurfaceMesh.h:100
DGtal::SurfaceMesh::myFaceNormals
std::vector< RealVector > myFaceNormals
For each face, its normal vector.
Definition: SurfaceMesh.h:729
DGtal::SurfaceMesh::myNeighborVertices
std::vector< Vertices > myNeighborVertices
For each vertex, its range of neighbor vertices (no particular order)
Definition: SurfaceMesh.h:733
DGtal::SurfaceMesh::myEdgeVertices
std::vector< VertexPair > myEdgeVertices
For each edge, its two vertices.
Definition: SurfaceMesh.h:735
DGtal::SurfaceMesh::positions
const std::vector< RealPoint > & positions() const
Definition: SurfaceMesh.h:528
DGtal::SurfaceMesh::nbVertices
Size nbVertices() const
Definition: SurfaceMesh.h:278
DGtal::SurfaceMesh::ConstIterator
IntegerSequenceIterator< Vertex > ConstIterator
Non mutable iterator for visiting vertices.
Definition: SurfaceMesh.h:129
DGtal::SurfaceMesh::myEdgeFaces
std::vector< Faces > myEdgeFaces
For each edge, its faces (one, two, or more if non manifold)
Definition: SurfaceMesh.h:737
DGtal::SurfaceMesh::myIncidentFaces
std::vector< Faces > myIncidentFaces
For each vertex, its range of incident faces.
Definition: SurfaceMesh.h:723
DGtal::SurfaceMesh::nbEdges
Size nbEdges() const
Definition: SurfaceMesh.h:282
DGtal::SurfaceMesh::myIncidentVertices
std::vector< Vertices > myIncidentVertices
For each face, its range of incident vertices.
Definition: SurfaceMesh.h:721
DGtal::SurfaceMesh::myEdgeLeftFaces
std::vector< Faces > myEdgeLeftFaces
Definition: SurfaceMesh.h:749
DGtal::SurfaceMesh::myPositions
std::vector< RealPoint > myPositions
For each vertex, its position.
Definition: SurfaceMesh.h:725
DGtal::SurfaceMesh::myEdgeRightFaces
std::vector< Faces > myEdgeRightFaces
Definition: SurfaceMesh.h:743
DGtal::SurfaceMesh::nbFaces
Size nbFaces() const
Definition: SurfaceMesh.h:286
DGtal::SurfaceMesh::myVertexNormals
std::vector< RealVector > myVertexNormals
For each vertex, its normal vector.
Definition: SurfaceMesh.h:727
DGtal::SurfaceMesh::myNeighborFaces
std::vector< Faces > myNeighborFaces
For each face, its range of neighbor faces (no particular order)
Definition: SurfaceMesh.h:731