VTK  9.6.0
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
48
49#ifndef vtkCameraOrientationWidget_h
50#define vtkCameraOrientationWidget_h
51
52#include "vtkAbstractWidget.h"
53#include "vtkInteractionWidgetsModule.h" // needed for export macro
54#include "vtkWeakPointer.h" // for weak pointer ivar
55#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
56
57VTK_ABI_NAMESPACE_BEGIN
60class vtkRenderer;
61
62class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkCameraOrientationWidget
63 : public vtkAbstractWidget
64{
65public:
68 void PrintSelf(ostream& os, vtkIndent indent) override;
69
71
75 vtkSetMacro(Animate, bool);
76 vtkGetMacro(Animate, bool);
77 vtkBooleanMacro(Animate, bool);
79
81
84 vtkSetClampMacro(AnimatorTotalFrames, int, 2, VTK_INT_MAX);
85 vtkGetMacro(AnimatorTotalFrames, int);
87
94
99
104
110 void SetDefaultRenderer(vtkRenderer* renderer) override;
111
113
123
124protected:
127
128 // These methods handle events
129 void ComputeWidgetState(int X, int Y, int modify = 0);
133
134 // These control the representation and parent renderer's camera.
135 void OrientParentCamera(double back[3], double up[3]);
137 void InterpolateCamera(int t);
138
140 void PlayAnimationSingleFrame(vtkObject* caller, unsigned long event, void* callData);
142
143 // Manage the state of the widget
144 enum class WidgetStateType : int
145 {
146 Inactive, // mouse is not over the widget, none of the handles are selected.
147 Hot, // mouse is over the widget but none of the handles are selected
148 Active // any one handle is selected, representation could be rotating.
149 };
151
153
154 // Store camera interpolations.
156
157 bool Animate = true;
161
165
166private:
168 void operator=(const vtkCameraOrientationWidget&) = delete;
169};
170
171VTK_ABI_NAMESPACE_END
172#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:29
Allocate and hold a VTK object.
Definition vtkNew.h:58
abstract specification for renderers
Definition vtkRenderer.h:64
a weak reference to a vtkObject.
#define VTK_INT_MAX
Definition vtkType.h:197
#define VTK_MARSHALAUTO