DGtal 1.3.0
|
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 | 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 |
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 |
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< 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::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
|
inline |
Definition at line 386 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeFaces.
|
inline |
(..., i, j, ... )
. Definition at line 406 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeLeftFaces.
|
inline |
(..., j, i, ... )
. Definition at line 396 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeRightFaces.
|
inline |
Definition at line 381 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeVertices.
Referenced by main().
|
inline |
Definition at line 367 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myIncidentFaces.
|
inline |
Definition at line 362 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myIncidentVertices.
Referenced by main().
|
inline |
Definition at line 371 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myNeighborFaces.
|
inline |
Definition at line 375 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myNeighborVertices.
Scalar DGtal::SurfaceMesh< TRealPoint, TRealVector >::averageEdgeLength | ( | ) | const |
|
inline |
Definition at line 616 of file SurfaceMesh.h.
|
inline |
Definition at line 559 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. |
|
protected |
Computes edge information.
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 473 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 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 |
|
protected |
Computes neighboring information.
Edges DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeNonManifoldEdges | ( | ) | const |
Referenced by 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 [84] 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 567 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myNeighborVertices.
|
inline |
i | first vertex |
j | second vertex |
Definition at line 692 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 335 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 357 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeLeftFaces.
|
inline |
e | any edge |
(..., j, i, ... )
. Definition at line 346 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeRightFaces.
|
inline |
e | any edge |
Definition at line 329 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeVertices.
Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::computeManifoldBoundaryChains(), DGtal::SurfaceMesh< TRealPoint, TRealVector >::isBoundariesManifold(), and TEST_CASE().
|
inline |
Definition at line 620 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::nbVertices().
|
inline |
Definition at line 294 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. |
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 677 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myFaceNormals.
|
inline |
Const accessor to face normal.
f | any face. |
Definition at line 683 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myFaceNormals.
|
inline |
Definition at line 671 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myFaceNormals.
|
inline |
Definition at line 667 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myFaceNormals.
Scalars DGtal::SurfaceMesh< TRealPoint, TRealVector >::getMaxWeights | ( | Index | v | ) | const |
v | any valid vertex index. |
myIncidentFaces[ v ]
.
|
inline |
v | any vertex |
Definition at line 313 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 307 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myIncidentVertices.
Referenced by DGtal::PolygonalCalculus< TRealPoint, TRealVector >::globalConnectionLaplace(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::globalLaplaceBeltrami(), 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 446 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 >::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 284 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myEdgeVertices.
Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::Euler(), main(), and SCENARIO().
|
inline |
Definition at line 288 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(), main(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::nbFaces(), saveToObj(), SCENARIO(), TEST_CASE(), and DGtal::PolygonalCalculus< TRealPoint, TRealVector >::updateFaceDegree().
|
inline |
Definition at line 280 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myIncidentFaces.
Referenced by 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(), 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 318 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myNeighborFaces.
|
inline |
v | any vertex |
Definition at line 323 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 |
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 637 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myPositions.
Referenced by main(), DGtal::PolygonalCalculus< TRealPoint, TRealVector >::PolygonalCalculus(), 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 643 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myPositions.
|
inline |
Definition at line 631 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myPositions.
|
inlinestaticprotected |
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.
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 550 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 657 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myVertexNormals.
|
inline |
Const accessor to vertex normal.
v | any vertex. |
Definition at line 663 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myVertexNormals.
|
inline |
Definition at line 651 of file SurfaceMesh.h.
References DGtal::SurfaceMesh< TRealPoint, TRealVector >::myVertexNormals.
|
inline |
Definition at line 647 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 582 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 607 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 891 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 903 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 897 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 889 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 883 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 877 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 875 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 885 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 887 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 879 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 881 of file SurfaceMesh.h.
Referenced by DGtal::SurfaceMesh< TRealPoint, TRealVector >::vertexNormal(), and DGtal::SurfaceMesh< TRealPoint, TRealVector >::vertexNormals().