sofa::component::topology::HexahedronSetTopologyContainer Class Reference

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

#include <HexahedronSetTopologyContainer.h>

Inheritance diagram for sofa::component::topology::HexahedronSetTopologyContainer:

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

Collaboration graph
[legend]

Public Types

typedef Hexa Hexahedron
typedef HexaEdges HexahedronEdges
typedef HexaQuads HexahedronQuads

Public Member Functions

 HexahedronSetTopologyContainer ()
 HexahedronSetTopologyContainer (const sofa::helper::vector< Hexahedron > &hexahedra)
virtual ~HexahedronSetTopologyContainer ()
virtual void init ()
 Initialization method called at graph modification, during bottom-up traversal.
virtual bool checkTopology () const
 Checks if the topology is coherent.
const sofa::helper::vector
< Hexahedron > & 
getHexahedronArray ()
 Returns the Hexahedron array.
const Hexahedron & getHexahedron (const unsigned int i)
 Returns the ith Hexahedron.
unsigned int getNumberOfHexahedra () const
 Returns the number of hexahedra in this topology.
const sofa::helper::vector
< sofa::helper::vector
< unsigned int > > & 
getHexahedronVertexShellArray ()
 Returns the Hexahedron Vertex Shells array.
const sofa::helper::vector
< unsigned int > & 
getHexahedronVertexShell (const unsigned int i)
 Returns the set of hexahedra adjacent to a given vertex.
const sofa::helper::vector
< HexahedronEdges > & 
getHexahedronEdgeArray ()
 Returns the Hexahedron Edges array.
const HexahedronEdges & getHexahedronEdges (const unsigned int i)
 Returns the 12 edges adjacent to a given hexahedron.
Edge getLocalHexahedronEdges (const unsigned int i) const
 Returns for each index (between 0 and 12) the two vertex indices that are adjacent to that edge.
const sofa::helper::vector
< HexahedronQuads > & 
getHexahedronQuadArray ()
 Returns the Hexahedron Quads array.
const HexahedronQuads & getHexahedronQuads (const unsigned int i)
 Returns the 6 quads adjacent to a given hexahedron.
const sofa::helper::vector
< sofa::helper::vector
< unsigned int > > & 
getHexahedronEdgeShellArray ()
 Returns the Hexahedron Edge Shells array.
const sofa::helper::vector
< unsigned int > & 
getHexahedronEdgeShell (const unsigned int i)
 Returns the set of hexahedra adjacent to a given edge.
const sofa::helper::vector
< sofa::helper::vector
< unsigned int > > & 
getHexahedronQuadShellArray ()
 Returns the Hexahedron Quad Shells array.
const sofa::helper::vector
< unsigned int > & 
getHexahedronQuadShell (const unsigned int i)
 Returns the set of hexahedra adjacent to a given quad.
int getVertexIndexInHexahedron (Hexahedron &t, unsigned int vertexIndex) const
 returns the index of the vertex whose global index is vertexIndex.
int getEdgeIndexInHexahedron (const HexahedronEdges &t, unsigned int edgeIndex) const
 returns the index of the edge whose global index is edgeIndex.
int getQuadIndexInHexahedron (const HexahedronQuads &t, unsigned int quadIndex) const
 returns the index of the quad whose global index is quadIndex.
virtual void clear ()
 Procedural creation methods.
virtual void addHexa (int a, int b, int c, int d, int e, int f, int g, int h)
const SeqHexas & getHexas ()
 BaseMeshTopology API.
const HexaEdges & getEdgeHexaShell (HexaID i)
 Returns the set of edges adjacent to a given hexahedron.
const HexaQuads & getQuadHexaShell (HexaID i)
 Returns the set of quads adjacent to a given hexahedron.
const VertexHexas & getHexaVertexShell (PointID i)
 Returns the set of hexahedra adjacent to a given vertex.
const EdgeHexas & getHexaEdgeShell (EdgeID i)
 Returns the set of hexahedra adjacent to a given edge.
const QuadHexas & getHexaQuadShell (QuadID i)
 Returns the set of hexahedra adjacent to a given quad.
virtual int getHexahedronIndex (PointID v1, PointID v2, PointID v3, PointID v4, PointID v5, PointID v6, PointID v7, PointID v8)
 Returns the indices of a hexahedron given 8 vertex indices : returns -1 if none.

Protected Member Functions

virtual void createEdgeSetArray ()
 Creates the EdgeSet array.
virtual void createQuadSetArray ()
 Creates the QuadSet array.
virtual void createHexahedronSetArray ()
 Creates the HexahedronSet array.
bool hasHexahedra () const
bool hasHexahedronEdges () const
bool hasHexahedronQuads () const
bool hasHexahedronVertexShell () const
bool hasHexahedronEdgeShell () const
bool hasHexahedronQuadShell () const
void clearHexahedra ()
void clearHexahedronEdges ()
void clearHexahedronQuads ()
void clearHexahedronVertexShell ()
void clearHexahedronEdgeShell ()
void clearHexahedronQuadShell ()
virtual void loadFromMeshLoader (sofa::component::MeshLoader *loader)

Protected Attributes

sofa::helper::vector< Hexahedron > m_hexahedron
 provides the set of hexahedra
sofa::helper::vector
< HexahedronEdges > 
m_hexahedronEdge
 provides the set of edges for each hexahedron
sofa::helper::vector
< HexahedronQuads > 
m_hexahedronQuad
 provides the set of quads for each hexahedron
sofa::helper::vector
< sofa::helper::vector
< unsigned int > > 
m_hexahedronVertexShell
 for each vertex provides the set of hexahedra adjacent to that vertex
sofa::helper::vector
< sofa::helper::vector
< unsigned int > > 
m_hexahedronEdgeShell
 for each edge provides the set of hexahedra adjacent to that edge
sofa::helper::vector
< sofa::helper::vector
< unsigned int > > 
m_hexahedronQuadShell
 for each quad provides the set of hexahedra adjacent to that edge

Private Member Functions

void createHexahedronEdgeArray ()
 Creates the array of edge indices for each hexahedron.
void createHexahedronQuadArray ()
 Creates the array of quad indices for each hexahedron.
void createHexahedronVertexShellArray ()
 Creates the Hexahedron Vertex Shell Array.
void createHexahedronEdgeShellArray ()
 Creates the Hexahedron Edge Shell Array.
void createHexahedronQuadShellArray ()
 Creates the Hexahedron Quad Shell Array.
sofa::helper::vector< unsigned
int > & 
getHexahedronVertexShellForModification (const unsigned int vertexIndex)
 Returns a non-const hexahedron vertex shell given a vertex index for subsequent modification.
sofa::helper::vector< unsigned
int > & 
getHexahedronEdgeShellForModification (const unsigned int edgeIndex)
 Returns a non-const hexahedron edge shell given the index of an edge for subsequent modification.

Friends

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

Detailed Description

a class that stores a set of hexahedra and provides access with adjacent quads, edges and vertices

Definition at line 75 of file HexahedronSetTopologyContainer.h.


Member Typedef Documentation

Definition at line 80 of file HexahedronSetTopologyContainer.h.

Definition at line 81 of file HexahedronSetTopologyContainer.h.

Definition at line 82 of file HexahedronSetTopologyContainer.h.


Constructor & Destructor Documentation

sofa::component::topology::HexahedronSetTopologyContainer::HexahedronSetTopologyContainer (  ) 

Definition at line 47 of file HexahedronSetTopologyContainer.cpp.

sofa::component::topology::HexahedronSetTopologyContainer::HexahedronSetTopologyContainer ( const sofa::helper::vector< Hexahedron > &  hexahedra  ) 

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

Definition at line 88 of file HexahedronSetTopologyContainer.h.


Member Function Documentation

void sofa::component::topology::HexahedronSetTopologyContainer::addHexa ( int  a,
int  b,
int  c,
int  d,
int  e,
int  f,
int  g,
int  h 
) [virtual]

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

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

void sofa::component::topology::HexahedronSetTopologyContainer::clearHexahedra (  )  [protected]

Definition at line 833 of file HexahedronSetTopologyContainer.cpp.

References m_hexahedron.

Referenced by clear().

void sofa::component::topology::HexahedronSetTopologyContainer::clearHexahedronEdges (  )  [protected]

void sofa::component::topology::HexahedronSetTopologyContainer::clearHexahedronEdgeShell (  )  [protected]

void sofa::component::topology::HexahedronSetTopologyContainer::clearHexahedronQuads (  )  [protected]

void sofa::component::topology::HexahedronSetTopologyContainer::clearHexahedronQuadShell (  )  [protected]

void sofa::component::topology::HexahedronSetTopologyContainer::clearHexahedronVertexShell (  )  [protected]

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

void sofa::component::topology::HexahedronSetTopologyContainer::createHexahedronEdgeArray (  )  [private]

Creates the array of edge indices for each hexahedron.

This function is only called if the HexahedronEdge array is required. m_hexahedronEdge[i] contains the 12 indices of the 12 edges of each hexahedron

Definition at line 134 of file HexahedronSetTopologyContainer.cpp.

References clearHexahedronEdges(), createEdgeSetArray(), sofa::component::topology::EdgeSetTopologyContainer::getEdgeIndex(), getNumberOfHexahedra(), sofa::component::topology::EdgeSetTopologyContainer::hasEdges(), hasHexahedronEdges(), sofa::component::topology::hexahedronEdgeArray, m_hexahedron, and m_hexahedronEdge.

Referenced by createHexahedronEdgeShellArray(), getHexahedronEdgeArray(), and getHexahedronEdges().

void sofa::component::topology::HexahedronSetTopologyContainer::createHexahedronEdgeShellArray (  )  [private]

void sofa::component::topology::HexahedronSetTopologyContainer::createHexahedronQuadArray (  )  [private]

Creates the array of quad indices for each hexahedron.

This function is only called if the HexahedronQuad array is required. m_hexahedronQuad[i] contains the 6 indices of the 6 quads opposite to the ith vertex

Definition at line 338 of file HexahedronSetTopologyContainer.cpp.

References clearHexahedronQuads(), createQuadSetArray(), getNumberOfHexahedra(), sofa::component::topology::QuadSetTopologyContainer::getQuadIndex(), hasHexahedronQuads(), sofa::component::topology::QuadSetTopologyContainer::hasQuads(), m_hexahedron, and m_hexahedronQuad.

Referenced by createHexahedronQuadShellArray(), getHexahedronQuadArray(), and getHexahedronQuads().

void sofa::component::topology::HexahedronSetTopologyContainer::createHexahedronQuadShellArray (  )  [private]

void sofa::component::topology::HexahedronSetTopologyContainer::createHexahedronSetArray (  )  [protected, virtual]

Creates the HexahedronSet array.

This function must be implemented by a derived classes

Definition at line 90 of file HexahedronSetTopologyContainer.cpp.

Referenced by getHexahedron(), and getHexahedronArray().

void sofa::component::topology::HexahedronSetTopologyContainer::createHexahedronVertexShellArray (  )  [private]

void sofa::component::topology::HexahedronSetTopologyContainer::createQuadSetArray (  )  [protected, virtual]

const HexaEdges& sofa::component::topology::HexahedronSetTopologyContainer::getEdgeHexaShell ( HexaID  i  )  [inline]

Returns the set of edges adjacent to a given hexahedron.

Definition at line 107 of file HexahedronSetTopologyContainer.h.

References getHexahedronEdges().

int sofa::component::topology::HexahedronSetTopologyContainer::getEdgeIndexInHexahedron ( const HexahedronEdges &  t,
unsigned int  edgeIndex 
) const

returns the index of the edge whose global index is edgeIndex.

Returns -1 if none

Definition at line 647 of file HexahedronSetTopologyContainer.cpp.

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

const EdgeHexas& sofa::component::topology::HexahedronSetTopologyContainer::getHexaEdgeShell ( EdgeID  i  )  [inline]

Returns the set of hexahedra adjacent to a given edge.

Definition at line 125 of file HexahedronSetTopologyContainer.h.

References getHexahedronEdgeShell().

const Hexahedron & sofa::component::topology::HexahedronSetTopologyContainer::getHexahedron ( const unsigned int  i  ) 

Returns the ith Hexahedron.

Definition at line 516 of file HexahedronSetTopologyContainer.cpp.

References createHexahedronSetArray(), hasHexahedra(), and m_hexahedron.

const sofa::helper::vector< Hexahedron > & sofa::component::topology::HexahedronSetTopologyContainer::getHexahedronArray (  ) 

const sofa::helper::vector< HexahedronEdges > & sofa::component::topology::HexahedronSetTopologyContainer::getHexahedronEdgeArray (  ) 

Returns the Hexahedron Edges array.

Definition at line 553 of file HexahedronSetTopologyContainer.cpp.

References createHexahedronEdgeArray(), hasHexahedronEdges(), and m_hexahedronEdge.

const HexahedronEdges & sofa::component::topology::HexahedronSetTopologyContainer::getHexahedronEdges ( const unsigned int  i  ) 

Returns the 12 edges adjacent to a given hexahedron.

Definition at line 605 of file HexahedronSetTopologyContainer.cpp.

References createHexahedronEdgeArray(), hasHexahedronEdges(), and m_hexahedronEdge.

Referenced by getEdgeHexaShell().

const sofa::helper::vector< unsigned int > & sofa::component::topology::HexahedronSetTopologyContainer::getHexahedronEdgeShell ( const unsigned int  i  ) 

Returns the set of hexahedra adjacent to a given edge.

Definition at line 585 of file HexahedronSetTopologyContainer.cpp.

References createHexahedronEdgeShellArray(), hasHexahedronEdgeShell(), and m_hexahedronEdgeShell.

Referenced by getHexaEdgeShell().

const sofa::helper::vector< sofa::helper::vector< unsigned int > > & sofa::component::topology::HexahedronSetTopologyContainer::getHexahedronEdgeShellArray (  ) 

Returns the Hexahedron Edge Shells array.

Definition at line 537 of file HexahedronSetTopologyContainer.cpp.

References createHexahedronEdgeShellArray(), hasHexahedronEdgeShell(), and m_hexahedronEdgeShell.

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

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

Definition at line 697 of file HexahedronSetTopologyContainer.cpp.

References createHexahedronEdgeShellArray(), hasHexahedronEdgeShell(), and m_hexahedronEdgeShell.

int sofa::component::topology::HexahedronSetTopologyContainer::getHexahedronIndex ( PointID  v1,
PointID  v2,
PointID  v3,
PointID  v4,
PointID  v5,
PointID  v6,
PointID  v7,
PointID  v8 
) [virtual]

Returns the indices of a hexahedron given 8 vertex indices : returns -1 if none.

Definition at line 449 of file HexahedronSetTopologyContainer.cpp.

References createHexahedronVertexShellArray(), getHexahedronVertexShell(), and hasHexahedronVertexShell().

Referenced by sofa::component::topology::HexahedronSetTopologyModifier::addHexahedronProcess().

const sofa::helper::vector< HexahedronQuads > & sofa::component::topology::HexahedronSetTopologyContainer::getHexahedronQuadArray (  ) 

Returns the Hexahedron Quads array.

Definition at line 567 of file HexahedronSetTopologyContainer.cpp.

References createHexahedronQuadArray(), hasHexahedronQuads(), and m_hexahedronQuad.

const HexahedronQuads & sofa::component::topology::HexahedronSetTopologyContainer::getHexahedronQuads ( const unsigned int  i  ) 

Returns the 6 quads adjacent to a given hexahedron.

Definition at line 615 of file HexahedronSetTopologyContainer.cpp.

References createHexahedronQuadArray(), hasHexahedronQuads(), and m_hexahedronQuad.

Referenced by getQuadHexaShell().

const sofa::helper::vector< unsigned int > & sofa::component::topology::HexahedronSetTopologyContainer::getHexahedronQuadShell ( const unsigned int  i  ) 

Returns the set of hexahedra adjacent to a given quad.

Definition at line 595 of file HexahedronSetTopologyContainer.cpp.

References createHexahedronQuadShellArray(), hasHexahedronQuadShell(), and m_hexahedronQuadShell.

Referenced by getHexaQuadShell().

const sofa::helper::vector< sofa::helper::vector< unsigned int > > & sofa::component::topology::HexahedronSetTopologyContainer::getHexahedronQuadShellArray (  ) 

Returns the Hexahedron Quad Shells array.

Definition at line 545 of file HexahedronSetTopologyContainer.cpp.

References createHexahedronQuadShellArray(), hasHexahedronQuadShell(), and m_hexahedronQuadShell.

const sofa::helper::vector< unsigned int > & sofa::component::topology::HexahedronSetTopologyContainer::getHexahedronVertexShell ( const unsigned int  i  ) 

Returns the set of hexahedra adjacent to a given vertex.

Definition at line 575 of file HexahedronSetTopologyContainer.cpp.

References createHexahedronVertexShellArray(), hasHexahedronVertexShell(), and m_hexahedronVertexShell.

Referenced by getHexahedronIndex(), and getHexaVertexShell().

const sofa::helper::vector< sofa::helper::vector< unsigned int > > & sofa::component::topology::HexahedronSetTopologyContainer::getHexahedronVertexShellArray (  ) 

Returns the Hexahedron Vertex Shells array.

Definition at line 529 of file HexahedronSetTopologyContainer.cpp.

References createHexahedronVertexShellArray(), hasHexahedronVertexShell(), and m_hexahedronVertexShell.

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

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

Definition at line 707 of file HexahedronSetTopologyContainer.cpp.

References createHexahedronVertexShellArray(), hasHexahedronVertexShell(), and m_hexahedronVertexShell.

Referenced by sofa::component::topology::HexahedronSetTopologyModifier::addHexahedronProcess().

const QuadHexas& sofa::component::topology::HexahedronSetTopologyContainer::getHexaQuadShell ( QuadID  i  )  [inline]

Returns the set of hexahedra adjacent to a given quad.

Definition at line 131 of file HexahedronSetTopologyContainer.h.

References getHexahedronQuadShell().

const SeqHexas& sofa::component::topology::HexahedronSetTopologyContainer::getHexas (  )  [inline, virtual]

BaseMeshTopology API.

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

Definition at line 101 of file HexahedronSetTopologyContainer.h.

References getHexahedronArray().

const VertexHexas& sofa::component::topology::HexahedronSetTopologyContainer::getHexaVertexShell ( PointID  i  )  [inline]

Returns the set of hexahedra adjacent to a given vertex.

Definition at line 119 of file HexahedronSetTopologyContainer.h.

References getHexahedronVertexShell().

Edge sofa::component::topology::HexahedronSetTopologyContainer::getLocalHexahedronEdges ( const unsigned int  i  )  const

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

Definition at line 561 of file HexahedronSetTopologyContainer.cpp.

References sofa::component::topology::hexahedronEdgeArray.

unsigned int sofa::component::topology::HexahedronSetTopologyContainer::getNumberOfHexahedra (  )  const

Returns the number of hexahedra in this topology.

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

Definition at line 524 of file HexahedronSetTopologyContainer.cpp.

References m_hexahedron.

Referenced by sofa::component::topology::HexahedronSetTopologyModifier::addHexahedronProcess(), createHexahedronEdgeArray(), createHexahedronQuadArray(), and sofa::component::topology::HexahedronSetTopologyModifier::removeHexahedraProcess().

const HexaQuads& sofa::component::topology::HexahedronSetTopologyContainer::getQuadHexaShell ( HexaID  i  )  [inline]

Returns the set of quads adjacent to a given hexahedron.

Definition at line 113 of file HexahedronSetTopologyContainer.h.

References getHexahedronQuads().

int sofa::component::topology::HexahedronSetTopologyContainer::getQuadIndexInHexahedron ( const HexahedronQuads &  t,
unsigned int  quadIndex 
) const

returns the index of the quad whose global index is quadIndex.

Returns -1 if none

Definition at line 678 of file HexahedronSetTopologyContainer.cpp.

Referenced by sofa::component::topology::HexahedronSetTopologyModifier::removeQuadsProcess().

int sofa::component::topology::HexahedronSetTopologyContainer::getVertexIndexInHexahedron ( Hexahedron &  t,
unsigned int  vertexIndex 
) const

returns the index of the vertex whose global index is vertexIndex.

Returns -1 if none

Definition at line 625 of file HexahedronSetTopologyContainer.cpp.

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

bool sofa::component::topology::HexahedronSetTopologyContainer::hasHexahedra (  )  const [protected]

bool sofa::component::topology::HexahedronSetTopologyContainer::hasHexahedronEdges (  )  const [protected]

bool sofa::component::topology::HexahedronSetTopologyContainer::hasHexahedronEdgeShell (  )  const [protected]

bool sofa::component::topology::HexahedronSetTopologyContainer::hasHexahedronQuads (  )  const [protected]

bool sofa::component::topology::HexahedronSetTopologyContainer::hasHexahedronQuadShell (  )  const [protected]

bool sofa::component::topology::HexahedronSetTopologyContainer::hasHexahedronVertexShell (  )  const [protected]

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

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

Reimplemented from sofa::component::topology::QuadSetTopologyContainer.

Definition at line 78 of file HexahedronSetTopologyContainer.cpp.

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


Friends And Related Function Documentation

friend class HexahedronSetTopologyModifier [friend]

Definition at line 77 of file HexahedronSetTopologyContainer.h.

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

Definition at line 228 of file HexahedronSetTopologyContainer.h.

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

Definition at line 252 of file HexahedronSetTopologyContainer.h.


Field Documentation


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

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