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.
 SoPointerPosition (const int v[2])
 SoPointerPosition (int x, int y)
 SoPointerPosition (const SoPointerPosition &other)=default
bool isNull () const
int manhattanLength () const
int x () const
 Returns the x-component of this position.
int y () const
 Returns the y-component of this position.
void getValue (int &x, int &y) const
 Returns the position as two individual components.
SoPointerPositionsetValue (const int v[2])
 Sets the value of vector from array of two components.
SoPointerPositionsetValue (int x, int y)
 Sets the value of vector from two individual components.
int operator[] (int i) const
 Accesses the indexed component of the position vector.
SoPointerPositionoperator= (const SoPointerPosition &u)
 Assignment operator.
SoHandleEventAction * getAction () const
 Returns the Inventor action.
SoState * getState () const
 Returns the Inventor state.
template<class T>
void set (T *data)
 Sets a pointer to additional position data, e.g., for SoView2D or SoDiagram2D.
template<class T>
Tget () const
const View2DPositiongetView2DPosition () const
 Returns the additional data as View2DPosition. Legacy support, rather use get<View2DPosition>().

Friends

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

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.

Referenced by operator!=, operator=(), operator==, setValue(), setValue(), and SoPointerPosition().

◆ SoPointerPosition() [2/4]

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

◆ SoPointerPosition() [3/4]

SoPointerPosition::SoPointerPosition ( int x,
int y )

References x(), and y().

◆ SoPointerPosition() [4/4]

SoPointerPosition::SoPointerPosition ( const SoPointerPosition & other)
default

References SoPointerPosition().

Member Function Documentation

◆ get()

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

Returns a 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. For example, for SoView2DExtension the data will always be View2DPosition.

Definition at line 93 of file SoPointerPosition.h.

References T.

Referenced by getView2DPosition().

◆ 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.

References x(), and y().

◆ 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.

References get().

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.

References SoPointerPosition().

◆ operator[]()

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

Accesses the indexed component of the position vector.

Definition at line 68 of file SoPointerPosition.h.

◆ set()

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

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

Definition at line 87 of file SoPointerPosition.h.

References T.

◆ setValue() [1/2]

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

Sets the value of vector from array of two components.

References SoPointerPosition().

◆ setValue() [2/2]

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

Sets the value of vector from two individual components.

References SoPointerPosition(), x(), and y().

◆ x()

int SoPointerPosition::x ( ) const
inline

Returns the x-component of this position.

Definition at line 54 of file SoPointerPosition.h.

Referenced by getValue(), setValue(), and SoPointerPosition().

◆ y()

int SoPointerPosition::y ( ) const
inline

Returns the y-component of this position.

Definition at line 56 of file SoPointerPosition.h.

Referenced by getValue(), setValue(), and SoPointerPosition().

◆ operator!=

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

Negated equality comparison operator.

Definition at line 76 of file SoPointerPosition.h.

References SOMANAGEDINTERACTION_API, and SoPointerPosition().

◆ operator==

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

Equality comparison operator.

References SOMANAGEDINTERACTION_API, and SoPointerPosition().

◆ SoInteractionHandler

friend class SoInteractionHandler
friend

Let only the SoInteractionHandler set the SoHandleEventAction on this position.

Definition at line 30 of file SoPointerPosition.h.

References SoInteractionHandler.

Referenced by SoInteractionHandler.


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