sofa::component::topology::QuadSetTopologyModifier Class Reference

A class that modifies the topology by adding and removing quads. More...

#include <QuadSetTopologyModifier.h>

Inheritance diagram for sofa::component::topology::QuadSetTopologyModifier:

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

Collaboration graph
[legend]

Public Member Functions

 QuadSetTopologyModifier ()
virtual ~QuadSetTopologyModifier ()
virtual void init ()
 Initialization method called at graph modification, during bottom-up traversal.
void addQuadsWarning (const unsigned int nQuads, const sofa::helper::vector< Quad > &quadsList, const sofa::helper::vector< unsigned int > &quadsIndexList)
 Sends a message to warn that some quads were added in this topology.
void addQuadsWarning (const unsigned int nQuads, const sofa::helper::vector< Quad > &quadsList, const sofa::helper::vector< unsigned int > &quadsIndexList, const sofa::helper::vector< sofa::helper::vector< unsigned int > > &ancestors, const sofa::helper::vector< sofa::helper::vector< double > > &baryCoefs)
 Sends a message to warn that some quads were added in this topology.
void addQuadProcess (Quad e)
 Add a quad.
virtual void addQuadsProcess (const sofa::helper::vector< Quad > &quads)
 Actually Add some quads to this topology.
virtual void removeQuadsWarning (sofa::helper::vector< unsigned int > &quads)
 Sends a message to warn that some quads are about to be deleted.
virtual void removeQuadsProcess (const sofa::helper::vector< unsigned int > &indices, const bool removeIsolatedEdges=false, const bool removeIsolatedPoints=false)
 Remove a subset of quads.
void addEdgesProcess (const sofa::helper::vector< Edge > &edges)
 Add some edges to this topology.
virtual void removeEdgesProcess (const sofa::helper::vector< unsigned int > &indices, const bool removeIsolatedItems=false)
 Remove a subset of edges.
virtual void addPointsProcess (const unsigned int nPoints)
 Add some points to this topology.
virtual void removePointsProcess (sofa::helper::vector< unsigned int > &indices, const bool removeDOF=true)
 Remove a subset of points.
virtual void renumberPointsProcess (const sofa::helper::vector< unsigned int > &index, const sofa::helper::vector< unsigned int > &inv_index, const bool renumberDOF=true)
 Reorder this topology.
virtual void removeQuads (sofa::helper::vector< unsigned int > &quads, const bool removeIsolatedEdges, const bool removeIsolatedPoints)
 Remove a set of quads.
virtual void removeItems (sofa::helper::vector< unsigned int > &items)
 Generic method to remove a list of items.
virtual void renumberPoints (const sofa::helper::vector< unsigned int > &index, const sofa::helper::vector< unsigned int > &inv_index)
 Generic method for points renumbering.

Private Attributes

QuadSetTopologyContainer * m_container

Detailed Description

A class that modifies the topology by adding and removing quads.

Definition at line 51 of file QuadSetTopologyModifier.h.


Constructor & Destructor Documentation

sofa::component::topology::QuadSetTopologyModifier::QuadSetTopologyModifier (  )  [inline]

Definition at line 54 of file QuadSetTopologyModifier.h.

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

Definition at line 58 of file QuadSetTopologyModifier.h.


Member Function Documentation

void sofa::component::topology::QuadSetTopologyModifier::addEdgesProcess ( const sofa::helper::vector< Edge > &  edges  )  [virtual]

void sofa::component::topology::QuadSetTopologyModifier::addPointsProcess ( const unsigned int  nPoints  )  [virtual]

void sofa::component::topology::QuadSetTopologyModifier::addQuadProcess ( Quad  e  ) 

void sofa::component::topology::QuadSetTopologyModifier::addQuadsProcess ( const sofa::helper::vector< Quad > &  quads  )  [virtual]

void sofa::component::topology::QuadSetTopologyModifier::addQuadsWarning ( const unsigned int  nQuads,
const sofa::helper::vector< Quad > &  quadsList,
const sofa::helper::vector< unsigned int > &  quadsIndexList,
const sofa::helper::vector< sofa::helper::vector< unsigned int > > &  ancestors,
const sofa::helper::vector< sofa::helper::vector< double > > &  baryCoefs 
)

Sends a message to warn that some quads were added in this topology.

See also:
addQuadsProcess

Definition at line 152 of file QuadSetTopologyModifier.cpp.

References sofa::core::componentmodel::topology::TopologyModifier::addTopologyChange().

void sofa::component::topology::QuadSetTopologyModifier::addQuadsWarning ( const unsigned int  nQuads,
const sofa::helper::vector< Quad > &  quadsList,
const sofa::helper::vector< unsigned int > &  quadsIndexList 
)

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

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

Reimplemented from sofa::component::topology::EdgeSetTopologyModifier.

Reimplemented in sofa::component::topology::HexahedronSetTopologyModifier.

Definition at line 48 of file QuadSetTopologyModifier.cpp.

References sofa::component::topology::EdgeSetTopologyModifier::init().

void sofa::component::topology::QuadSetTopologyModifier::removeEdgesProcess ( const sofa::helper::vector< unsigned int > &  indices,
const bool  removeIsolatedItems = false 
) [virtual]

Remove a subset of edges.

Important : some structures might need to be warned BEFORE the points are actually deleted, so always use method removeEdgesWarning before calling removeEdgesProcess.

See also:
removeEdgesWarning
Parameters:
removeIsolatedItems if true isolated vertices are also removed Important : parameter indices is not const because it is actually sorted from the highest index to the lowest one.

Reimplemented from sofa::component::topology::EdgeSetTopologyModifier.

Reimplemented in sofa::component::topology::HexahedronSetTopologyModifier.

Definition at line 347 of file QuadSetTopologyModifier.cpp.

References sofa::component::topology::QuadSetTopologyContainer::createQuadEdgeShellArray(), sofa::component::topology::QuadSetTopologyContainer::getEdgeIndexInQuad(), sofa::component::topology::EdgeSetTopologyContainer::getNumberOfEdges(), sofa::component::topology::QuadSetTopologyContainer::hasQuadEdges(), sofa::component::topology::QuadSetTopologyContainer::hasQuadEdgeShell(), m_container, sofa::component::topology::QuadSetTopologyContainer::m_quadEdge, and sofa::component::topology::QuadSetTopologyContainer::m_quadEdgeShell.

Referenced by removeQuadsProcess().

void sofa::component::topology::QuadSetTopologyModifier::removeItems ( sofa::helper::vector< unsigned int > &  items  )  [virtual]

Generic method to remove a list of items.

Reimplemented from sofa::component::topology::EdgeSetTopologyModifier.

Reimplemented in sofa::component::topology::HexahedronSetTopologyModifier.

Definition at line 422 of file QuadSetTopologyModifier.cpp.

References removeQuads().

void sofa::component::topology::QuadSetTopologyModifier::removePointsProcess ( sofa::helper::vector< unsigned int > &  indices,
const bool  removeDOF = true 
) [virtual]

Remove a subset of points.

Elements corresponding to these points are removed from the mechanical object's state vectors.

Important : some structures might need to be warned BEFORE the points are actually deleted, so always use method removePointsWarning before calling removePointsProcess.

See also:
removePointsWarning Important : the points are actually deleted from the mechanical object's state vectors iff (removeDOF == true)

Reimplemented from sofa::component::topology::EdgeSetTopologyModifier.

Reimplemented in sofa::component::topology::HexahedronSetTopologyModifier.

Definition at line 310 of file QuadSetTopologyModifier.cpp.

References sofa::component::topology::QuadSetTopologyContainer::createQuadVertexShellArray(), sofa::component::topology::PointSetTopologyContainer::getNbPoints(), sofa::component::topology::QuadSetTopologyContainer::hasQuads(), sofa::component::topology::QuadSetTopologyContainer::hasQuadVertexShell(), m_container, sofa::component::topology::QuadSetTopologyContainer::m_quad, and sofa::component::topology::QuadSetTopologyContainer::m_quadVertexShell.

Referenced by removeQuadsProcess(), and sofa::component::topology::Hexa2QuadTopologicalMapping::updateTopologicalMapping().

void sofa::component::topology::QuadSetTopologyModifier::removeQuads ( sofa::helper::vector< unsigned int > &  quads,
const bool  removeIsolatedEdges,
const bool  removeIsolatedPoints 
) [virtual]

Remove a set of quads.

Parameters:
quads an array of quad indices to be removed (note that the array is not const since it needs to be sorted)
removeIsolatedEdges if true isolated edges are also removed
removeIsolatedPoints if true isolated vertices are also removed

add the topological changes in the queue

Definition at line 408 of file QuadSetTopologyModifier.cpp.

References sofa::component::topology::QuadSetTopologyContainer::checkTopology(), m_container, sofa::component::topology::PointSetTopologyModifier::propagateTopologicalChanges(), removeQuadsProcess(), and removeQuadsWarning().

Referenced by removeItems(), sofa::component::topology::Hexa2QuadTopologicalMapping::updateTopologicalMapping(), and sofa::component::topology::Edge2QuadTopologicalMapping::updateTopologicalMapping().

void sofa::component::topology::QuadSetTopologyModifier::removeQuadsProcess ( const sofa::helper::vector< unsigned int > &  indices,
const bool  removeIsolatedEdges = false,
const bool  removeIsolatedPoints = false 
) [virtual]

Remove a subset of quads.

Eventually remove isolated edges and vertices

Important : some structures might need to be warned BEFORE the points are actually deleted, so always use method removeEdgesWarning before calling removeEdgesProcess.

See also:
removeQuadsWarning
Parameters:
removeIsolatedEdges if true isolated edges are also removed
removeIsolatedPoints if true isolated vertices are also removed

warn that edges will be deleted

actually remove edges without looking for isolated vertices

propagate to all components

Reimplemented in sofa::component::topology::HexahedronSetTopologyModifier.

Definition at line 175 of file QuadSetTopologyModifier.cpp.

References sofa::component::topology::QuadSetTopologyContainer::createQuadEdgeArray(), sofa::component::topology::QuadSetTopologyContainer::createQuadEdgeShellArray(), sofa::component::topology::QuadSetTopologyContainer::createQuadVertexShellArray(), sofa::component::topology::QuadSetTopologyContainer::getNumberOfQuads(), sofa::component::topology::EdgeSetTopologyContainer::hasEdges(), sofa::component::topology::QuadSetTopologyContainer::hasQuadEdges(), sofa::component::topology::QuadSetTopologyContainer::hasQuadEdgeShell(), sofa::component::topology::QuadSetTopologyContainer::hasQuads(), sofa::component::topology::QuadSetTopologyContainer::hasQuadVertexShell(), m_container, sofa::component::topology::QuadSetTopologyContainer::m_quad, sofa::component::topology::QuadSetTopologyContainer::m_quadEdge, sofa::component::topology::QuadSetTopologyContainer::m_quadEdgeShell, sofa::component::topology::QuadSetTopologyContainer::m_quadVertexShell, sofa::component::topology::PointSetTopologyModifier::propagateTopologicalChanges(), removeEdgesProcess(), sofa::component::topology::EdgeSetTopologyModifier::removeEdgesWarning(), removePointsProcess(), and sofa::component::topology::PointSetTopologyModifier::removePointsWarning().

Referenced by removeQuads().

void sofa::component::topology::QuadSetTopologyModifier::removeQuadsWarning ( sofa::helper::vector< unsigned int > &  quads  )  [virtual]

Sends a message to warn that some quads are about to be deleted.

See also:
removeQuadsProcess
Important : parameter indices is not const because it is actually sorted from the highest index to the lowest one.

sort vertices to remove in a descendent order

Definition at line 164 of file QuadSetTopologyModifier.cpp.

References sofa::core::componentmodel::topology::TopologyModifier::addTopologyChange().

Referenced by sofa::component::topology::HexahedronSetTopologyModifier::removeHexahedraProcess(), and removeQuads().

void sofa::component::topology::QuadSetTopologyModifier::renumberPoints ( const sofa::helper::vector< unsigned int > &  index,
const sofa::helper::vector< unsigned int > &  inv_index 
) [virtual]

void sofa::component::topology::QuadSetTopologyModifier::renumberPointsProcess ( const sofa::helper::vector< unsigned int > &  index,
const sofa::helper::vector< unsigned int > &  inv_index,
const bool  renumberDOF = true 
) [virtual]


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