OSDN Git Service

modified: src/Tools/mrcImage/mrcImageShrink/src/test/Makefile
[eos/hostdependX86LINUX64.git] / include / eosInteractorMyStyle.hh
1 #ifndef EOS_INTERACTOR_MY_STYLE_HH
2 #define EOS_INTERACTOR_MY_STYLE_HH
3
4 #include <vtkInteractorStyle.h>
5 #include <stdio.h>
6 #include <math.h>
7
8 #include "tcl.h" 
9 #include "tk.h"
10
11 class eosStereoWindow;
12 extern int Vtktcl_SafeInit(Tcl_Interp *interp);
13 class VTK_RENDERING_EXPORT eosInteractorMyStyle : public vtkInteractorStyleSwitch
14 {
15 public:
16   static eosInteractorMyStyle *New();
17
18   vtkTypeMacro(eosInteractorMyStyle, vtkInteractorStyle);
19
20   virtual void OnMouseMove();
21   void OnMouseMoveTrackball();
22   void OnMouseMoveJoyStick();
23   virtual void OnLeftButtonDown();
24   virtual void OnLeftButtonUp();
25   virtual void OnMiddleButtonDown();
26   virtual void OnMiddleButtonUp();
27   virtual void OnRightButtonDown();
28   virtual void OnRightButtonUp();
29   virtual void OnChar   ();
30
31   virtual void OnButtonFromWindow (char* ButtonCode);
32   
33   void SetInteractor(vtkRenderWindowInteractor *iren);
34   void SetStereoInteractor(vtkRenderWindowInteractor *iren);
35   void SetAutoAdjustCameraClippingRange( int value );
36   void ResetCameraClippingRange(void);
37
38   virtual void StartState(int newstate);
39   virtual void StopState();
40
41   void SetRenderWindowData(vtkRenderer*,vtkRenderWindowInteractor*);
42   void OnTimer();
43   void SetStereoCamera(vtkCamera*,vtkCamera*,double,double);
44   void Rotate();
45   void Spin();
46   void Pan();
47   void Dolly();
48   void StereoCameraRotate(int,int);
49   void StereoCameraPan(int,int);
50   void StereoCameraDolly(int,int);
51   void StereoCameraSpin(int,int);
52
53   void DeleteXwindow(Display* disp, Window win);
54
55   void DeleteStereoWindow(void);
56   void CreateStereoWindow(void);
57
58   void SetTclWindowInterp(Tcl_Interp *interp);
59
60   Tcl_Interp* GetTclWindowInterp(void);
61   eosInteractorMyStyle();  
62   eosInteractorMyStyle(const eosInteractorMyStyle& myStyle);  
63   ~eosInteractorMyStyle();  
64
65 protected:
66   float MotionFactor;
67
68 private:
69   void SetStereoWindowInformation();
70   void ResetStereoWindowInformation();
71
72   void JoyStickPan(void);
73   void TrackballPan(void);
74   void StereoCameraPanJoyStick();
75   void StereoCameraPanTrackball();
76   void StereoCameraDollyJoyStick();
77   void StereoCameraDollyTrackball();
78   static int StereoState;
79   static int WindowButtonState;
80   static int TJSwitchState;
81   static vtkRenderer *Ren,*RenLeft,*RenRight;
82   static vtkCamera  *Cam,*CamLeft,*CamRight;
83
84   static vtkRenderWindowInteractor *rwiStereo;
85   static vtkRenderWindowInteractor *rwiMain;
86
87   eosStereoWindow *stereoWin;
88   Tcl_Interp *TclWindowInterp;
89
90   //static const int  VTKIS_CAMERA = 0;
91   //static const int  VTKIS_ACTOR = 1;
92   static const char SPACE = ' ';  
93   static const int  VTKIS_STEREO = 8; 
94   static const int  SPACE_ON = 1;
95   static const int  SPACE_OFF = 0; 
96   static const int  STEREO_ON = 1;
97   static const int  STEREO_OFF = 0;
98   static const int  TRACKBALL = 0;
99   static const int  JOYSTICK = 1;
100 };
101
102 #endif