SOFA plugin: SofaCarving  master
Open source framework for multi-physics simuation
sofacarving::CarvingManager Class Reference

#include <CarvingManager.h>

Inheritance diagram for sofacarving::CarvingManager:

Detailed Description

The CarvingManager class will perform topological resection on a triangle surface (could be on top of tetrahedron topology) The tool performing the carving need to be represented by a collision model

See also
toolCollisionModel The surface to be carved are also mapped on collision models
surfaceCollisionModels Detecting the collision is done using the scene Intersection and NarrowPhaseDetection pipeline.

Public Attributes

SingleLink< CarvingManager, core::CollisionModel, BaseLink::FLAG_STOREPATH|BaseLink::FLAG_STRONGLINK > l_toolModel
 Tool model path. More...
 
SingleLink< CarvingManager, core::collision::NarrowPhaseDetection, BaseLink::FLAG_STOREPATH|BaseLink::FLAG_STRONGLINK > l_detectionNP
 
Data< std::string > d_surfaceModelPath
 TriangleSetModel or SphereCollisionModel<sofa::defaulttype::Vec3Types> path. More...
 
Data< SReal > d_carvingDistance
 Collision distance at which carving will start. Equal to contactDistance by default. More...
 
Data< bool > d_active
 key to press to activate this object until the key is released More...
 
Data< char > d_keyEvent
 key to activate this object until the key is pressed again More...
 
Data< char > d_keySwitchEvent
 Activate carving with middle mouse button. More...
 
Data< bool > d_mouseEvent
 Activate carving with omni button. More...
 
Data< bool > d_omniEvent
 Activate carving with string Event, the activator name has to be inside the script event. Will look for 'pressed' or 'release' keyword. For example: 'button1_pressed'. More...
 
Data< std::string > d_activatorName
 

Protected Attributes

std::vector< core::CollisionModel * > m_surfaceCollisionModels
 

Public Member Functions

 SOFA_CLASS (CarvingManager, sofa::core::behavior::BaseController)
 
void init () override
 Sofa API init method of the component. More...
 
void handleEvent (sofa::core::objectmodel::Event *event) override
 Method to handle various event like keyboard or omni. More...
 
virtual void doCarve ()
 Impl method that will compute the intersection and check if some element have to be removed. More...
 

Protected Member Functions

 CarvingManager ()
 Default constructor. More...
 
 ~CarvingManager () override
 Default destructor. More...
 

Attribute details

◆ d_activatorName

Data< std::string > sofacarving::CarvingManager::d_activatorName

◆ d_active

Data< bool > sofacarving::CarvingManager::d_active

key to press to activate this object until the key is released

◆ d_carvingDistance

Data< SReal > sofacarving::CarvingManager::d_carvingDistance

Collision distance at which carving will start. Equal to contactDistance by default.

Activate this object. Note that this can be dynamically controlled by using a key

◆ d_keyEvent

Data< char > sofacarving::CarvingManager::d_keyEvent

key to activate this object until the key is pressed again

◆ d_keySwitchEvent

Data< char > sofacarving::CarvingManager::d_keySwitchEvent

Activate carving with middle mouse button.

◆ d_mouseEvent

Data< bool > sofacarving::CarvingManager::d_mouseEvent

Activate carving with omni button.

◆ d_omniEvent

Data< bool > sofacarving::CarvingManager::d_omniEvent

Activate carving with string Event, the activator name has to be inside the script event. Will look for 'pressed' or 'release' keyword. For example: 'button1_pressed'.

◆ d_surfaceModelPath

Data< std::string > sofacarving::CarvingManager::d_surfaceModelPath

TriangleSetModel or SphereCollisionModel<sofa::defaulttype::Vec3Types> path.

◆ l_detectionNP

SingleLink<CarvingManager, core::collision::NarrowPhaseDetection, BaseLink::FLAG_STOREPATH | BaseLink::FLAG_STRONGLINK> sofacarving::CarvingManager::l_detectionNP

◆ l_toolModel

SingleLink<CarvingManager, core::CollisionModel, BaseLink::FLAG_STOREPATH | BaseLink::FLAG_STRONGLINK> sofacarving::CarvingManager::l_toolModel

Tool model path.

◆ m_surfaceCollisionModels

std::vector<core::CollisionModel*> sofacarving::CarvingManager::m_surfaceCollisionModels
protected

Constructor details

◆ CarvingManager()

sofacarving::CarvingManager::CarvingManager ( )
protected

Default constructor.

◆ ~CarvingManager()

sofacarving::CarvingManager::~CarvingManager ( )
inlineoverrideprotected

Default destructor.

Function details

◆ doCarve()

void sofacarving::CarvingManager::doCarve ( )
virtual

Impl method that will compute the intersection and check if some element have to be removed.

◆ handleEvent()

void sofacarving::CarvingManager::handleEvent ( sofa::core::objectmodel::Event event)
override

Method to handle various event like keyboard or omni.

◆ init()

void sofacarving::CarvingManager::init ( )
override

Sofa API init method of the component.

◆ SOFA_CLASS()

sofacarving::CarvingManager::SOFA_CLASS ( CarvingManager  ,
sofa::core::behavior::BaseController   
)