SOFA plugin: SofaSimpleGUI  master
Open source framework for multi-physics simuation
sofa::simplegui::Interactor Class Referenceabstract

#include <Interactor.h>

Base class for all interactors. Interactors are sofa subgraphs used to apply actions to the scene, typically through user interaction. More...

Inheritance diagram for sofa::simplegui::Interactor:

Detailed Description

Base class for all interactors. Interactors are sofa subgraphs used to apply actions to the scene, typically through user interaction.

Note that they are not necessarily moved using the mouse, since there is no mouse or window coordinates in the API.

Author
Francois Faure, 2014

Protected Attributes

Node::SPtr _interactionNode
 Scene node used to implement this. More...
 
PickedPoint _pickedPoint
 The point attached to this. More...
 

Public Member Functions

 Interactor (const PickedPoint &picked)
 
virtual ~Interactor ()
 
virtual void attach (SofaScene *)
 Insert this in the scene as a child of the given node. If overloaded, this function should be called at the beginning of the overloaded function. More...
 
virtual void detach ()
 Remove this from the scene, without destroying it. If overloaded, this function should be called at the end of the overloaded function. More...
 
virtual Vec3 getPoint ()=0
 Current interaction point. More...
 
virtual void setPoint (const Vec3 &p)=0
 Displace the interaction to the given point. More...
 
Node::SPtr getNode ()
 Root of the interactor graph. More...
 
const PickedPointgetPickedPoint () const
 Simulated point attached to this. More...
 

Attribute details

◆ _interactionNode

Node::SPtr sofa::simplegui::Interactor::_interactionNode
protected

Scene node used to implement this.

◆ _pickedPoint

PickedPoint sofa::simplegui::Interactor::_pickedPoint
protected

The point attached to this.

Constructor details

◆ Interactor()

sofa::simplegui::Interactor::Interactor ( const PickedPoint picked)

◆ ~Interactor()

sofa::simplegui::Interactor::~Interactor ( )
virtual

Function details

◆ attach()

void sofa::simplegui::Interactor::attach ( SofaScene scene)
virtual

Insert this in the scene as a child of the given node. If overloaded, this function should be called at the beginning of the overloaded function.

Reimplemented in sofa::simplegui::SpringInteractor.

◆ detach()

void sofa::simplegui::Interactor::detach ( )
virtual

Remove this from the scene, without destroying it. If overloaded, this function should be called at the end of the overloaded function.

Reimplemented in sofa::simplegui::SpringInteractor.

◆ getNode()

Node::SPtr sofa::simplegui::Interactor::getNode ( )
inline

Root of the interactor graph.

◆ getPickedPoint()

const PickedPoint& sofa::simplegui::Interactor::getPickedPoint ( ) const
inline

Simulated point attached to this.

◆ getPoint()

virtual Vec3 sofa::simplegui::Interactor::getPoint ( )
pure virtual

Current interaction point.

Implemented in sofa::simplegui::SpringInteractor.

◆ setPoint()

virtual void sofa::simplegui::Interactor::setPoint ( const Vec3 p)
pure virtual

Displace the interaction to the given point.

Implemented in sofa::simplegui::SpringInteractor.