SOFA API  56988ca1
Open source framework for multi-physics simuation
sofa::core::topology::TopologyHandler Class Reference

#include <TopologyHandler.h>

Inheritance diagram for sofa::core::topology::TopologyHandler:

Detailed Description

A class that will interact on a topological Data

Protected Attributes

std::string m_prefix
 use to define engine name. More...
 
std::string m_data_name
 use to define data handled name. More...
 
std::set< sofa::geometry::ElementTypem_registeredElements
 Set to store the information which topology element this handler is linked. I.e in which handler list this handler is registered inside the Topology. More...
 
sofa::core::topology::TopologyContainerm_topology
 
std::map< core::topology::TopologyChangeType, TopologyChangeCallbackm_callbackMap
 
- Protected Attributes inherited from sofa::core::objectmodel::DDGNode
DDGLinkContainer inputs
 
DDGLinkContainer outputs
 

Public Member Functions

virtual void handleTopologyChange ()
 
void update () override
 Update this value. More...
 
virtual void ApplyTopologyChanges (const std::list< const core::topology::TopologyChange * > &_topologyChangeEvents, const Size _dataSize)
 
virtual void ApplyTopologyChange (const core::topology::EndingEvent *)
 
virtual void ApplyTopologyChange (const core::topology::PointsIndicesSwap *)
 
virtual void ApplyTopologyChange (const core::topology::PointsAdded *)
 Apply adding points elements. More...
 
virtual void ApplyTopologyChange (const core::topology::PointsRemoved *)
 Apply removing points elements. More...
 
virtual void ApplyTopologyChange (const core::topology::PointsRenumbering *)
 Apply renumbering on points elements. More...
 
virtual void ApplyTopologyChange (const core::topology::PointsMoved *)
 Apply moving points elements. More...
 
virtual void ApplyTopologyChange (const core::topology::EdgesIndicesSwap *)
 
virtual void ApplyTopologyChange (const core::topology::EdgesAdded *)
 Apply adding edges elements. More...
 
virtual void ApplyTopologyChange (const core::topology::EdgesRemoved *)
 Apply removing edges elements. More...
 
virtual void ApplyTopologyChange (const core::topology::EdgesMoved_Removing *)
 Apply removing function on moved edges elements. More...
 
virtual void ApplyTopologyChange (const core::topology::EdgesMoved_Adding *)
 Apply adding function on moved edges elements. More...
 
virtual void ApplyTopologyChange (const core::topology::EdgesRenumbering *)
 Apply renumbering on edges elements. More...
 
virtual void ApplyTopologyChange (const core::topology::TrianglesIndicesSwap *)
 
virtual void ApplyTopologyChange (const core::topology::TrianglesAdded *)
 Apply adding triangles elements. More...
 
virtual void ApplyTopologyChange (const core::topology::TrianglesRemoved *)
 Apply removing triangles elements. More...
 
virtual void ApplyTopologyChange (const core::topology::TrianglesMoved_Removing *)
 Apply removing function on moved triangles elements. More...
 
virtual void ApplyTopologyChange (const core::topology::TrianglesMoved_Adding *)
 Apply adding function on moved triangles elements. More...
 
virtual void ApplyTopologyChange (const core::topology::TrianglesRenumbering *)
 Apply renumbering on triangles elements. More...
 
virtual void ApplyTopologyChange (const core::topology::QuadsIndicesSwap *)
 
virtual void ApplyTopologyChange (const core::topology::QuadsAdded *)
 Apply adding quads elements. More...
 
virtual void ApplyTopologyChange (const core::topology::QuadsRemoved *)
 Apply removing quads elements. More...
 
virtual void ApplyTopologyChange (const core::topology::QuadsMoved_Removing *)
 Apply removing function on moved quads elements. More...
 
virtual void ApplyTopologyChange (const core::topology::QuadsMoved_Adding *)
 Apply adding function on moved quads elements. More...
 
virtual void ApplyTopologyChange (const core::topology::QuadsRenumbering *)
 Apply renumbering on quads elements. More...
 
virtual void ApplyTopologyChange (const core::topology::TetrahedraIndicesSwap *)
 
virtual void ApplyTopologyChange (const core::topology::TetrahedraAdded *)
 Apply adding tetrahedron elements. More...
 
virtual void ApplyTopologyChange (const core::topology::TetrahedraRemoved *)
 Apply removing tetrahedron elements. More...
 
virtual void ApplyTopologyChange (const core::topology::TetrahedraMoved_Removing *)
 Apply removing function on moved tetrahedron elements. More...
 
virtual void ApplyTopologyChange (const core::topology::TetrahedraMoved_Adding *)
 Apply adding function on moved tetrahedron elements. More...
 
virtual void ApplyTopologyChange (const core::topology::TetrahedraRenumbering *)
 Apply renumbering on tetrahedron elements. More...
 
virtual void ApplyTopologyChange (const core::topology::HexahedraIndicesSwap *)
 
virtual void ApplyTopologyChange (const core::topology::HexahedraAdded *)
 Apply adding hexahedron elements. More...
 
virtual void ApplyTopologyChange (const core::topology::HexahedraRemoved *)
 Apply removing hexahedron elements. More...
 
virtual void ApplyTopologyChange (const core::topology::HexahedraMoved_Removing *)
 Apply removing function on moved hexahedron elements. More...
 
virtual void ApplyTopologyChange (const core::topology::HexahedraMoved_Adding *)
 Apply adding function on moved hexahedron elements. More...
 
virtual void ApplyTopologyChange (const core::topology::HexahedraRenumbering *)
 Apply renumbering on hexahedron elements. More...
 
virtual void ApplyTopologyChange (const TopologyChangeElementInfo< Topology::Point >::EMoved_Adding *)
 
virtual void ApplyTopologyChange (const TopologyChangeElementInfo< Topology::Point >::EMoved_Removing *)
 
virtual void ApplyTopologyChange (const TopologyChangeElementInfo< Topology::Edge >::EMoved *)
 
virtual void ApplyTopologyChange (const TopologyChangeElementInfo< Topology::Triangle >::EMoved *)
 
virtual void ApplyTopologyChange (const TopologyChangeElementInfo< Topology::Quad >::EMoved *)
 
virtual void ApplyTopologyChange (const TopologyChangeElementInfo< Topology::Tetrahedron >::EMoved *)
 
virtual void ApplyTopologyChange (const TopologyChangeElementInfo< Topology::Hexahedron >::EMoved *)
 
void unregisterTopologyHandler ()
 Method to notify that this topologyHandler is not anymore registerd into a Topology Container. More...
 
bool isTopologyHandlerRegistered () const
 Method to get the information if this topologyHandler is registered into a Topology Container. More...
 
size_t getNumberOfTopologicalChanges ()
 
void setNamePrefix (const std::string &s)
 
std::string getName ()
 
virtual bool registerTopology (sofa::core::topology::BaseMeshTopology *_topology, bool printLog=false)
 
void addCallBack (core::topology::TopologyChangeType type, TopologyChangeCallback callback)
 
- Public Member Functions inherited from sofa::core::objectmodel::DDGNode
 DDGNode ()
 Constructor. More...
 
virtual ~DDGNode ()
 Destructor. Automatically remove remaining links. More...
 
void addInput (DDGNode *n)
 Add a new input to this node. More...
 
void delInput (DDGNode *n)
 Remove an input from this node. More...
 
void addOutput (DDGNode *n)
 Add a new output to this node. More...
 
void delOutput (DDGNode *n)
 Remove an output from this node. More...
 
const DDGLinkContainergetInputs ()
 Get the list of inputs for this DDGNode. More...
 
const DDGLinkContainergetOutputs ()
 Get the list of outputs for this DDGNode. More...
 
bool isDirty () const
 Returns true if the DDGNode needs to be updated. More...
 
virtual void setDirtyValue ()
 Indicate the value needs to be updated. More...
 
virtual void setDirtyOutputs ()
 Indicate the outputs needs to be updated. This method must be called after changing the value of this node. More...
 
void cleanDirty ()
 Set dirty flag to false. More...
 
virtual void notifyEndEdit ()
 Notify links that the DGNode has been modified. More...
 
void updateIfDirty () const
 Utility method to call update if necessary. This method should be called before reading of writing the value of this node. More...
 

Protected Member Functions

 TopologyHandler ()
 
- Protected Member Functions inherited from sofa::core::objectmodel::DDGNode
virtual void doAddInput (DDGNode *n)
 
virtual void doDelInput (DDGNode *n)
 
virtual void doAddOutput (DDGNode *n)
 
virtual void doDelOutput (DDGNode *n)
 
void cleanDirtyOutputsOfInputs ()
 the dirtyOutputs flags of all the inputs will be set to false More...
 

Attribute details

◆ m_callbackMap

std::map< core::topology::TopologyChangeType, TopologyChangeCallback> sofa::core::topology::TopologyHandler::m_callbackMap
protected

◆ m_data_name

std::string sofa::core::topology::TopologyHandler::m_data_name
protected

use to define data handled name.

◆ m_prefix

std::string sofa::core::topology::TopologyHandler::m_prefix
protected

use to define engine name.

◆ m_registeredElements

std::set<sofa::geometry::ElementType> sofa::core::topology::TopologyHandler::m_registeredElements
protected

Set to store the information which topology element this handler is linked. I.e in which handler list this handler is registered inside the Topology.

◆ m_topology

sofa::core::topology::TopologyContainer* sofa::core::topology::TopologyHandler::m_topology
protected

Constructor details

◆ TopologyHandler()

sofa::core::topology::TopologyHandler::TopologyHandler ( )
protected

Function details

◆ addCallBack()

void sofa::core::topology::TopologyHandler::addCallBack ( core::topology::TopologyChangeType  type,
TopologyChangeCallback  callback 
)

Method to add a CallBack method to be used when a

See also
core::topology::TopologyChangeType event is fired. The call back should use the @TopologyChangeCallback signature and pass the corresponding core::topology::TopologyChange* structure.

◆ ApplyTopologyChange() [1/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::EdgesAdded )
inlinevirtual

Apply adding edges elements.

◆ ApplyTopologyChange() [2/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::EdgesIndicesSwap )
inlinevirtual

Functions on Edges ////////////////////////////////////// Apply swap between edges indices elements.

◆ ApplyTopologyChange() [3/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::EdgesMoved_Adding )
inlinevirtual

Apply adding function on moved edges elements.

◆ ApplyTopologyChange() [4/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::EdgesMoved_Removing )
inlinevirtual

Apply removing function on moved edges elements.

◆ ApplyTopologyChange() [5/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::EdgesRemoved )
inlinevirtual

Apply removing edges elements.

◆ ApplyTopologyChange() [6/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::EdgesRenumbering )
inlinevirtual

Apply renumbering on edges elements.

◆ ApplyTopologyChange() [7/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::EndingEvent )
inlinevirtual

◆ ApplyTopologyChange() [8/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::HexahedraAdded )
inlinevirtual

Apply adding hexahedron elements.

◆ ApplyTopologyChange() [9/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::HexahedraIndicesSwap )
inlinevirtual

Functions on Hexahedron ////////////////////////////////////// Apply swap between hexahedron indices elements.

◆ ApplyTopologyChange() [10/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::HexahedraMoved_Adding )
inlinevirtual

Apply adding function on moved hexahedron elements.

◆ ApplyTopologyChange() [11/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::HexahedraMoved_Removing )
inlinevirtual

Apply removing function on moved hexahedron elements.

◆ ApplyTopologyChange() [12/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::HexahedraRemoved )
inlinevirtual

Apply removing hexahedron elements.

◆ ApplyTopologyChange() [13/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::HexahedraRenumbering )
inlinevirtual

Apply renumbering on hexahedron elements.

◆ ApplyTopologyChange() [14/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::PointsAdded )
inlinevirtual

Apply adding points elements.

◆ ApplyTopologyChange() [15/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::PointsIndicesSwap )
inlinevirtual

Functions on Points ////////////////////////////////////// Apply swap between point indicPointes elements.

◆ ApplyTopologyChange() [16/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::PointsMoved )
inlinevirtual

Apply moving points elements.

◆ ApplyTopologyChange() [17/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::PointsRemoved )
inlinevirtual

Apply removing points elements.

◆ ApplyTopologyChange() [18/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::PointsRenumbering )
inlinevirtual

Apply renumbering on points elements.

◆ ApplyTopologyChange() [19/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::QuadsAdded )
inlinevirtual

Apply adding quads elements.

◆ ApplyTopologyChange() [20/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::QuadsIndicesSwap )
inlinevirtual

Functions on Quads ////////////////////////////////////// Apply swap between quads indices elements.

◆ ApplyTopologyChange() [21/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::QuadsMoved_Adding )
inlinevirtual

Apply adding function on moved quads elements.

◆ ApplyTopologyChange() [22/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::QuadsMoved_Removing )
inlinevirtual

Apply removing function on moved quads elements.

◆ ApplyTopologyChange() [23/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::QuadsRemoved )
inlinevirtual

Apply removing quads elements.

◆ ApplyTopologyChange() [24/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::QuadsRenumbering )
inlinevirtual

Apply renumbering on quads elements.

◆ ApplyTopologyChange() [25/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::TetrahedraAdded )
inlinevirtual

Apply adding tetrahedron elements.

◆ ApplyTopologyChange() [26/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::TetrahedraIndicesSwap )
inlinevirtual

Functions on Tetrahedron ////////////////////////////////////// Apply swap between tetrahedron indices elements.

◆ ApplyTopologyChange() [27/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::TetrahedraMoved_Adding )
inlinevirtual

Apply adding function on moved tetrahedron elements.

◆ ApplyTopologyChange() [28/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::TetrahedraMoved_Removing )
inlinevirtual

Apply removing function on moved tetrahedron elements.

◆ ApplyTopologyChange() [29/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::TetrahedraRemoved )
inlinevirtual

Apply removing tetrahedron elements.

◆ ApplyTopologyChange() [30/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::TetrahedraRenumbering )
inlinevirtual

Apply renumbering on tetrahedron elements.

◆ ApplyTopologyChange() [31/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::TrianglesAdded )
inlinevirtual

Apply adding triangles elements.

◆ ApplyTopologyChange() [32/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::TrianglesIndicesSwap )
inlinevirtual

Functions on Triangles ////////////////////////////////////// Apply swap between triangles indices elements.

◆ ApplyTopologyChange() [33/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::TrianglesMoved_Adding )
inlinevirtual

Apply adding function on moved triangles elements.

◆ ApplyTopologyChange() [34/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::TrianglesMoved_Removing )
inlinevirtual

Apply removing function on moved triangles elements.

◆ ApplyTopologyChange() [35/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::TrianglesRemoved )
inlinevirtual

Apply removing triangles elements.

◆ ApplyTopologyChange() [36/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const core::topology::TrianglesRenumbering )
inlinevirtual

Apply renumbering on triangles elements.

◆ ApplyTopologyChange() [37/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const TopologyChangeElementInfo< Topology::Edge >::EMoved *  )
inlinevirtual

◆ ApplyTopologyChange() [38/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const TopologyChangeElementInfo< Topology::Hexahedron >::EMoved *  )
inlinevirtual

◆ ApplyTopologyChange() [39/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const TopologyChangeElementInfo< Topology::Point >::EMoved_Adding *  )
inlinevirtual

◆ ApplyTopologyChange() [40/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const TopologyChangeElementInfo< Topology::Point >::EMoved_Removing *  )
inlinevirtual

◆ ApplyTopologyChange() [41/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const TopologyChangeElementInfo< Topology::Quad >::EMoved *  )
inlinevirtual

◆ ApplyTopologyChange() [42/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const TopologyChangeElementInfo< Topology::Tetrahedron >::EMoved *  )
inlinevirtual

◆ ApplyTopologyChange() [43/43]

virtual void sofa::core::topology::TopologyHandler::ApplyTopologyChange ( const TopologyChangeElementInfo< Topology::Triangle >::EMoved *  )
inlinevirtual

◆ ApplyTopologyChanges()

void sofa::core::topology::TopologyHandler::ApplyTopologyChanges ( const std::list< const core::topology::TopologyChange * > &  _topologyChangeEvents,
const Size  _dataSize 
)
virtual

◆ getName()

std::string sofa::core::topology::TopologyHandler::getName ( )
inline

◆ getNumberOfTopologicalChanges()

size_t sofa::core::topology::TopologyHandler::getNumberOfTopologicalChanges ( )

◆ handleTopologyChange()

virtual void sofa::core::topology::TopologyHandler::handleTopologyChange ( )
inlinevirtual

◆ isTopologyHandlerRegistered()

bool sofa::core::topology::TopologyHandler::isTopologyHandlerRegistered ( ) const
inline

Method to get the information if this topologyHandler is registered into a Topology Container.

◆ registerTopology()

bool sofa::core::topology::TopologyHandler::registerTopology ( sofa::core::topology::BaseMeshTopology _topology,
bool  printLog = false 
)
virtual

Function to link the topological Data with the engine and the current topology. And init everything. This function should be used at the end of the all declaration link to this Data while using it in a component.

◆ setNamePrefix()

void sofa::core::topology::TopologyHandler::setNamePrefix ( const std::string &  s)
inline

◆ unregisterTopologyHandler()

void sofa::core::topology::TopologyHandler::unregisterTopologyHandler ( )
inline

Method to notify that this topologyHandler is not anymore registerd into a Topology Container.

◆ update()

void sofa::core::topology::TopologyHandler::update ( )
overridevirtual

Update this value.

Implements sofa::core::objectmodel::DDGNode.