SOFA API  c76874b7
Open source framework for multi-physics simuation
sofa::component::collision::RemovePrimitivePerformer< DataTypes > Class Template Reference

#include <RemovePrimitivePerformer.h>

Inheritance diagram for sofa::component::collision::RemovePrimitivePerformer< DataTypes >:

Detailed Description

template<class DataTypes>
class sofa::component::collision::RemovePrimitivePerformer< DataTypes >

Class to perform removing of topological elements (either one element or a an area) and handling topological mapping

Protected Attributes

BodyPicked picked
 picked structure from mouseInteractor. More...
 
bool firstClick
 bool: true if first click (when removing zone, first clic show zone, second delete it). More...
 
bool surfaceOnVolume
 bool: true if a surface zone is going to be removed on a volumique mesh. More...
 
bool volumeOnSurface
 bool: true if a volumique zone is going to be removed at the surface of a volumique mesh. More...
 
VecIds selectedElem
 vector of element Id concerned by the operation More...
 
- Protected Attributes inherited from sofa::component::collision::RemovePrimitivePerformerConfiguration
int topologicalOperation
 
bool volumicMesh
 
double selectorScale
 

Public Member Functions

 RemovePrimitivePerformer (BaseMouseInteractor *i)
 
 ~RemovePrimitivePerformer ()
 
void start ()
 Functions called by TopologicalOperation performer. More...
 
void execute ()
 
void end ()
 
void draw (const core::visual::VisualParams *vparams)
 
- Public Member Functions inherited from sofa::component::collision::TInteractionPerformer< DataTypes >
 TInteractionPerformer (BaseMouseInteractor *i)
 
- Public Member Functions inherited from sofa::component::collision::InteractionPerformer
 InteractionPerformer (BaseMouseInteractor *i)
 
virtual ~InteractionPerformer ()
 
virtual void configure (configurationsetting::MouseButtonSetting *)
 
virtual void handleEvent (core::objectmodel::Event *)
 
virtual void setPerformerFreeze ()
 
- Public Member Functions inherited from sofa::component::collision::RemovePrimitivePerformerConfiguration
 RemovePrimitivePerformerConfiguration ()
 
void setTopologicalOperation (int m)
 
void setVolumicMesh (bool v)
 
void setScale (double s)
 

Protected Member Functions

bool createElementList ()
 
VecIds getNeighboorElements (VecIds &elementsToTest)
 
VecIds getElementInZone (VecIds &elementsToTest)
 

Additional Inherited Members

- Public Attributes inherited from sofa::component::collision::InteractionPerformer
BaseMouseInteractorinteractor
 
bool freezePerformer
 
- Static Public Member Functions inherited from sofa::component::collision::TInteractionPerformer< DataTypes >
template<class RealObject >
static RealObject * create (RealObject *, BaseMouseInteractor *interactor)
 
- Static Public Member Functions inherited from sofa::component::collision::InteractionPerformer
template<class RealObject >
static RealObject * create (RealObject *, BaseMouseInteractor *interactor)
 

Attribute details

template<class DataTypes >
bool sofa::component::collision::RemovePrimitivePerformer< DataTypes >::firstClick
protected

bool: true if first click (when removing zone, first clic show zone, second delete it).

template<class DataTypes >
BodyPicked sofa::component::collision::RemovePrimitivePerformer< DataTypes >::picked
protected

picked structure from mouseInteractor.

template<class DataTypes >
VecIds sofa::component::collision::RemovePrimitivePerformer< DataTypes >::selectedElem
protected

vector of element Id concerned by the operation

template<class DataTypes >
bool sofa::component::collision::RemovePrimitivePerformer< DataTypes >::surfaceOnVolume
protected

bool: true if a surface zone is going to be removed on a volumique mesh.

template<class DataTypes >
bool sofa::component::collision::RemovePrimitivePerformer< DataTypes >::volumeOnSurface
protected

bool: true if a volumique zone is going to be removed at the surface of a volumique mesh.

Constructor details

template<class DataTypes >
sofa::component::collision::RemovePrimitivePerformer< DataTypes >::~RemovePrimitivePerformer ( )
inline

Function details

template<class DataTypes >
bool sofa::component::collision::RemovePrimitivePerformer< DataTypes >::createElementList ( )
protected

Function creating a list of elements concerned by the removal operation. This function detect if a volume or a surface or a volume on the surface is going to be removed. Elements are stored in

See also
selectedElem. Calling
getNeighboorElements and
getElementInZone.
Returns
bool: false if method has encounter an error.
template<class DataTypes >
void sofa::component::collision::RemovePrimitivePerformer< DataTypes >::draw ( const core::visual::VisualParams vparams)
virtual
template<class DataTypes >
void sofa::component::collision::RemovePrimitivePerformer< DataTypes >::end ( )
template<class DataTypes >
void sofa::component::collision::RemovePrimitivePerformer< DataTypes >::execute ( )
virtual
template<class DataTypes >
sofa::helper::vector< unsigned int > sofa::component::collision::RemovePrimitivePerformer< DataTypes >::getElementInZone ( VecIds elementsToTest)
protected

Function testing if elements are in the range of a given zone The zone is given by the selectorScale. Test is done on Barycentric point of elements. I.e if this point is in the range of the area. then, element is accepted otherwise, element is rejected.

Parameters
elementsToTestvector of element Id to test.
Returns
VecIds: vector of element Id containing accepted element.
template<class DataTypes >
sofa::helper::vector< unsigned int > sofa::component::collision::RemovePrimitivePerformer< DataTypes >::getNeighboorElements ( VecIds elementsToTest)
protected

Function to get all elements directly neighboor of a given list of elements compute the list without redundancy using container xxAroundVertex() (where xx is the type of element).

Parameters
elementsToTestvector of element Id to test.
Returns
VecIds: vector of element Id containing neighbour (without already accepted elements and redundancy).
template<class DataTypes >
void sofa::component::collision::RemovePrimitivePerformer< DataTypes >::start ( )
virtual

Functions called by TopologicalOperation performer.

Functions called in framework of the mouse Interactor.

Implements sofa::component::collision::InteractionPerformer.