VTK  9.7.1
vtkInteractorStyle3D.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
39 #ifndef vtkInteractorStyle3D_h
40 #define vtkInteractorStyle3D_h
41 
42 #include "vtkInteractorStyle.h"
43 #include "vtkNew.h" // ivars
44 #include "vtkRenderingCoreModule.h" // For export macro
45 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO, VTK_MARSHALEXCLUDE
46 
47 VTK_ABI_NAMESPACE_BEGIN
49 class vtkCamera;
50 class vtkProp3D;
51 class vtkMatrix3x3;
52 class vtkMatrix4x4;
53 class vtkTimerLog;
54 class vtkTransform;
55 
56 class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkInteractorStyle3D : public vtkInteractorStyle
57 {
58 public:
59  static vtkInteractorStyle3D* New();
61  void PrintSelf(ostream& os, vtkIndent indent) override;
62 
63  // This method handles updating the prop based on changes in the devices
64  // pose. We use rotate as the state to mean adjusting-the-actor-pose
65  // if last world event position \p lwpos and orientation \p lwori are defined
66  // then this function do not use the Interactor3D to get the last world event position
67  // and orientation. This is useful when one needs to pass custom world event data.
68  virtual void PositionProp(vtkEventData*, double* lwpos = nullptr, double* lwori = nullptr);
69 
70  // This method handles updating the camera based on changes in the devices
71  // pose. We use Dolly as the state to mean moving the camera forward
72  virtual void Dolly3D(vtkEventData*);
73 
75 
80  vtkSetMacro(DollyPhysicalSpeed, double);
81  vtkGetMacro(DollyPhysicalSpeed, double);
83 
89  virtual void SetScale(vtkCamera* cam, double newScale);
90 
92 
97  vtkGetObjectMacro(InteractionPicker, vtkAbstractPropPicker);
99  void SetInteractionPicker(vtkAbstractPropPicker* prop);
100 
101 protected:
103  ~vtkInteractorStyle3D() override;
104 
105  void FindPickedActor(double pos[3], double orient[4]);
106 
107  void Prop3DTransform(
108  vtkProp3D* prop3D, double* boxCenter, int NumRotation, double** rotate, double* scale);
109 
110  vtkAbstractPropPicker* InteractionPicker;
111  vtkProp3D* InteractionProp;
112  vtkMatrix3x3* TempMatrix3;
113  vtkMatrix4x4* TempMatrix4;
114 
115  vtkTransform* TempTransform;
116  double AppliedTranslation[3];
117 
118  double DollyPhysicalSpeed;
119  vtkNew<vtkTimerLog> LastDolly3DEventTime;
120  double LastTrackPadPosition[2];
121 
122 private:
123  vtkInteractorStyle3D(const vtkInteractorStyle3D&) = delete;
124  void operator=(const vtkInteractorStyle3D&) = delete;
125 };
126 
127 VTK_ABI_NAMESPACE_END
128 #endif
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:31
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:50
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:39
Timer support and logging.
Definition: vtkTimerLog.h:85
a simple class to control print indentation
Definition: vtkIndent.h:28
a virtual camera for 3D rendering
Definition: vtkCamera.h:41
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define VTK_MARSHALEXCLUDE(reason)
abstract API for pickers that can pick an instance of vtkProp
Allocate and hold a VTK object.
provide event-driven interface to the rendering window (defines trackball mode)
#define VTK_MARSHALAUTO
represent and manipulate 3x3 transformation matrices
Definition: vtkMatrix3x3.h:26
#define VTK_MARSHAL_EXCLUDE_REASON_IS_INTERNAL