VTK  9.1.0
vtkCameraOrientationWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCameraOrientationWidget.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
144 #ifndef vtkCameraOrientationWidget_h
145 #define vtkCameraOrientationWidget_h
146 
147 #include "vtkAbstractWidget.h"
148 #include "vtkInteractionWidgetsModule.h" // needed for export macro
149 #include "vtkWeakPointer.h" // for weak pointer ivar
150 
153 class vtkRenderer;
154 
155 class VTKINTERACTIONWIDGETS_EXPORT vtkCameraOrientationWidget : public vtkAbstractWidget
156 {
157 public:
160  void PrintSelf(ostream& os, vtkIndent indent) override;
161 
163 
167  vtkSetMacro(Animate, bool);
168  vtkGetMacro(Animate, bool);
169  vtkBooleanMacro(Animate, bool);
171 
173 
176  vtkSetClampMacro(AnimatorTotalFrames, int, 2, VTK_INT_MAX);
177  vtkGetMacro(AnimatorTotalFrames, int);
179 
184 
188  void SquareResize();
189 
191 
201 
202 protected:
204  ~vtkCameraOrientationWidget() override = default;
205 
206  // These methods handle events
207  void ComputeWidgetState(int X, int Y, int modify = 0);
211 
212  // These control the representation and parent renderer's camera.
213  void OrientParentCamera(double back[3], double up[3]);
215  void InterpolateCamera(int t);
216 
217  // Manage the state of the widget
218  enum class WidgetStateType : int
219  {
220  Inactive, // mouse is not over the widget, none of the handles are selected.
221  Hot, // mouse is over the widget but none of the handles are selected
222  Active // any one handle is selected, representation could be rotating.
223  };
224  WidgetStateType WidgetState = WidgetStateType::Inactive;
225 
227 
228  // Store camera interpolations.
230 
231  bool Animate = true;
232  int AnimatorTotalFrames = 20;
233 
234  int ResizeObserverTag = -1;
235 
236 private:
238  void operator=(const vtkCameraOrientationWidget&) = delete;
239 };
240 
241 #endif
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:155
vtkCameraOrientationWidget::New
static vtkCameraOrientationWidget * New()
vtkCameraOrientationWidget::EndSelectAction
static void EndSelectAction(vtkAbstractWidget *)
vtkAbstractWidget.h
vtkCameraOrientationWidget::MoveAction
static void MoveAction(vtkAbstractWidget *)
vtkCameraOrientationWidget::InterpolateCamera
void InterpolateCamera(int t)
vtkCameraInterpolator
interpolate a series of cameras to update a new camera
Definition: vtkCameraInterpolator.h:80
vtkCameraOrientationWidget::OrientParentCamera
void OrientParentCamera(double back[3], double up[3])
vtkCameraOrientationWidget::WidgetStateType
WidgetStateType
Definition: vtkCameraOrientationWidget.h:219
vtkCameraOrientationWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
vtkCameraOrientationWidget::SelectAction
static void SelectAction(vtkAbstractWidget *)
vtkCameraOrientationRepresentation
a 3D axes representation for interactive widgets
Definition: vtkCameraOrientationRepresentation.h:50
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:66
vtkCameraOrientationWidget::SetParentRenderer
void SetParentRenderer(vtkRenderer *renderer)
This widget shows and manipulates the orientation of the parent renderer's active camera.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkCameraOrientationWidget::vtkCameraOrientationWidget
vtkCameraOrientationWidget()
vtkCameraOrientationWidget::ComputeWidgetState
void ComputeWidgetState(int X, int Y, int modify=0)
vtkNew< vtkCameraInterpolator >
vtkWeakPointer.h
vtkCameraOrientationWidget::ParentRenderer
vtkWeakPointer< vtkRenderer > ParentRenderer
Definition: vtkCameraOrientationWidget.h:226
vtkCameraOrientationWidget::CreateDefaultRepresentation
void CreateDefaultRepresentation() override
Create a vtkCameraOrientationRepresentation.
vtkCameraOrientationWidget::SquareResize
void SquareResize()
Fits the widget's renderer to a square viewport.
vtkCameraOrientationWidget::GetParentRenderer
vtkRenderer * GetParentRenderer()
This widget shows and manipulates the orientation of the parent renderer's active camera.
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:182
vtkCameraOrientationWidget::~vtkCameraOrientationWidget
~vtkCameraOrientationWidget() override=default
vtkCameraOrientationWidget::OrientWidgetRepresentation
void OrientWidgetRepresentation()
vtkCameraOrientationWidget
A widget to manipulate vtkCameraOrientationWidget.
Definition: vtkCameraOrientationWidget.h:156
vtkWeakPointer< vtkRenderer >
vtkCameraOrientationWidget::CameraInterpolator
vtkNew< vtkCameraInterpolator > CameraInterpolator
Definition: vtkCameraOrientationWidget.h:229