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 
31 #include "vtkPVVTKExtensionsInteractionStyleModule.h" // needed for export macro
32 
34 class vtkCollection;
35 
38 {
39 public:
40  static vtkPVInteractorStyle* New();
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
45 
49  void OnMouseMove() override;
50  void OnLeftButtonDown() override;
51  void OnLeftButtonUp() override;
52  void OnMiddleButtonDown() override;
53  void OnMiddleButtonUp() override;
54  void OnRightButtonDown() override;
55  void OnRightButtonUp() override;
57 
59 
64  void OnKeyDown() override;
65  void OnKeyUp() override;
67 
72  void OnChar() override;
73 
77  void AddManipulator(vtkCameraManipulator* m);
78 
82  void RemoveAllManipulators();
83 
85 
88  vtkGetObjectMacro(CameraManipulators, vtkCollection);
90 
92 
96  vtkSetMacro(MouseWheelZoomsToCursor, bool);
97  vtkGetMacro(MouseWheelZoomsToCursor, bool);
99 
101 
110  vtkSetVector3Macro(CenterOfRotation, double);
111  vtkGetVector3Macro(CenterOfRotation, double);
113 
115 
124  vtkSetMacro(RotationFactor, double);
125  vtkGetMacro(RotationFactor, double);
127 
131  virtual vtkCameraManipulator* FindManipulator(int button, int shift, int control);
132 
136  static void DollyToPosition(double fact, int* position, vtkRenderer* renderer);
137 
141  static void TranslateCamera(vtkRenderer* renderer, int toX, int toY, int fromX, int fromY);
142 
144 
145 protected:
147  ~vtkPVInteractorStyle() override;
148 
149  void Dolly(double factor) override;
150 
152  bool MouseWheelZoomsToCursor = false;
153  double CenterOfRotation[3];
155 
156  // The CameraInteractors also store there button and modifier.
158 
159  void OnButtonDown(int button, int shift, int control);
160  void OnButtonUp(int button);
161  void ResetLights();
162 
164  void operator=(const vtkPVInteractorStyle&) = delete;
165 };
166 
167 #endif
virtual void OnKeyUp()
void PrintSelf(ostream &os, vtkIndent indent)
vtkCollection * CameraManipulators
Abstraction of style away from button.
static vtkInteractorStyleTrackballCamera * New()
#define VTKPVVTKEXTENSIONSINTERACTIONSTYLE_EXPORT
virtual void OnKeyDown()
virtual void OnChar()
interactive manipulation of the camera
void operator=(const vtkObjectBase &)
vtkCameraManipulator * CurrentManipulator