sofa::component::topology::EdgeSetTopologyModifier Class Reference

A class that can apply basic transformations on a set of edges. More...

#include <EdgeSetTopologyModifier.h>

Inheritance diagram for sofa::component::topology::EdgeSetTopologyModifier:

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

Collaboration graph
[legend]

Public Member Functions

 EdgeSetTopologyModifier ()
virtual ~EdgeSetTopologyModifier ()
virtual void init ()
 Initialization method called at graph modification, during bottom-up traversal.
virtual void addEdgesWarning (const unsigned int nEdges)
 Sends a message to warn that some edges were added in this topology.
virtual void addEdgesWarning (const unsigned int nEdges, const sofa::helper::vector< Edge > &edgesList, const sofa::helper::vector< unsigned int > &edgesIndexList)
 Sends a message to warn that some edges were added in this topology.
virtual void addEdgesWarning (const unsigned int nEdges, const sofa::helper::vector< Edge > &edgesList, const sofa::helper::vector< unsigned int > &edgesIndexList, const sofa::helper::vector< sofa::helper::vector< unsigned int > > &ancestors)
 Sends a message to warn that some edges were added in this topology.
virtual void addEdgesWarning (const unsigned int nEdges, const sofa::helper::vector< Edge > &edgesList, const sofa::helper::vector< unsigned int > &edgesIndexList, 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 edges were added in this topology.
void addEdgeProcess (Edge e)
 Add an edge.
virtual void addEdgesProcess (const sofa::helper::vector< Edge > &edges)
 Add some edges to this topology.
virtual void removeEdgesWarning (sofa::helper::vector< unsigned int > &edges)
 Sends a message to warn that some edges are about to be deleted.
virtual void removeEdgesProcess (const sofa::helper::vector< unsigned int > &indices, const bool removeIsolatedItems=false)
 Effectively Remove a subset of edges.
virtual void swapEdgesProcess (const sofa::helper::vector< sofa::helper::vector< unsigned int > > &edgesPairs)
 Swap the edges.
virtual void fuseEdgesProcess (const sofa::helper::vector< sofa::helper::vector< unsigned int > > &edgesPairs, const bool removeIsolatedPoints=true)
 Fuse the edges.
virtual void splitEdgesProcess (sofa::helper::vector< unsigned int > &indices, const bool removeIsolatedPoints=true)
 Split the edges.
virtual void splitEdgesProcess (sofa::helper::vector< unsigned int > &indices, const sofa::helper::vector< sofa::helper::vector< double > > &baryCoefs, const bool removeIsolatedPoints=true)
 Split the 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 removeEdges (sofa::helper::vector< unsigned int > &edges, const bool removeIsolatedPoints=true)
 Remove a set of edges.
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.
virtual void addEdges (const sofa::helper::vector< Edge > &edges)
 add a set of edges
virtual void addEdges (const sofa::helper::vector< Edge > &edges, const sofa::helper::vector< sofa::helper::vector< unsigned int > > &ancestors, const sofa::helper::vector< sofa::helper::vector< double > > &baryCoefs)
 add a set of edges
virtual void swapEdges (const sofa::helper::vector< sofa::helper::vector< unsigned int > > &edgesPairs)
 Swap a list of pair edges, replacing each edge pair ((p11, p12), (p21, p22)) by the edge pair ((p11, p21), (p12, p22)).
virtual void fuseEdges (const sofa::helper::vector< sofa::helper::vector< unsigned int > > &edgesPairs, const bool removeIsolatedPoints=true)
 Fuse a list of pair edges, replacing each edge pair ((p11, p12), (p21, p22)) by one edge (p11, p22).
virtual void splitEdges (sofa::helper::vector< unsigned int > &indices, const bool removeIsolatedPoints=true)
 Split an array of edges, replacing each edge (p1, p2) by two edges (p1, p3) and (p3, p2) where p3 is the new vertex On each edge, a vertex is created based on its barycentric coordinates.
virtual void splitEdges (sofa::helper::vector< unsigned int > &indices, const sofa::helper::vector< sofa::helper::vector< double > > &baryCoefs, const bool removeIsolatedPoints=true)
 Split an array of edges, replacing each edge (p1, p2) by two edges (p1, p3) and (p3, p2) where p3 is the new vertex On each edge, a vertex is created based on its barycentric coordinates.
virtual void resortCuthillMckee (sofa::helper::vector< int > &inverse_permutation)
 Gives the optimal vertex permutation according to the Reverse CuthillMckee algorithm (use BOOST GRAPH LIBRAIRY).

Private Attributes

EdgeSetTopologyContainer * m_container

Detailed Description

A class that can apply basic transformations on a set of edges.

Definition at line 49 of file EdgeSetTopologyModifier.h.


Constructor & Destructor Documentation

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

Definition at line 52 of file EdgeSetTopologyModifier.h.

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

Definition at line 56 of file EdgeSetTopologyModifier.h.


Member Function Documentation

void sofa::component::topology::EdgeSetTopologyModifier::addEdgeProcess ( Edge  e  ) 

void sofa::component::topology::EdgeSetTopologyModifier::addEdges ( const sofa::helper::vector< Edge > &  edges,
const sofa::helper::vector< sofa::helper::vector< unsigned int > > &  ancestors,
const sofa::helper::vector< sofa::helper::vector< double > > &  baryCoefs 
) [virtual]

add a set of edges

Parameters:
edges an array of pair of vertex indices describing the edge to be created
ancestors for each edge to be created provides an array of edge ancestors (optional)
baryCoefs for each edge provides the barycentric coordinates (sum to 1) associated with each ancestor (optional)

actually add edges in the topology container

Reimplemented in sofa::component::topology::ManifoldEdgeSetTopologyModifier.

Definition at line 621 of file EdgeSetTopologyModifier.cpp.

References addEdgesProcess(), addEdgesWarning(), sofa::component::topology::EdgeSetTopologyContainer::getNumberOfEdges(), m_container, and sofa::component::topology::PointSetTopologyModifier::propagateTopologicalChanges().

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

add a set of edges

Parameters:
edges an array of pair of vertex indices describing the edge to be created

actually add edges in the topology container

Reimplemented in sofa::component::topology::ManifoldEdgeSetTopologyModifier.

Definition at line 599 of file EdgeSetTopologyModifier.cpp.

References addEdgesProcess(), addEdgesWarning(), sofa::component::topology::EdgeSetTopologyContainer::getNumberOfEdges(), m_container, and sofa::component::topology::PointSetTopologyModifier::propagateTopologicalChanges().

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

void sofa::component::topology::EdgeSetTopologyModifier::addEdgesWarning ( const unsigned int  nEdges,
const sofa::helper::vector< Edge > &  edgesList,
const sofa::helper::vector< unsigned int > &  edgesIndexList,
const sofa::helper::vector< sofa::helper::vector< unsigned int > > &  ancestors,
const sofa::helper::vector< sofa::helper::vector< double > > &  baryCoefs 
) [virtual]

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

See also:
addEdgesProcess

Reimplemented in sofa::component::topology::TriangleSetTopologyModifier.

Definition at line 147 of file EdgeSetTopologyModifier.cpp.

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

void sofa::component::topology::EdgeSetTopologyModifier::addEdgesWarning ( const unsigned int  nEdges,
const sofa::helper::vector< Edge > &  edgesList,
const sofa::helper::vector< unsigned int > &  edgesIndexList,
const sofa::helper::vector< sofa::helper::vector< unsigned int > > &  ancestors 
) [virtual]

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

See also:
addEdgesProcess

Definition at line 136 of file EdgeSetTopologyModifier.cpp.

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

void sofa::component::topology::EdgeSetTopologyModifier::addEdgesWarning ( const unsigned int  nEdges,
const sofa::helper::vector< Edge > &  edgesList,
const sofa::helper::vector< unsigned int > &  edgesIndexList 
) [virtual]

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

See also:
addEdgesProcess

Reimplemented in sofa::component::topology::TriangleSetTopologyModifier.

Definition at line 126 of file EdgeSetTopologyModifier.cpp.

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

void sofa::component::topology::EdgeSetTopologyModifier::addEdgesWarning ( const unsigned int  nEdges  )  [virtual]

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

void sofa::component::topology::EdgeSetTopologyModifier::fuseEdges ( const sofa::helper::vector< sofa::helper::vector< unsigned int > > &  edgesPairs,
const bool  removeIsolatedPoints = true 
) [virtual]

Fuse a list of pair edges, replacing each edge pair ((p11, p12), (p21, p22)) by one edge (p11, p22).

Parameters:
removeIsolatedPoints if true isolated vertices are also removed

Reimplemented in sofa::component::topology::ManifoldEdgeSetTopologyModifier.

Definition at line 651 of file EdgeSetTopologyModifier.cpp.

References sofa::component::topology::EdgeSetTopologyContainer::checkTopology(), fuseEdgesProcess(), and m_container.

Referenced by sofa::component::controller::EdgeSetController< DataTypes >::modifyTopology().

void sofa::component::topology::EdgeSetTopologyModifier::fuseEdgesProcess ( const sofa::helper::vector< sofa::helper::vector< unsigned int > > &  edgesPairs,
const bool  removeIsolatedPoints = true 
) [virtual]

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

void sofa::component::topology::EdgeSetTopologyModifier::removeEdges ( sofa::helper::vector< unsigned int > &  edges,
const bool  removeIsolatedPoints = true 
) [virtual]

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

Effectively Remove a subset of edges.

Eventually remove isolated vertices

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

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

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

Parameters:
removeIsolatedItems if true isolated vertices are also removed

Reimplemented in sofa::component::topology::HexahedronSetTopologyModifier, sofa::component::topology::ManifoldEdgeSetTopologyModifier, sofa::component::topology::QuadSetTopologyModifier, sofa::component::topology::TetrahedronSetTopologyModifier, and sofa::component::topology::TriangleSetTopologyModifier.

Definition at line 170 of file EdgeSetTopologyModifier.cpp.

References sofa::component::topology::EdgeSetTopologyContainer::createEdgeVertexShellArray(), sofa::component::topology::EdgeSetTopologyContainer::getNumberOfEdges(), sofa::component::topology::EdgeSetTopologyContainer::hasEdges(), sofa::component::topology::EdgeSetTopologyContainer::hasEdgeVertexShell(), m_container, sofa::component::topology::EdgeSetTopologyContainer::m_edge, sofa::component::topology::EdgeSetTopologyContainer::m_edgeVertexShell, sofa::component::topology::PointSetTopologyModifier::propagateTopologicalChanges(), sofa::helper::remove(), removePointsProcess(), and sofa::component::topology::PointSetTopologyModifier::removePointsWarning().

Referenced by fuseEdgesProcess(), removeEdges(), splitEdgesProcess(), and swapEdgesProcess().

void sofa::component::topology::EdgeSetTopologyModifier::removeEdgesWarning ( sofa::helper::vector< unsigned int > &  edges  )  [virtual]

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

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

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

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

void sofa::component::topology::EdgeSetTopologyModifier::resortCuthillMckee ( sofa::helper::vector< int > &  inverse_permutation  )  [virtual]

Gives the optimal vertex permutation according to the Reverse CuthillMckee algorithm (use BOOST GRAPH LIBRAIRY).

Definition at line 673 of file EdgeSetTopologyModifier.cpp.

References sofa::component::topology::EdgeSetTopologyContainer::getEdgeArray(), and m_container.

void sofa::component::topology::EdgeSetTopologyModifier::splitEdges ( sofa::helper::vector< unsigned int > &  indices,
const sofa::helper::vector< sofa::helper::vector< double > > &  baryCoefs,
const bool  removeIsolatedPoints = true 
) [virtual]

Split an array of edges, replacing each edge (p1, p2) by two edges (p1, p3) and (p3, p2) where p3 is the new vertex On each edge, a vertex is created based on its barycentric coordinates.

Parameters:
removeIsolatedPoints if true isolated vertices are also removed

Reimplemented in sofa::component::topology::ManifoldEdgeSetTopologyModifier.

Definition at line 664 of file EdgeSetTopologyModifier.cpp.

References sofa::component::topology::EdgeSetTopologyContainer::checkTopology(), m_container, and splitEdgesProcess().

void sofa::component::topology::EdgeSetTopologyModifier::splitEdges ( sofa::helper::vector< unsigned int > &  indices,
const bool  removeIsolatedPoints = true 
) [virtual]

Split an array of edges, replacing each edge (p1, p2) by two edges (p1, p3) and (p3, p2) where p3 is the new vertex On each edge, a vertex is created based on its barycentric coordinates.

Parameters:
removeIsolatedPoints if true isolated vertices are also removed

Reimplemented in sofa::component::topology::ManifoldEdgeSetTopologyModifier.

Definition at line 657 of file EdgeSetTopologyModifier.cpp.

References sofa::component::topology::EdgeSetTopologyContainer::checkTopology(), m_container, and splitEdgesProcess().

Referenced by sofa::component::controller::EdgeSetController< DataTypes >::modifyTopology().

void sofa::component::topology::EdgeSetTopologyModifier::splitEdgesProcess ( sofa::helper::vector< unsigned int > &  indices,
const sofa::helper::vector< sofa::helper::vector< double > > &  baryCoefs,
const bool  removeIsolatedPoints = true 
) [virtual]

void sofa::component::topology::EdgeSetTopologyModifier::splitEdgesProcess ( sofa::helper::vector< unsigned int > &  indices,
const bool  removeIsolatedPoints = true 
) [virtual]

void sofa::component::topology::EdgeSetTopologyModifier::swapEdges ( const sofa::helper::vector< sofa::helper::vector< unsigned int > > &  edgesPairs  )  [virtual]

Swap a list of pair edges, replacing each edge pair ((p11, p12), (p21, p22)) by the edge pair ((p11, p21), (p12, p22)).

Reimplemented in sofa::component::topology::ManifoldEdgeSetTopologyModifier.

Definition at line 645 of file EdgeSetTopologyModifier.cpp.

References sofa::component::topology::EdgeSetTopologyContainer::checkTopology(), m_container, and swapEdgesProcess().

void sofa::component::topology::EdgeSetTopologyModifier::swapEdgesProcess ( const sofa::helper::vector< sofa::helper::vector< unsigned int > > &  edgesPairs  )  [virtual]


Field Documentation


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

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