VTK  9.3.1
vtkCameraHandleSource.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
16 #ifndef vtkCameraHandleSource_h
17 #define vtkCameraHandleSource_h
18 
19 #include "vtkCamera.h" // for vtkCamera
20 #include "vtkHandleSource.h"
21 #include "vtkInteractionWidgetsModule.h" // For export macro
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkArrowSource;
25 class vtkActor;
26 class vtkAppendPolyData;
27 class vtkSphereSource;
28 class vtkTransform;
29 class vtkTransformFilter;
30 
31 class VTKINTERACTIONWIDGETS_EXPORT vtkCameraHandleSource : public vtkHandleSource
32 {
33 public:
34  static vtkCameraHandleSource* New();
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
42  void SetCamera(vtkCamera* cam);
43 
45 
49  void SetPosition(double xPos, double yPos, double zPos) override;
51  double* GetPosition() override;
53 
55 
61  void SetDirection(double xTarget, double yTarget, double zTarget) override;
63  double* GetDirection() override;
65 
67  void operator=(const vtkCameraHandleSource&) = delete;
68 
69 protected:
71  ~vtkCameraHandleSource() override;
73 
74  void RecomputeArrows();
75 
76  void RecomputeSphere();
77 
78 private:
80  vtkNew<vtkArrowSource> UpArrow;
81  vtkNew<vtkArrowSource> FrontArrow;
82  vtkNew<vtkTransform> UpTransform;
83  vtkNew<vtkTransformFilter> UpTransformFilter;
84  vtkNew<vtkTransform> FrontTransform;
85  vtkNew<vtkTransformFilter> FrontTransformFilter;
86  vtkNew<vtkAppendPolyData> ArrowsAppend;
87  vtkNew<vtkSphereSource> PositionSphere;
88 };
89 
90 VTK_ABI_NAMESPACE_END
91 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:40
virtual double * GetPosition()=0
Get the position of the handle.
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual double * GetDirection()=0
Get the direction of the handle.
interface that can be inherited to define handler sources for any kind of interaction.
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:49
static vtkSmartPointer< T > New()
Create an instance of a VTK object.
handle source used to represent one camera.
static vtkPolyDataAlgorithm * New()
create a polygonal sphere centered at the origin
a simple class to control print indentation
Definition: vtkIndent.h:28
a virtual camera for 3D rendering
Definition: vtkCamera.h:40
void SetDirection(const double dir[3])
Set the direction of the handle.
Appends a cylinder to a cone to form an arrow.
appends one or more polygonal datasets together
void SetPosition(const double pos[3])
Set the position of the handle.
transform points and associated normals and vectors
Store zero or more vtkInformation instances.
void operator=(const vtkHandleSource &)=delete