DGtal
1.5.beta
|
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>
Data Structures | |
struct | VertexMap |
Public Types | |
typedef TRealPoint | RealPoint |
typedef TRealVector | RealVector |
typedef SurfaceMesh< RealPoint, RealVector > | Self |
typedef RealVector::Component | Scalar |
typedef std::vector< Scalar > | Scalars |
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, Scalar > | WeightedEdge |
typedef std::pair< Face, Scalar > | WeightedFace |
typedef std::vector< Vertex > | Vertices |
The type that defines a list/range of vertices (e.g. to define faces) More... | |
typedef std::vector< Edge > | Edges |
The type that defines a list/range of edges. More... | |
typedef std::vector< WeightedEdge > | WeightedEdges |
typedef std::vector< Face > | Faces |
typedef std::vector< WeightedFace > | WeightedFaces |
typedef std::pair< Vertex, Vertex > | VertexPair |
typedef std::set< Vertex > | VertexSet |
typedef IntegerSequenceIterator< Vertex > | ConstIterator |
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 | |
Self & | operator= (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 | computeFaceNormalFromPositions (const Face f) |
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< RealVector > | computeFaceUnitVectorsFromVertexUnitVectors (const std::vector< RealVector > &vuvectors) const |
std::vector< RealVector > | computeVertexUnitVectorsFromFaceUnitVectors (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 Vertices & | incidentVertices (Face f) const |
const Faces & | incidentFaces (Vertex v) const |
const Faces & | neighborFaces (Face f) const |
const Vertices & | neighborVertices (Vertex v) const |
VertexPair | edgeVertices (Edge e) const |
const Faces & | edgeFaces (Edge e) const |
const Faces & | edgeRightFaces (Edge e) const |
const Faces & | edgeLeftFaces (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 |
bool | isBoundariesManifold (bool checkClosed=true) const |
std::vector< Vertices > | computeManifoldBoundaryChains () 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 |
RealPoint & | position (Vertex v) |
const RealPoint & | position (Vertex v) const |
const std::vector< RealVector > & | vertexNormals () const |
std::vector< RealVector > & | vertexNormals () |
RealVector & | vertexNormal (Vertex v) |
const RealVector & | vertexNormal (Vertex v) const |
const std::vector< RealVector > & | faceNormals () const |
std::vector< RealVector > & | faceNormals () |
RealVector & | faceNormal (Face f) |
const RealVector & | faceNormal (Face f) const |
Scalar | averageEdgeLength () const |
Scalar | distance (const Vertex i, const Vertex j) 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 |
WeightedFaces | computeFacesInclusionsInBall (Scalar r, Index f, RealPoint p) const |
std::tuple< Vertices, WeightedEdges, WeightedFaces > | computeCellsInclusionsInBall (Scalar r, Index f) const |
std::tuple< Vertices, WeightedEdges, WeightedFaces > | computeCellsInclusionsInBall (Scalar r, Index f, RealPoint p) 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 |
Mesh editing services | |
bool | isFlippable (const Edge e) const |
VertexPair | otherDiagonal (const Edge e) const |
void | flip (const Edge e, bool recompute_face_normals=false) |
Look-up table computation services | |
void | computeNeighbors () |
Computes neighboring information. More... | |
void | computeEdges () |
Computes edge information. More... | |
Static Public Attributes | |
static const Dimension | dimension = RealPoint::dimension |
Protected Member Functions | |
void | removeIndex (std::vector< Index > &v, Index i) |
void | replaceIndex (std::vector< Index > &v, Index i, Index ri) |
void | addIndex (std::vector< Index > &v, Index i) |
Static Protected Member Functions | |
static Scalar | rand01 () |
Protected Attributes | |
std::vector< Vertices > | myIncidentVertices |
For each face, its range of incident vertices. More... | |
std::vector< Faces > | myIncidentFaces |
For each vertex, its range of incident faces. More... | |
std::vector< RealPoint > | myPositions |
For each vertex, its position. More... | |
std::vector< RealVector > | myVertexNormals |
For each vertex, its normal vector. More... | |
std::vector< RealVector > | myFaceNormals |
For each face, its normal vector. More... | |
std::vector< Faces > | myNeighborFaces |
For each face, its range of neighbor faces (no particular order) More... | |
std::vector< Vertices > | myNeighborVertices |
For each vertex, its range of neighbor vertices (no particular order) More... | |
std::vector< VertexPair > | myEdgeVertices |
For each edge, its two vertices. More... | |
std::map< VertexPair, Edge > | myVertexPairEdge |
For each vertex pair, its edge index. More... | |
std::vector< Faces > | myEdgeFaces |
For each edge, its faces (one, two, or more if non manifold) More... | |
std::vector< Faces > | myEdgeRightFaces |
std::vector< Faces > | myEdgeLeftFaces |
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.
TRealPoint | an arbitrary model of 3D RealPoint. |
TRealVector | an arbitrary model of 3D RealVector. |
Definition at line 91 of file SurfaceMesh.h.
typedef IntegerSequenceIterator< Vertex > DGtal::SurfaceMesh< TRealPoint, TRealVector >::ConstIterator |
Non mutable iterator for visiting vertices.
Definition at line 129 of file SurfaceMesh.h.
typedef Index DGtal::SurfaceMesh< TRealPoint, TRealVector >::Edge |
Definition at line 107 of file SurfaceMesh.h.
typedef std::vector< Edge > DGtal::SurfaceMesh< TRealPoint, TRealVector >::Edges |
The type that defines a list/range of edges.
Definition at line 114 of file SurfaceMesh.h.
typedef Index DGtal::SurfaceMesh< TRealPoint, TRealVector >::Face |
Definition at line 106 of file SurfaceMesh.h.
typedef std::vector< Face > DGtal::SurfaceMesh< TRealPoint, TRealVector >::Faces |
Definition at line 116 of file SurfaceMesh.h.
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.
typedef TRealPoint DGtal::SurfaceMesh< TRealPoint, TRealVector >::RealPoint |
Definition at line 93 of file SurfaceMesh.h.
typedef TRealVector DGtal::SurfaceMesh< TRealPoint, TRealVector >::RealVector |
Definition at line 94 of file SurfaceMesh.h.
typedef RealVector::Component DGtal::SurfaceMesh< TRealPoint, TRealVector >::Scalar |
Definition at line 100 of file SurfaceMesh.h.
typedef std::vector<Scalar> DGtal::SurfaceMesh< TRealPoint, TRealVector >::Scalars |
Definition at line 101 of file SurfaceMesh.h.
typedef SurfaceMesh< RealPoint, RealVector > DGtal::SurfaceMesh< TRealPoint, TRealVector >::Self |
Definition at line 95 of file SurfaceMesh.h.
typedef std::size_t DGtal::SurfaceMesh< TRealPoint, TRealVector >::Size |
The type for counting elements.
Definition at line 103 of file SurfaceMesh.h.
typedef Index DGtal::SurfaceMesh< TRealPoint, TRealVector >::Vertex |
Definition at line 108 of file SurfaceMesh.h.
typedef std::pair< Vertex, Vertex > DGtal::SurfaceMesh< TRealPoint, TRealVector >::VertexPair |
Definition at line 118 of file SurfaceMesh.h.
typedef std::set<Vertex> DGtal::SurfaceMesh< TRealPoint, TRealVector >::VertexSet |
Definition at line 121 of file SurfaceMesh.h.
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.
typedef std::pair< Edge, Scalar > DGtal::SurfaceMesh< TRealPoint, TRealVector >::WeightedEdge |
Definition at line 109 of file SurfaceMesh.h.
typedef std::vector< WeightedEdge > DGtal::SurfaceMesh< TRealPoint, TRealVector >::WeightedEdges |
Definition at line 115 of file SurfaceMesh.h.
typedef std::pair< Face, Scalar > DGtal::SurfaceMesh< TRealPoint, TRealVector >::WeightedFace |
Definition at line 110 of file SurfaceMesh.h.
typedef std::vector< WeightedFace > DGtal::SurfaceMesh< TRealPoint, TRealVector >::WeightedFaces |
Definition at line 117 of file SurfaceMesh.h.
|
default |
Default destructor.
|
default |
Default constructor.
A typical construction usage is
|
default |
Default copy constructor.
other | the object to clone |
|
default |
Default move constructor.
other | the object to move |
DGtal::SurfaceMesh< TRealPoint, TRealVector >::SurfaceMesh | ( | RealPointIterator | itPos, |
RealPointIterator | itPosEnd, | ||
VerticesIterator | itVertices, | ||
VerticesIterator | itVerticesEnd | ||
) |
Builds a mesh from vertex positions and polygonal faces.
RealPointIterator | any forward iterator on RealPoint. |
VerticesIterator | any forward iterator on the range of vertices defining a face. |
itPos | start of range of iterators pointing on the positions of vertices of the mesh |
itPosEnd | end of range of iterators pointing on the positions of vertices of the mesh. |
itVertices | start of range of iterators pointing on the (oriented) faces of the mesh, each face being a range of vertex indices. |
itVerticesEnd | end of range of iterators pointing on the (oriented) faces of the mesh, each face being a range of vertex indices. |
A typical construction usage is
|
inlineprotected |
Adds the index i to the vector v.
[in,out] | v | a vector of indices |
[in] | i | an index |
Definition at line 1047 of file SurfaceMesh.h.
|
inline |
Definition at line 396 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeFaces.
|
inline |
(..., i, j, ... )
. Definition at line 416 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeLeftFaces.
|
inline |
(..., j, i, ... )
. Definition at line 406 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeRightFaces.
|
inline |
Definition at line 391 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeVertices.
Referenced by main().
|
inline |
Definition at line 376 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myIncidentFaces.
|
inline |
Definition at line 371 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myIncidentVertices.
Referenced by main().
|
inline |
Definition at line 380 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myNeighborFaces.
|
inline |
Definition at line 384 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myNeighborVertices.
Scalar DGtal::SurfaceMesh< TRealPoint, TRealVector >::averageEdgeLength | ( | ) | const |
|
inline |
Definition at line 626 of file SurfaceMesh.h.
|
inline |
Definition at line 569 of file SurfaceMesh.h.
DGtal::SurfaceMesh< TRealPoint, TRealVector >::BOOST_STATIC_ASSERT | ( | (dimension==3) | ) |
void DGtal::SurfaceMesh< TRealPoint, TRealVector >::clear | ( | ) |
Clears everything. The object is empty.
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).
r | the radius of the ball. |
f | the face where the ball is centered. |
Referenced by DGtal::SurfaceMeshMeasure< TRealPoint, TRealVector, TValue >::measure().
std::tuple< Vertices, WeightedEdges, WeightedFaces > DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeCellsInclusionsInBall | ( | Scalar | r, |
Index | f, | ||
RealPoint | p | ||
) | const |
Given a ball of radius r centered on a point p belonging to 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).
r | the radius of the ball. |
f | the face where the ball is centered. |
p | the position on the face where the ball is centered. |
void DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeEdges | ( | ) |
Computes edge information.
void DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeFaceNormalFromPositions | ( | const Face | f | ) |
Uses the positions of vertices to compute a normal vector to the face f of the mesh. It computes the barycenter, triangulates implicitly the face to build the normal vector from the average of implicit triangle normals.
f | any valid index of face. |
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.
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.
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).
r | the radius of the ball. |
f | the face where the ball is centered. |
Referenced by DGtal::SurfaceMeshMeasure< TRealPoint, TRealVector, TValue >::measure().
WeightedFaces DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeFacesInclusionsInBall | ( | Scalar | r, |
Index | f, | ||
RealPoint | p | ||
) | const |
Given a ball of radius r centered on a point p belonging to 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).
r | the radius of the ball. |
f | the face where the ball is centered. |
p | the position on the face where the ball is centered. |
std::vector<RealVector> DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeFaceUnitVectorsFromVertexUnitVectors | ( | const std::vector< RealVector > & | vuvectors | ) | const |
vuvectors | any vector of unit vectors on vertices. |
std::vector<AnyRing> DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeFaceValuesFromVertexValues | ( | const std::vector< AnyRing > & | vvalues | ) | const |
vvalues | any vector of vertex values. |
AnyRing | any summable and averagable type. |
Referenced by main(), and saveToObj().
|
inline |
Extract the boundary of a surface mesh as a collection of sequences of vertices. The boundaries must be 1d manifold polygonal curves.
Definition at line 483 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeManifoldBoundaryEdges(), DGtal::SurfaceMesh< TRealPoint, TRealVector >::edgeVertices(), and DGtal::SurfaceMesh< TRealPoint, TRealVector >::isBoundariesManifold().
Edges DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeManifoldBoundaryEdges | ( | ) | const |
Referenced by computeLaplace(), DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeManifoldBoundaryChains(), DGtal::SurfaceMesh< TRealPoint, TRealVector >::isBoundariesManifold(), SCENARIO(), and TEST_CASE().
Edges DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeManifoldInnerConsistentEdges | ( | ) | const |
Edges DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeManifoldInnerEdges | ( | ) | const |
Edges DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeManifoldInnerUnconsistentEdges | ( | ) | const |
void DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeNeighbors | ( | ) |
Computes neighboring information.
Edges DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeNonManifoldEdges | ( | ) | const |
Referenced by main(), and SCENARIO().
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.
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 [89] for combining face information into vertex information.
std::vector<RealVector> DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeVertexUnitVectorsFromFaceUnitVectors | ( | const std::vector< RealVector > & | fuvectors | ) | const |
fuvectors | any vector of unit vectors on faces. |
std::vector<AnyRing> DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeVertexValuesFromFaceValues | ( | const std::vector< AnyRing > & | fvalues | ) | const |
fvalues | any vector of vertex values. |
AnyRing | any summable and averagable type. |
|
inline |
v | any vertex |
Definition at line 577 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myNeighborVertices.
|
inline |
i | first vertex |
j | second vertex |
Definition at line 702 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myPositions.
RealPoint DGtal::SurfaceMesh< TRealPoint, TRealVector >::edgeCentroid | ( | Index | e | ) | const |
e | any valid edge index. |
|
inline |
e | any edge |
Definition at line 344 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeFaces.
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.
p | the center of the ball. |
r | the radius of the ball. |
e | any index of edge. |
|
inline |
e | any edge |
(..., i, j, ... )
. Definition at line 366 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeLeftFaces.
|
inline |
e | any edge |
(..., j, i, ... )
. Definition at line 355 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeRightFaces.
|
inline |
e | any edge |
Definition at line 338 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeVertices.
Referenced by computeLaplace(), DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeManifoldBoundaryChains(), DGtal::SurfaceMesh< TRealPoint, TRealVector >::isBoundariesManifold(), and TEST_CASE().
|
inline |
Definition at line 630 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::nbVertices().
|
inline |
Definition at line 302 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::nbEdges(), DGtal::SurfaceMesh< TRealPoint, TRealVector >::nbFaces(), and DGtal::SurfaceMesh< TRealPoint, TRealVector >::nbVertices().
Referenced by SCENARIO().
Scalar DGtal::SurfaceMesh< TRealPoint, TRealVector >::faceArea | ( | Index | f | ) | const |
f | any valid face index. |
RealPoint DGtal::SurfaceMesh< TRealPoint, TRealVector >::faceCentroid | ( | Index | f | ) | const |
f | any valid face index. |
Referenced by precompute().
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.
p | the center of the ball. |
r | the radius of the ball. |
f | any index of face. |
|
inline |
Mutable accessor to face normal.
f | any face. |
Definition at line 687 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myFaceNormals.
Referenced by precompute().
|
inline |
Const accessor to face normal.
f | any face. |
Definition at line 693 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myFaceNormals.
|
inline |
Definition at line 681 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myFaceNormals.
|
inline |
Definition at line 677 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myFaceNormals.
void DGtal::SurfaceMesh< TRealPoint, TRealVector >::flip | ( | const Edge | e, |
bool | recompute_face_normals = false |
||
) |
Flip the edge e. Be careful that after the flip, this edge index determines another edge, which is the other diagonal of the quadrilateral having e as its diagonal.
l l / \ /|\ / \ / | \ / \ / | \ / lf \ / | \ / \ / | \ i --- e --- j ==> i lf e rf j if k < l otherwise rf and lf are swapped \ / \ | / \ rf / \ | / \ / \ | / \ / \ | / \ / \|/ k k
e | any valid edge. |
recompute_face_normals | when 'true', recompute normals of flipped faces with the positions of the vertices. |
isFlippable( e ) == true
Scalars DGtal::SurfaceMesh< TRealPoint, TRealVector >::getMaxWeights | ( | Index | v | ) | const |
v | any valid vertex index. |
myIncidentFaces[ v ]
.
|
inline |
v | any vertex |
Definition at line 321 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myIncidentFaces.
Referenced by DGtal::PolygonalCalculus< TRealPoint, TRealVector >::computeVertexNormal(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::doubledGlobalLumpedMassMatrix(), and DGtal::PolygonalCalculus< TRealPoint, TRealVector >::globalLumpedMassMatrix().
|
inline |
f | any face |
Definition at line 315 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myIncidentVertices.
Referenced by DGtal::PolygonalCalculus< TRealPoint, TRealVector >::globalConnectionLaplace(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::globalLaplaceBeltrami(), phi(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::shapeOperator(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::Tf(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::transportAndFormatVectorField(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::updateFaceDegree(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::vectorArea(), and DGtal::PolygonalCalculus< TRealPoint, TRealVector >::X().
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).
RealPointIterator | any forward iterator on RealPoint. |
VerticesIterator | any forward iterator on a range of vertices. |
itPos | start of range of iterators pointing on the positions of vertices of the mesh |
itPosEnd | end of range of iterators pointing on the positions of vertices of the mesh. |
itVertices | start of range of iterators pointing on the (oriented) faces of the mesh, each face being a range of vertex indices. |
itVerticesEnd | end of range of iterators pointing on the (oriented) faces of the mesh, each face being a range of vertex indices. |
A typical construction usage is
Referenced by main().
|
inline |
The method returns false if the surface mesh has no boundary.
checkClosed | if true, we check that each vertex has exactly two adejcent edges. |
Definition at line 456 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeManifoldBoundaryEdges(), and DGtal::SurfaceMesh< TRealPoint, TRealVector >::edgeVertices().
Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeManifoldBoundaryChains().
bool DGtal::SurfaceMesh< TRealPoint, TRealVector >::isFlippable | ( | const Edge | e | ) | const |
An edge is (topologically) flippable iff: (1) it does not lie on the boundary, (2) it is bordered by two triangles, one that to its right, one to its left, (3) the two other vertices of the quad are not already neighbors, (4) the edge is not bordered by the same two triangles, in opposite orientation.
e | any edge. |
bool DGtal::SurfaceMesh< TRealPoint, TRealVector >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
Scalar DGtal::SurfaceMesh< TRealPoint, TRealVector >::localWindow | ( | Face | f | ) | const |
f | any valid face index |
Edge DGtal::SurfaceMesh< TRealPoint, TRealVector >::makeEdge | ( | Vertex | i, |
Vertex | j | ||
) | const |
i | any vertex of the mesh |
j | any vertex of the mesh |
nbEdges()
if this edge does not exist.
|
inline |
Definition at line 292 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeVertices.
Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::Euler(), main(), and SCENARIO().
|
inline |
Definition at line 296 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myIncidentVertices.
Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::Euler(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::getOperatorCacheMatrix(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::getOperatorCacheVector(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::globalConnectionLaplace(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::globalLaplaceBeltrami(), initQuantities(), initQuantitiesCached(), main(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::nbFaces(), saveToObj(), SCENARIO(), and DGtal::PolygonalCalculus< TRealPoint, TRealVector >::updateFaceDegree().
|
inline |
Definition at line 288 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myIncidentFaces.
Referenced by addSource(), computeLaplace(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::doubledGlobalLumpedMassMatrix(), DGtal::SurfaceMesh< TRealPoint, TRealVector >::end(), DGtal::SurfaceMesh< TRealPoint, TRealVector >::Euler(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::globalConnectionLaplace(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::globalLaplaceBeltrami(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::globalLumpedMassMatrix(), initPhi(), main(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::nbVertices(), SCENARIO(), DGtal::SurfaceMesh< TRealPoint, TRealVector >::size(), TEST_CASE(), and DGtal::PolygonalCalculus< TRealPoint, TRealVector >::toExtrinsicVectors().
|
inline |
f | any face |
Definition at line 326 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myNeighborFaces.
|
inline |
v | any vertex |
Definition at line 331 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myNeighborVertices.
Referenced by DGtal::PolygonalCalculus< TRealPoint, TRealVector >::Tv().
|
default |
Default assignment constructor.
other | the object to clone |
VertexPair DGtal::SurfaceMesh< TRealPoint, TRealVector >::otherDiagonal | ( | const Edge | e | ) | const |
isFlippable( e )
must be true. e | any edge. |
void DGtal::SurfaceMesh< TRealPoint, TRealVector >::perturbateWithAdaptiveUniformRandomNoise | ( | Scalar | p | ) |
Perturbate the positions with a uniform random noise of 'p * averageLocalEdgeLength' along arbitrary directions.
p | any positive real value. |
void DGtal::SurfaceMesh< TRealPoint, TRealVector >::perturbateWithUniformRandomNoise | ( | Scalar | p | ) |
Perturbate the positions with a uniform random noise of 'p * averageEdgeLength' along arbitrary directions.
p | any positive real value. |
|
inline |
Mutable accessor to vertex position.
v | any vertex. |
Definition at line 647 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myPositions.
Referenced by computeLaplace(), main(), DGtal::functors::EmbedderFromNormalVectors< TRealPoint, TRealVector >::operator()(), phiVertex(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::PolygonalCalculus(), precompute(), TEST_CASE(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::Tf(), and DGtal::PolygonalCalculus< TRealPoint, TRealVector >::Tv().
|
inline |
Const accessor to vertex position.
v | any vertex. |
Definition at line 653 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myPositions.
|
inline |
Definition at line 641 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myPositions.
|
inlinestaticprotected |
|
inlineprotected |
Removes the index i from the vector v.
[in,out] | v | a vector of indices |
[in] | i | an index |
Definition at line 1009 of file SurfaceMesh.h.
References DGtal::Trace::error(), and DGtal::trace.
|
inlineprotected |
Replaces the index i with the index ri in the vector v.
[in,out] | v | a vector of indices |
[in] | i | an index |
[in] | ri | an index |
Definition at line 1029 of file SurfaceMesh.h.
References DGtal::Trace::error(), and DGtal::trace.
void DGtal::SurfaceMesh< TRealPoint, TRealVector >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
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.
Referenced by main().
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.
|
inline |
Definition at line 560 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::nbVertices().
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.
p | the center of the ball. |
r | the radius of the ball. |
v | any index of vertex. |
|
inline |
Mutable accessor to vertex normal.
v | any vertex. |
Definition at line 667 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myVertexNormals.
|
inline |
Const accessor to vertex normal.
v | any vertex. |
Definition at line 673 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myVertexNormals.
|
inline |
Definition at line 661 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myVertexNormals.
|
inline |
Definition at line 657 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myVertexNormals.
|
inline |
Writes the neighbors of a vertex using an output iterator
OutputIterator | the type of an output iterator writing in a container of vertices. |
it | the output iterator |
v | the vertex whose neighbors will be writen |
Definition at line 592 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myNeighborVertices.
|
inline |
Writes the neighbors of a vertex which satisfy a predicate using an output iterator
OutputIterator | the type of an output iterator writing in a container of vertices. |
VertexPredicate | the type of the predicate |
it | the output iterator |
v | the vertex whose neighbors will be written |
pred | the predicate that must be satisfied |
Definition at line 617 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myNeighborVertices.
|
static |
Definition at line 97 of file SurfaceMesh.h.
|
protected |
For each edge, its faces (one, two, or more if non manifold)
Definition at line 985 of file SurfaceMesh.h.
Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::allEdgeFaces(), and DGtal::SurfaceMesh< TRealPoint, TRealVector >::edgeFaces().
|
protected |
For each edge, its faces to its left (zero if open, one, or more if non manifold).
(..., i, j, ... )
. Definition at line 997 of file SurfaceMesh.h.
Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::allEdgeLeftFaces(), and DGtal::SurfaceMesh< TRealPoint, TRealVector >::edgeLeftFaces().
|
protected |
For each edge, its faces to its right (zero if open, one, or more if non manifold).
(..., j, i, ... )
. Definition at line 991 of file SurfaceMesh.h.
Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::allEdgeRightFaces(), and DGtal::SurfaceMesh< TRealPoint, TRealVector >::edgeRightFaces().
|
protected |
For each edge, its two vertices.
Definition at line 981 of file SurfaceMesh.h.
Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::allEdgeVertices(), DGtal::SurfaceMesh< TRealPoint, TRealVector >::edgeVertices(), and DGtal::SurfaceMesh< TRealPoint, TRealVector >::nbEdges().
|
protected |
For each face, its normal vector.
Definition at line 975 of file SurfaceMesh.h.
Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::faceNormal(), and DGtal::SurfaceMesh< TRealPoint, TRealVector >::faceNormals().
|
protected |
For each vertex, its range of incident faces.
Definition at line 969 of file SurfaceMesh.h.
Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::allIncidentFaces(), DGtal::SurfaceMesh< TRealPoint, TRealVector >::incidentFaces(), and DGtal::SurfaceMesh< TRealPoint, TRealVector >::nbVertices().
|
protected |
For each face, its range of incident vertices.
Definition at line 967 of file SurfaceMesh.h.
Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::allIncidentVertices(), DGtal::SurfaceMesh< TRealPoint, TRealVector >::incidentVertices(), and DGtal::SurfaceMesh< TRealPoint, TRealVector >::nbFaces().
|
protected |
For each face, its range of neighbor faces (no particular order)
Definition at line 977 of file SurfaceMesh.h.
Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::allNeighborFaces(), and DGtal::SurfaceMesh< TRealPoint, TRealVector >::neighborFaces().
|
protected |
For each vertex, its range of neighbor vertices (no particular order)
Definition at line 979 of file SurfaceMesh.h.
Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::allNeighborVertices(), DGtal::SurfaceMesh< TRealPoint, TRealVector >::degree(), DGtal::SurfaceMesh< TRealPoint, TRealVector >::neighborVertices(), and DGtal::SurfaceMesh< TRealPoint, TRealVector >::writeNeighbors().
|
protected |
For each vertex, its position.
Definition at line 971 of file SurfaceMesh.h.
Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::distance(), DGtal::SurfaceMesh< TRealPoint, TRealVector >::position(), and DGtal::SurfaceMesh< TRealPoint, TRealVector >::positions().
|
protected |
For each vertex, its normal vector.
Definition at line 973 of file SurfaceMesh.h.
Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::vertexNormal(), and DGtal::SurfaceMesh< TRealPoint, TRealVector >::vertexNormals().
|
protected |
For each vertex pair, its edge index.
Definition at line 983 of file SurfaceMesh.h.