ParaView
vtkPVInteractorStyle.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkPVInteractorStyle.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
27 #ifndef vtkPVInteractorStyle_h
28 #define vtkPVInteractorStyle_h
29 
30 #include "vtkInteractorStyleTrackballCamera.h"
31 #include "vtkPVVTKExtensionsRenderingModule.h" // needed for export macro
32 
34 class vtkCollection;
35 
36 class VTKPVVTKEXTENSIONSRENDERING_EXPORT vtkPVInteractorStyle
37  : public vtkInteractorStyleTrackballCamera
38 {
39 public:
40  static vtkPVInteractorStyle* New();
41  vtkTypeMacro(vtkPVInteractorStyle, vtkInteractorStyleTrackballCamera);
42  void PrintSelf(ostream& os, vtkIndent indent);
43 
45 
49  virtual void OnMouseMove();
50  virtual void OnLeftButtonDown();
51  virtual void OnLeftButtonUp();
52  virtual void OnMiddleButtonDown();
53  virtual void OnMiddleButtonUp();
54  virtual void OnRightButtonDown();
55  virtual void OnRightButtonUp();
57 
59 
64  virtual void OnKeyDown();
65  virtual void OnKeyUp();
67 
72  virtual void OnChar();
73 
77  void AddManipulator(vtkCameraManipulator* m);
78 
82  void RemoveAllManipulators();
83 
85 
88  vtkGetObjectMacro(CameraManipulators, vtkCollection);
90 
92 
101  vtkSetVector3Macro(CenterOfRotation, double);
102  vtkGetVector3Macro(CenterOfRotation, double);
104 
106 
115  vtkSetMacro(RotationFactor, double);
116  vtkGetMacro(RotationFactor, double);
118 
122  virtual vtkCameraManipulator* FindManipulator(int button, int shift, int control);
123 
127  static void DollyToPosition(double fact, int* position, vtkRenderer* renderer);
128 
132  static void TranslateCamera(vtkRenderer* renderer, int toX, int toY, int fromX, int fromY);
133 
134  using vtkInteractorStyleTrackballCamera::Dolly;
135 
136 protected:
139 
140  virtual void Dolly(double factor);
141 
143  double CenterOfRotation[3];
145 
146  // The CameraInteractors also store there button and modifier.
147  vtkCollection* CameraManipulators;
148 
149  void OnButtonDown(int button, int shift, int control);
150  void OnButtonUp(int button);
151  void ResetLights();
152 
153  vtkPVInteractorStyle(const vtkPVInteractorStyle&) VTK_DELETE_FUNCTION;
154  void operator=(const vtkPVInteractorStyle&) VTK_DELETE_FUNCTION;
155 };
156 
157 #endif
vtkCollection * CameraManipulators
Abstraction of style away from button.
interactive manipulation of the camera
vtkCameraManipulator * CurrentManipulator