SOFA API  6a688117
Open source framework for multi-physics simuation
sofa::component::topology::QuadSetTopologyModifier Class Reference

#include <QuadSetTopologyModifier.h>

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

Detailed Description

A class that modifies the topology by adding and removing quads

Public Member Functions

 SOFA_CLASS (QuadSetTopologyModifier, EdgeSetTopologyModifier)
 
void init () override
 
void propagateTopologicalEngineChanges () override
 function to propagate topological change events by parsing the list of topologyEngines linked to this topology. More...
 
virtual void addQuads (const sofa::helper::vector< Quad > &quads)
 add a set of quads More...
 
virtual void addQuads (const sofa::helper::vector< Quad > &quads, const sofa::helper::vector< sofa::helper::vector< QuadID > > &ancestors, const sofa::helper::vector< sofa::helper::vector< double > > &baryCoefs)
 add a set of quads More...
 
void addQuadsWarning (const size_t nQuads, const sofa::helper::vector< Quad > &quadsList, const sofa::helper::vector< QuadID > &quadsIndexList)
 Sends a message to warn that some quads were added in this topology. More...
 
void addQuadsWarning (const size_t nQuads, const sofa::helper::vector< Quad > &quadsList, const sofa::helper::vector< QuadID > &quadsIndexList, const sofa::helper::vector< sofa::helper::vector< QuadID > > &ancestors, const sofa::helper::vector< sofa::helper::vector< double > > &baryCoefs)
 Sends a message to warn that some quads were added in this topology. More...
 
void addQuadProcess (Quad e)
 Effectively Add a quad. More...
 
virtual void addQuadsProcess (const sofa::helper::vector< Quad > &quads)
 Effectively Add some quads to this topology. More...
 
virtual void removeQuadsWarning (sofa::helper::vector< QuadID > &quads)
 Sends a message to warn that some quads are about to be deleted. More...
 
virtual void removeQuadsProcess (const sofa::helper::vector< QuadID > &indices, const bool removeIsolatedEdges=false, const bool removeIsolatedPoints=false)
 Remove a subset of quads. Eventually remove isolated edges and vertices. More...
 
void addEdgesProcess (const sofa::helper::vector< Edge > &edges) override
 Add some edges to this topology. More...
 
void removeEdgesProcess (const sofa::helper::vector< QuadID > &indices, const bool removeIsolatedItems=false) override
 Remove a subset of edges. More...
 
void addPointsProcess (const size_t nPoints) override
 Add some points to this topology. More...
 
void removePointsProcess (const sofa::helper::vector< PointID > &indices, const bool removeDOF=true) override
 Remove a subset of points. More...
 
void renumberPointsProcess (const sofa::helper::vector< PointID > &index, const sofa::helper::vector< PointID > &inv_index, const bool renumberDOF=true) override
 Reorder this topology. More...
 
virtual void removeQuads (const sofa::helper::vector< QuadID > &quadIds, const bool removeIsolatedEdges, const bool removeIsolatedPoints)
 Remove a set of quads. More...
 
void removeItems (const sofa::helper::vector< QuadID > &items) override
 Generic method to remove a list of items. More...
 
void renumberPoints (const sofa::helper::vector< PointID > &index, const sofa::helper::vector< PointID > &inv_index) override
 Generic method for points renumbering. More...
 
- Public Member Functions inherited from sofa::component::topology::EdgeSetTopologyModifier
 SOFA_CLASS (EdgeSetTopologyModifier, PointSetTopologyModifier)
 
void init () override
 
virtual void addEdges (const sofa::helper::vector< Edge > &edges)
 add a set of edges More...
 
virtual void addEdges (const sofa::helper::vector< Edge > &edges, const sofa::helper::vector< sofa::helper::vector< EdgeID > > &ancestors, const sofa::helper::vector< sofa::helper::vector< SReal > > &baryCoefs)
 add a set of edges More...
 
virtual void addEdges (const sofa::helper::vector< Edge > &edges, const sofa::helper::vector< core::topology::EdgeAncestorElem > &ancestorElems)
 add a set of edges More...
 
virtual void addEdgesWarning (const size_t nEdges)
 Sends a message to warn that some edges were added in this topology. More...
 
virtual void addEdgesWarning (const size_t nEdges, const sofa::helper::vector< Edge > &edgesList, const sofa::helper::vector< EdgeID > &edgesIndexList)
 Sends a message to warn that some edges were added in this topology. More...
 
virtual void addEdgesWarning (const size_t nEdges, const sofa::helper::vector< Edge > &edgesList, const sofa::helper::vector< EdgeID > &edgesIndexList, const sofa::helper::vector< sofa::helper::vector< EdgeID > > &ancestors)
 Sends a message to warn that some edges were added in this topology. More...
 
virtual void addEdgesWarning (const size_t nEdges, const sofa::helper::vector< Edge > &edgesList, const sofa::helper::vector< EdgeID > &edgesIndexList, const sofa::helper::vector< sofa::helper::vector< EdgeID > > &ancestors, const sofa::helper::vector< sofa::helper::vector< SReal > > &baryCoefs)
 Sends a message to warn that some edges were added in this topology. More...
 
virtual void addEdgesWarning (const size_t nEdges, const sofa::helper::vector< Edge > &edgesList, const sofa::helper::vector< EdgeID > &edgesIndexList, const sofa::helper::vector< core::topology::EdgeAncestorElem > &ancestorElems)
 Sends a message to warn that some edges were added in this topology. More...
 
void addEdgeProcess (Edge e)
 Effectively add an edge. More...
 
virtual void removeEdgesWarning (sofa::helper::vector< EdgeID > &edges)
 Sends a message to warn that some edges are about to be deleted. More...
 
virtual void swapEdgesProcess (const sofa::helper::vector< sofa::helper::vector< EdgeID > > &edgesPairs)
 Swap the edges. More...
 
virtual void fuseEdgesProcess (const sofa::helper::vector< sofa::helper::vector< EdgeID > > &edgesPairs, const bool removeIsolatedPoints=true)
 Fuse the edges. More...
 
virtual void splitEdgesProcess (sofa::helper::vector< EdgeID > &indices, const bool removeIsolatedPoints=true)
 Split the edges. More...
 
virtual void splitEdgesProcess (sofa::helper::vector< EdgeID > &indices, const sofa::helper::vector< sofa::helper::vector< SReal > > &baryCoefs, const bool removeIsolatedPoints=true)
 Split the edges. More...
 
virtual void removeEdges (const sofa::helper::vector< EdgeID > &edgeIds, const bool removeIsolatedPoints=true, const bool resetTopoChange=true)
 Remove a set of edges. More...
 
void removeItems (const sofa::helper::vector< EdgeID > &items) override
 Generic method to remove a list of items. More...
 
virtual void swapEdges (const sofa::helper::vector< sofa::helper::vector< EdgeID > > &edgesPairs)
 Swap a list of pair edges, replacing each edge pair ((p11, p12), (p21, p22)) by the edge pair ((p11, p21), (p12, p22)) More...
 
virtual void fuseEdges (const sofa::helper::vector< sofa::helper::vector< EdgeID > > &edgesPairs, const bool removeIsolatedPoints=true)
 Fuse a list of pair edges, replacing each edge pair ((p11, p12), (p21, p22)) by one edge (p11, p22) More...
 
virtual void splitEdges (sofa::helper::vector< EdgeID > &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. More...
 
virtual void splitEdges (sofa::helper::vector< EdgeID > &indices, const sofa::helper::vector< sofa::helper::vector< SReal > > &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. More...
 
virtual void resortCuthillMckee (sofa::helper::vector< int > &inverse_permutation)
 Gives the optimal vertex permutation according to the Reverse CuthillMckee algorithm (use BOOST GRAPH LIBRAIRY) More...
 
void movePointsProcess (const sofa::helper::vector< PointID > &id, const sofa::helper::vector< sofa::helper::vector< PointID > > &ancestors, const sofa::helper::vector< sofa::helper::vector< SReal > > &coefs, const bool moveDOF=true) override
 Move input points indices to input new coords. Also propagate event and update edgesAroundVertex for data handling. More...
 
virtual bool removeConnectedComponents (EdgeID elemID)
 Given an element indice, it will remove all the connected component in which this element belongs to. Warning: if there is only one connected component in the model. All the object will be removed. More...
 
virtual bool removeConnectedElements (EdgeID elemID)
 Given an element indice, it will remove all elements directly connected to the input one. More...
 
virtual bool removeIsolatedElements ()
 If several connected components are detected, it will keep only the biggest one and remove all the rest. Warning: if two connected components have the same number of element and are the biggest. It will keep the first one. More...
 
virtual bool removeIsolatedElements (size_t scaleElem)
 If several connected components are detected, it will remove all connected component with less than a given number of elements. More...
 
- Public Member Functions inherited from sofa::component::topology::PointSetTopologyModifier
 SOFA_CLASS (PointSetTopologyModifier, core::topology::TopologyModifier)
 
void init () override
 
virtual void swapPoints (const int i1, const int i2)
 Swap points i1 and i2. More...
 
void addPointsWarning (const size_t nPoints, const bool addDOF=true)
 Sends a message to warn that some points were added in this topology. More...
 
void addPointsWarning (const size_t nPoints, const sofa::helper::vector< sofa::helper::vector< PointID > > &ancestors, const sofa::helper::vector< sofa::helper::vector< SReal > > &coefs, const bool addDOF=true)
 Sends a message to warn that some points were added in this topology. More...
 
void addPointsWarning (const size_t nPoints, const sofa::helper::vector< core::topology::PointAncestorElem > &ancestorElems, const bool addDOF=true)
 Sends a message to warn that some points were added in this topology. More...
 
virtual void addPoints (const size_t nPoints, const bool addDOF=true)
 Add a set of points. More...
 
virtual void addPoints (const size_t nPoints, const sofa::helper::vector< sofa::helper::vector< PointID > > &ancestors, const sofa::helper::vector< sofa::helper::vector< SReal > > &coefs, const bool addDOF=true)
 Add a set of points. More...
 
void addPoints (const size_t nPoints, const sofa::helper::vector< core::topology::PointAncestorElem > &ancestorElems, const bool addDOF=true)
 Add a set of points according to their ancestors topology elements. More...
 
void removePointsWarning (sofa::helper::vector< PointID > &indices, const bool removeDOF=true)
 Sends a message to warn that some points are about to be deleted. More...
 
void renumberPointsWarning (const sofa::helper::vector< PointID > &index, const sofa::helper::vector< PointID > &inv_index, const bool renumberDOF=true)
 Sends a message to warn that points are about to be reordered. More...
 
void propagateTopologicalChanges () override
 Called by a topology to warn specific topologies linked to it that TopologyChange objects happened. More...
 
void propagateTopologicalChangesWithoutReset ()
 TODO: doc ?? More...
 
void propagateStateChanges () override
 Called by a topology to warn the Mechanical Object component that points have been added or will be removed. More...
 
void notifyEndingEvent () override
 
void removeItems (const sofa::helper::vector< PointID > &) override
 Generic method to remove a list of items. More...
 

Protected Member Functions

 QuadSetTopologyModifier ()
 
 ~QuadSetTopologyModifier () override
 
- Protected Member Functions inherited from sofa::component::topology::EdgeSetTopologyModifier
 EdgeSetTopologyModifier ()
 
 ~EdgeSetTopologyModifier () override
 
- Protected Member Functions inherited from sofa::component::topology::PointSetTopologyModifier
 PointSetTopologyModifier ()
 
 ~PointSetTopologyModifier () override
 

Additional Inherited Members

- Public Attributes inherited from sofa::component::topology::PointSetTopologyModifier
Data< boold_propagateToDOF
 propagate changes to Mechanical object DOFs More...
 

Constructor details

sofa::component::topology::QuadSetTopologyModifier::QuadSetTopologyModifier ( )
inlineprotected
sofa::component::topology::QuadSetTopologyModifier::~QuadSetTopologyModifier ( )
inlineoverrideprotected

Function details

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

Add some edges to this topology.

See also
addEdgesWarning

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

void sofa::component::topology::QuadSetTopologyModifier::addPointsProcess ( const size_t  nPoints)
overridevirtual

Add some points to this topology.

See also
addPointsWarning

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

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

Effectively Add a quad.

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

add a set of quads

Parameters
quadsan array of vertex indices describing the quads to be created
void sofa::component::topology::QuadSetTopologyModifier::addQuads ( const sofa::helper::vector< Quad > &  quads,
const sofa::helper::vector< sofa::helper::vector< QuadID > > &  ancestors,
const sofa::helper::vector< sofa::helper::vector< double > > &  baryCoefs 
)
virtual

add a set of quads

Parameters
quadsan array of vertex indices describing the quads to be created
ancestorsfor each quad to be created provides an array of quad ancestors (optional)
baryCoefsfor each quad provides the barycentric coordinates (sum to 1) associated with each ancestor (optional)
void sofa::component::topology::QuadSetTopologyModifier::addQuadsProcess ( const sofa::helper::vector< Quad > &  quads)
virtual

Effectively Add some quads to this topology.

See also
addQuadsWarning

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

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

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

See also
addQuadsProcess
void sofa::component::topology::QuadSetTopologyModifier::addQuadsWarning ( const size_t  nQuads,
const sofa::helper::vector< Quad > &  quadsList,
const sofa::helper::vector< QuadID > &  quadsIndexList,
const sofa::helper::vector< sofa::helper::vector< QuadID > > &  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
void sofa::component::topology::QuadSetTopologyModifier::init ( void  )
override
void sofa::component::topology::QuadSetTopologyModifier::propagateTopologicalEngineChanges ( )
overridevirtual

function to propagate topological change events by parsing the list of topologyEngines linked to this topology.

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

void sofa::component::topology::QuadSetTopologyModifier::removeEdgesProcess ( const sofa::helper::vector< QuadID > &  indices,
const bool  removeIsolatedItems = false 
)
overridevirtual

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
removeIsolatedItemsif 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.

void sofa::component::topology::QuadSetTopologyModifier::removeItems ( const sofa::helper::vector< QuadID > &  items)
override

Generic method to remove a list of items.

void sofa::component::topology::QuadSetTopologyModifier::removePointsProcess ( const sofa::helper::vector< PointID > &  indices,
const bool  removeDOF = true 
)
overridevirtual

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.

void sofa::component::topology::QuadSetTopologyModifier::removeQuads ( const sofa::helper::vector< QuadID > &  quadIds,
const bool  removeIsolatedEdges,
const bool  removeIsolatedPoints 
)
virtual

Remove a set of quads.

Parameters
quadsan array of quad indices to be removed (note that the array is not const since it needs to be sorted)
removeIsolatedEdgesif true isolated edges are also removed
removeIsolatedPointsif true isolated vertices are also removed
void sofa::component::topology::QuadSetTopologyModifier::removeQuadsProcess ( const sofa::helper::vector< QuadID > &  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
removeIsolatedEdgesif true isolated edges are also removed
removeIsolatedPointsif true isolated vertices are also removed

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

void sofa::component::topology::QuadSetTopologyModifier::removeQuadsWarning ( sofa::helper::vector< QuadID > &  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.

void sofa::component::topology::QuadSetTopologyModifier::renumberPoints ( const sofa::helper::vector< PointID > &  index,
const sofa::helper::vector< PointID > &  inv_index 
)
overridevirtual

Generic method for points renumbering.

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

void sofa::component::topology::QuadSetTopologyModifier::renumberPointsProcess ( const sofa::helper::vector< PointID > &  index,
const sofa::helper::vector< PointID > &  inv_index,
const bool  renumberDOF = true 
)
overridevirtual

Reorder this topology.

Important : the points are actually renumbered in the mechanical object's state vectors iff (renumberDOF == true)

See also
MechanicalObject::renumberValues

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

sofa::component::topology::QuadSetTopologyModifier::SOFA_CLASS ( QuadSetTopologyModifier  ,
EdgeSetTopologyModifier   
)