Public Types | Public Member Functions | Private Attributes

WPickInfo Class Reference

Encapsulates info for pick action. More...

#include <WPickInfo.h>

List of all members.

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())
 Creates an object with the needed information.
 WPickInfo ()
 Creates an object with the empty name, zero position and no modkey.
modifierKey getModifierKey () const
 Get the modifier key associated with the pick.
WMouseButton getMouseButton () const
 Get the mouse button associated with the pick.
void setModifierKey (const modifierKey &modKey)
 Set the modifier key associated with the pick.
void setMouseButton (const WMouseButton &mButton)
 Set the modifier key associated with the pick.
std::string getName () const
 Get name of picked object.
std::string getViewerName () const
 Get name of the viewer.
WPosition getPickPosition () const
 Get position where object was hit.
WVector3d getPickNormal () const
 Get normal at position where object was hit.
WVector2d getPickPixel () const
 Returns the picked pixel coordinates in screen-space.
bool operator== (WPickInfo rhs) const
 Tests two pick infos for equality.
bool operator!= (WPickInfo rhs) const
 Tests two pick infos for inequality.

Private Attributes

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

Detailed Description

Encapsulates info for pick action.

Definition at line 39 of file WPickInfo.h.


Member Enumeration Documentation

Different types of modifier keys.

Definition at line 45 of file WPickInfo.h.

Different types of mouse buttons.

Definition at line 57 of file WPickInfo.h.


Constructor & Destructor Documentation

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() 
) [inline]

Creates an object with the needed information.

Parameters:
name name of picked object
viewerName name of the viewer
pickPosition position where object was hit
pixelCoords pixel coordinates of the mouse
modKey relevant modifier key pressed during the pick
mButton mouse button that initiated the pick
pickNormal normal at position where object was hit. (0,0,0) means not set.

Definition at line 182 of file WPickInfo.h.

WPickInfo::WPickInfo (  )  [inline]

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

Definition at line 199 of file WPickInfo.h.


Member Function Documentation

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

Get the modifier key associated with the pick.

Returns:
the mod key

Definition at line 209 of file WPickInfo.h.

References m_modKey.

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

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

Get the mouse button associated with the pick.

Returns:
the mouse button

Definition at line 219 of file WPickInfo.h.

References m_mouseButton.

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

Get name of picked object.

Returns:
object name

Definition at line 229 of file WPickInfo.h.

References m_name.

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

WVector3d WPickInfo::getPickNormal (  )  const [inline]

Get normal at position where object was hit.

Returns:
pick normal

Definition at line 244 of file WPickInfo.h.

References m_pickNormal.

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

WVector2d WPickInfo::getPickPixel (  )  const [inline]

Returns the picked pixel coordinates in screen-space.

Returns:
the coordinates

Definition at line 261 of file WPickInfo.h.

References m_pixelCoords.

Referenced by WROISphere::updateGFX(), and WROIBox::updateGFX().

WPosition WPickInfo::getPickPosition (  )  const [inline]

Get position where object was hit.

Returns:
the pick position

Definition at line 239 of file WPickInfo.h.

References m_pickPosition.

Referenced by WPickHandler::pick().

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

Get name of the viewer.

Returns:
viewer name

Definition at line 234 of file WPickInfo.h.

References m_viewerName.

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

Tests two pick infos for inequality.

Parameters:
rhs right hand side of comparison
Returns:
true if not equal

Definition at line 256 of file WPickInfo.h.

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

Tests two pick infos for equality.

Parameters:
rhs right hand side of comparison
Returns:
true if equal

Definition at line 249 of file WPickInfo.h.

References m_modKey, m_name, and m_pickPosition.

void WPickInfo::setModifierKey ( const modifierKey modKey  )  [inline]

Set the modifier key associated with the pick.

Parameters:
modKey new modifier key

Definition at line 214 of file WPickInfo.h.

References m_modKey.

Referenced by WPickHandler::updatePickInfoModifierKeys().

void WPickInfo::setMouseButton ( const WMouseButton mButton  )  [inline]

Set the modifier key associated with the pick.

Parameters:
mButton new mouse button

Definition at line 224 of file WPickInfo.h.

References m_mouseButton.


Member Data Documentation

modifier key associated with the pick

Definition at line 177 of file WPickInfo.h.

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

which mouse button was used for the pick

Definition at line 178 of file WPickInfo.h.

Referenced by getMouseButton(), and setMouseButton().

std::string WPickInfo::m_name [private]

name of picked object.

Definition at line 173 of file WPickInfo.h.

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

normal at position where object was hit.

Definition at line 179 of file WPickInfo.h.

Referenced by getPickNormal().

position where object was hit.

Definition at line 175 of file WPickInfo.h.

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

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

Pixel coordinates of the mouse.

Definition at line 176 of file WPickInfo.h.

Referenced by getPickPixel().

std::string WPickInfo::m_viewerName [private]

name of the viewer

Definition at line 174 of file WPickInfo.h.

Referenced by getViewerName().


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends