VTK  9.3.20240519
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
23VTK_ABI_NAMESPACE_BEGIN
24class vtkArrowSource;
25class vtkActor;
27class vtkSphereSource;
28class vtkTransform;
30
31class VTKINTERACTIONWIDGETS_EXPORT vtkCameraHandleSource : public vtkHandleSource
32{
33public:
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
69protected:
73
75
77
78private:
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
90VTK_ABI_NAMESPACE_END
91#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
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
double * GetDirection() override
Set/Get the direction of the camera handle.
void SetCamera(vtkCamera *cam)
Set the camera represented by this handle.
static vtkCameraHandleSource * New()
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.
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:151
interface that can be inherited to define handler sources for any kind of interaction.
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 * GetPosition()=0
Get the position 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.
Allocate and hold a VTK object.
Definition vtkNew.h:160
Hold a reference to a vtkObjectBase instance.
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