VTK  9.7.20260731
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
157
158#ifndef vtkCameraOrientationWidget_h
159#define vtkCameraOrientationWidget_h
160
161#include "vtkAbstractWidget.h"
162#include "vtkInteractionWidgetsModule.h" // needed for export macro
163#include "vtkWeakPointer.h" // for weak pointer ivar
164#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
165
166VTK_ABI_NAMESPACE_BEGIN
169class vtkRenderer;
170
171class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkCameraOrientationWidget
172 : public vtkAbstractWidget
173{
174public:
177 void PrintSelf(ostream& os, vtkIndent indent) override;
178
180
184 vtkSetMacro(Animate, bool);
185 vtkGetMacro(Animate, bool);
186 vtkBooleanMacro(Animate, bool);
188
190
193 vtkSetClampMacro(AnimatorTotalFrames, int, 2, VTK_INT_MAX);
194 vtkGetMacro(AnimatorTotalFrames, int);
196
203
208
213
219 void SetDefaultRenderer(vtkRenderer* renderer) override;
220
222
232
234
238 vtkSetMacro(ShouldResetCamera, bool);
239 vtkGetMacro(ShouldResetCamera, bool);
240 vtkBooleanMacro(ShouldResetCamera, bool);
242
244
250 vtkSetMacro(UseCenterOfRotation, bool);
251 vtkGetMacro(UseCenterOfRotation, bool);
252 vtkBooleanMacro(UseCenterOfRotation, bool);
254
255protected:
258
259 // These methods handle events
260 void ComputeWidgetState(int X, int Y, int modify = 0);
264
265 // These control the representation and parent renderer's camera.
266 void OrientParentCamera(double back[3], double up[3]);
268 void InterpolateCamera(int t);
269
271 void PlayAnimationSingleFrame(vtkObject* caller, unsigned long event, void* callData);
273
274 // Manage the state of the widget
275 enum class WidgetStateType : int
276 {
277 Inactive, // mouse is not over the widget, none of the handles are selected.
278 Hot, // mouse is over the widget but none of the handles are selected
279 Active // any one handle is selected, representation could be rotating.
280 };
282
284
285 // Store camera interpolations.
287
288 bool Animate = true;
289 bool ShouldResetCamera = true;
294
298
299private:
301 void operator=(const vtkCameraOrientationWidget&) = delete;
302};
303
304VTK_ABI_NAMESPACE_END
305#endif
interpolate a series of cameras to update a new camera
A 3D representation for vtkCameraOrientationWidget.
vtkWeakPointer< vtkRenderer > ParentRenderer
vtkNew< vtkCameraInterpolator > CameraInterpolator
void PlayAnimationSingleFrame(vtkObject *caller, unsigned long event, void *callData)
void SetRepresentation(vtkCameraOrientationRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
static void SelectAction(vtkAbstractWidget *)
void SetDefaultRenderer(vtkRenderer *renderer) override
Override super class method for default renderer.
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:168
abstract specification for renderers
a weak reference to a vtkObject.
#define VTK_INT_MAX
Definition vtkType.h:192
#define VTK_MARSHALAUTO