VTK  9.6.20260315
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
157
158#ifndef vtkCameraOrientationWidget_h
159#define vtkCameraOrientationWidget_h
160
161#include "vtkAbstractWidget.h"
162#include "vtkInteractionWidgetsModule.h" // needed for export macro
163#include "vtkWeakPointer.h" // for weak pointer ivar
164#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
165
166VTK_ABI_NAMESPACE_BEGIN
169class vtkRenderer;
170
171class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkCameraOrientationWidget
172 : public vtkAbstractWidget
173{
174public:
177 void PrintSelf(ostream& os, vtkIndent indent) override;
178
180
184 vtkSetMacro(Animate, bool);
185 vtkGetMacro(Animate, bool);
186 vtkBooleanMacro(Animate, bool);
188
190
193 vtkSetClampMacro(AnimatorTotalFrames, int, 2, VTK_INT_MAX);
194 vtkGetMacro(AnimatorTotalFrames, int);
196
203
208
213
219 void SetDefaultRenderer(vtkRenderer* renderer) override;
220
222
232
234
238 vtkSetMacro(ShouldResetCamera, bool);
239 vtkGetMacro(ShouldResetCamera, bool);
240 vtkBooleanMacro(ShouldResetCamera, bool);
241
242protected:
245
246 // These methods handle events
247 void ComputeWidgetState(int X, int Y, int modify = 0);
251
252 // These control the representation and parent renderer's camera.
253 void OrientParentCamera(double back[3], double up[3]);
255 void InterpolateCamera(int t);
256
258 void PlayAnimationSingleFrame(vtkObject* caller, unsigned long event, void* callData);
260
261 // Manage the state of the widget
262 enum class WidgetStateType : int
263 {
264 Inactive, // mouse is not over the widget, none of the handles are selected.
265 Hot, // mouse is over the widget but none of the handles are selected
266 Active // any one handle is selected, representation could be rotating.
267 };
269
271
272 // Store camera interpolations.
274
275 bool Animate = true;
276 bool ShouldResetCamera = true;
280
284
285private:
287 void operator=(const vtkCameraOrientationWidget&) = delete;
288};
289
290VTK_ABI_NAMESPACE_END
291#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:108
Allocate and hold a VTK object.
Definition vtkNew.h:167
abstract specification for renderers
a weak reference to a vtkObject.
#define VTK_INT_MAX
Definition vtkType.h:192
#define VTK_MARSHALAUTO