sofa::component::topology::TetrahedronSetTopologyModifier Class Reference

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

#include <TetrahedronSetTopologyModifier.h>

Inheritance diagram for sofa::component::topology::TetrahedronSetTopologyModifier:

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

Collaboration graph
[legend]

Public Member Functions

 TetrahedronSetTopologyModifier ()
virtual ~TetrahedronSetTopologyModifier ()
virtual void init ()
 Initialization method called at graph modification, during bottom-up traversal.
void addTetrahedraWarning (const unsigned int nTetrahedra, const sofa::helper::vector< Tetrahedron > &tetrahedraList, const sofa::helper::vector< unsigned int > &tetrahedraIndexList)
 Sends a message to warn that some tetrahedra were added in this topology.
void addTetrahedraWarning (const unsigned int nTetrahedra, const sofa::helper::vector< Tetrahedron > &tetrahedraList, const sofa::helper::vector< unsigned int > &tetrahedraIndexList, 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 tetrahedra were added in this topology.
void addTetrahedronProcess (Tetrahedron e)
 Add a tetrahedron.
virtual void addTetrahedraProcess (const sofa::helper::vector< Tetrahedron > &tetrahedra)
 Actually Add some tetrahedra to this topology.
void removeTetrahedraWarning (sofa::helper::vector< unsigned int > &tetrahedra)
 Sends a message to warn that some tetrahedra are about to be deleted.
virtual void removeTetrahedraProcess (const sofa::helper::vector< unsigned int > &indices, const bool removeIsolatedItems=false)
 Remove a subset of tetrahedra.
virtual void addTrianglesProcess (const sofa::helper::vector< Triangle > &triangles)
 Actually Add some triangles to this topology.
virtual void removeTrianglesProcess (const sofa::helper::vector< unsigned int > &indices, const bool removeIsolatedEdges=false, const bool removeIsolatedPoints=false)
 Remove a subset of triangles.
virtual 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 > &, const bool renumberDOF=true)
 Reorder this topology.
virtual void removeTetrahedra (sofa::helper::vector< unsigned int > &tetrahedra)
 Remove a set of tetrahedra.
virtual void removeItems (sofa::helper::vector< unsigned int > &items)
 Generic method to remove a list of items.
void RemoveTetraBall (unsigned int ind_ta, unsigned int ind_tb)
 Removes all tetrahedra in the ball of center "ind_ta" and of radius dist(ind_ta, ind_tb).
virtual void renumberPoints (const sofa::helper::vector< unsigned int > &, const sofa::helper::vector< unsigned int > &)
 Generic method for points renumbering.

Private Attributes

TetrahedronSetTopologyContainer * m_container

Detailed Description

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

Definition at line 57 of file TetrahedronSetTopologyModifier.h.


Constructor & Destructor Documentation

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

Definition at line 60 of file TetrahedronSetTopologyModifier.h.

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

Definition at line 64 of file TetrahedronSetTopologyModifier.h.


Member Function Documentation

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

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

void sofa::component::topology::TetrahedronSetTopologyModifier::addTetrahedraProcess ( const sofa::helper::vector< Tetrahedron > &  tetrahedra  )  [virtual]

Actually Add some tetrahedra to this topology.

See also:
addTetrahedraWarning

Definition at line 147 of file TetrahedronSetTopologyModifier.cpp.

References addTetrahedronProcess().

void sofa::component::topology::TetrahedronSetTopologyModifier::addTetrahedraWarning ( const unsigned int  nTetrahedra,
const sofa::helper::vector< Tetrahedron > &  tetrahedraList,
const sofa::helper::vector< unsigned int > &  tetrahedraIndexList,
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 tetrahedra were added in this topology.

See also:
addTetrahedraProcess

Definition at line 166 of file TetrahedronSetTopologyModifier.cpp.

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

void sofa::component::topology::TetrahedronSetTopologyModifier::addTetrahedraWarning ( const unsigned int  nTetrahedra,
const sofa::helper::vector< Tetrahedron > &  tetrahedraList,
const sofa::helper::vector< unsigned int > &  tetrahedraIndexList 
)

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

See also:
addTetrahedraProcess

Definition at line 156 of file TetrahedronSetTopologyModifier.cpp.

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

void sofa::component::topology::TetrahedronSetTopologyModifier::addTetrahedronProcess ( Tetrahedron  e  ) 

void sofa::component::topology::TetrahedronSetTopologyModifier::addTrianglesProcess ( const sofa::helper::vector< Triangle > &  triangles  )  [virtual]

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

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

Reimplemented from sofa::component::topology::TriangleSetTopologyModifier.

Definition at line 52 of file TetrahedronSetTopologyModifier.cpp.

References sofa::core::objectmodel::BaseContext::get(), sofa::core::objectmodel::BaseObject::getContext(), and m_container.

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

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

Generic method to remove a list of items.

Reimplemented from sofa::component::topology::TriangleSetTopologyModifier.

Definition at line 514 of file TetrahedronSetTopologyModifier.cpp.

References removeTetrahedra().

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

Remove a subset of points.

Elements corresponding to these points are removed form 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::TriangleSetTopologyModifier.

Definition at line 375 of file TetrahedronSetTopologyModifier.cpp.

References sofa::component::topology::TetrahedronSetTopologyContainer::createTetrahedronVertexShellArray(), sofa::component::topology::PointSetTopologyContainer::getNbPoints(), sofa::component::topology::TetrahedronSetTopologyContainer::getVertexIndexInTetrahedron(), sofa::component::topology::TetrahedronSetTopologyContainer::hasTetrahedra(), sofa::component::topology::TetrahedronSetTopologyContainer::hasTetrahedronVertexShell(), m_container, sofa::component::topology::TetrahedronSetTopologyContainer::m_tetrahedron, and sofa::component::topology::TetrahedronSetTopologyContainer::m_tetrahedronVertexShell.

Referenced by removeTetrahedraProcess().

void sofa::component::topology::TetrahedronSetTopologyModifier::RemoveTetraBall ( unsigned int  ind_ta,
unsigned int  ind_tb 
)

Removes all tetrahedra in the ball of center "ind_ta" and of radius dist(ind_ta, ind_tb).

void sofa::component::topology::TetrahedronSetTopologyModifier::removeTetrahedra ( sofa::helper::vector< unsigned int > &  tetrahedra  )  [virtual]

Remove a set of tetrahedra.

Parameters:
tetrahedra an array of tetrahedron indices to be removed (note that the array is not const since it needs to be sorted)

Definition at line 501 of file TetrahedronSetTopologyModifier.cpp.

References sofa::component::topology::TetrahedronSetTopologyContainer::checkTopology(), m_container, sofa::component::topology::PointSetTopologyModifier::propagateTopologicalChanges(), removeTetrahedraProcess(), and removeTetrahedraWarning().

Referenced by sofa::component::collision::CarvingManager::doCarve(), and removeItems().

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

Remove a subset of tetrahedra.

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

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

See also:
removeTetrahedraWarning
Parameters:
removeIsolatedItems if true remove isolated triangles, edges and vertices

warn that triangles will be deleted

warn that edges will be deleted

actually remove triangles without looking for isolated vertices

actually remove edges without looking for isolated vertices

Definition at line 189 of file TetrahedronSetTopologyModifier.cpp.

References sofa::component::topology::TetrahedronSetTopologyContainer::createTetrahedronEdgeShellArray(), sofa::component::topology::TetrahedronSetTopologyContainer::createTetrahedronTriangleShellArray(), sofa::component::topology::TetrahedronSetTopologyContainer::createTetrahedronVertexShellArray(), sofa::component::topology::TetrahedronSetTopologyContainer::getNumberOfTetrahedra(), sofa::component::topology::EdgeSetTopologyContainer::hasEdges(), sofa::component::topology::TetrahedronSetTopologyContainer::hasTetrahedra(), sofa::component::topology::TetrahedronSetTopologyContainer::hasTetrahedronEdges(), sofa::component::topology::TetrahedronSetTopologyContainer::hasTetrahedronEdgeShell(), sofa::component::topology::TetrahedronSetTopologyContainer::hasTetrahedronTriangles(), sofa::component::topology::TetrahedronSetTopologyContainer::hasTetrahedronTriangleShell(), sofa::component::topology::TetrahedronSetTopologyContainer::hasTetrahedronVertexShell(), sofa::component::topology::TriangleSetTopologyContainer::hasTriangles(), m_container, sofa::component::topology::TetrahedronSetTopologyContainer::m_tetrahedron, sofa::component::topology::TetrahedronSetTopologyContainer::m_tetrahedronEdge, sofa::component::topology::TetrahedronSetTopologyContainer::m_tetrahedronEdgeShell, sofa::component::topology::TetrahedronSetTopologyContainer::m_tetrahedronTriangle, sofa::component::topology::TetrahedronSetTopologyContainer::m_tetrahedronTriangleShell, sofa::component::topology::TetrahedronSetTopologyContainer::m_tetrahedronVertexShell, sofa::component::topology::PointSetTopologyModifier::propagateTopologicalChanges(), removeEdgesProcess(), sofa::component::topology::EdgeSetTopologyModifier::removeEdgesWarning(), removePointsProcess(), sofa::component::topology::PointSetTopologyModifier::removePointsWarning(), removeTrianglesProcess(), and sofa::component::topology::TriangleSetTopologyModifier::removeTrianglesWarning().

Referenced by removeTetrahedra().

void sofa::component::topology::TetrahedronSetTopologyModifier::removeTetrahedraWarning ( sofa::helper::vector< unsigned int > &  tetrahedra  ) 

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

See also:
removeTetrahedraProcess
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 178 of file TetrahedronSetTopologyModifier.cpp.

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

Referenced by removeTetrahedra().

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

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

void sofa::component::topology::TetrahedronSetTopologyModifier::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:39 2008 for Sofa by  doxygen 1.5.7.1