SOFA API  1a4bb3e7
Open source framework for multi-physics simuation
sofa::gui::component::performer::RemovePrimitivePerformer< DataTypes > Class Template Reference

#include <RemovePrimitivePerformer.h>

Inheritance diagram for sofa::gui::component::performer::RemovePrimitivePerformer< DataTypes >:

Detailed Description

template<class DataTypes>
class sofa::gui::component::performer::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::gui::component::performer::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::gui::component::performer::TInteractionPerformer< DataTypes >
 TInteractionPerformer (BaseMouseInteractor *i)
 
- Public Member Functions inherited from sofa::gui::component::performer::InteractionPerformer
 InteractionPerformer (BaseMouseInteractor *i)
 
virtual ~InteractionPerformer ()
 
virtual void configure (sofa::component::setting::MouseButtonSetting *)
 
virtual void handleEvent (core::objectmodel::Event *)
 
virtual void setPerformerFreeze ()
 
 SOFA_ATTRIBUTE_DISABLED__NAMING ("v24.06", "v24.06", interactor, m_interactor)
 
 SOFA_ATTRIBUTE_DISABLED__NAMING ("v24.06", "v24.06", freezePerformer, m_freezePerformer)
 
- Public Member Functions inherited from sofa::gui::component::performer::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::gui::component::performer::InteractionPerformer
BaseMouseInteractorm_interactor
 
bool m_freezePerformer
 
- Static Public Member Functions inherited from sofa::gui::component::performer::TInteractionPerformer< DataTypes >
template<class RealObject >
static RealObject * create (RealObject *, BaseMouseInteractor *interactor)
 
- Static Public Member Functions inherited from sofa::gui::component::performer::InteractionPerformer
template<class RealObject >
static RealObject * create (RealObject *, BaseMouseInteractor *interactor)
 

Attribute details

◆ firstClick

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

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

◆ picked

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

picked structure from mouseInteractor.

◆ selectedElem

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

vector of element Id concerned by the operation

◆ surfaceOnVolume

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

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

◆ volumeOnSurface

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

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

Constructor details

◆ RemovePrimitivePerformer()

◆ ~RemovePrimitivePerformer()

Function details

◆ createElementList()

template<class DataTypes >
bool sofa::gui::component::performer::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.

◆ draw()

◆ end()

◆ execute()

◆ getElementInZone()

template<class DataTypes >
RemovePrimitivePerformer< DataTypes >::VecIds sofa::gui::component::performer::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.

◆ getNeighboorElements()

template<class DataTypes >
RemovePrimitivePerformer< DataTypes >::VecIds sofa::gui::component::performer::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).

◆ start()

template<class DataTypes >
void sofa::gui::component::performer::RemovePrimitivePerformer< DataTypes >::start
virtual

Functions called by TopologicalOperation performer.

Functions called in framework of the mouse Interactor.

Implements sofa::gui::component::performer::InteractionPerformer.