SOFA API  6a688117
Open source framework for multi-physics simuation
sofa::gui::PickHandler Class Reference

#include <PickHandler.h>

Inheritance diagram for sofa::gui::PickHandler:

Protected Attributes

bool interactorInUse
 
MOUSE_STATUS mouseStatus
 
MOUSE_BUTTON mouseButton
 
Node::SPtr mouseNode
 
MouseContainer::SPtr mouseContainer
 
MouseCollisionModel::SPtr mouseCollision
 
MousePosition mousePosition
 
ComponentMouseInteractioninteraction
 
std::vector< ComponentMouseInteraction * > instanceComponents
 
BodyPicked lastPicked
 
bool useCollisions
 
helper::fixed_array< Operation *, NONEoperations
 
helper::vector< CallBackPicker * > callbacks
 
CallBackRenderrenderCallback
 
PickingMethod pickingMethod
 
double m_defaultLength
 Default length of the ray. Set by constructor. More...
 

Public Member Functions

 PickHandler (double defaultLength=1000000)
 
virtual ~PickHandler ()
 
void activateRay (int width, int height, core::objectmodel::BaseNode *root)
 
void deactivateRay ()
 
virtual void allocateSelectionBuffer (int width, int height)
 
virtual void destroySelectionBuffer ()
 
void setPickingMethod (PickingMethod method)
 
bool useSelectionBufferMethod () const
 
void updateRay (const sofa::defaulttype::Vector3 &position, const sofa::defaulttype::Vector3 &orientation)
 
void handleMouseEvent (MOUSE_STATUS status, MOUSE_BUTTON button)
 
void init (core::objectmodel::BaseNode *root)
 
void reset ()
 
void unload ()
 
void setColourRenderCallback (CallBackRender *colourRender)
 
void updateMouse2D (MousePosition mouse)
 
OperationgetOperation (MOUSE_BUTTON button)
 
OperationchangeOperation (sofa::component::configurationsetting::MouseButtonSetting *setting)
 
OperationchangeOperation (MOUSE_BUTTON button, const std::string &op)
 
void addCallBack (CallBackPicker *c)
 
helper::vector< CallBackPicker * > getCallBackPicker ()
 
void clearCallBacks ()
 
virtual BodyPicked findCollisionUsingColourCoding (const defaulttype::Vector3 &origin, const defaulttype::Vector3 &direction)
 
ComponentMouseInteractiongetInteraction ()
 
BodyPickedgetLastPicked ()
 

Static Public Member Functions

static BodyPicked findCollisionUsingBruteForce (const defaulttype::Vector3 &origin, const defaulttype::Vector3 &direction, double maxLength, core::objectmodel::BaseNode *root)
 

Protected Member Functions

virtual BodyPicked findCollision ()
 
BodyPicked findCollisionUsingPipeline ()
 
BodyPicked findCollisionUsingBruteForce ()
 
BodyPicked findCollisionUsingColourCoding ()
 
bool needToCastRay ()
 
void setCompatibleInteractor ()
 

Attribute details

helper::vector< CallBackPicker* > sofa::gui::PickHandler::callbacks
protected
std::vector< ComponentMouseInteraction *> sofa::gui::PickHandler::instanceComponents
protected
ComponentMouseInteraction* sofa::gui::PickHandler::interaction
protected
bool sofa::gui::PickHandler::interactorInUse
protected
BodyPicked sofa::gui::PickHandler::lastPicked
protected
double sofa::gui::PickHandler::m_defaultLength
protected

Default length of the ray. Set by constructor.

MOUSE_BUTTON sofa::gui::PickHandler::mouseButton
protected
MouseCollisionModel::SPtr sofa::gui::PickHandler::mouseCollision
protected
MouseContainer::SPtr sofa::gui::PickHandler::mouseContainer
protected
Node::SPtr sofa::gui::PickHandler::mouseNode
protected
MousePosition sofa::gui::PickHandler::mousePosition
protected
MOUSE_STATUS sofa::gui::PickHandler::mouseStatus
protected
helper::fixed_array< Operation*,NONE > sofa::gui::PickHandler::operations
protected
PickingMethod sofa::gui::PickHandler::pickingMethod
protected
CallBackRender* sofa::gui::PickHandler::renderCallback
protected
bool sofa::gui::PickHandler::useCollisions
protected

Constructor details

sofa::gui::PickHandler::PickHandler ( double  defaultLength = 1000000)
sofa::gui::PickHandler::~PickHandler ( )
virtual

Function details

void sofa::gui::PickHandler::activateRay ( int  width,
int  height,
core::objectmodel::BaseNode root 
)
void sofa::gui::PickHandler::addCallBack ( CallBackPicker c)
inline
void sofa::gui::PickHandler::allocateSelectionBuffer ( int  width,
int  height 
)
virtual

Reimplemented in sofa::gui::GLPickHandler.

Operation * sofa::gui::PickHandler::changeOperation ( sofa::component::configurationsetting::MouseButtonSetting setting)
Operation * sofa::gui::PickHandler::changeOperation ( MOUSE_BUTTON  button,
const std::string &  op 
)
void sofa::gui::PickHandler::clearCallBacks ( )
inline
void sofa::gui::PickHandler::deactivateRay ( )
void sofa::gui::PickHandler::destroySelectionBuffer ( )
virtual

Reimplemented in sofa::gui::GLPickHandler.

component::collision::BodyPicked sofa::gui::PickHandler::findCollision ( )
protectedvirtual
component::collision::BodyPicked sofa::gui::PickHandler::findCollisionUsingBruteForce ( const defaulttype::Vector3 &  origin,
const defaulttype::Vector3 &  direction,
double  maxLength,
core::objectmodel::BaseNode root 
)
static
component::collision::BodyPicked sofa::gui::PickHandler::findCollisionUsingBruteForce ( )
protected
component::collision::BodyPicked sofa::gui::PickHandler::findCollisionUsingColourCoding ( const defaulttype::Vector3 &  origin,
const defaulttype::Vector3 &  direction 
)
virtual

Reimplemented in sofa::gui::GLPickHandler.

component::collision::BodyPicked sofa::gui::PickHandler::findCollisionUsingColourCoding ( )
protected
component::collision::BodyPicked sofa::gui::PickHandler::findCollisionUsingPipeline ( )
protected
helper::vector< CallBackPicker* > sofa::gui::PickHandler::getCallBackPicker ( )
inline
ComponentMouseInteraction * sofa::gui::PickHandler::getInteraction ( )
BodyPicked* sofa::gui::PickHandler::getLastPicked ( )
inline
Operation* sofa::gui::PickHandler::getOperation ( MOUSE_BUTTON  button)
inline
void sofa::gui::PickHandler::handleMouseEvent ( MOUSE_STATUS  status,
MOUSE_BUTTON  button 
)
void sofa::gui::PickHandler::init ( core::objectmodel::BaseNode root)
bool sofa::gui::PickHandler::needToCastRay ( )
protected
void sofa::gui::PickHandler::reset ( )
void sofa::gui::PickHandler::setColourRenderCallback ( CallBackRender colourRender)
inline
void sofa::gui::PickHandler::setCompatibleInteractor ( )
protected
void sofa::gui::PickHandler::setPickingMethod ( PickingMethod  method)
inline
void sofa::gui::PickHandler::unload ( )
void sofa::gui::PickHandler::updateMouse2D ( MousePosition  mouse)
inline
void sofa::gui::PickHandler::updateRay ( const sofa::defaulttype::Vector3 &  position,
const sofa::defaulttype::Vector3 &  orientation 
)
bool sofa::gui::PickHandler::useSelectionBufferMethod ( ) const
inline

Enum details

Enumerator
RAY_CASTING 
SELECTION_BUFFER