OpenWalnut  1.5.0dev
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
WMNavigationSlices::PickCallback Class Reference

Handles picking events. More...

+ Collaboration diagram for WMNavigationSlices::PickCallback:

Public Types

typedef std::shared_ptr< PickCallbackSPtr
 For the lazy guys. More...
 

Public Member Functions

 PickCallback (osg::ref_ptr< osg::Node > node, WPropDouble property, bool negateDirection=false)
 The callback, controlling. More...
 

Private Member Functions

void pick (WPickInfo pickInfo)
 Pick event handler. More...
 

Private Attributes

boost::signals2::scoped_connection m_pickConnection
 The pick connection for the pick() event handler. More...
 
osg::ref_ptr< osg::Node > m_node
 The slice node. More...
 
WPropDouble m_property
 The property controlling the position of the slice. More...
 
osg::ref_ptr< WGECameram_camera
 The camera under which the node is placed. More...
 
bool m_isPicked
 If true, the item is still picked. More...
 
osg::ref_ptr< osg::Uniform > m_pickUniform
 This uniform is used to inform the shader about current pick-state. More...
 
WVector2d m_oldPixelPosition
 The stored pixel position of a previous drag event. More...
 
float m_dir
 The transformation direction. More...
 

Detailed Description

Handles picking events.

Definition at line 112 of file WMNavigationSlices.h.

Member Typedef Documentation

◆ SPtr

For the lazy guys.

Definition at line 118 of file WMNavigationSlices.h.

Constructor & Destructor Documentation

◆ PickCallback()

WMNavigationSlices::PickCallback::PickCallback ( osg::ref_ptr< osg::Node >  node,
WPropDouble  property,
bool  negateDirection = false 
)

The callback, controlling.

Parameters
propertythe property controlling the position of the slice
nodethe node getting controlled by this instance.
negateDirectionif true, the translation direction is switched.

Definition at line 301 of file WMNavigationSlices.cpp.

References WGraphicsEngine::getGraphicsEngine(), m_camera, m_pickConnection, m_pickUniform, and pick().

+ Here is the call graph for this function:

Member Function Documentation

◆ pick()

void WMNavigationSlices::PickCallback::pick ( WPickInfo  pickInfo)
private

Pick event handler.

Uses for dragging the slices

Parameters
pickInfothe pick information.

Definition at line 316 of file WMNavigationSlices.cpp.

References WPickInfo::getName(), WPickInfo::getPickNormal(), WPickInfo::getPickPixel(), and wge::unprojectFromScreen().

Referenced by PickCallback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_camera

osg::ref_ptr< WGECamera > WMNavigationSlices::PickCallback::m_camera
private

The camera under which the node is placed.

Needed for proper back-projection.

Definition at line 155 of file WMNavigationSlices.h.

Referenced by PickCallback().

◆ m_dir

float WMNavigationSlices::PickCallback::m_dir
private

The transformation direction.

This is needed since the OSG coord system has a mirrored coronal direction.

Definition at line 175 of file WMNavigationSlices.h.

◆ m_isPicked

bool WMNavigationSlices::PickCallback::m_isPicked
private

If true, the item is still picked.

Definition at line 160 of file WMNavigationSlices.h.

◆ m_node

osg::ref_ptr< osg::Node > WMNavigationSlices::PickCallback::m_node
private

The slice node.

Used for checking if picked.

Definition at line 145 of file WMNavigationSlices.h.

◆ m_oldPixelPosition

WVector2d WMNavigationSlices::PickCallback::m_oldPixelPosition
private

The stored pixel position of a previous drag event.

Definition at line 170 of file WMNavigationSlices.h.

◆ m_pickConnection

boost::signals2::scoped_connection WMNavigationSlices::PickCallback::m_pickConnection
private

The pick connection for the pick() event handler.

Definition at line 140 of file WMNavigationSlices.h.

Referenced by PickCallback().

◆ m_pickUniform

osg::ref_ptr< osg::Uniform > WMNavigationSlices::PickCallback::m_pickUniform
private

This uniform is used to inform the shader about current pick-state.

Definition at line 165 of file WMNavigationSlices.h.

Referenced by PickCallback().

◆ m_property

WPropDouble WMNavigationSlices::PickCallback::m_property
private

The property controlling the position of the slice.

Definition at line 150 of file WMNavigationSlices.h.


The documentation for this class was generated from the following files: