VTK
vtkInteractorStyle3D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkInteractorStyle3D.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm 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 =========================================================================*/
51 #ifndef vtkInteractorStyle3D_h
52 #define vtkInteractorStyle3D_h
53 
54 #include "vtkRenderingCoreModule.h" // For export macro
55 #include "vtkInteractorStyle.h"
56 
57 class vtkCamera;
58 class vtkPropPicker3D;
59 class vtkProp3D;
60 class vtkMatrix3x3;
61 class vtkMatrix4x4;
62 class vtkTransform;
63 
64 class VTKRENDERINGCORE_EXPORT vtkInteractorStyle3D : public vtkInteractorStyle
65 {
66 public:
67  static vtkInteractorStyle3D *New();
69  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
70 
72 
76  void OnMouseMove() VTK_OVERRIDE;
77  void OnLeftButtonDown() VTK_OVERRIDE;
78  void OnLeftButtonUp() VTK_OVERRIDE;
79  void OnRightButtonDown() VTK_OVERRIDE;
80  void OnRightButtonUp() VTK_OVERRIDE;
81  void OnMiddleButtonDown() VTK_OVERRIDE;
82  void OnMiddleButtonUp() VTK_OVERRIDE;
83  void OnFourthButtonUp() VTK_OVERRIDE;
85 
87 
90  void OnPinch() VTK_OVERRIDE;
91  void OnPan() VTK_OVERRIDE;
93 
94  // This method handles updating the prop based on changes in the devices
95  // pose. We use rotate as the state to mean adjusting-the-actor-pose
96  void Rotate() VTK_OVERRIDE;
97 
98  // This method handles updating the camera based on changes in the devices
99  // pose. We use Dolly as the state to mean moving the camera forward
100  void Dolly() VTK_OVERRIDE;
101 
102  // This method handles updating the clip plane for all mappers
103  // in the renderer
104  virtual void Clip();
105 
107 
110  virtual void StartClip();
111  virtual void EndClip();
113 
115 
122  vtkSetMacro(DollyMotionFactor, double);
123  vtkGetMacro(DollyMotionFactor, double);
125 
133  void SetDistance(vtkCamera *cam, double distance);
134 
135 protected:
137  ~vtkInteractorStyle3D() VTK_OVERRIDE;
138 
139  void FindPickedActor(double x, double y, double z);
140 
141  void Prop3DTransform(vtkProp3D *prop3D,
142  double *boxCenter,
143  int NumRotation,
144  double **rotate,
145  double *scale);
146 
147  vtkPropPicker3D *InteractionPicker;
148  vtkProp3D *InteractionProp;
149  vtkMatrix3x3 *TempMatrix3;
150  vtkMatrix4x4 *TempMatrix4;
151  vtkTransform *TempTransform;
152  double AppliedTranslation[3];
153 
154  double DollyMotionFactor;
155 
156 private:
157  vtkInteractorStyle3D(const vtkInteractorStyle3D&) VTK_DELETE_FUNCTION; // Not implemented.
158  void operator=(const vtkInteractorStyle3D&) VTK_DELETE_FUNCTION; // Not implemented.
159 };
160 
161 #endif
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:35
static vtkInteractorStyle * New()
This class must be supplied with a vtkRenderWindowInteractor wrapper or parent.
extends interaction to support 3D input
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:54
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:43
a simple class to control print indentation
Definition: vtkIndent.h:33
a virtual camera for 3D rendering
Definition: vtkCamera.h:44
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
pick an actor/prop given XYZ coordinates
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
provide event-driven interface to the rendering window (defines trackball mode)
represent and manipulate 3x3 transformation matrices
Definition: vtkMatrix3x3.h:33
virtual void OnMouseMove()
Generic event bindings can be overridden in subclasses.