VTK  9.4.20251007
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
89
94
96
106
107protected:
110
111 // These methods handle events
112 void ComputeWidgetState(int X, int Y, int modify = 0);
116
117 // These control the representation and parent renderer's camera.
118 void OrientParentCamera(double back[3], double up[3]);
120 void InterpolateCamera(int t);
121
122 // Manage the state of the widget
123 enum class WidgetStateType : int
124 {
125 Inactive, // mouse is not over the widget, none of the handles are selected.
126 Hot, // mouse is over the widget but none of the handles are selected
127 Active // any one handle is selected, representation could be rotating.
128 };
130
132
133 // Store camera interpolations.
135
136 bool Animate = true;
138
140
141private:
143 void operator=(const vtkCameraOrientationWidget&) = delete;
144};
145
146VTK_ABI_NAMESPACE_END
147#endif
interpolate a series of cameras to update a new camera
A 3D representation for 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:29
Allocate and hold a VTK object.
Definition vtkNew.h:58
abstract specification for renderers
Definition vtkRenderer.h:63
a weak reference to a vtkObject.
#define VTK_INT_MAX
Definition vtkType.h:144
#define VTK_MARSHALAUTO