sofa::component::topology::ManifoldEdgeSetTopologyModifier Class Reference

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

#include <ManifoldEdgeSetTopologyModifier.h>

Inheritance diagram for sofa::component::topology::ManifoldEdgeSetTopologyModifier:

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

Collaboration graph
[legend]

Public Member Functions

 ManifoldEdgeSetTopologyModifier ()
virtual ~ManifoldEdgeSetTopologyModifier ()
virtual void init ()
 Initialization method called at graph modification, during bottom-up traversal.
void addEdgeProcess (Edge e)
 Add an edge.
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)
 Effectively Remove a subset of edges.
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.

Private Attributes

ManifoldEdgeSetTopologyContainer * m_container

Detailed Description

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

Definition at line 49 of file ManifoldEdgeSetTopologyModifier.h.


Constructor & Destructor Documentation

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

Definition at line 52 of file ManifoldEdgeSetTopologyModifier.h.

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

Definition at line 56 of file ManifoldEdgeSetTopologyModifier.h.


Member Function Documentation

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

void sofa::component::topology::ManifoldEdgeSetTopologyModifier::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 from sofa::component::topology::EdgeSetTopologyModifier.

Definition at line 131 of file ManifoldEdgeSetTopologyModifier.cpp.

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

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

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

void sofa::component::topology::ManifoldEdgeSetTopologyModifier::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 from sofa::component::topology::EdgeSetTopologyModifier.

Definition at line 161 of file ManifoldEdgeSetTopologyModifier.cpp.

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

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

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

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

Definition at line 50 of file ManifoldEdgeSetTopologyModifier.cpp.

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

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

Remove a set of edges.

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

add the topological changes in the queue

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

Definition at line 78 of file ManifoldEdgeSetTopologyModifier.cpp.

References sofa::component::topology::ManifoldEdgeSetTopologyContainer::checkTopology(), m_container, sofa::component::topology::PointSetTopologyModifier::propagateTopologicalChanges(), removeEdgesProcess(), and sofa::component::topology::EdgeSetTopologyModifier::removeEdgesWarning().

Referenced by removeItems().

void sofa::component::topology::ManifoldEdgeSetTopologyModifier::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 from sofa::component::topology::EdgeSetTopologyModifier.

Definition at line 70 of file ManifoldEdgeSetTopologyModifier.cpp.

References m_container, and sofa::component::topology::ManifoldEdgeSetTopologyContainer::resetConnectedComponent().

Referenced by removeEdges().

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

Generic method to remove a list of items.

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

Definition at line 91 of file ManifoldEdgeSetTopologyModifier.cpp.

References removeEdges().

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

void sofa::component::topology::ManifoldEdgeSetTopologyModifier::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 from sofa::component::topology::EdgeSetTopologyModifier.

Definition at line 174 of file ManifoldEdgeSetTopologyModifier.cpp.

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

void sofa::component::topology::ManifoldEdgeSetTopologyModifier::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 from sofa::component::topology::EdgeSetTopologyModifier.

Definition at line 167 of file ManifoldEdgeSetTopologyModifier.cpp.

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

void sofa::component::topology::ManifoldEdgeSetTopologyModifier::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 from sofa::component::topology::EdgeSetTopologyModifier.

Definition at line 154 of file ManifoldEdgeSetTopologyModifier.cpp.

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


Field Documentation


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

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