VTK  9.1.0
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 class vtkArrowSource;
36 class vtkActor;
37 class vtkAppendPolyData;
38 class vtkSphereSource;
39 class vtkTransform;
40 class vtkTransformFilter;
41 
42 class VTKINTERACTIONWIDGETS_EXPORT vtkCameraHandleSource : public vtkHandleSource
43 {
44 public:
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
53  void SetCamera(vtkCamera* cam);
54 
56 
60  void SetPosition(double xPos, double yPos, double zPos) override;
62  double* GetPosition() override;
64 
66 
72  void SetDirection(double xTarget, double yTarget, double zTarget) override;
74  double* GetDirection() override;
76 
78  void operator=(const vtkCameraHandleSource&) = delete;
79 
80 protected:
84 
86 
88 
89 private:
91  vtkNew<vtkArrowSource> UpArrow;
92  vtkNew<vtkArrowSource> FrontArrow;
93  vtkNew<vtkTransform> UpTransform;
94  vtkNew<vtkTransformFilter> UpTransformFilter;
95  vtkNew<vtkTransform> FrontTransform;
96  vtkNew<vtkTransformFilter> FrontTransformFilter;
97  vtkNew<vtkAppendPolyData> ArrowsAppend;
98  vtkNew<vtkSphereSource> PositionSphere;
99 };
100 
101 #endif
vtkCameraHandleSource::SetDirection
void SetDirection(double xTarget, double yTarget, double zTarget) override
Set/Get the direction of the camera handle.
vtkCameraHandleSource::SetPosition
void SetPosition(double xPos, double yPos, double zPos) override
Set/Get the position of the camera handle.
vtkArrowSource
Appends a cylinder to a cone to form an arrow.
Definition: vtkArrowSource.h:144
vtkCameraHandleSource::SetCamera
void SetCamera(vtkCamera *cam)
Set the camera represented by this handle.
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkSmartPointer< vtkCamera >
vtkCameraHandleSource::GetDirection
double * GetDirection() override
Set/Get the direction of the camera handle.
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:164
vtkHandleSource::GetDirection
virtual double * GetDirection()=0
Get the direction of the handle.
vtkCameraHandleSource::RecomputeArrows
void RecomputeArrows()
vtkCameraHandleSource::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkHandleSource
interface that can be inherited to define handler sources for any kind of interaction.
Definition: vtkHandleSource.h:34
vtkCameraHandleSource
handle source used to represent one camera.
Definition: vtkCameraHandleSource.h:43
vtkAppendPolyData
appends one or more polygonal datasets together
Definition: vtkAppendPolyData.h:157
vtkSphereSource
create a polygonal sphere centered at the origin
Definition: vtkSphereSource.h:149
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:155
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkCamera
a virtual camera for 3D rendering
Definition: vtkCamera.h:155
vtkHandleSource::GetPosition
virtual double * GetPosition()=0
Get the position of the handle.
vtkSmartPointer::New
static vtkSmartPointer< T > New()
Create an instance of a VTK object.
Definition: vtkSmartPointer.h:334
vtkNew< vtkArrowSource >
vtkCameraHandleSource::vtkCameraHandleSource
vtkCameraHandleSource()
vtkCamera.h
vtkHandleSource::SetDirection
void SetDirection(const double dir[3])
Set the direction of the handle.
Definition: vtkHandleSource.h:72
vtkCameraHandleSource::RecomputeSphere
void RecomputeSphere()
vtkCameraHandleSource::vtkCameraHandleSource
vtkCameraHandleSource(const vtkCameraHandleSource &)=delete
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkCameraHandleSource::GetPosition
double * GetPosition() override
Set/Get the position of the camera handle.
vtkTransformFilter
transform points and associated normals and vectors
Definition: vtkTransformFilter.h:136
vtkHandleSource.h
vtkCameraHandleSource::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkCameraHandleSource::New
static vtkCameraHandleSource * New()
vtkCameraHandleSource::operator=
void operator=(const vtkCameraHandleSource &)=delete
vtkHandleSource::SetPosition
void SetPosition(const double pos[3])
Set the position of the handle.
Definition: vtkHandleSource.h:55
vtkCameraHandleSource::~vtkCameraHandleSource
~vtkCameraHandleSource() override