5 #ifndef VART_MOUSECONTROL_H
6 #define VART_MOUSECONTROL_H
void SetReleasedYPosition(int newValue)
Sets the y postion of last button release.
void SetDragHandler(DragHandler *handlerPtr)
Sets the drag handler.
void SetClickYPosition(int newValue)
Sets the y postion of last click.
int GetCurrentY() const
Returns the current y postion.
StateID state
state of button event (DOWN/UP)
bool LastClickButtonIs(ButtonID btValue) const
Checks if last event is relative to given button.
void SetModifierState(ModifierID mdValue, bool state)
Sets the modifier state on last event.
MouseControl * mouseCtrlPtr
Pointer to mouse controller.
MouseControl()
Creates an unitialized mouse controller.
virtual void OnMotion()=0
StateID GetLastClickState() const
Returns the button state of last click.
int GetClickXPosition() const
Returns the x positon of last click.
virtual void OnClick()=0
Called upon activation of MouseHandler::OnClick.
bool ButtonIsDown(ButtonID btn) const
Returns true if given button is down.
void OnMotion()
Activates motion (with no buttons pressed) handler, if any.
MouseControl * mouseCtrlPtr
Pointer to mouse controller.
void SetClickXPosition(int newValue)
Sets the x postion of last click.
V-ART Viewer that uses GLUT/OpenGL.
std::bitset< 5 > buttonsState
state (down if set) of LEFT, MIDDLE, RIGHT, WHEEL_UP and WHEEL_DOWN buttons
std::bitset< 3 > modifiers
state of modifiers upon last button event
void SetCurrentPosititon(int newX, int newY)
Set the current position.
void SetCurrentY(int newValue)
Sets the current y position.
int GetCurrentX() const
Returns the current x postion.
void SetOwner(ViewerGlutOGL *ownerPtr)
Set the owner viewer.
void SetClickHandler(ClickHandler *handlerPtr)
Sets the click handler.
void SetLastClickButton(ButtonID btValue)
Sets button relative to last event.
void SetCurrentX(int newValue)
Sets the current x position.
ViewerGlutOGL * viewerPtr
Pointer to the viewer that owns the mouse control.
int currentX
Current mouse X position.
int clickY
Mouse Y position for last button down event.
int GetReleasedXPosition() const
Returns the x positon of last button release.
int GetClickYPosition() const
Returns the y positon of last click.
void OnDrag()
Activates drag (motion with buttons pressed) handler, if any.
ViewerGlutOGL * viewerPtr
Pointer to owner viewer.
void NewEvent(ButtonID btn, StateID newState)
Registers new button event.
void SetReleasedXPosition(int newValue)
Sets the x postion of last button release.
void SetLastClickState(StateID newState)
Set the button state on last click.
Keeps track of mouse events and state.
ViewerGlutOGL * viewerPtr
Pointer to owner viewer.
void OnClick()
Activates click handler, if any.
ViewerGlutOGL * viewerPtr
Pointer to owner viewer.
ButtonID button
which button was last pressed or released
int clickX
Mouse X position for last button down event.
int releasedX
Mouse X position for last button up event.
int currentY
Current mouse Y position.
int releasedY
Mouse Y position for last button up event.
bool LastClickIsDown() const
Checks whether state is DOWN.
void SetMotionHandler(MotionHandler *handlerPtr)
Sets the motion handler.
void SetReleasedPosition(int newX, int newY)
Sets the position of last button release.
ButtonID GetLastClickButton() const
Returns button relative to last event.
MouseControl * mouseCtrlPtr
Pointer to mouse controller.
bool AnyButtonIsDown() const
Checks whether any of LEFT, MIDDLE, RIGHT buttons are down.
bool ModifierIsActive(ModifierID mdValue) const
Checks if given modifier was active on last event.
int GetReleasedYPosition() const
Returns the y positon of last button release.
void SetClickPosition(int newX, int newY)
Sets the position of last click.