VTK  9.5.2
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
45
46#ifndef vtkCameraOrientationWidget_h
47#define vtkCameraOrientationWidget_h
48
49#include "vtkAbstractWidget.h"
50#include "vtkInteractionWidgetsModule.h" // needed for export macro
51#include "vtkWeakPointer.h" // for weak pointer ivar
52#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
53
54VTK_ABI_NAMESPACE_BEGIN
57class vtkRenderer;
58
59class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkCameraOrientationWidget
60 : public vtkAbstractWidget
61{
62public:
65 void PrintSelf(ostream& os, vtkIndent indent) override;
66
68
72 vtkSetMacro(Animate, bool);
73 vtkGetMacro(Animate, bool);
74 vtkBooleanMacro(Animate, bool);
76
78
81 vtkSetClampMacro(AnimatorTotalFrames, int, 2, VTK_INT_MAX);
82 vtkGetMacro(AnimatorTotalFrames, int);
84
91
96
101
107 void SetDefaultRenderer(vtkRenderer* renderer) override;
108
110
120
121protected:
124
125 // These methods handle events
126 void ComputeWidgetState(int X, int Y, int modify = 0);
130
131 // These control the representation and parent renderer's camera.
132 void OrientParentCamera(double back[3], double up[3]);
134 void InterpolateCamera(int t);
135
137 void PlayAnimationSingleFrame(vtkObject* caller, unsigned long event, void* callData);
139
140 // Manage the state of the widget
141 enum class WidgetStateType : int
142 {
143 Inactive, // mouse is not over the widget, none of the handles are selected.
144 Hot, // mouse is over the widget but none of the handles are selected
145 Active // any one handle is selected, representation could be rotating.
146 };
148
150
151 // Store camera interpolations.
153
154 bool Animate = true;
158
162
163private:
165 void operator=(const vtkCameraOrientationWidget&) = delete;
166};
167
168VTK_ABI_NAMESPACE_END
169#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:60
a weak reference to a vtkObject.
#define VTK_INT_MAX
Definition vtkType.h:161
#define VTK_MARSHALAUTO