V-ARTContributions
mousecontrol.cpp
Go to the documentation of this file.
1 
6 
7 #include <iostream>
8 using namespace std;
9 
11 {
12  viewerPtr = NULL;
13  clickHndPtr = NULL;
14  dragHndPtr = NULL;
15  motionHndPtr = NULL;
16 }
17 
19 {
20  //~ cout << "in VART::MouseControl::OnClick" << endl;
21  if (clickHndPtr)
22  clickHndPtr->OnClick();
23 }
24 
26 {
27  //~ cout << "in VART::MouseControl::SetModifierState" << endl;
28  modifiers.set(mdValue,state);
29  //~ cout << "out VART::MouseControl::SetModifierState" << endl;
30 }
31 
33 {
34  dragHndPtr = handlerPtr;
35  handlerPtr->mouseCtrlPtr = this;
36  handlerPtr->viewerPtr = viewerPtr;
37 }
38 
40 {
41  clickHndPtr = handlerPtr;
42  handlerPtr->mouseCtrlPtr = this;
43  handlerPtr->viewerPtr = viewerPtr;
44 }
45 
47 {
48  motionHndPtr = handlerPtr;
49  handlerPtr->mouseCtrlPtr = this;
50  handlerPtr->viewerPtr = viewerPtr;
51 }
52 
54 {
55  if (newState == DOWN)
56  buttonsState.set(btn);
57  else
58  buttonsState.reset(btn);
59  button = btn;
60  state = newState;
61 }
void SetDragHandler(DragHandler *handlerPtr)
Sets the drag handler.
void SetModifierState(ModifierID mdValue, bool state)
Sets the modifier state on last event.
MouseControl * mouseCtrlPtr
Pointer to mouse controller.
Definition: mousecontrol.h:78
MouseControl()
Creates an unitialized mouse controller.
MouseControl * mouseCtrlPtr
Pointer to mouse controller.
Definition: mousecontrol.h:31
void SetClickHandler(ClickHandler *handlerPtr)
Sets the click handler.
ViewerGlutOGL * viewerPtr
Pointer to owner viewer.
Definition: mousecontrol.h:42
void NewEvent(ButtonID btn, StateID newState)
Registers new button event.
ViewerGlutOGL * viewerPtr
Pointer to owner viewer.
Definition: mousecontrol.h:82
void OnClick()
Activates click handler, if any.
ViewerGlutOGL * viewerPtr
Pointer to owner viewer.
Definition: mousecontrol.h:62
Header file for V-ART class "MouseControl".
void SetMotionHandler(MotionHandler *handlerPtr)
Sets the motion handler.
MouseControl * mouseCtrlPtr
Pointer to mouse controller.
Definition: mousecontrol.h:58