VTK  9.3.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
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
53VTK_ABI_NAMESPACE_BEGIN
56class vtkRenderer;
57
58class VTKINTERACTIONWIDGETS_EXPORT vtkCameraOrientationWidget : public vtkAbstractWidget
59{
60public:
63 void PrintSelf(ostream& os, vtkIndent indent) override;
64
66
70 vtkSetMacro(Animate, bool);
71 vtkGetMacro(Animate, bool);
72 vtkBooleanMacro(Animate, bool);
74
76
79 vtkSetClampMacro(AnimatorTotalFrames, int, 2, VTK_INT_MAX);
80 vtkGetMacro(AnimatorTotalFrames, int);
82
87
92
94
104
105protected:
107 ~vtkCameraOrientationWidget() override = default;
108
109 // These methods handle events
110 void ComputeWidgetState(int X, int Y, int modify = 0);
114
115 // These control the representation and parent renderer's camera.
116 void OrientParentCamera(double back[3], double up[3]);
118 void InterpolateCamera(int t);
119
120 // Manage the state of the widget
121 enum class WidgetStateType : int
122 {
123 Inactive, // mouse is not over the widget, none of the handles are selected.
124 Hot, // mouse is over the widget but none of the handles are selected
125 Active // any one handle is selected, representation could be rotating.
126 };
127 WidgetStateType WidgetState = WidgetStateType::Inactive;
128
130
131 // Store camera interpolations.
133
134 bool Animate = true;
135 int AnimatorTotalFrames = 20;
136
137 int ResizeObserverTag = -1;
138
139private:
141 void operator=(const vtkCameraOrientationWidget&) = delete;
142};
143
144VTK_ABI_NAMESPACE_END
145#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
~vtkCameraOrientationWidget() override=default
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 *)
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:51
abstract specification for renderers
Definition vtkRenderer.h:59
a weak reference to a vtkObject.
#define VTK_INT_MAX
Definition vtkType.h:144