MeVisLab Toolbox Reference
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)
 
 SoPointerPosition (const SoPointerPosition &other)=default
 
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 27 of file SoPointerPosition.h.

Constructor & Destructor Documentation

◆ SoPointerPosition() [1/4]

SoPointerPosition::SoPointerPosition ( )

Default constructor.

◆ SoPointerPosition() [2/4]

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

◆ SoPointerPosition() [3/4]

SoPointerPosition::SoPointerPosition ( int  x,
int  y 
)

◆ SoPointerPosition() [4/4]

SoPointerPosition::SoPointerPosition ( const SoPointerPosition other)
default

Member Function Documentation

◆ get()

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 93 of file SoPointerPosition.h.

References T.

◆ getAction()

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

Definition at line 80 of file SoPointerPosition.h.

Referenced by SoCSODrawOnSurfaceDrawAction::isInViewportRegion(), and SoCSODrawOnSurfaceDrawAction::isSensitiveAt().

◆ getState()

SoState* SoPointerPosition::getState ( ) const
Returns
the Inventor state.

◆ getValue()

void SoPointerPosition::getValue ( int &  x,
int &  y 
) const
Returns
the position as two individual components.

◆ getView2DPosition()

const View2DPosition* SoPointerPosition::getView2DPosition ( ) const
inline
Returns
the additional data as View2DPosition. Legacy support, rather use get<View2DPosition>().

Definition at line 96 of file SoPointerPosition.h.

Referenced by CSOBulgeAction::isInViewportRegion().

◆ isNull()

bool SoPointerPosition::isNull ( ) const
Returns
whether the stored position is the coordinate system's origin (0/0).

◆ manhattanLength()

int SoPointerPosition::manhattanLength ( ) const
Returns
the manhattan distance of this position to the coordinate system's origin.

◆ operator=()

SoPointerPosition& SoPointerPosition::operator= ( const SoPointerPosition u)

Assignment operator.

◆ operator[]()

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

Accesses indexed component of position vector.

Definition at line 68 of file SoPointerPosition.h.

◆ set()

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

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

Definition at line 87 of file SoPointerPosition.h.

◆ setValue() [1/2]

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

Sets the value of vector from array of two components.

◆ setValue() [2/2]

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

Sets the value of vector from two individual components.

◆ x()

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

Definition at line 54 of file SoPointerPosition.h.

◆ y()

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

Definition at line 56 of file SoPointerPosition.h.

Friends And Related Function Documentation

◆ operator!=

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

Negated equality comparison operator.

Definition at line 76 of file SoPointerPosition.h.

◆ operator==

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

Equality comparison operator.

◆ SoInteractionHandler

friend class SoInteractionHandler
friend

Let only the SoInteractionHandler set the SoHandleEventAction on this position.

Definition at line 30 of file SoPointerPosition.h.


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