sofa::component::topology::TetrahedronSetTopologyContainer Class Reference

a class that stores a set of tetrahedra and provides access with adjacent triangles, edges and vertices More...

#include <TetrahedronSetTopologyContainer.h>

Inheritance diagram for sofa::component::topology::TetrahedronSetTopologyContainer:

Inheritance graph
[legend]
Collaboration diagram for sofa::component::topology::TetrahedronSetTopologyContainer:

Collaboration graph
[legend]

Public Types

typedef Tetra Tetrahedron
typedef TetraEdges TetrahedronEdges
typedef TetraTriangles TetrahedronTriangles

Public Member Functions

 TetrahedronSetTopologyContainer ()
 TetrahedronSetTopologyContainer (const sofa::helper::vector< Tetrahedron > &tetrahedra)
virtual ~TetrahedronSetTopologyContainer ()
virtual void init ()
 Initialization method called at graph modification, during bottom-up traversal.
virtual bool checkTopology () const
 Checks if the topology is coherent.
unsigned int getNumberOfTetrahedra () const
 Returns the number of tetrahedra in this topology.
const sofa::helper::vector
< Tetrahedron > & 
getTetrahedronArray ()
 Returns the Tetrahedron array.
const sofa::helper::vector
< sofa::helper::vector
< unsigned int > > & 
getTetrahedronVertexShellArray ()
 Returns the Tetrahedron Vertex Shells array.
const sofa::helper::vector
< unsigned int > & 
getTetrahedronVertexShell (const unsigned int i)
 Returns the set of tetrahedra adjacent to a given vertex.
const sofa::helper::vector
< TetrahedronEdges > & 
getTetrahedronEdgeArray ()
 Returns the Tetrahedron Edges array.
const TetrahedronEdges & getTetrahedronEdges (const unsigned int i)
 Returns the 6 edges adjacent to a given tetrahedron.
const sofa::helper::vector
< TetrahedronTriangles > & 
getTetrahedronTriangleArray ()
 Returns the Tetrahedron Triangles array.
const TetrahedronTriangles & getTetrahedronTriangles (const unsigned int i)
 Returns the 4 triangles adjacent to a given tetrahedron.
const sofa::helper::vector
< sofa::helper::vector
< unsigned int > > & 
getTetrahedronEdgeShellArray ()
 Returns the Tetrahedron Edge Shells array.
const sofa::helper::vector
< unsigned int > & 
getTetrahedronEdgeShell (const unsigned int i)
 Returns the set of tetrahedra adjacent to a given edge.
const sofa::helper::vector
< sofa::helper::vector
< unsigned int > > & 
getTetrahedronTriangleShellArray ()
 Returns the Tetrahedron Triangle Shells array.
const sofa::helper::vector
< unsigned int > & 
getTetrahedronTriangleShell (const unsigned int i)
 Returns the set of tetrahedra adjacent to a given triangle.
int getVertexIndexInTetrahedron (const Tetrahedron &t, unsigned int vertexIndex) const
 returns the index (either 0, 1 ,2 or 3) of the vertex whose global index is vertexIndex.
int getEdgeIndexInTetrahedron (const TetrahedronEdges &t, unsigned int edgeIndex) const
 returns the index (either 0, 1 ,2, 3, 4 or 5) of the edge whose global index is edgeIndex.
int getTriangleIndexInTetrahedron (const TetrahedronTriangles &t, unsigned int triangleIndex) const
 returns the index (either 0, 1 ,2 or 3) of the triangle whose global index is triangleIndex.
virtual void clear ()
 Procedural creation methods.
virtual void addTetra (int a, int b, int c, int d)
const SeqTetras & getTetras ()
 BaseMeshTopology API.
const TetraEdges & getEdgeTetraShell (TetraID i)
 Returns the set of edges adjacent to a given tetrahedron.
const TetraTriangles & getTriangleTetraShell (TetraID i)
 Returns the set of triangles adjacent to a given tetrahedron.
const VertexTetras & getTetraVertexShell (PointID i)
 Returns the set of tetrahedra adjacent to a given vertex.
const EdgeTetras & getTetraEdgeShell (EdgeID i)
 Returns the set of tetrahedra adjacent to a given edge.
const TriangleTetras & getTetraTriangleShell (TriangleID i)
 Returns the set of tetrahedra adjacent to a given triangle.
virtual int getTetrahedronIndex (PointID v1, PointID v2, PointID v3, PointID v4)
 Returns the indices of a tetrahedron given four vertex indices : returns -1 if none.
virtual Edge getLocalTetrahedronEdges (const unsigned int i) const
 Returns for each index (between 0 and 5) the two vertex indices that are adjacent to that edge.

Protected Member Functions

virtual void createEdgeSetArray ()
 Creates the EdgeSet array.
virtual void createTriangleSetArray ()
 Creates the TriangleSet array.
virtual void createTetrahedronSetArray ()
 Creates the TetrahedronSet array.
bool hasTetrahedra () const
bool hasTetrahedronEdges () const
bool hasTetrahedronTriangles () const
bool hasTetrahedronVertexShell () const
bool hasTetrahedronEdgeShell () const
bool hasTetrahedronTriangleShell () const
void clearTetrahedra ()
void clearTetrahedronEdges ()
void clearTetrahedronTriangles ()
void clearTetrahedronVertexShell ()
void clearTetrahedronEdgeShell ()
void clearTetrahedronTriangleShell ()
virtual void loadFromMeshLoader (sofa::component::MeshLoader *loader)

Protected Attributes

sofa::helper::vector< Tetrahedron > m_tetrahedron
 provides the set of tetrahedra
sofa::helper::vector
< TetrahedronEdges > 
m_tetrahedronEdge
 provides the set of edges for each tetrahedron
sofa::helper::vector
< TetrahedronTriangles > 
m_tetrahedronTriangle
 provides the set of triangles for each tetrahedron
sofa::helper::vector
< sofa::helper::vector
< unsigned int > > 
m_tetrahedronVertexShell
 for each vertex provides the set of tetrahedra adjacent to that vertex
sofa::helper::vector
< sofa::helper::vector
< unsigned int > > 
m_tetrahedronEdgeShell
 for each edge provides the set of tetrahedra adjacent to that edge
sofa::helper::vector
< sofa::helper::vector
< unsigned int > > 
m_tetrahedronTriangleShell
 for each triangle provides the set of tetrahedra adjacent to that edge

Private Member Functions

void createTetrahedronEdgeArray ()
 Creates the array of edge indices for each tetrahedron.
void createTetrahedronTriangleArray ()
 Creates the array of triangle indices for each tetrahedron.
void createTetrahedronVertexShellArray ()
 Creates the Tetrahedron Vertex Shell Array.
void createTetrahedronEdgeShellArray ()
 Creates the Tetrahedron Edge Shell Array.
void createTetrahedronTriangleShellArray ()
 Creates the Tetrahedron Triangle Shell Array.
sofa::helper::vector< unsigned
int > & 
getTetrahedronVertexShellForModification (const unsigned int vertexIndex)
 Returns a non-const tetrahedron vertex shell given a vertex index for subsequent modification.
sofa::helper::vector< unsigned
int > & 
getTetrahedronEdgeShellForModification (const unsigned int edgeIndex)
 Returns a non-const tetrahedron edge shell given the index of an edge for subsequent modification.

Friends

class TetrahedronSetTopologyModifier
std::ostream & operator<< (std::ostream &out, const TetrahedronSetTopologyContainer &t)
std::istream & operator>> (std::istream &in, TetrahedronSetTopologyContainer &t)

Detailed Description

a class that stores a set of tetrahedra and provides access with adjacent triangles, edges and vertices

Definition at line 61 of file TetrahedronSetTopologyContainer.h.


Member Typedef Documentation

Definition at line 66 of file TetrahedronSetTopologyContainer.h.

Definition at line 67 of file TetrahedronSetTopologyContainer.h.

Definition at line 68 of file TetrahedronSetTopologyContainer.h.


Constructor & Destructor Documentation

sofa::component::topology::TetrahedronSetTopologyContainer::TetrahedronSetTopologyContainer (  ) 

Definition at line 49 of file TetrahedronSetTopologyContainer.cpp.

sofa::component::topology::TetrahedronSetTopologyContainer::TetrahedronSetTopologyContainer ( const sofa::helper::vector< Tetrahedron > &  tetrahedra  ) 

virtual sofa::component::topology::TetrahedronSetTopologyContainer::~TetrahedronSetTopologyContainer (  )  [inline, virtual]

Definition at line 74 of file TetrahedronSetTopologyContainer.h.


Member Function Documentation

void sofa::component::topology::TetrahedronSetTopologyContainer::addTetra ( int  a,
int  b,
int  c,
int  d 
) [virtual]

bool sofa::component::topology::TetrahedronSetTopologyContainer::checkTopology (  )  const [virtual]

void sofa::component::topology::TetrahedronSetTopologyContainer::clear (  )  [virtual]

void sofa::component::topology::TetrahedronSetTopologyContainer::clearTetrahedra (  )  [protected]

Definition at line 619 of file TetrahedronSetTopologyContainer.cpp.

References m_tetrahedron.

Referenced by clear().

void sofa::component::topology::TetrahedronSetTopologyContainer::clearTetrahedronEdges (  )  [protected]

void sofa::component::topology::TetrahedronSetTopologyContainer::clearTetrahedronEdgeShell (  )  [protected]

void sofa::component::topology::TetrahedronSetTopologyContainer::clearTetrahedronTriangles (  )  [protected]

void sofa::component::topology::TetrahedronSetTopologyContainer::clearTetrahedronTriangleShell (  )  [protected]

void sofa::component::topology::TetrahedronSetTopologyContainer::clearTetrahedronVertexShell (  )  [protected]

void sofa::component::topology::TetrahedronSetTopologyContainer::createEdgeSetArray (  )  [protected, virtual]

void sofa::component::topology::TetrahedronSetTopologyContainer::createTetrahedronEdgeArray (  )  [private]

Creates the array of edge indices for each tetrahedron.

This function is only called if the TetrahedronEdge array is required. m_tetrahedronEdge[i] contains the 6 indices of the 6 edges of each tetrahedron The number of each edge is the following : edge 0 links vertex 0 and 1, edge 1 links vertex 0 and 2, edge 2 links vertex 0 and 3, edge 3 links vertex 1 and 2, edge 4 links vertex 1 and 3, edge 5 links vertex 2 and 3

Definition at line 132 of file TetrahedronSetTopologyContainer.cpp.

References clearTetrahedronEdges(), createEdgeSetArray(), sofa::component::topology::EdgeSetTopologyContainer::getEdgeIndex(), getNumberOfTetrahedra(), sofa::component::topology::EdgeSetTopologyContainer::hasEdges(), hasTetrahedronEdges(), m_tetrahedron, m_tetrahedronEdge, and sofa::component::topology::tetrahedronEdgeArray.

Referenced by createTetrahedronEdgeShellArray(), getTetrahedronEdgeArray(), and getTetrahedronEdges().

void sofa::component::topology::TetrahedronSetTopologyContainer::createTetrahedronEdgeShellArray (  )  [private]

void sofa::component::topology::TetrahedronSetTopologyContainer::createTetrahedronSetArray (  )  [protected, virtual]

Creates the TetrahedronSet array.

This function must be implemented by a derived classes

Definition at line 88 of file TetrahedronSetTopologyContainer.cpp.

Referenced by getTetrahedronArray().

void sofa::component::topology::TetrahedronSetTopologyContainer::createTetrahedronTriangleArray (  )  [private]

Creates the array of triangle indices for each tetrahedron.

This function is only called if the TetrahedronTriangle array is required. m_tetrahedronTriangle[i] contains the 4 indices of the 4 triangles opposite to the ith vertex

Definition at line 214 of file TetrahedronSetTopologyContainer.cpp.

References clearTetrahedronTriangles(), createTriangleSetArray(), getNumberOfTetrahedra(), sofa::component::topology::TriangleSetTopologyContainer::getTriangleIndex(), hasTetrahedronTriangles(), sofa::component::topology::TriangleSetTopologyContainer::hasTriangles(), m_tetrahedron, and m_tetrahedronTriangle.

Referenced by createTetrahedronTriangleShellArray(), getTetrahedronTriangleArray(), and getTetrahedronTriangles().

void sofa::component::topology::TetrahedronSetTopologyContainer::createTetrahedronTriangleShellArray (  )  [private]

void sofa::component::topology::TetrahedronSetTopologyContainer::createTetrahedronVertexShellArray (  )  [private]

void sofa::component::topology::TetrahedronSetTopologyContainer::createTriangleSetArray (  )  [protected, virtual]

int sofa::component::topology::TetrahedronSetTopologyContainer::getEdgeIndexInTetrahedron ( const TetrahedronEdges &  t,
unsigned int  edgeIndex 
) const

returns the index (either 0, 1 ,2, 3, 4 or 5) of the edge whose global index is edgeIndex.

Returns -1 if none

Definition at line 462 of file TetrahedronSetTopologyContainer.cpp.

Referenced by sofa::component::topology::TetrahedronSetTopologyModifier::removeEdgesProcess().

const TetraEdges& sofa::component::topology::TetrahedronSetTopologyContainer::getEdgeTetraShell ( TetraID  i  )  [inline]

Returns the set of edges adjacent to a given tetrahedron.

Definition at line 93 of file TetrahedronSetTopologyContainer.h.

References getTetrahedronEdges().

Edge sofa::component::topology::TetrahedronSetTopologyContainer::getLocalTetrahedronEdges ( const unsigned int  i  )  const [virtual]

Returns for each index (between 0 and 5) the two vertex indices that are adjacent to that edge.

Reimplemented from sofa::core::componentmodel::topology::BaseMeshTopology.

Definition at line 383 of file TetrahedronSetTopologyContainer.cpp.

References sofa::component::topology::tetrahedronEdgeArray.

unsigned int sofa::component::topology::TetrahedronSetTopologyContainer::getNumberOfTetrahedra (  )  const

Returns the number of tetrahedra in this topology.

The difference to getNbTetras() is that this method does not generate the tetra array if it does not exist.

Definition at line 346 of file TetrahedronSetTopologyContainer.cpp.

References m_tetrahedron.

Referenced by createTetrahedronEdgeArray(), createTetrahedronTriangleArray(), and sofa::component::topology::TetrahedronSetTopologyModifier::removeTetrahedraProcess().

const EdgeTetras& sofa::component::topology::TetrahedronSetTopologyContainer::getTetraEdgeShell ( EdgeID  i  )  [inline]

Returns the set of tetrahedra adjacent to a given edge.

Definition at line 111 of file TetrahedronSetTopologyContainer.h.

References getTetrahedronEdgeShell().

const sofa::helper::vector< Tetrahedron > & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedronArray (  ) 

const sofa::helper::vector< TetrahedronEdges > & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedronEdgeArray (  ) 

Returns the Tetrahedron Edges array.

Definition at line 375 of file TetrahedronSetTopologyContainer.cpp.

References createTetrahedronEdgeArray(), hasTetrahedronEdges(), and m_tetrahedronEdge.

const TetrahedronEdges & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedronEdges ( const unsigned int  i  ) 

Returns the 6 edges adjacent to a given tetrahedron.

Definition at line 427 of file TetrahedronSetTopologyContainer.cpp.

References createTetrahedronEdgeArray(), hasTetrahedronEdges(), and m_tetrahedronEdge.

Referenced by getEdgeTetraShell().

const sofa::helper::vector< unsigned int > & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedronEdgeShell ( const unsigned int  i  ) 

Returns the set of tetrahedra adjacent to a given edge.

Definition at line 407 of file TetrahedronSetTopologyContainer.cpp.

References createTetrahedronEdgeShellArray(), hasTetrahedronEdgeShell(), and m_tetrahedronEdgeShell.

Referenced by getTetraEdgeShell().

const sofa::helper::vector< sofa::helper::vector< unsigned int > > & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedronEdgeShellArray (  ) 

Returns the Tetrahedron Edge Shells array.

Definition at line 359 of file TetrahedronSetTopologyContainer.cpp.

References createTetrahedronEdgeShellArray(), hasTetrahedronEdgeShell(), and m_tetrahedronEdgeShell.

sofa::helper::vector< unsigned int > & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedronEdgeShellForModification ( const unsigned int  edgeIndex  )  [private]

Returns a non-const tetrahedron edge shell given the index of an edge for subsequent modification.

Definition at line 496 of file TetrahedronSetTopologyContainer.cpp.

References createTetrahedronEdgeShellArray(), hasTetrahedronEdgeShell(), and m_tetrahedronEdgeShell.

int sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedronIndex ( PointID  v1,
PointID  v2,
PointID  v3,
PointID  v4 
) [virtual]

Returns the indices of a tetrahedron given four vertex indices : returns -1 if none.

Definition at line 307 of file TetrahedronSetTopologyContainer.cpp.

References createTetrahedronVertexShellArray(), getTetrahedronVertexShell(), and hasTetrahedronVertexShell().

const sofa::helper::vector< TetrahedronTriangles > & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedronTriangleArray (  ) 

Returns the Tetrahedron Triangles array.

Definition at line 389 of file TetrahedronSetTopologyContainer.cpp.

References createTetrahedronTriangleArray(), hasTetrahedronTriangles(), and m_tetrahedronTriangle.

const TetrahedronTriangles & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedronTriangles ( const unsigned int  i  ) 

Returns the 4 triangles adjacent to a given tetrahedron.

Definition at line 437 of file TetrahedronSetTopologyContainer.cpp.

References createTetrahedronTriangleArray(), hasTetrahedronTriangles(), and m_tetrahedronTriangle.

Referenced by getTriangleTetraShell().

const sofa::helper::vector< unsigned int > & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedronTriangleShell ( const unsigned int  i  ) 

Returns the set of tetrahedra adjacent to a given triangle.

Definition at line 417 of file TetrahedronSetTopologyContainer.cpp.

References createTetrahedronTriangleShellArray(), hasTetrahedronTriangleShell(), and m_tetrahedronTriangleShell.

Referenced by getTetraTriangleShell().

const sofa::helper::vector< sofa::helper::vector< unsigned int > > & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedronTriangleShellArray (  ) 

Returns the Tetrahedron Triangle Shells array.

Definition at line 367 of file TetrahedronSetTopologyContainer.cpp.

References createTetrahedronTriangleShellArray(), hasTetrahedronTriangleShell(), and m_tetrahedronTriangleShell.

const sofa::helper::vector< unsigned int > & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedronVertexShell ( const unsigned int  i  ) 

Returns the set of tetrahedra adjacent to a given vertex.

Definition at line 397 of file TetrahedronSetTopologyContainer.cpp.

References createTetrahedronVertexShellArray(), hasTetrahedronVertexShell(), and m_tetrahedronVertexShell.

Referenced by getTetrahedronIndex(), and getTetraVertexShell().

const sofa::helper::vector< sofa::helper::vector< unsigned int > > & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedronVertexShellArray (  ) 

Returns the Tetrahedron Vertex Shells array.

Definition at line 351 of file TetrahedronSetTopologyContainer.cpp.

References createTetrahedronVertexShellArray(), hasTetrahedronVertexShell(), and m_tetrahedronVertexShell.

sofa::helper::vector< unsigned int > & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedronVertexShellForModification ( const unsigned int  vertexIndex  )  [private]

Returns a non-const tetrahedron vertex shell given a vertex index for subsequent modification.

Definition at line 506 of file TetrahedronSetTopologyContainer.cpp.

References createTetrahedronVertexShellArray(), hasTetrahedronVertexShell(), and m_tetrahedronVertexShell.

Referenced by sofa::component::topology::TetrahedronSetTopologyModifier::addTetrahedronProcess().

const SeqTetras& sofa::component::topology::TetrahedronSetTopologyContainer::getTetras (  )  [inline, virtual]

BaseMeshTopology API.

Reimplemented from sofa::core::componentmodel::topology::TopologyContainer.

Definition at line 87 of file TetrahedronSetTopologyContainer.h.

References getTetrahedronArray().

const TriangleTetras& sofa::component::topology::TetrahedronSetTopologyContainer::getTetraTriangleShell ( TriangleID  i  )  [inline]

Returns the set of tetrahedra adjacent to a given triangle.

Definition at line 117 of file TetrahedronSetTopologyContainer.h.

References getTetrahedronTriangleShell().

const VertexTetras& sofa::component::topology::TetrahedronSetTopologyContainer::getTetraVertexShell ( PointID  i  )  [inline]

Returns the set of tetrahedra adjacent to a given vertex.

Definition at line 105 of file TetrahedronSetTopologyContainer.h.

References getTetrahedronVertexShell().

int sofa::component::topology::TetrahedronSetTopologyContainer::getTriangleIndexInTetrahedron ( const TetrahedronTriangles &  t,
unsigned int  triangleIndex 
) const

returns the index (either 0, 1 ,2 or 3) of the triangle whose global index is triangleIndex.

Returns -1 if none

Definition at line 481 of file TetrahedronSetTopologyContainer.cpp.

Referenced by sofa::component::topology::TetrahedronSetTopologyModifier::removeTrianglesProcess().

const TetraTriangles& sofa::component::topology::TetrahedronSetTopologyContainer::getTriangleTetraShell ( TetraID  i  )  [inline]

Returns the set of triangles adjacent to a given tetrahedron.

Definition at line 99 of file TetrahedronSetTopologyContainer.h.

References getTetrahedronTriangles().

int sofa::component::topology::TetrahedronSetTopologyContainer::getVertexIndexInTetrahedron ( const Tetrahedron &  t,
unsigned int  vertexIndex 
) const

returns the index (either 0, 1 ,2 or 3) of the vertex whose global index is vertexIndex.

Returns -1 if none

Definition at line 447 of file TetrahedronSetTopologyContainer.cpp.

Referenced by sofa::component::topology::TetrahedronSetTopologyModifier::removePointsProcess().

bool sofa::component::topology::TetrahedronSetTopologyContainer::hasTetrahedra (  )  const [protected]

bool sofa::component::topology::TetrahedronSetTopologyContainer::hasTetrahedronEdges (  )  const [protected]

bool sofa::component::topology::TetrahedronSetTopologyContainer::hasTetrahedronEdgeShell (  )  const [protected]

bool sofa::component::topology::TetrahedronSetTopologyContainer::hasTetrahedronTriangles (  )  const [protected]

bool sofa::component::topology::TetrahedronSetTopologyContainer::hasTetrahedronTriangleShell (  )  const [protected]

bool sofa::component::topology::TetrahedronSetTopologyContainer::hasTetrahedronVertexShell (  )  const [protected]

void sofa::component::topology::TetrahedronSetTopologyContainer::init ( void   )  [virtual]

Initialization method called at graph modification, during bottom-up traversal.

Reimplemented from sofa::component::topology::TriangleSetTopologyContainer.

Definition at line 76 of file TetrahedronSetTopologyContainer.cpp.

void sofa::component::topology::TetrahedronSetTopologyContainer::loadFromMeshLoader ( sofa::component::MeshLoader *  loader  )  [protected, virtual]


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const TetrahedronSetTopologyContainer &  t 
) [friend]

Definition at line 207 of file TetrahedronSetTopologyContainer.h.

std::istream& operator>> ( std::istream &  in,
TetrahedronSetTopologyContainer &  t 
) [friend]

Definition at line 231 of file TetrahedronSetTopologyContainer.h.

friend class TetrahedronSetTopologyModifier [friend]

Definition at line 63 of file TetrahedronSetTopologyContainer.h.


Field Documentation


The documentation for this class was generated from the following files:

Generated on Sun Nov 23 04:21:39 2008 for Sofa by  doxygen 1.5.7.1