An indexed simplex set that stores vertex-simplex incidences and simplex adjacencies. More...
#include <IndSimpSetIncAdj.h>
Public Types | |
enum | { N = Base::N, M = Base::M, A = Base::A } |
The space dimension, simplex dimension and allocation. | |
typedef IndSimpSet< _N, _M, _A, T, V, IS > | Base |
The base type. | |
typedef Base::Number | Number |
The number type. | |
typedef Base::Vertex | Vertex |
A vertex. | |
typedef Base::Simplex | Simplex |
A simplex of vertices. | |
typedef Base::SimplexFace | SimplexFace |
The face of a simplex of vertices. | |
typedef Base::IndexedSimplex | IndexedSimplex |
An indexed simplex. (A simplex of indices.). | |
typedef Base::IndexedSimplexFace | IndexedSimplexFace |
The face of an indexed simplex. | |
typedef Base::VertexContainer | VertexContainer |
The vertex container. | |
typedef Base::VertexConstIterator | VertexConstIterator |
A vertex const iterator. | |
typedef Base::VertexIterator | VertexIterator |
A vertex iterator. | |
typedef Base::IndexedSimplexContainer | IndexedSimplexContainer |
The indexed simplex container. | |
typedef Base::IndexedSimplexConstIterator | IndexedSimplexConstIterator |
An indexed simplex const iterator. | |
typedef Base::IndexedSimplexIterator | IndexedSimplexIterator |
An indexed simplex iterator. | |
typedef Base::SimplexConstIterator | SimplexConstIterator |
A simplex const iterator. | |
typedef Base::SizeType | SizeType |
The size type. | |
typedef VertexSimplexInc< M > | IncidenceContainer |
The vertex-simplex incidences. | |
typedef IncidenceContainer::ConstIterator | IncidenceConstIterator |
Iterator over the vertex-simplex incidences. | |
typedef SimplexAdj< M > | AdjacencyContainer |
The simplex adjacencies. | |
typedef std::pair< int, int > | Face |
A face is determined by a simplex index and an integer in [0..M]. | |
typedef IssiaFaceIterator < IndSimpSetIncAdj > | FaceIterator |
A bidirectional, iterator on the faces. | |
Public Member Functions | |
Constructors etc. | |
IndSimpSetIncAdj () | |
Default constructor. | |
IndSimpSetIncAdj (const IndSimpSetIncAdj &other) | |
Copy constructor. | |
IndSimpSetIncAdj & | operator= (const IndSimpSetIncAdj &other) |
Assignment operator. | |
template<bool A1, bool A2> | |
IndSimpSetIncAdj (const ads::Array< 1, Vertex, A1 > &vertices, const ads::Array< 1, IndexedSimplex, A2 > &indexedSimplices) | |
Construct from arrays of vertices and indexed simplices. | |
template<bool A1, bool A2> | |
void | build (const ads::Array< 1, Vertex, A1 > &vertices, const ads::Array< 1, IndexedSimplex, A2 > &indexedSimplices) |
Build from arrays of vertices and indexed simplices. | |
IndSimpSetIncAdj (const SizeType numVertices, void *verticesData, const SizeType numSimplices, void *indexedSimplicesData) | |
Construct from pointers to the vertices and indexed simplices. | |
void | build (const SizeType numVertices, void *verticesData, const SizeType numSimplices, void *indexedSimplicesData) |
Build from pointers to the vertices and indexed simplices. | |
IndSimpSetIncAdj (const SizeType numVertices, const void *verticesData, const SizeType numSimplices, const void *indexedSimplicesData) | |
Construct from pointers to the vertices and indexed simplices. | |
void | build (const SizeType numVertices, const void *verticesData, const SizeType numSimplices, const void *indexedSimplicesData) |
Build from pointers to the vertices and indexed simplices. | |
IndSimpSetIncAdj (const SizeType numVertices, const SizeType numSimplices) | |
Construct from the number of vertices and simplices. | |
void | build (const SizeType numVertices, const SizeType numSimplices) |
Build from the number of vertices and simplices. | |
void | swap (IndSimpSetIncAdj &x) |
Swap data with another mesh. | |
IndSimpSetIncAdj (const Base &iss) | |
Construct from an indexed simplex set. | |
virtual | ~IndSimpSetIncAdj () |
Destructor. Free any memory that was allocated. | |
Vertex-Simplex Incidence Accessors | |
const IncidenceContainer & | getVertexSimplexIncidence () const |
A const reference to the vertex-simplex incidence. | |
SizeType | getIncidentSize (const int n) const |
Return the number of incident simplices to the n_th vertex. | |
bool | isIncidentEmpty (const int n) const |
Return true if the n_th vertex has no incident simplices. | |
IncidenceConstIterator | getIncidentBeginning (const int n) const |
Return a const iterator on simplex indices to the first incident simplex index of the n_th vertex. | |
IncidenceConstIterator | getIncidentEnd (const int n) const |
Return a const iterator on simplex indices to one past the last incident simplex index of the n_th vertex. | |
int | getIncident (const int n, const int m) const |
Return the m_th incident simplex index of the n_th vertex. | |
Simplex Adjacency Accessors | |
const AdjacencyContainer & | getSimplexAdjacencies () const |
Return a const reference to the simplex adjacencies. | |
int | getAdjacentSize (const int n) const |
Return number of simplices adjacent to the n_th simplex. | |
int | getAdjacent (const int n, const int m) const |
Return the index of the m_th adjacent simplex to the n_th simplex. | |
int | getMirrorIndex (const int n, const int m) const |
Return the index of the n_th simplex in its m_th adjacent neighbor. | |
Face accessors. | |
SizeType | computeFacesSize () const |
Return the number of faces. | |
FaceIterator | getFacesBeginning () const |
Return the beginning of the faces. | |
FaceIterator | getFacesEnd () const |
Return the end of the faces. | |
bool | isOnBoundary (const Face &f) const |
Return true if the face is on the boundary. | |
bool | isOnBoundary (const FaceIterator &f) const |
Return true if the face is on the boundary. | |
Other Accessors | |
bool | isVertexOnBoundary (int index) const |
Return true if the vertex is on the boundary of the mesh. | |
Simplex Manipulators | |
void | reverseOrientation (const int n) |
Reverse the orientation of the n_th simplex. | |
Update the topology. | |
virtual void | updateTopology () |
Update the data structure following a change in the topology. | |
Related Functions | |
(Note that these are not member functions.) | |
template<int N, bool A, typename T , typename V , typename IS > | |
int | getPreviousVertexIndex (const IndSimpSetIncAdj< N, 1, A, T, V, IS > &mesh, int n) |
Get the previous vertex index. | |
template<int N, bool A, typename T , typename V , typename IS > | |
int | getNextVertexIndex (const IndSimpSetIncAdj< N, 1, A, T, V, IS > &mesh, int n) |
Get the next vertex index. | |
template<int N, bool A, typename T , typename V , typename IS > | |
IndSimpSetIncAdj< N, 1, A, T, V, IS >::Vertex | getPreviousVertex (const IndSimpSetIncAdj< N, 1, A, T, V, IS > &mesh, const int n) |
Get the previous vertex. | |
template<int N, bool A, typename T , typename V , typename IS > | |
IndSimpSetIncAdj< N, 1, A, T, V, IS >::Vertex | getNextVertex (const IndSimpSetIncAdj< N, 1, A, T, V, IS > &mesh, const int n) |
Get the next vertex. | |
template<int N, int M, bool A, typename T , typename V , typename IS > | |
bool | isOriented (const IndSimpSetIncAdj< N, M, A, T, V, IS > &mesh) |
Return true if the simplices of the mesh have consistent orientations. | |
template<int N, int M, bool A1, bool A2, typename T , typename V1 , typename V2 , typename IS1 , typename IS2 > | |
bool | operator== (const IndSimpSetIncAdj< N, M, A1, T, V1, IS1 > &x, const IndSimpSetIncAdj< N, M, A2, T, V2, IS2 > &y) |
Return true if the meshes are equal. | |
template<int N, int M, bool A1, bool A2, typename T , typename V1 , typename V2 , typename IS1 , typename IS2 > | |
bool | operator!= (const IndSimpSetIncAdj< N, M, A1, T, V1, IS1 > &x, const IndSimpSetIncAdj< N, M, A2, T, V2, IS2 > &y) |
Return true if the meshes are not equal. | |
template<bool A, typename T , typename V , typename IS , class ISS > | |
void | fit (IndSimpSetIncAdj< 2, 1, A, T, V, IS > *mesh, const ISS_SignedDistance< ISS, 2 > &signedDistance, T deviationTangent, int numSweeps) |
Fit a mesh to a level-set description. | |
template<int N, int M, bool A, typename T , typename V , typename IS > | |
void | applyLaplacian (IndSimpSetIncAdj< N, M, A, T, V, IS > *mesh, int numSweeps=1) |
Perform sweeps of Laplacian smoothing on the interior vertices. | |
template<bool A, typename T , typename V , typename IS , class BoundaryCondition > | |
void | applyLaplacian (IndSimpSetIncAdj< 2, 1, A, T, V, IS > *mesh, const BoundaryCondition &condition, T maxAngleDeviation, int numSweeps=1) |
Perform sweeps of Laplacian smoothing on the vertices. | |
template<bool A, typename T , typename V , typename IS , int SD> | |
void | applyLaplacian (IndSimpSetIncAdj< 2, 1, A, T, V, IS > *mesh, PointsOnManifold< 2, 1, SD, T > *manifold, int numSweeps=1) |
Perform sweeps of Laplacian smoothing on the vertices. | |
template<bool A, typename T , typename V , typename IS , class BoundaryCondition > | |
void | applyLaplacian (IndSimpSetIncAdj< 3, 2, A, T, V, IS > *mesh, const BoundaryCondition &condition, T maxAngleDeviation, int numSweeps=1) |
Perform sweeps of Laplacian smoothing on the boundary vertices. | |
template<std::size_t N, typename T , typename PointRandomAccessIterator , typename TupleOutputIterator > | |
std::size_t | reportPenetrations (const IndSimpSetIncAdj< N, N, T > &mesh, PointRandomAccessIterator pointsBeginning, PointRandomAccessIterator pointsEnd, TupleOutputIterator penetrations) |
Report the points that penetrate the solid mesh. | |
template<std::size_t N, typename T > | |
T | maximumRelativePenetration (const IndSimpSetIncAdj< N, N, T > &mesh) |
Report the maximum relative penetration for a boundary node. | |
template<int N, int M, bool A, typename T , typename V , typename IS > | |
T | computeMeanEdgeLength (const IndSimpSetIncAdj< N, M, A, T, V, IS > &mesh) |
Compute edge length statistics. | |
template<int N, int M, bool A, typename T , typename V , typename IS > | |
void | printInformation (std::ostream &out, const IndSimpSetIncAdj< N, M, A, T, V, IS > &mesh) |
Print information about the mesh. | |
template<int N, int M, bool A, typename T , typename V , typename IS , typename IntOutIter > | |
void | determineSimplicesWithRequiredAdjacencies (const IndSimpSetIncAdj< N, M, A, T, V, IS > &mesh, int minRequiredAdjacencies, IntOutIter indexIterator) |
Add the simplices with at least the specified number of adjacencies to the set. | |
template<int N, int M, bool A, typename T , typename V , typename IS , typename IntOutIter > | |
void | determineInteriorVertices (const IndSimpSetIncAdj< N, M, A, T, V, IS > &mesh, IntOutIter indexIterator) |
Add the interior vertex indices to the set. | |
template<int N, int M, bool A, typename T , typename V , typename IS , typename IntOutIter > | |
void | determineBoundaryVertices (const IndSimpSetIncAdj< N, M, A, T, V, IS > &mesh, IntOutIter indexIterator) |
Add the boundary vertex indices to the set. | |
template<int N, int M, bool A, typename T , typename V , typename IS , typename IntInIter , typename IntOutIter > | |
void | determineIncidentSimplices (const IndSimpSetIncAdj< N, M, A, T, V, IS > &mesh, IntInIter vertexIndicesBeginning, IntInIter vertexIndicesEnd, IntOutIter simplexIndicesIterator) |
Add the simplices (simplex indices) which are incident to the vertices. | |
template<int N, int M, bool A, typename T , typename V , typename IS , typename IntOutIter > | |
void | determineSimplicesInComponent (const IndSimpSetIncAdj< N, M, A, T, V, IS > &mesh, int index, IntOutIter indexIterator) |
Add the simplices in the component with the n_th simplex to the set. | |
template<int N, int M, bool A, typename T , typename V , typename IS , typename IntOutputIterator > | |
void | separateComponents (IndSimpSetIncAdj< N, M, A, T, V, IS > *mesh, IntOutputIterator delimiterIterator) |
Separate the connected components of the mesh. | |
template<int N, int M, bool A, typename T , typename V , typename IS , typename IntOutputIterator1 , typename IntOutputIterator2 > | |
void | separateComponents (IndSimpSetIncAdj< N, M, A, T, V, IS > *mesh, IntOutputIterator1 delimiterIterator, IntOutputIterator2 permutationIterator) |
Separate the connected components of the mesh. | |
template<int N, int M, bool A, typename T , typename V , typename IS > | |
void | solveLaplacian (IndSimpSetIncAdj< N, M, A, T, V, IS > *mesh) |
Perform Laplacian smoothing on the interior vertices. | |
template<int N, int M, bool A, typename T , typename V , typename IS > | |
int | countComponents (const IndSimpSetIncAdj< N, M, A, T, V, IS > &mesh) |
Count the connected components of the mesh. | |
template<int N, int M, bool A, typename T , typename V , typename IS , typename IntForIter , class ISS > | |
void | transform (IndSimpSetIncAdj< N, M, A, T, V, IS > *mesh, IntForIter beginning, IntForIter end, const ISS_SD_ClosestPointDirection< ISS > &f) |
Transform each vertex in the range with the closest point in the normal direction. | |
template<int N, int M, bool A, typename T , typename V , typename IS , class ISS > | |
void | transform (IndSimpSetIncAdj< N, M, A, T, V, IS > *mesh, const ISS_SD_ClosestPointDirection< ISS > &f) |
Transform each vertex in the mesh with the closest point in the normal direction. | |
template<int N, int M, bool A, typename T , typename V , typename IS , typename IntForIter , class ISS > | |
void | transform (IndSimpSetIncAdj< N, M, A, T, V, IS > *mesh, IntForIter beginning, IntForIter end, const ISS_SD_CloserPointDirection< ISS > &f) |
Transform each vertex in the range with the closer point in the normal direction. | |
template<int N, int M, bool A, typename T , typename V , typename IS , class ISS > | |
void | transform (IndSimpSetIncAdj< N, M, A, T, V, IS > *mesh, const ISS_SD_CloserPointDirection< ISS > &f) |
Transform each vertex in the mesh with the closer point in the normal direction. | |
template<int N, int M, typename T , typename V , typename IS > | |
void | removeLowAdjacencies (IndSimpSetIncAdj< N, M, true, T, V, IS > *mesh, int minRequiredAdjencies) |
Remove simplices until there are none with minimum adjacencies less than specified. |
An indexed simplex set that stores vertex-simplex incidences and simplex adjacencies.
N | is the space dimension. | |
M | is the simplex dimension By default it is N. | |
A | determines whether memory will be allocated for the vertices and the indexed simplices. By default A is true. (Memory will always be allocated for the vertex-simplex incidences and the simplex adjacencies.) | |
T | is the number type. By default it is double. | |
V | is the vertex type, an N-tuple of the number type. It must be subscriptable. By default it is ads::FixedArray<N,T>. | |
IS | is the Indexed Simplex type, a tuple of M+1 integers. It must be subscriptable. By default it is Simplex<M,int>. |
Note that the indices for indexed simplices follow the C convention of starting at 0.
The free functions that operate on this class are grouped into the following categories:
This class derives from geom::IndSimpSet. Any function that takes a geom::IndSimpSet as an argument may also take this class as an argument. This includes function that build the mesh or modify the topology. This functionality is made possible with the update_topology() virtual function. Any free function that modifies the topology of the mesh calls update_topology(). In the base class, the function has no effect, but in this class, it builds/rebuilds the vertex-simplex incidences and the simplex adjacencies.
IndSimpSetIncAdj< _N, _M, _A, T, V, IS >::IndSimpSetIncAdj | ( | const ads::Array< 1, Vertex, A1 > & | vertices, | |
const ads::Array< 1, IndexedSimplex, A2 > & | indexedSimplices | |||
) | [inline] |
Construct from arrays of vertices and indexed simplices.
If A
is true, the arrays will be copied. If A
is false, the memory is adopted. It will not be freed when the class destructor is called.
vertices | is the array of vertices. | |
indexedSimplices | is the array of indexed simplices. |
IndSimpSetIncAdj< _N, _M, _A, T, V, IS >::IndSimpSetIncAdj | ( | const SizeType | numVertices, | |
void * | verticesData, | |||
const SizeType | numSimplices, | |||
void * | indexedSimplicesData | |||
) | [inline] |
Construct from pointers to the vertices and indexed simplices.
If A
is true, the arrays will be copied. If A
is false, the memory is adopted. It will not be freed when the class destructor is called. The objects to which vertices
and indexedSimplices
point will be cast to Vertex
and IndexedSimplex
, respectively. Thus they should have the same memory layout as these classes.
numVertices | is the number of vertices. | |
verticesData | points to the data for the vertices. | |
numSimplices | is the number of simplices. | |
indexedSimplicesData | points to the data for the indexed simplices. |
IndSimpSetIncAdj< _N, _M, _A, T, V, IS >::IndSimpSetIncAdj | ( | const SizeType | numVertices, | |
const void * | verticesData, | |||
const SizeType | numSimplices, | |||
const void * | indexedSimplicesData | |||
) | [inline] |
Construct from pointers to the vertices and indexed simplices.
A
must be true to use this constructor. The objects to which vertices
and indexedSimplices
point will be cast to Vertex
and IndexedSimplex
, respectively. Thus they should have the same memory layout as these classes.
numVertices | is the number of vertices. | |
verticesData | points to the data for the vertices. | |
numSimplices | is the number of simplices. | |
indexedSimplicesData | points to the data for the indexed simplices. |
IndSimpSetIncAdj< _N, _M, _A, T, V, IS >::IndSimpSetIncAdj | ( | const SizeType | numVertices, | |
const SizeType | numSimplices | |||
) | [inline] |
Construct from the number of vertices and simplices.
A
must be true.
The vertices and indexed simplices are left uninitialized. The incidence and adjacency relations are not built.
numVertices | is the number of vertices. | |
numSimplices | is the number of simplices. |
IndSimpSetIncAdj< _N, _M, _A, T, V, IS >::IndSimpSetIncAdj | ( | const Base & | iss | ) | [inline] |
Construct from an indexed simplex set.
iss | is the indexed simplex set. |
void IndSimpSetIncAdj< _N, _M, _A, T, V, IS >::build | ( | const SizeType | numVertices, | |
const SizeType | numSimplices | |||
) | [inline] |
Build from the number of vertices and simplices.
Performs the same action as the constructor.
numVertices | is the number of vertices. | |
numSimplices | is the number of simplices. |
Reimplemented from IndSimpSet< _N, _M, _A, T, V, IS >.
void IndSimpSetIncAdj< _N, _M, _A, T, V, IS >::build | ( | const SizeType | numVertices, | |
const void * | verticesData, | |||
const SizeType | numSimplices, | |||
const void * | indexedSimplicesData | |||
) | [inline] |
Build from pointers to the vertices and indexed simplices.
Performs the same action as the constructor.
numVertices | is the number of vertices. | |
verticesData | points to the data for the vertices. | |
numSimplices | is the number of simplices. | |
indexedSimplicesData | points to the data for the indexed simplices. |
Reimplemented from IndSimpSet< _N, _M, _A, T, V, IS >.
void IndSimpSetIncAdj< _N, _M, _A, T, V, IS >::build | ( | const SizeType | numVertices, | |
void * | verticesData, | |||
const SizeType | numSimplices, | |||
void * | indexedSimplicesData | |||
) | [inline] |
Build from pointers to the vertices and indexed simplices.
Performs the same action as the constructor.
numVertices | is the number of vertices. | |
verticesData | points to the data for the vertices. | |
numSimplices | is the number of simplices. | |
indexedSimplicesData | points to the data for the indexed simplices. |
Reimplemented from IndSimpSet< _N, _M, _A, T, V, IS >.
void IndSimpSetIncAdj< _N, _M, _A, T, V, IS >::build | ( | const ads::Array< 1, Vertex, A1 > & | vertices, | |
const ads::Array< 1, IndexedSimplex, A2 > & | indexedSimplices | |||
) | [inline] |
Build from arrays of vertices and indexed simplices.
Performs same actions as the constructor.
vertices | is the array of vertices. | |
indexedSimplices | is the array of indexed simplices. |
Reimplemented from IndSimpSet< _N, _M, _A, T, V, IS >.
SizeType IndSimpSetIncAdj< _N, _M, _A, T, V, IS >::computeFacesSize | ( | ) | const [inline] |
Return the number of faces.
int IndSimpSetIncAdj< _N, _M, _A, T, V, IS >::getAdjacent | ( | const int | n, | |
const int | m | |||
) | const [inline] |
Return the index of the m_th adjacent simplex to the n_th simplex.
An index of -1 indicates that there is no adjacent simplex.
Referenced by IndSimpSetIncAdj< N, M-1, true, T >::isOnBoundary().
bool IndSimpSetIncAdj< _N, _M, _A, T, V, IS >::isVertexOnBoundary | ( | int | index | ) | const |
Return true if the vertex is on the boundary of the mesh.
index | is the index of a vertex. |
virtual void IndSimpSetIncAdj< _N, _M, _A, T, V, IS >::updateTopology | ( | ) | [inline, virtual] |
Update the data structure following a change in the topology.
Update the vertex-simplex incidences and simplex adjacencies following a change in the topology.
Reimplemented from IndSimpSet< _N, _M, _A, T, V, IS >.