]> Creatis software - openheart.git/blob - Applications/vtkMyInteractorStyleTrackballCameraOpenHeartYZ.h
commit all the files for the first time
[openheart.git] / Applications / vtkMyInteractorStyleTrackballCameraOpenHeartYZ.h
1 /**
2 * Progam made by Olivier Bernard, associate professor
3 * at Institut National des Sciences Appliquees (INSA) Lyon,
4 * CREATIS-LRMN Laboratory,
5 * 69621 Villeurbanne, France,
6 * 20th of May 2014
7 */
8
9 #ifndef __vtkMyInteractorStyleTrackballCameraOpenHeartYZ_h__
10 #define __vtkMyInteractorStyleTrackballCameraOpenHeartYZ_h__
11
12 #include <vtkObjectFactory.h>
13 #include <vtkInteractorStyleTrackballCamera.h>
14 #include "OpenHeartGui.h"
15
16
17 class vtkMyInteractorStyleTrackballCameraOpenHeartYZ : public vtkInteractorStyleTrackballCamera
18 {
19
20     public:
21
22         void SetOpenHeartGui( OpenHeartGui *win ) { this->window = win; }
23
24         static vtkMyInteractorStyleTrackballCameraOpenHeartYZ *New()
25         {
26             /// First try to create the object from the vtkObjectFactory
27             vtkObject *ret = vtkObjectFactory::CreateInstance ("vtkMyInteractorStyleTrackballCameraOpenHeartYZ");
28             if (ret)
29             {
30                 return (vtkMyInteractorStyleTrackballCameraOpenHeartYZ *) ret;
31             }
32             /// If the factory was unable to create the object, then create it here.
33             return (new vtkMyInteractorStyleTrackballCameraOpenHeartYZ);
34         }
35
36
37         virtual void OnLeftButtonDown() { }
38         virtual void OnRightButtonDown() { }
39         virtual void OnMiddleButtonDown() { }
40
41         virtual void OnMouseWheelForward();
42         virtual void OnMouseWheelBackward();
43         virtual void OnEnter();
44         virtual void OnLeave();
45
46
47     protected:
48
49         vtkMyInteractorStyleTrackballCameraOpenHeartYZ() : FlagFirstTime(0), Step(1), PadBound(0.2)
50         {
51             for (int i=0; i<6; i++)
52                 Bounds[i] = 0;
53             for (int i=0; i<4; i++)
54                 Limits[i] = 0;
55         }
56
57         ~vtkMyInteractorStyleTrackballCameraOpenHeartYZ()
58         {}
59
60         OpenHeartGui *window;
61
62         /// Attributes
63         int FlagFirstTime;
64         double Bounds[6];
65         double Limits[4];
66         int Step;
67         double PadBound;
68
69         /// Methods
70         void GetPickerPosition(double *pos);
71         bool IsInside(double *pos);
72
73 };
74
75
76 #endif