]> Creatis software - openheart.git/blobdiff - Applications/vtkMyInteractorStyleTrackballCameraOpenHeartYZ.h
commit all the files for the first time
[openheart.git] / Applications / vtkMyInteractorStyleTrackballCameraOpenHeartYZ.h
diff --git a/Applications/vtkMyInteractorStyleTrackballCameraOpenHeartYZ.h b/Applications/vtkMyInteractorStyleTrackballCameraOpenHeartYZ.h
new file mode 100644 (file)
index 0000000..3ea7372
--- /dev/null
@@ -0,0 +1,76 @@
+/**
+* Progam made by Olivier Bernard, associate professor
+* at Institut National des Sciences Appliquees (INSA) Lyon,
+* CREATIS-LRMN Laboratory,
+* 69621 Villeurbanne, France,
+* 20th of May 2014
+*/
+
+#ifndef __vtkMyInteractorStyleTrackballCameraOpenHeartYZ_h__
+#define __vtkMyInteractorStyleTrackballCameraOpenHeartYZ_h__
+
+#include <vtkObjectFactory.h>
+#include <vtkInteractorStyleTrackballCamera.h>
+#include "OpenHeartGui.h"
+
+
+class vtkMyInteractorStyleTrackballCameraOpenHeartYZ : public vtkInteractorStyleTrackballCamera
+{
+
+    public:
+
+        void SetOpenHeartGui( OpenHeartGui *win ) { this->window = win; }
+
+        static vtkMyInteractorStyleTrackballCameraOpenHeartYZ *New()
+        {
+            /// First try to create the object from the vtkObjectFactory
+            vtkObject *ret = vtkObjectFactory::CreateInstance ("vtkMyInteractorStyleTrackballCameraOpenHeartYZ");
+            if (ret)
+            {
+                return (vtkMyInteractorStyleTrackballCameraOpenHeartYZ *) ret;
+            }
+            /// If the factory was unable to create the object, then create it here.
+            return (new vtkMyInteractorStyleTrackballCameraOpenHeartYZ);
+        }
+
+
+        virtual void OnLeftButtonDown() { }
+        virtual void OnRightButtonDown() { }
+        virtual void OnMiddleButtonDown() { }
+
+        virtual void OnMouseWheelForward();
+        virtual void OnMouseWheelBackward();
+        virtual void OnEnter();
+        virtual void OnLeave();
+
+
+    protected:
+
+        vtkMyInteractorStyleTrackballCameraOpenHeartYZ() : FlagFirstTime(0), Step(1), PadBound(0.2)
+        {
+            for (int i=0; i<6; i++)
+                Bounds[i] = 0;
+            for (int i=0; i<4; i++)
+                Limits[i] = 0;
+        }
+
+        ~vtkMyInteractorStyleTrackballCameraOpenHeartYZ()
+        {}
+
+        OpenHeartGui *window;
+
+        /// Attributes
+        int FlagFirstTime;
+        double Bounds[6];
+        double Limits[4];
+        int Step;
+        double PadBound;
+
+        /// Methods
+        void GetPickerPosition(double *pos);
+        bool IsInside(double *pos);
+
+};
+
+
+#endif