VTK  9.3.20240327
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:
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:
73 
75 
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:150
appends one or more polygonal datasets together
Appends a cylinder to a cone to form an arrow.
handle source used to represent one camera.
~vtkCameraHandleSource() override
static vtkCameraHandleSource * New()
void SetCamera(vtkCamera *cam)
Set the camera represented by this handle.
double * GetPosition() override
Set/Get the position of the camera handle.
void SetPosition(double xPos, double yPos, double zPos) override
Set/Get the position of the camera handle.
double * GetDirection() override
Set/Get the direction of the camera handle.
void operator=(const vtkCameraHandleSource &)=delete
void SetDirection(double xTarget, double yTarget, double zTarget) override
Set/Get the direction of the camera handle.
vtkCameraHandleSource(const vtkCameraHandleSource &)=delete
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
a virtual camera for 3D rendering
Definition: vtkCamera.h:150
interface that can be inherited to define handler sources for any kind of interaction.
virtual double * GetPosition()=0
Get the position of the handle.
void SetPosition(const double pos[3])
Set the position of the handle.
void SetDirection(const double dir[3])
Set the direction of the handle.
virtual double * GetDirection()=0
Get the direction of the handle.
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
static vtkSmartPointer< T > New()
Create an instance of a VTK object.
create a polygonal sphere centered at the origin
transform points and associated normals and vectors
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:159