13 #ifndef SO_POINTER_POSITION_H
14 #define SO_POINTER_POSITION_H
19 class SoHandleEventAction;
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); }
80 SoHandleEventAction*
getAction()
const {
return _action; }
87 void set(
T* data) { _data = data; }
93 T*
get()
const {
return static_cast<T*
>(_data); }
100 void setAction(SoHandleEventAction* action) { _action = action; }
106 SoHandleEventAction* _action;
#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.
SoPointerPosition & setValue(int x, int y)
Sets the value of vector from two individual components.
void getValue(int &x, int &y) const
Returns the position as two individual components.
SoHandleEventAction * getAction() const
Returns the Inventor action.
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.
const View2DPosition * getView2DPosition() const
Returns the additional data as View2DPosition. Legacy support, rather use get<View2DPosition>().
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.
T * get() const
Returns a pointer to additional position data.
SoPointerPosition()
Default constructor.
This class stores all position information needed by SoView2DExtensions to handle the pointer positio...
bool operator==(const Tmat2< DT > &a, const Tmat2< DT > &b)
a == b ? Returns true if yes.
bool operator!=(const Tmat2< DT > &a, const Tmat2< DT > &b)
a != b ? Returns true if yes.