SOFA API  d5b6f761
Open source framework for multi-physics simuation
sofa::gui::component::performer::TopologicalChangeManager Class Reference

#include <TopologicalChangeManager.h>

a class to manage the handling of topological changes which have been requested from the Collision Model More...

Detailed Description

a class to manage the handling of topological changes which have been requested from the Collision Model

Public Member Functions

 TopologicalChangeManager ()
 
 ~TopologicalChangeManager ()
 
Index removeItemsFromCollisionModel (sofa::core::CollisionElementIterator) const
 Handles Removing of topological element (from any type of topology) More...
 
Index removeItemsFromCollisionModel (sofa::core::CollisionModel *model, const Index &index) const
 
Index removeItemsFromCollisionModel (sofa::core::CollisionModel *model, const type::vector< Index > &indices) const
 
bool incisionCollisionModel (sofa::core::CollisionElementIterator elem, sofa::type::Vec3 &pos, bool firstInput, int snapingValue=0, int snapingBorderValue=0)
 
bool incisionCollisionModel (sofa::core::CollisionModel *model1, Index idx1, const sofa::type::Vec3 &firstPoint, sofa::core::CollisionModel *model2, Index idx2, const sofa::type::Vec3 &secondPoint, int snapingValue=0, int snapingBorderValue=0)
 
void setIncisionFirstCut (bool isFirstCut)
 

Constructor details

◆ TopologicalChangeManager()

sofa::gui::component::performer::TopologicalChangeManager::TopologicalChangeManager ( )

◆ ~TopologicalChangeManager()

sofa::gui::component::performer::TopologicalChangeManager::~TopologicalChangeManager ( )

Function details

◆ incisionCollisionModel() [1/2]

bool sofa::gui::component::performer::TopologicalChangeManager::incisionCollisionModel ( sofa::core::CollisionElementIterator  elem,
sofa::type::Vec3 pos,
bool  firstInput,
int  snapingValue = 0,
int  snapingBorderValue = 0 
)

Handles Cutting (activated only for a triangular topology)

Only one model is given. This function perform incision beetween input point and stocked informations. If it is the first point of the incision, these informations are stocked. i.e element index and picked point coordinates.

See also
incisionTriangleSetTopology
Parameters
elem- iterator to collision model.
pos- picked point coordinates.
firstInput- bool, if yes this is the first incision point.
snapingValue- threshold distance from point to incision path where point has to be snap on incision path.
snapingBorderValue- threshold distance from point to mesh border where incision is considered to reach the border..
Returns
bool - true if incision has been performed.

◆ incisionCollisionModel() [2/2]

bool sofa::gui::component::performer::TopologicalChangeManager::incisionCollisionModel ( sofa::core::CollisionModel model1,
Index  idx1,
const sofa::type::Vec3 firstPoint,
sofa::core::CollisionModel model2,
Index  idx2,
const sofa::type::Vec3 secondPoint,
int  snapingValue = 0,
int  snapingBorderValue = 0 
)

Handles Cutting for general model collision (activated only for a triangular topology for the moment).

Given two collision model, perform an incision between two points.

See also
incisionTriangleSetTopology
Parameters
model1- first collision model.
idx1- first element index.
firstPoint- first picked point coordinates.
model2- second collision model.
idx2- second element index.
secondPoint- second picked point coordinates.
snapingValue- threshold distance from point to incision path where point has to be snap on incision path.
snapingBorderValue- threshold distance from point to mesh border where incision is considered to reach the border..
Returns
bool - true if incision has been performed.

◆ removeItemsFromCollisionModel() [1/3]

Index sofa::gui::component::performer::TopologicalChangeManager::removeItemsFromCollisionModel ( sofa::core::CollisionElementIterator  elem2) const

Handles Removing of topological element (from any type of topology)

◆ removeItemsFromCollisionModel() [2/3]

Index sofa::gui::component::performer::TopologicalChangeManager::removeItemsFromCollisionModel ( sofa::core::CollisionModel model,
const Index index 
) const

◆ removeItemsFromCollisionModel() [3/3]

Index sofa::gui::component::performer::TopologicalChangeManager::removeItemsFromCollisionModel ( sofa::core::CollisionModel model,
const type::vector< Index > &  indices 
) const

◆ setIncisionFirstCut()

void sofa::gui::component::performer::TopologicalChangeManager::setIncisionFirstCut ( bool  isFirstCut)

Sets incision starting parameter - incision is just started or already in course

Parameters
isFirstCut- true if the next incision event will be the first of a new incision