sofa::component::topology::QuadSetTopologyContainer Class Reference

Object that stores a set of quads and provides access to each quad and its edges and vertices. More...

#include <QuadSetTopologyContainer.h>

Inheritance diagram for sofa::component::topology::QuadSetTopologyContainer:

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

Collaboration graph
[legend]

Public Member Functions

 QuadSetTopologyContainer ()
 QuadSetTopologyContainer (const sofa::helper::vector< Quad > &quads)
virtual ~QuadSetTopologyContainer ()
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
< Quad > & 
getQuadArray ()
 Returns the Quad array.
const sofa::helper::vector
< sofa::helper::vector
< unsigned int > > & 
getQuadVertexShellArray ()
 Returns the Quad Vertex Shells array.
const sofa::helper::vector
< QuadEdges > & 
getQuadEdgeArray ()
 Returns the QuadEdges array (ie provide the 4 edge indices for each quad).
const sofa::helper::vector
< sofa::helper::vector
< unsigned int > > & 
getQuadEdgeShellArray ()
 Returns the Quad Edge Shells array (ie provides the quads adjacent to each edge).
unsigned int getNumberOfQuads () const
 Returns the number of quads in this topology.
const QuadEdges & getQuadEdge (const unsigned int i)
 Returns the 4 edges adjacent to a given quad.
int getVertexIndexInQuad (Quad &t, unsigned int vertexIndex) const
 returns the index (either 0, 1, 2, 3) of the vertex whose global index is vertexIndex.
int getEdgeIndexInQuad (QuadEdges &t, unsigned int edheIndex) const
 returns the index (either 0, 1, 2, 3) of the edge whose global index is edgeIndex.
virtual void clear ()
 Procedural creation methods.
virtual void addQuad (int a, int b, int c, int d)
const SeqQuads & getQuads ()
 BaseMeshTopology API.
const QuadEdges & getEdgeQuadShell (QuadID i)
 Returns the set of edges adjacent to a given quad.
virtual const VertexQuads & getQuadVertexShell (PointID i)
 Returns the set of quads adjacent to a given vertex.
virtual const EdgeQuads & getQuadEdgeShell (EdgeID i)
 Returns the set of quads adjacent to a given edge.
virtual int getQuadIndex (PointID v1, PointID v2, PointID v3, PointID v4)
 Returns the indices of a quad given four vertex indices : returns -1 if none.

Protected Member Functions

virtual void createQuadSetArray ()
 Creates the QuadSet array.
virtual void createEdgeSetArray ()
 Creates the EdgeSet array.
bool hasQuads () const
bool hasQuadEdges () const
bool hasQuadVertexShell () const
bool hasQuadEdgeShell () const
void clearQuads ()
void clearQuadEdges ()
void clearQuadVertexShell ()
void clearQuadEdgeShell ()
virtual void loadFromMeshLoader (sofa::component::MeshLoader *loader)

Protected Attributes

sofa::helper::vector< Quad > m_quad
 provides the set of quads
sofa::helper::vector< QuadEdges > m_quadEdge
 provides the 4 edges in each quad
sofa::helper::vector
< sofa::helper::vector
< unsigned int > > 
m_quadVertexShell
 for each vertex provides the set of quads adjacent to that vertex
sofa::helper::vector
< sofa::helper::vector
< unsigned int > > 
m_quadEdgeShell
 for each edge provides the set of quads adjacent to that edge

Private Member Functions

void createQuadEdgeArray ()
 Creates the array of edge indices for each quad.
void createQuadVertexShellArray ()
 Creates the Quad Vertex Shell Array.
void createQuadEdgeShellArray ()
 Creates the Quad Edge Shell Array.
sofa::helper::vector< unsigned
int > & 
getQuadVertexShellForModification (const unsigned int vertexIndex)
 Returns a non-const quad vertex shell given a vertex index for subsequent modification.
sofa::helper::vector< unsigned
int > & 
getQuadEdgeShellForModification (const unsigned int edgeIndex)
 Returns a non-const quad edge shell given the index of an edge for subsequent modification.

Friends

class QuadSetTopologyModifier
std::ostream & operator<< (std::ostream &out, const QuadSetTopologyContainer &t)
std::istream & operator>> (std::istream &in, QuadSetTopologyContainer &t)
 Needed to be compliant with Datas.

Detailed Description

Object that stores a set of quads and provides access to each quad and its edges and vertices.

Definition at line 52 of file QuadSetTopologyContainer.h.


Constructor & Destructor Documentation

sofa::component::topology::QuadSetTopologyContainer::QuadSetTopologyContainer (  ) 

Definition at line 46 of file QuadSetTopologyContainer.cpp.

sofa::component::topology::QuadSetTopologyContainer::QuadSetTopologyContainer ( const sofa::helper::vector< Quad > &  quads  ) 

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

Definition at line 61 of file QuadSetTopologyContainer.h.


Member Function Documentation

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

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

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

void sofa::component::topology::QuadSetTopologyContainer::clearQuadEdges (  )  [protected]

void sofa::component::topology::QuadSetTopologyContainer::clearQuadEdgeShell (  )  [protected]

void sofa::component::topology::QuadSetTopologyContainer::clearQuads (  )  [protected]

void sofa::component::topology::QuadSetTopologyContainer::clearQuadVertexShell (  )  [protected]

Definition at line 538 of file QuadSetTopologyContainer.cpp.

References clear(), and m_quadVertexShell.

Referenced by clear(), and createQuadVertexShellArray().

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

void sofa::component::topology::QuadSetTopologyContainer::createQuadEdgeArray (  )  [private]

Creates the array of edge indices for each quad.

This function is only called if the QuadEdge array is required. m_quadEdge[i] contains the 4 indices of the 4 edges opposite to the ith vertex

Definition at line 211 of file QuadSetTopologyContainer.cpp.

References clearQuadEdges(), createEdgeSetArray(), createQuadSetArray(), sofa::component::topology::EdgeSetTopologyContainer::getEdgeIndex(), getNumberOfQuads(), sofa::component::topology::EdgeSetTopologyContainer::hasEdges(), hasQuadEdges(), hasQuads(), m_quad, and m_quadEdge.

Referenced by createQuadEdgeShellArray(), getQuadEdge(), getQuadEdgeArray(), and sofa::component::topology::QuadSetTopologyModifier::removeQuadsProcess().

void sofa::component::topology::QuadSetTopologyContainer::createQuadEdgeShellArray (  )  [private]

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

Creates the QuadSet array.

This function must be implemented by derived classes to create a list of quads from a set of hexahedra for instance

Reimplemented in sofa::component::topology::HexahedronSetTopologyContainer.

Definition at line 85 of file QuadSetTopologyContainer.cpp.

Referenced by createEdgeSetArray(), createQuadEdgeArray(), createQuadEdgeShellArray(), createQuadVertexShellArray(), and getQuadArray().

void sofa::component::topology::QuadSetTopologyContainer::createQuadVertexShellArray (  )  [private]

int sofa::component::topology::QuadSetTopologyContainer::getEdgeIndexInQuad ( QuadEdges &  t,
unsigned int  edheIndex 
) const

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

Returns -1 if none

Definition at line 412 of file QuadSetTopologyContainer.cpp.

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

const QuadEdges& sofa::component::topology::QuadSetTopologyContainer::getEdgeQuadShell ( QuadID  i  )  [inline]

Returns the set of edges adjacent to a given quad.

Definition at line 80 of file QuadSetTopologyContainer.h.

References getQuadEdge().

unsigned int sofa::component::topology::QuadSetTopologyContainer::getNumberOfQuads (  )  const

const sofa::helper::vector< Quad > & sofa::component::topology::QuadSetTopologyContainer::getQuadArray (  ) 

const QuadEdges & sofa::component::topology::QuadSetTopologyContainer::getQuadEdge ( const unsigned int  i  ) 

Returns the 4 edges adjacent to a given quad.

Definition at line 382 of file QuadSetTopologyContainer.cpp.

References createQuadEdgeArray(), and m_quadEdge.

Referenced by getEdgeQuadShell().

const sofa::helper::vector< QuadEdges > & sofa::component::topology::QuadSetTopologyContainer::getQuadEdgeArray (  ) 

Returns the QuadEdges array (ie provide the 4 edge indices for each quad).

Definition at line 334 of file QuadSetTopologyContainer.cpp.

References createQuadEdgeArray(), and m_quadEdge.

const EdgeQuads & sofa::component::topology::QuadSetTopologyContainer::getQuadEdgeShell ( EdgeID  i  )  [virtual]

Returns the set of quads adjacent to a given edge.

Definition at line 362 of file QuadSetTopologyContainer.cpp.

References createQuadEdgeShellArray(), hasQuadEdgeShell(), and m_quadEdgeShell.

const sofa::helper::vector< sofa::helper::vector< unsigned int > > & sofa::component::topology::QuadSetTopologyContainer::getQuadEdgeShellArray (  ) 

Returns the Quad Edge Shells array (ie provides the quads adjacent to each edge).

Definition at line 321 of file QuadSetTopologyContainer.cpp.

References createQuadEdgeShellArray(), hasQuadEdgeShell(), and m_quadEdgeShell.

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

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

Definition at line 426 of file QuadSetTopologyContainer.cpp.

References createQuadEdgeShellArray(), hasQuadEdgeShell(), and m_quadEdgeShell.

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

const SeqQuads& sofa::component::topology::QuadSetTopologyContainer::getQuads (  )  [inline, virtual]

BaseMeshTopology API.

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

Definition at line 74 of file QuadSetTopologyContainer.h.

References getQuadArray().

const VertexQuads & sofa::component::topology::QuadSetTopologyContainer::getQuadVertexShell ( PointID  i  )  [virtual]

Returns the set of quads adjacent to a given vertex.

Definition at line 342 of file QuadSetTopologyContainer.cpp.

References createQuadVertexShellArray(), hasQuadVertexShell(), and m_quadVertexShell.

Referenced by getQuadIndex().

const sofa::helper::vector< sofa::helper::vector< unsigned int > > & sofa::component::topology::QuadSetTopologyContainer::getQuadVertexShellArray (  ) 

Returns the Quad Vertex Shells array.

Definition at line 308 of file QuadSetTopologyContainer.cpp.

References createQuadVertexShellArray(), hasQuadVertexShell(), and m_quadVertexShell.

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

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

Definition at line 447 of file QuadSetTopologyContainer.cpp.

References createQuadVertexShellArray(), hasQuadVertexShell(), and m_quadVertexShell.

Referenced by sofa::component::topology::QuadSetTopologyModifier::addQuadProcess().

int sofa::component::topology::QuadSetTopologyContainer::getVertexIndexInQuad ( Quad &  t,
unsigned int  vertexIndex 
) const

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

Returns -1 if none

Definition at line 398 of file QuadSetTopologyContainer.cpp.

bool sofa::component::topology::QuadSetTopologyContainer::hasQuadEdges (  )  const [protected]

bool sofa::component::topology::QuadSetTopologyContainer::hasQuadEdgeShell (  )  const [protected]

bool sofa::component::topology::QuadSetTopologyContainer::hasQuads (  )  const [protected]

bool sofa::component::topology::QuadSetTopologyContainer::hasQuadVertexShell (  )  const [protected]

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

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

Reimplemented from sofa::component::topology::EdgeSetTopologyContainer.

Reimplemented in sofa::component::topology::HexahedronSetTopologyContainer.

Definition at line 73 of file QuadSetTopologyContainer.cpp.

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


Friends And Related Function Documentation

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

Definition at line 142 of file QuadSetTopologyContainer.h.

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

Needed to be compliant with Datas.

Definition at line 163 of file QuadSetTopologyContainer.h.

friend class QuadSetTopologyModifier [friend]

Definition at line 54 of file QuadSetTopologyContainer.h.


Field Documentation


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

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