VTK  9.3.20240420
vtkCameraOrientationWidget.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
155#ifndef vtkCameraOrientationWidget_h
156#define vtkCameraOrientationWidget_h
157
158#include "vtkAbstractWidget.h"
159#include "vtkInteractionWidgetsModule.h" // needed for export macro
160#include "vtkWeakPointer.h" // for weak pointer ivar
161#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
162
163VTK_ABI_NAMESPACE_BEGIN
166class vtkRenderer;
167
168class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkCameraOrientationWidget
169 : public vtkAbstractWidget
170{
171public:
174 void PrintSelf(ostream& os, vtkIndent indent) override;
175
177
181 vtkSetMacro(Animate, bool);
182 vtkGetMacro(Animate, bool);
183 vtkBooleanMacro(Animate, bool);
185
187
190 vtkSetClampMacro(AnimatorTotalFrames, int, 2, VTK_INT_MAX);
191 vtkGetMacro(AnimatorTotalFrames, int);
193
198
203
205
215
216protected:
219
220 // These methods handle events
221 void ComputeWidgetState(int X, int Y, int modify = 0);
225
226 // These control the representation and parent renderer's camera.
227 void OrientParentCamera(double back[3], double up[3]);
229 void InterpolateCamera(int t);
230
231 // Manage the state of the widget
232 enum class WidgetStateType : int
233 {
234 Inactive, // mouse is not over the widget, none of the handles are selected.
235 Hot, // mouse is over the widget but none of the handles are selected
236 Active // any one handle is selected, representation could be rotating.
237 };
238 WidgetStateType WidgetState = WidgetStateType::Inactive;
239
241
242 // Store camera interpolations.
244
245 bool Animate = true;
246 int AnimatorTotalFrames = 20;
247
248 int ResizeObserverTag = -1;
249
250private:
252 void operator=(const vtkCameraOrientationWidget&) = delete;
253};
254
255VTK_ABI_NAMESPACE_END
256#endif
define the API for widget / widget representation
interpolate a series of cameras to update a new camera
A 3D representation for vtkCameraOrientationWidget.
A widget to manipulate vtkCameraOrientationWidget.
vtkWeakPointer< vtkRenderer > ParentRenderer
vtkNew< vtkCameraInterpolator > CameraInterpolator
static void SelectAction(vtkAbstractWidget *)
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
static void MoveAction(vtkAbstractWidget *)
void CreateDefaultRepresentation() override
Create a vtkCameraOrientationRepresentation.
static void EndSelectAction(vtkAbstractWidget *)
~vtkCameraOrientationWidget() override
void ComputeWidgetState(int X, int Y, int modify=0)
void SetParentRenderer(vtkRenderer *renderer)
This widget shows and manipulates the orientation of the parent renderer's active camera.
void OrientParentCamera(double back[3], double up[3])
vtkRenderer * GetParentRenderer()
This widget shows and manipulates the orientation of the parent renderer's active camera.
static vtkCameraOrientationWidget * New()
void SquareResize()
Fits the widget's renderer to a square viewport.
a simple class to control print indentation
Definition vtkIndent.h:108
Allocate and hold a VTK object.
Definition vtkNew.h:160
abstract specification for renderers
a weak reference to a vtkObject.
#define VTK_INT_MAX
Definition vtkType.h:144
#define VTK_MARSHALAUTO