VTK  9.6.1
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
125
129 vtkSetMacro(ShouldResetCamera, bool);
130 vtkGetMacro(ShouldResetCamera, bool);
131 vtkBooleanMacro(ShouldResetCamera, bool);
132
133protected:
136
137 // These methods handle events
138 void ComputeWidgetState(int X, int Y, int modify = 0);
142
143 // These control the representation and parent renderer's camera.
144 void OrientParentCamera(double back[3], double up[3]);
146 void InterpolateCamera(int t);
147
149 void PlayAnimationSingleFrame(vtkObject* caller, unsigned long event, void* callData);
151
152 // Manage the state of the widget
153 enum class WidgetStateType : int
154 {
155 Inactive, // mouse is not over the widget, none of the handles are selected.
156 Hot, // mouse is over the widget but none of the handles are selected
157 Active // any one handle is selected, representation could be rotating.
158 };
160
162
163 // Store camera interpolations.
165
166 bool Animate = true;
167 bool ShouldResetCamera = true;
171
175
176private:
178 void operator=(const vtkCameraOrientationWidget&) = delete;
179};
180
181VTK_ABI_NAMESPACE_END
182#endif
interpolate a series of cameras to update a new camera
A 3D representation for vtkCameraOrientationWidget.
vtkWeakPointer< vtkRenderer > ParentRenderer
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
vtkNew< vtkCameraInterpolator > CameraInterpolator
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
void StopAnimation()
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
void PlayAnimationSingleFrame(vtkObject *caller, unsigned long event, void *callData)
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
bool ShouldResetCamera
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
void SetRepresentation(vtkCameraOrientationRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
WidgetStateType
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
WidgetStateType WidgetState
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
void OrientWidgetRepresentation()
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
static void SelectAction(vtkAbstractWidget *)
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
vtkCameraOrientationWidget()
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
void InterpolateCamera(int t)
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
int ResizeObserverTag
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
int AnimatorCurrentFrame
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
int AnimatorTotalFrames
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
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.
bool Animate
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
void StartAnimation()
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
static void MoveAction(vtkAbstractWidget *)
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
void CreateDefaultRepresentation() override
Create a vtkCameraOrientationRepresentation.
static void EndSelectAction(vtkAbstractWidget *)
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
~vtkCameraOrientationWidget() override
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
void ComputeWidgetState(int X, int Y, int modify=0)
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
int AnimationTimerId
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
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])
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
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.
int ReorientObserverTag
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
int AnimationTimerObserverTag
Enable/disable resetting the camera to the bounds of the scene after reorienting the camera.
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