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

Encapsulates info for pick action. More...

#include <WPickInfo.h>

+ Collaboration diagram for WPickInfo:

Public Types

enum  modifierKey {
  NONE , SHIFT , STRG , ALT ,
  WIN
}
 Different types of modifier keys. More...
 
enum  WMouseButton {
  NOMOUSE , MOUSE_LEFT , MOUSE_RIGHT , MOUSE_MIDDLE ,
  MOUSE4 , MOUSE5
}
 Different types of mouse buttons. More...
 

Public Member Functions

 WPickInfo (std::string name, std::string viewerName, WPosition pickPosition, std::pair< float, float > pixelCoords, modifierKey modKey, WMouseButton mButton=WPickInfo::MOUSE_LEFT, WVector3d pickNormal=WVector3d(), int32_t wheelValue=0)
 Creates an object with the needed information. More...
 
 WPickInfo ()
 Creates an object with the empty name, zero position and no modkey. More...
 
modifierKey getModifierKey () const
 Get the modifier key associated with the pick. More...
 
WMouseButton getMouseButton () const
 Get the mouse button associated with the pick. More...
 
void setModifierKey (const modifierKey &modKey)
 Set the modifier key associated with the pick. More...
 
void setMouseButton (const WMouseButton &mButton)
 Set the modifier key associated with the pick. More...
 
std::string getName () const
 Get name of picked object. More...
 
std::string getViewerName () const
 Get name of the viewer. More...
 
WPosition getPickPosition () const
 Get position where object was hit. More...
 
WVector3d getPickNormal () const
 Get normal at position where object was hit. More...
 
WVector2d getPickPixel () const
 Returns the picked pixel coordinates in screen-space. More...
 
int32_t getScrollWheel () const
 Returns an integer denoting the wheel movement. More...
 
bool operator== (WPickInfo rhs) const
 Tests two pick infos for equality. More...
 
bool operator!= (WPickInfo rhs) const
 Tests two pick infos for inequality. More...
 

Private Attributes

std::string m_name
 name of picked object. More...
 
std::string m_viewerName
 name of the viewer More...
 
WPosition m_pickPosition
 position where object was hit. More...
 
std::pair< float, float > m_pixelCoords
 Pixel coordinates of the mouse. More...
 
modifierKey m_modKey
 modifier key associated with the pick More...
 
WMouseButton m_mouseButton
 which mouse button was used for the pick More...
 
WVector3d m_pickNormal
 normal at position where object was hit. More...
 
int32_t m_scrollValue
 the scroll wheel value. More...
 

Detailed Description

Encapsulates info for pick action.

Definition at line 41 of file WPickInfo.h.

Member Enumeration Documentation

◆ modifierKey

Different types of modifier keys.

Definition at line 47 of file WPickInfo.h.

◆ WMouseButton

Different types of mouse buttons.

Definition at line 59 of file WPickInfo.h.

Constructor & Destructor Documentation

◆ WPickInfo() [1/2]

WPickInfo::WPickInfo ( std::string  name,
std::string  viewerName,
WPosition  pickPosition,
std::pair< float, float >  pixelCoords,
modifierKey  modKey,
WMouseButton  mButton = WPickInfo::MOUSE_LEFT,
WVector3d  pickNormal = WVector3d(),
int32_t  wheelValue = 0 
)
inline

Creates an object with the needed information.

Parameters
namename of picked object
viewerNamename of the viewer
pickPositionposition where object was hit
pixelCoordspixel coordinates of the mouse
modKeyrelevant modifier key pressed during the pick
mButtonmouse button that initiated the pick
pickNormalnormal at position where object was hit. (0,0,0) means not set.
wheelValuethe value of the scroll wheel

Definition at line 193 of file WPickInfo.h.

◆ WPickInfo() [2/2]

WPickInfo::WPickInfo ( )
inline

Creates an object with the empty name, zero position and no modkey.

Definition at line 212 of file WPickInfo.h.

Member Function Documentation

◆ getModifierKey()

WPickInfo::modifierKey WPickInfo::getModifierKey ( ) const
inline

Get the modifier key associated with the pick.

Returns
the mod key

Definition at line 223 of file WPickInfo.h.

References m_modKey.

Referenced by WPickHandler::pick(), WMPaintTexture::queuePaint(), WROIBox::updateGFX(), and WROISphere::updateGFX().

+ Here is the caller graph for this function:

◆ getMouseButton()

WPickInfo::WMouseButton WPickInfo::getMouseButton ( ) const
inline

Get the mouse button associated with the pick.

Returns
the mouse button

Definition at line 233 of file WPickInfo.h.

References m_mouseButton.

Referenced by WMPickingDVR::pickHandler(), and WMPaintTexture::queuePaint().

+ Here is the caller graph for this function:

◆ getName()

std::string WPickInfo::getName ( ) const
inline

Get name of picked object.

Returns
object name

Definition at line 243 of file WPickInfo.h.

References m_name.

Referenced by WMClusterDisplayVoxels::dendrogramClick(), WMPaintTexture::doPaint(), WPickHandler::pick(), WMNavigationSlices::PickCallback::pick(), WMPickingDVR::pickHandler(), WMPaintTexture::queuePaint(), WROIBox::updateGFX(), and WROISphere::updateGFX().

+ Here is the caller graph for this function:

◆ getPickNormal()

WVector3d WPickInfo::getPickNormal ( ) const
inline

Get normal at position where object was hit.

Returns
pick normal

Definition at line 258 of file WPickInfo.h.

References m_pickNormal.

Referenced by WPickHandler::pick(), WMNavigationSlices::PickCallback::pick(), and WROIBox::updateGFX().

+ Here is the caller graph for this function:

◆ getPickPixel()

WVector2d WPickInfo::getPickPixel ( ) const
inline

Returns the picked pixel coordinates in screen-space.

Returns
the coordinates

Definition at line 275 of file WPickInfo.h.

References m_pixelCoords.

Referenced by WMClusterDisplayVoxels::dendrogramClick(), WMNavigationSlices::PickCallback::pick(), WMPickingDVR::pickHandler(), WROIBox::updateGFX(), and WROISphere::updateGFX().

+ Here is the caller graph for this function:

◆ getPickPosition()

WPosition WPickInfo::getPickPosition ( ) const
inline

Get position where object was hit.

Returns
the pick position

Definition at line 253 of file WPickInfo.h.

References m_pickPosition.

Referenced by WMPaintTexture::doPaint(), WPickHandler::pick(), and WMPaintTexture::setColorFromPick().

+ Here is the caller graph for this function:

◆ getScrollWheel()

int32_t WPickInfo::getScrollWheel ( ) const
inline

Returns an integer denoting the wheel movement.

If the value gets smaller, the wheel scrolled down.

Returns
the value.

Definition at line 283 of file WPickInfo.h.

References m_scrollValue.

Referenced by WROIBox::updateGFX().

+ Here is the caller graph for this function:

◆ getViewerName()

std::string WPickInfo::getViewerName ( ) const
inline

Get name of the viewer.

Returns
viewer name

Definition at line 248 of file WPickInfo.h.

References m_viewerName.

◆ operator!=()

bool WPickInfo::operator!= ( WPickInfo  rhs) const
inline

Tests two pick infos for inequality.

Parameters
rhsright hand side of comparison
Returns
true if not equal

Definition at line 270 of file WPickInfo.h.

◆ operator==()

bool WPickInfo::operator== ( WPickInfo  rhs) const
inline

Tests two pick infos for equality.

Parameters
rhsright hand side of comparison
Returns
true if equal

Definition at line 263 of file WPickInfo.h.

References m_modKey, m_name, and m_pickPosition.

◆ setModifierKey()

void WPickInfo::setModifierKey ( const modifierKey modKey)
inline

Set the modifier key associated with the pick.

Parameters
modKeynew modifier key

Definition at line 228 of file WPickInfo.h.

References m_modKey.

Referenced by WPickHandler::updatePickInfoModifierKeys().

+ Here is the caller graph for this function:

◆ setMouseButton()

void WPickInfo::setMouseButton ( const WMouseButton mButton)
inline

Set the modifier key associated with the pick.

Parameters
mButtonnew mouse button

Definition at line 238 of file WPickInfo.h.

References m_mouseButton.

Member Data Documentation

◆ m_modKey

modifierKey WPickInfo::m_modKey
private

modifier key associated with the pick

Definition at line 187 of file WPickInfo.h.

Referenced by getModifierKey(), operator==(), and setModifierKey().

◆ m_mouseButton

WMouseButton WPickInfo::m_mouseButton
private

which mouse button was used for the pick

Definition at line 188 of file WPickInfo.h.

Referenced by getMouseButton(), and setMouseButton().

◆ m_name

std::string WPickInfo::m_name
private

name of picked object.

Definition at line 183 of file WPickInfo.h.

Referenced by getName(), and operator==().

◆ m_pickNormal

WVector3d WPickInfo::m_pickNormal
private

normal at position where object was hit.

Definition at line 189 of file WPickInfo.h.

Referenced by getPickNormal().

◆ m_pickPosition

WPosition WPickInfo::m_pickPosition
private

position where object was hit.

Definition at line 185 of file WPickInfo.h.

Referenced by getPickPosition(), and operator==().

◆ m_pixelCoords

std::pair< float, float > WPickInfo::m_pixelCoords
private

Pixel coordinates of the mouse.

Definition at line 186 of file WPickInfo.h.

Referenced by getPickPixel().

◆ m_scrollValue

int32_t WPickInfo::m_scrollValue
private

the scroll wheel value.

Definition at line 190 of file WPickInfo.h.

Referenced by getScrollWheel().

◆ m_viewerName

std::string WPickInfo::m_viewerName
private

name of the viewer

Definition at line 184 of file WPickInfo.h.

Referenced by getViewerName().


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