SOFA API  c76874b7
Open source framework for multi-physics simuation
sofa::component::collision::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 ()
 
int removeItemsFromCollisionModel (sofa::core::CollisionElementIterator) const
 Handles Removing of topological element (from any type of topology) More...
 
int removeItemsFromCollisionModel (sofa::core::CollisionModel *model, const int &index) const
 
int removeItemsFromCollisionModel (sofa::core::CollisionModel *model, const helper::vector< int > &indices) const
 
bool incisionCollisionModel (sofa::core::CollisionElementIterator elem, defaulttype::Vector3 &pos, bool firstInput, int snapingValue=0, int snapingBorderValue=0)
 
bool incisionCollisionModel (sofa::core::CollisionModel *model1, unsigned int idx1, const defaulttype::Vector3 &firstPoint, sofa::core::CollisionModel *model2, unsigned int idx2, const defaulttype::Vector3 &secondPoint, int snapingValue=0, int snapingBorderValue=0)
 
void setIncisionFirstCut (bool isFirstCut)
 

Constructor details

sofa::component::collision::TopologicalChangeManager::TopologicalChangeManager ( )
sofa::component::collision::TopologicalChangeManager::~TopologicalChangeManager ( )

Function details

bool sofa::component::collision::TopologicalChangeManager::incisionCollisionModel ( sofa::core::CollisionElementIterator  elem,
defaulttype::Vector3 &  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.
bool sofa::component::collision::TopologicalChangeManager::incisionCollisionModel ( sofa::core::CollisionModel model1,
unsigned int  idx1,
const defaulttype::Vector3 &  firstPoint,
sofa::core::CollisionModel model2,
unsigned int  idx2,
const defaulttype::Vector3 &  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.
int sofa::component::collision::TopologicalChangeManager::removeItemsFromCollisionModel ( sofa::core::CollisionElementIterator  elem2) const

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

int sofa::component::collision::TopologicalChangeManager::removeItemsFromCollisionModel ( sofa::core::CollisionModel model,
const int index 
) const
int sofa::component::collision::TopologicalChangeManager::removeItemsFromCollisionModel ( sofa::core::CollisionModel model,
const helper::vector< int > &  indices 
) const
void sofa::component::collision::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