VTK  9.2.20230606
vtkCameraHandleSource.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCameraHandleSource.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 =========================================================================*/
28 #ifndef vtkCameraHandleSource_h
29 #define vtkCameraHandleSource_h
30 
31 #include "vtkCamera.h" // for vtkCamera
32 #include "vtkHandleSource.h"
33 #include "vtkInteractionWidgetsModule.h" // For export macro
34 
35 VTK_ABI_NAMESPACE_BEGIN
36 class vtkArrowSource;
37 class vtkActor;
38 class vtkAppendPolyData;
39 class vtkSphereSource;
40 class vtkTransform;
41 class vtkTransformFilter;
42 
43 class VTKINTERACTIONWIDGETS_EXPORT vtkCameraHandleSource : public vtkHandleSource
44 {
45 public:
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
54  void SetCamera(vtkCamera* cam);
55 
57 
61  void SetPosition(double xPos, double yPos, double zPos) override;
63  double* GetPosition() override;
65 
67 
73  void SetDirection(double xTarget, double yTarget, double zTarget) override;
75  double* GetDirection() override;
77 
79  void operator=(const vtkCameraHandleSource&) = delete;
80 
81 protected:
85 
87 
89 
90 private:
92  vtkNew<vtkArrowSource> UpArrow;
93  vtkNew<vtkArrowSource> FrontArrow;
94  vtkNew<vtkTransform> UpTransform;
95  vtkNew<vtkTransformFilter> UpTransformFilter;
96  vtkNew<vtkTransform> FrontTransform;
97  vtkNew<vtkTransformFilter> FrontTransformFilter;
98  vtkNew<vtkAppendPolyData> ArrowsAppend;
99  vtkNew<vtkSphereSource> PositionSphere;
100 };
101 
102 VTK_ABI_NAMESPACE_END
103 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:162
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:162
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:120
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:171