Go to the documentation of this file.
10 #ifndef vtk_m_rendering_Camera_h
11 #define vtk_m_rendering_Camera_h
13 #include <vtkm/rendering/vtkm_rendering_export.h>
35 : LookAt(0.0f, 0.0f, 0.0f)
36 , Position(0.0f, 0.0f, 1.0f)
37 , ViewUp(0.0f, 1.0f, 0.0f)
106 , ViewportLeft(-1.0f)
107 , ViewportRight(1.0f)
108 , ViewportBottom(-1.0f)
118 void GetRealViewport(
vtkm::Id screenWidth,
158 this->NearPlane = nearPlane;
159 this->FarPlane = farPlane;
164 this->SetClippingRange(
static_cast<vtkm::Float32>(nearPlane),
170 this->SetClippingRange(nearFarRange.
Min, nearFarRange.
Max);
187 left = this->ViewportLeft;
188 right = this->ViewportRight;
189 bottom = this->ViewportBottom;
190 top = this->ViewportTop;
198 left = this->ViewportLeft;
199 right = this->ViewportRight;
200 bottom = this->ViewportBottom;
201 top = this->ViewportTop;
207 this->ViewportLeft, this->ViewportRight, this->ViewportBottom, this->ViewportTop, 0.0, 0.0);
212 this->ViewportLeft = left;
213 this->ViewportRight = right;
214 this->ViewportBottom = bottom;
215 this->ViewportTop = top;
229 viewportBounds.
X.
Min, viewportBounds.
X.
Max, viewportBounds.
Y.
Min, viewportBounds.
Y.
Max);
243 this->Camera3D.LookAt = lookAt;
262 this->Camera3D.Position = position;
280 this->Camera3D.ViewUp = viewUp;
297 this->Camera2D.XScale = xscale;
315 this->Camera3D.FieldOfView = fov;
341 pan[0] = this->Camera3D.XPan;
342 pan[1] = this->Camera3D.YPan;
488 left = this->Camera2D.Left;
489 right = this->Camera2D.Right;
490 bottom = this->Camera2D.Bottom;
491 top = this->Camera2D.Top;
497 this->Camera2D.Right,
498 this->Camera2D.Bottom,
510 this->Camera2D.Left = left;
511 this->Camera2D.Right = right;
512 this->Camera2D.Bottom = bottom;
513 this->Camera2D.Top = top;
515 this->Camera2D.XPan = 0;
516 this->Camera2D.YPan = 0;
517 this->Camera2D.Zoom = 1;
533 this->SetViewRange2D(xRange.
Min, xRange.
Max, yRange.
Min, yRange.
Max);
538 this->SetViewRange2D(viewRange.
X, viewRange.
Y);
560 #endif // vtk_m_rendering_Camera_h
VTKM_CONT void GetViewport(vtkm::Float32 &left, vtkm::Float32 &right, vtkm::Float32 &bottom, vtkm::Float32 &top) const
The viewport of the projection.
Definition: Camera.h:182
vtkm::Float32 Top
Definition: Camera.h:87
Camera3DStruct Camera3D
Definition: Camera.h:546
VTKM_CONT void SetXScale(vtkm::Float32 xscale)
Definition: Camera.h:294
VTKM_CONT vtkm::Float32 GetZoom() const
Definition: Camera.h:359
vtkm::Float32 ViewportRight
Definition: Camera.h:553
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::Float32 NearPlane
Definition: Camera.h:549
VTKM_CONT void SetViewRange2D(const vtkm::Bounds &viewRange)
Definition: Camera.h:536
VTKM_CONT vtkm::Vec2f_32 GetPan() const
Definition: Camera.h:338
VTKM_CONT Camera3DStruct()
Definition: Camera.h:34
vtkm::Float32 YPan
Definition: Camera.h:57
vtkm::Float32 ViewportBottom
Definition: Camera.h:554
vtkm::Float32 Bottom
Definition: Camera.h:86
vtkm::Float32 XScale
Definition: Camera.h:88
vtkm::Float32 Left
Definition: Camera.h:84
VTKM_CONT void SetXScale(vtkm::Float64 xscale)
Definition: Camera.h:300
Camera2DStruct Camera2D
Definition: Camera.h:547
vtkm::Float32 ViewportTop
Definition: Camera.h:555
VTKM_CONT void Azimuth(vtkm::Float64 angleDegrees)
Definition: Camera.h:435
VTKM_CONT void SetViewRange2D(vtkm::Float32 left, vtkm::Float32 right, vtkm::Float32 bottom, vtkm::Float32 top)
Definition: Camera.h:504
vtkm::Vec3f_32 LookAt
Definition: Camera.h:52
VTKM_CONT void SetLookAt(const vtkm::Vec3f_32 &lookAt)
Definition: Camera.h:240
VTKM_CONT vtkm::Float32 GetXScale() const
The xscale of the camera.
Definition: Camera.h:292
VTKM_CONT void SetClippingRange(vtkm::Float64 nearPlane, vtkm::Float64 farPlane)
Definition: Camera.h:162
vtkm::Float32 FieldOfView
Definition: Camera.h:55
vtkm::Vec3f_32 ViewUp
Definition: Camera.h:54
VTKM_CONT vtkm::Float32 GetFieldOfView() const
The field of view angle.
Definition: Camera.h:310
VTKM_CONT void Roll(vtkm::Float64 angleDegrees)
Definition: Camera.h:421
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
VTKM_CONT void SetPosition(const vtkm::Vec3f_64 &position)
Definition: Camera.h:265
vtkm::Float32 Zoom
Definition: Camera.h:58
const VTKM_CONT vtkm::Vec3f_32 & GetViewUp() const
The up orientation of the camera in 3D mode.
Definition: Camera.h:275
VTKM_CONT void SetFieldOfView(vtkm::Float64 fov)
Definition: Camera.h:318
VTKM_CONT void SetPosition(const vtkm::Vec3f_32 &position)
Definition: Camera.h:259
VTKM_CONT vtkm::Range GetClippingRange() const
The clipping range of the camera.
Definition: Camera.h:154
VTKM_CONT void Pan(vtkm::Float64 dx, vtkm::Float64 dy)
Pans the camera.
Definition: Camera.h:327
vtkm::Vec3f_32 Position
Definition: Camera.h:53
VTKM_CONT void SetClippingRange(vtkm::Float32 nearPlane, vtkm::Float32 farPlane)
Definition: Camera.h:156
VTKM_CONT void GetViewport(vtkm::Float64 &left, vtkm::Float64 &right, vtkm::Float64 &bottom, vtkm::Float64 &top) const
Definition: Camera.h:193
VTKM_CONT void TrackballRotate(vtkm::Float64 startX, vtkm::Float64 startY, vtkm::Float64 endX, vtkm::Float64 endY)
Definition: Camera.h:377
vtkm::Float32 YPan
Definition: Camera.h:90
VTKM_CONT vtkm::Bounds GetViewRange2D() const
Definition: Camera.h:494
const VTKM_CONT vtkm::Vec3f_32 & GetLookAt() const
The focal point the camera is looking at in 3D mode.
Definition: Camera.h:238
vtkm::Float32 XPan
Definition: Camera.h:89
VTKM_CONT void GetViewRange2D(vtkm::Float32 &left, vtkm::Float32 &right, vtkm::Float32 &bottom, vtkm::Float32 &top) const
The viewable region in the x-y plane.
Definition: Camera.h:483
VTKM_CONT void SetViewport(vtkm::Float32 left, vtkm::Float32 right, vtkm::Float32 bottom, vtkm::Float32 top)
Definition: Camera.h:210
vtkm::Float32 XPan
Definition: Camera.h:56
const VTKM_CONT vtkm::Vec3f_32 & GetPosition() const
The spatial position of the camera in 3D mode.
Definition: Camera.h:257
VTKM_CONT void SetModeTo2D()
Definition: Camera.h:138
#define VTKM_CONT
Definition: ExportMacros.h:57
Mode
Definition: Camera.h:95
Mode ModeType
Definition: Camera.h:545
Represent an axis-aligned 3D bounds in space.
Definition: Bounds.h:29
VTKM_CONT vtkm::rendering::Camera::Mode GetMode() const
The mode of the camera (2D or 3D).
Definition: Camera.h:132
VTKM_CONT void Zoom(vtkm::Float64 zoom)
Definition: Camera.h:356
VTKM_CONT void SetLookAt(const vtkm::Vec< Float64, 3 > &lookAt)
Definition: Camera.h:246
vtkm::Float32 Right
Definition: Camera.h:85
VTKM_CONT void SetModeTo3D()
Definition: Camera.h:136
VTKM_CONT void SetViewRange2D(vtkm::Float64 left, vtkm::Float64 right, vtkm::Float64 bottom, vtkm::Float64 top)
Definition: Camera.h:520
vtkm::Float64 Min
Definition: Range.h:33
VTKM_CONT void Dolly(vtkm::Float64 value)
Definition: Camera.h:471
vtkm::Float32 Zoom
Definition: Camera.h:91
VTKM_CONT Camera(Mode vtype=Camera::Mode::ThreeD)
Definition: Camera.h:102
float Float32
Definition: Types.h:154
double Float64
Definition: Types.h:155
vtkm::Range X
Definition: Bounds.h:31
VTKM_CONT void SetViewUp(const vtkm::Vec3f_64 &viewUp)
Definition: Camera.h:283
vtkm::Range Y
Definition: Bounds.h:32
VTKM_CONT void Elevation(vtkm::Float64 angleDegrees)
Definition: Camera.h:453
vtkm::Float32 ViewportLeft
Definition: Camera.h:552
VTKM_CONT void SetViewRange2D(const vtkm::Range &xRange, const vtkm::Range &yRange)
Definition: Camera.h:531
VTKM_CONT void SetViewUp(const vtkm::Vec3f_32 &viewUp)
Definition: Camera.h:277
vtkm::Float64 Max
Definition: Range.h:34
VTKM_CONT void SetViewport(const vtkm::Bounds &viewportBounds)
Definition: Camera.h:226
vtkm::Float32 FarPlane
Definition: Camera.h:550
VTKM_CONT void Pan(vtkm::Vec2f_32 direction)
Definition: Camera.h:332
VTKM_CONT vtkm::Bounds GetViewport() const
Definition: Camera.h:204
VTKM_CONT void SetMode(vtkm::rendering::Camera::Mode mode)
Definition: Camera.h:134
VTKM_CONT void Pan(vtkm::Vec2f_64 direction)
Definition: Camera.h:335
VTKM_CONT void SetClippingRange(const vtkm::Range &nearFarRange)
Definition: Camera.h:168
VTKM_CONT void SetViewport(vtkm::Float64 left, vtkm::Float64 right, vtkm::Float64 bottom, vtkm::Float64 top)
Definition: Camera.h:218
VTKM_CONT void SetFieldOfView(vtkm::Float32 fov)
Definition: Camera.h:312
VTKM_CONT Camera2DStruct()
Definition: Camera.h:65
Represent a continuous scalar range of values.
Definition: Range.h:31