13#ifndef SO_POINTER_POSITION_H
14#define SO_POINTER_POSITION_H
54 int x()
const {
return _vec[0]; }
56 int y()
const {
return _vec[1]; }
68 int operator [](
int i)
const {
return (_vec[
i]); }
77 {
return !(v1 == v2); }
87 void set(
T* data) { _data = data; }
93 T*
get()
const {
return static_cast<T*
>(_data); }
#define SOMANAGEDINTERACTION_API
File to resolve system dependencies in View2D library.
SoInteractionHandler is a mix-in class for instances of SoNode to handle the interactions it provides...
SoPointerPosition manages the current position of the mouse cursor.
SoPointerPosition(const int v[2])
SoPointerPosition & setValue(const int v[2])
Sets the value of vector from array of two components.
SoHandleEventAction * getAction() const
Returns the Inventor action.
T * get() const
Returns a pointer to additional position data.
const View2DPosition * getView2DPosition() const
Returns the additional data as View2DPosition. Legacy support, rather use get<View2DPosition>().
void getValue(int &x, int &y) const
Returns the position as two individual components.
bool isNull() const
Returns whether the stored position is the coordinate system's origin (0/0).
int manhattanLength() const
Returns the manhattan distance of this position to the coordinate system's origin.
void set(T *data)
Sets a pointer to additional position data, e.g., for SoView2D or SoDiagram2D.
SoPointerPosition(const SoPointerPosition &other)=default
SoState * getState() const
Returns the Inventor state.
SoPointerPosition(int x, int y)
int x() const
Returns the x-component of this position.
int y() const
Returns the y-component of this position.
SoPointerPosition & setValue(int x, int y)
Sets the value of vector from two individual components.
SoPointerPosition()
Default constructor.
This class stores all position information needed by SoView2DExtensions to handle the pointer positio...
Target mlrange_cast(Source arg)
Generic version of checked ML casts.