SOFA API  c76874b7
Open source framework for multi-physics simuation
sofa::component::topology::PointSetTopologyModifier Class Reference

#include <PointSetTopologyModifier.h>

Inheritance diagram for sofa::component::topology::PointSetTopologyModifier:

Detailed Description

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

Public Attributes

Data< boold_propagateToDOF
 propagate changes to Mechanical object DOFs More...
 

Public Member Functions

 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 addPointsProcess (const size_t nPoints)
 Extend the point container storage by nPoints. 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...
 
virtual void removePointsProcess (const sofa::helper::vector< PointID > &indices, const bool removeDOF=true)
 Remove a subset of points. More...
 
virtual 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)
 move input points indices to input new coords. Also propagate event 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...
 
virtual void renumberPointsProcess (const sofa::helper::vector< PointID > &index, const sofa::helper::vector< PointID > &, const bool renumberDOF=true)
 Reorder this topology. 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...
 
virtual void propagateTopologicalEngineChanges ()
 function to propagate topological change events by parsing the list of topologyEngines linked to this topology. TODO: temporary duplication of topological events (commented by default) 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...
 
virtual void renumberPoints (const sofa::helper::vector< PointID > &, const sofa::helper::vector< PointID > &)
 Generic method for points renumbering. More...
 

Protected Member Functions

 PointSetTopologyModifier ()
 
 ~PointSetTopologyModifier () override
 

Attribute details

Data<bool> sofa::component::topology::PointSetTopologyModifier::d_propagateToDOF

propagate changes to Mechanical object DOFs

Constructor details

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

Function details

void sofa::component::topology::PointSetTopologyModifier::addPoints ( const size_t  nPoints,
const bool  addDOF = true 
)
virtual

Add a set of points.

See also
addPoints
virtual void sofa::component::topology::PointSetTopologyModifier::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 
)
virtual

Add a set of points.

See also
addPoints
void sofa::component::topology::PointSetTopologyModifier::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.

See also
addPoints
void sofa::component::topology::PointSetTopologyModifier::addPointsWarning ( const size_t  nPoints,
const bool  addDOF = true 
)

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

See also
addPointsProcess
void sofa::component::topology::PointSetTopologyModifier::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.

See also
addPointsProcess
void sofa::component::topology::PointSetTopologyModifier::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.

See also
addPointsProcess
void sofa::component::topology::PointSetTopologyModifier::init ( void  )
override
void sofa::component::topology::PointSetTopologyModifier::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 
)
virtual

move input points indices to input new coords. Also propagate event

Parameters
id: list of indices to move
ancestors list of ancestors to define relative new position
coefs: barycoef to locate new coord relatively to ancestors. bool allowing the move (default true)

Reimplemented in sofa::component::topology::EdgeSetTopologyModifier, and sofa::component::topology::TriangleSetTopologyModifier.

void sofa::component::topology::PointSetTopologyModifier::notifyEndingEvent ( )
override

the end for the current sequence of topological change events.

void sofa::component::topology::PointSetTopologyModifier::propagateStateChanges ( )
override

Called by a topology to warn the Mechanical Object component that points have been added or will be removed.

StateChangeList should contain all TopologyChange objects corresponding to vertex changes in this topology that just happened (in the case of creation) or are about to happen (in the case of destruction) since last call to propagateTopologicalChanges.

See also
beginChange()
endChange()
void sofa::component::topology::PointSetTopologyModifier::propagateTopologicalChanges ( )
override

Called by a topology to warn specific topologies linked to it that TopologyChange objects happened.

ChangeList should contain all TopologyChange objects corresponding to changes in this topology that just happened (in the case of creation) or are about to happen (in the case of destruction) since last call to propagateTopologicalChanges.

See also
beginChange()
endChange()
void sofa::component::topology::PointSetTopologyModifier::propagateTopologicalChangesWithoutReset ( )

TODO: doc ??

void sofa::component::topology::PointSetTopologyModifier::propagateTopologicalEngineChanges ( )
virtual

function to propagate topological change events by parsing the list of topologyEngines linked to this topology. TODO: temporary duplication of topological events (commented by default)

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

void sofa::component::topology::PointSetTopologyModifier::removeItems ( const sofa::helper::vector< PointID > &  )
inlineoverride

Generic method to remove a list of items.

void sofa::component::topology::PointSetTopologyModifier::removePointsProcess ( const sofa::helper::vector< PointID > &  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
Parameters
indicesis not const because it is actually sorted from the highest index to the lowest one.
removeDOFif true the points are actually deleted from the mechanical object's state vectors

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

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

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

See also
removePointsProcess
void sofa::component::topology::PointSetTopologyModifier::renumberPointsProcess ( const sofa::helper::vector< PointID > &  index,
const sofa::helper::vector< PointID > &  ,
const bool  renumberDOF = true 
)
virtual

Reorder this topology.

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

See also
MechanicalObject::renumberValues

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

void sofa::component::topology::PointSetTopologyModifier::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.

See also
renumberPointsProcess
sofa::component::topology::PointSetTopologyModifier::SOFA_CLASS ( PointSetTopologyModifier  ,
core::topology::TopologyModifier   
)
void sofa::component::topology::PointSetTopologyModifier::swapPoints ( const int  i1,
const int  i2 
)
virtual

Swap points i1 and i2.