MeVisLabToolboxReference
SoPointerPosition Class Reference

SoPointerPosition manages the current position of the mouse cursor. More...

#include <SoPointerPosition.h>

Public Member Functions

 SoPointerPosition ()
 Default constructor. More...
 
 SoPointerPosition (const int v[2])
 
 SoPointerPosition (int x, int y)
 
bool isNull () const
 
int manhattanLength () const
 
int x () const
 
int y () const
 
void getValue (int &x, int &y) const
 
SoPointerPositionsetValue (const int v[2])
 Sets the value of vector from array of two components. More...
 
SoPointerPositionsetValue (int x, int y)
 Sets the value of vector from two individual components. More...
 
int operator[] (int i) const
 Accesses indexed component of position vector. More...
 
SoPointerPositionoperator= (const SoPointerPosition &u)
 Assignment operator. More...
 
SoHandleEventAction * getAction () const
 
SoState * getState () const
 
template<class T >
void set (T *data)
 Sets pointer to additional position data, e.g., for SoView2D or SoDiagram2D. More...
 
template<class T >
Tget () const
 Gets pointer to additional position data. More...
 
const View2DPositiongetView2DPosition () const
 

Friends

class SoInteractionHandler
 Let only the SoInteractionHandler set the SoHandleEventAction on this position. More...
 
SOMANAGEDINTERACTION_API bool operator== (const SoPointerPosition &v1, const SoPointerPosition &v2)
 Equality comparison operator. More...
 
SOMANAGEDINTERACTION_API bool operator!= (const SoPointerPosition &v1, const SoPointerPosition &v2)
 Negated equality comparison operator. More...
 

Detailed Description

SoPointerPosition manages the current position of the mouse cursor.

Definition at line 23 of file SoPointerPosition.h.

Constructor & Destructor Documentation

SoPointerPosition::SoPointerPosition ( )

Default constructor.

SoPointerPosition::SoPointerPosition ( const int  v[2])
SoPointerPosition::SoPointerPosition ( int  x,
int  y 
)

Member Function Documentation

template<class T >
T* SoPointerPosition::get ( ) const
inline

Gets pointer to additional position data.

There is no safe-guard here, but since the type of the additional data is very context specific, there should be no ambiguities. E.g., for SoView2DExtension the data will always be View2DPosition.

Definition at line 86 of file SoPointerPosition.h.

References T.

SoHandleEventAction* SoPointerPosition::getAction ( ) const
inline
Returns
the Inventor action.

Definition at line 73 of file SoPointerPosition.h.

SoState* SoPointerPosition::getState ( ) const
Returns
the Inventor state.
void SoPointerPosition::getValue ( int &  x,
int &  y 
) const
Returns
the position as two individual components.
const View2DPosition* SoPointerPosition::getView2DPosition ( ) const
inline
Returns
the additional data as View2DPosition. Legacy support, rather use get<View2DPosition>().

Definition at line 89 of file SoPointerPosition.h.

bool SoPointerPosition::isNull ( ) const
Returns
whether the stored position is the coordinate system's origin (0/0).
int SoPointerPosition::manhattanLength ( ) const
Returns
the manhattan distance of this position to the coordinate system's origin.
SoPointerPosition& SoPointerPosition::operator= ( const SoPointerPosition u)

Assignment operator.

int SoPointerPosition::operator[] ( int  i) const
inline

Accesses indexed component of position vector.

Definition at line 61 of file SoPointerPosition.h.

template<class T >
void SoPointerPosition::set ( T data)
inline

Sets pointer to additional position data, e.g., for SoView2D or SoDiagram2D.

Definition at line 80 of file SoPointerPosition.h.

SoPointerPosition& SoPointerPosition::setValue ( const int  v[2])

Sets the value of vector from array of two components.

SoPointerPosition& SoPointerPosition::setValue ( int  x,
int  y 
)

Sets the value of vector from two individual components.

int SoPointerPosition::x ( ) const
inline
Returns
the x-component of this position.

Definition at line 47 of file SoPointerPosition.h.

int SoPointerPosition::y ( ) const
inline
Returns
the y-component of this position.

Definition at line 49 of file SoPointerPosition.h.

Friends And Related Function Documentation

SOMANAGEDINTERACTION_API bool operator!= ( const SoPointerPosition v1,
const SoPointerPosition v2 
)
friend

Negated equality comparison operator.

Definition at line 69 of file SoPointerPosition.h.

SOMANAGEDINTERACTION_API bool operator== ( const SoPointerPosition v1,
const SoPointerPosition v2 
)
friend

Equality comparison operator.

friend class SoInteractionHandler
friend

Let only the SoInteractionHandler set the SoHandleEventAction on this position.

Definition at line 26 of file SoPointerPosition.h.


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