vtf-logo

geom::IndSimpSetIncAdj< _N, _M, _A, T, V, IS > Class Template Reference

An indexed simplex set that stores vertex-simplex incidences and simplex adjacencies. More...

#include <IndSimpSetIncAdj.h>

Inheritance diagram for geom::IndSimpSetIncAdj< _N, _M, _A, T, V, IS >:

geom::IndSimpSet< _N, _M, _A, T, V, IS > List of all members.

Public Types

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.
 N = Base::N
 M = Base::M
 A = Base::A
enum  { N = Base::N, M = Base::M, A = Base::A }
 The space dimension, simplex dimension and allocation.

Public Member Functions

Constructors etc.
 IndSimpSetIncAdj ()
 Default constructor.
 IndSimpSetIncAdj (const IndSimpSetIncAdj &other)
 Copy constructor.
IndSimpSetIncAdjoperator= (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
Get the simplex given an iterator to the indexed simplex.

const IncidenceContainergetVertexSimplexIncidence () 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 AdjacencyContainergetSimplexAdjacencies () 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.)

int getPreviousVertexIndex (const IndSimpSetIncAdj< N, 1, A, T, V, IS > &mesh, int n)
 Get the previous vertex index.
int getNextVertexIndex (const IndSimpSetIncAdj< N, 1, A, T, V, IS > &mesh, int n)
 Get the next vertex index.
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.
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.
bool isOriented (const IndSimpSetIncAdj< N, M, A, T, V, IS > &mesh)
 Return true if the simplices of the mesh have consistent orientations.
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.
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.
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.
void applyLaplacian (IndSimpSetIncAdj< N, M, A, T, V, IS > *mesh, int numSweeps=1)
 Perform sweeps of Laplacian smoothing on the interior vertices.
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.
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.
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.
computeMeanEdgeLength (const IndSimpSetIncAdj< N, M, A, T, V, IS > &mesh)
 Compute edge length statistics.
void printInformation (std::ostream &out, const IndSimpSetIncAdj< N, M, A, T, V, IS > &mesh)
 Print information about the mesh.
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.
void determineInteriorVertices (const IndSimpSetIncAdj< N, M, A, T, V, IS > &mesh, IntOutIter indexIterator)
 Add the interior vertex indices to the set.
void determineBoundaryVertices (const IndSimpSetIncAdj< N, M, A, T, V, IS > &mesh, IntOutIter indexIterator)
 Add the boundary vertex indices to the set.
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.
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.
void separateComponents (IndSimpSetIncAdj< N, M, A, T, V, IS > *mesh, IntOutputIterator delimiterIterator)
 Separate the connected components of the mesh.
void separateComponents (IndSimpSetIncAdj< N, M, A, T, V, IS > *mesh, IntOutputIterator1 delimiterIterator, IntOutputIterator2 permutationIterator)
 Separate the connected components of the mesh.
void solveLaplacian (IndSimpSetIncAdj< N, M, A, T, V, IS > *mesh)
 Perform Laplacian smoothing on the interior vertices.
int countComponents (const IndSimpSetIncAdj< N, M, A, T, V, IS > &mesh)
 Count the connected components of the mesh.
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.
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.
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.
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.
void removeLowAdjacencies (IndSimpSetIncAdj< N, M, true, T, V, IS > *mesh, int minRequiredAdjencies)
 Remove simplices until there are none with minimum adjacencies less than specified.

Detailed Description

template<int _N, int _M = _N, bool _A = true, typename T = double, typename V = ads::FixedArray<_N,T>, typename IS = Simplex<_M,int>>
class geom::IndSimpSetIncAdj< _N, _M, _A, T, V, IS >

An indexed simplex set that stores vertex-simplex incidences and simplex adjacencies.

Parameters:
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.


Constructor & Destructor Documentation

template<int _N, int _M = _N, bool _A = true, typename T = double, typename V = ads::FixedArray<_N,T>, typename IS = Simplex<_M,int>>
template<bool A1, bool A2>
geom::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.

Parameters:
vertices is the array of vertices.
indexedSimplices is the array of indexed simplices.

template<int _N, int _M = _N, bool _A = true, typename T = double, typename V = ads::FixedArray<_N,T>, typename IS = Simplex<_M,int>>
geom::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.

Parameters:
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.

template<int _N, int _M = _N, bool _A = true, typename T = double, typename V = ads::FixedArray<_N,T>, typename IS = Simplex<_M,int>>
geom::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.

Parameters:
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.

template<int _N, int _M = _N, bool _A = true, typename T = double, typename V = ads::FixedArray<_N,T>, typename IS = Simplex<_M,int>>
geom::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.

Parameters:
numVertices is the number of vertices.
numSimplices is the number of simplices.

template<int _N, int _M = _N, bool _A = true, typename T = double, typename V = ads::FixedArray<_N,T>, typename IS = Simplex<_M,int>>
geom::IndSimpSetIncAdj< _N, _M, _A, T, V, IS >::IndSimpSetIncAdj ( const Base iss  )  [inline]

Construct from an indexed simplex set.

Parameters:
iss is the indexed simplex set.


Member Function Documentation

template<int _N, int _M = _N, bool _A = true, typename T = double, typename V = ads::FixedArray<_N,T>, typename IS = Simplex<_M,int>>
void geom::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.

Parameters:
numVertices is the number of vertices.
numSimplices is the number of simplices.

template<int _N, int _M = _N, bool _A = true, typename T = double, typename V = ads::FixedArray<_N,T>, typename IS = Simplex<_M,int>>
void geom::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.

Parameters:
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.

template<int _N, int _M = _N, bool _A = true, typename T = double, typename V = ads::FixedArray<_N,T>, typename IS = Simplex<_M,int>>
void geom::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.

Parameters:
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.

template<int _N, int _M = _N, bool _A = true, typename T = double, typename V = ads::FixedArray<_N,T>, typename IS = Simplex<_M,int>>
template<bool A1, bool A2>
void geom::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.

Parameters:
vertices is the array of vertices.
indexedSimplices is the array of indexed simplices.

template<int _N, int _M = _N, bool _A = true, typename T = double, typename V = ads::FixedArray<_N,T>, typename IS = Simplex<_M,int>>
SizeType geom::IndSimpSetIncAdj< _N, _M, _A, T, V, IS >::computeFacesSize (  )  const [inline]

Return the number of faces.

Note:
This is a slow function. It counts the faces.

template<int _N, int _M = _N, bool _A = true, typename T = double, typename V = ads::FixedArray<_N,T>, typename IS = Simplex<_M,int>>
int geom::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.

template<int _N, int _M = _N, bool _A = true, typename T = double, typename V = ads::FixedArray<_N,T>, typename IS = Simplex<_M,int>>
bool geom::IndSimpSetIncAdj< _N, _M, _A, T, V, IS >::isVertexOnBoundary ( int  index  )  const

Return true if the vertex is on the boundary of the mesh.

Parameters:
index is the index of a vertex.

template<int _N, int _M = _N, bool _A = true, typename T = double, typename V = ads::FixedArray<_N,T>, typename IS = Simplex<_M,int>>
virtual void geom::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 geom::IndSimpSet< _N, _M, _A, T, V, IS >.


The documentation for this class was generated from the following files:
Generated on Fri Aug 24 12:56:01 2007 for Computational Geometry Package by  doxygen 1.4.7