Go to the documentation of this file.
10 #ifndef vtk_m_rendering_Camera_h
11 #define vtk_m_rendering_Camera_h
44 : LookAt(0.0f, 0.0f, 0.0f)
45 , Position(0.0f, 0.0f, 1.0f)
46 , ViewUp(0.0f, 1.0f, 0.0f)
115 , ViewportLeft(-1.0f)
116 , ViewportRight(1.0f)
117 , ViewportBottom(-1.0f)
127 void GetRealViewport(
vtkm::Id screenWidth,
171 this->NearPlane = nearPlane;
172 this->FarPlane = farPlane;
178 this->SetClippingRange(
static_cast<vtkm::Float32>(nearPlane),
185 this->SetClippingRange(nearFarRange.
Min, nearFarRange.
Max);
202 left = this->ViewportLeft;
203 right = this->ViewportRight;
204 bottom = this->ViewportBottom;
205 top = this->ViewportTop;
214 left = this->ViewportLeft;
215 right = this->ViewportRight;
216 bottom = this->ViewportBottom;
217 top = this->ViewportTop;
224 this->ViewportLeft, this->ViewportRight, this->ViewportBottom, this->ViewportTop, 0.0, 0.0);
230 this->ViewportLeft = left;
231 this->ViewportRight = right;
232 this->ViewportBottom = bottom;
233 this->ViewportTop = top;
249 viewportBounds.
X.
Min, viewportBounds.
X.
Max, viewportBounds.
Y.
Min, viewportBounds.
Y.
Max);
264 this->Camera3D.LookAt = lookAt;
285 this->Camera3D.Position = position;
305 this->Camera3D.ViewUp = viewUp;
324 this->Camera2D.XScale = xscale;
344 this->Camera3D.FieldOfView = fov;
375 pan[0] = this->Camera3D.XPan;
376 pan[1] = this->Camera3D.YPan;
524 left = this->Camera2D.Left;
525 right = this->Camera2D.Right;
526 bottom = this->Camera2D.Bottom;
527 top = this->Camera2D.Top;
534 this->Camera2D.Right,
535 this->Camera2D.Bottom,
548 this->Camera2D.Left = left;
549 this->Camera2D.Right = right;
550 this->Camera2D.Bottom = bottom;
551 this->Camera2D.Top = top;
553 this->Camera2D.XPan = 0;
554 this->Camera2D.YPan = 0;
555 this->Camera2D.Zoom = 1;
573 this->SetViewRange2D(xRange.
Min, xRange.
Max, yRange.
Min, yRange.
Max);
578 this->SetViewRange2D(viewRange.
X, viewRange.
Y);
600 #endif // vtk_m_rendering_Camera_h
void SetLookAt(const vtkm::Vec3f_32 &lookAt)
The focal point the camera is looking at in 3D mode.
Definition: Camera.h:261
vtkm::Float32 Top
Definition: Camera.h:96
Camera3DStruct Camera3D
Definition: Camera.h:586
void SetViewUp(const vtkm::Vec3f_64 &viewUp)
The up orientation of the camera in 3D mode.
Definition: Camera.h:309
void SetClippingRange(const vtkm::Range &nearFarRange)
The clipping range of the camera.
Definition: Camera.h:183
vtkm::Float32 GetZoom() const
Zooms the camera in or out.
Definition: Camera.h:394
void TrackballRotate(vtkm::Float64 startX, vtkm::Float64 startY, vtkm::Float64 endX, vtkm::Float64 endY)
Moves the camera as if a point was dragged along a sphere.
Definition: Camera.h:412
vtkm::Float32 ViewportRight
Definition: Camera.h:593
Groups connected points that have the same field value.
Definition: Atomic.h:19
#define VTKM_RENDERING_EXPORT
Definition: vtkm_rendering_export.h:44
vtkm::Float32 NearPlane
Definition: Camera.h:589
void SetXScale(vtkm::Float32 xscale)
The xscale of the camera.
Definition: Camera.h:321
vtkm::Float32 YPan
Definition: Camera.h:66
void SetViewport(vtkm::Float64 left, vtkm::Float64 right, vtkm::Float64 bottom, vtkm::Float64 top)
The viewport of the projection.
Definition: Camera.h:237
vtkm::Float32 ViewportBottom
Definition: Camera.h:594
void SetModeTo3D()
The mode of the camera (2D or 3D).
Definition: Camera.h:147
vtkm::Float32 Bottom
Definition: Camera.h:95
vtkm::Float32 XScale
Definition: Camera.h:97
Camera(Mode vtype=Camera::Mode::ThreeD)
Definition: Camera.h:111
vtkm::Range GetClippingRange() const
The clipping range of the camera.
Definition: Camera.h:166
void SetViewUp(const vtkm::Vec3f_32 &viewUp)
The up orientation of the camera in 3D mode.
Definition: Camera.h:302
void SetXScale(vtkm::Float64 xscale)
The xscale of the camera.
Definition: Camera.h:328
vtkm::Float32 Left
Definition: Camera.h:93
void SetViewRange2D(vtkm::Float64 left, vtkm::Float64 right, vtkm::Float64 bottom, vtkm::Float64 top)
The viewable region in the x-y plane.
Definition: Camera.h:559
void SetClippingRange(vtkm::Float64 nearPlane, vtkm::Float64 farPlane)
The clipping range of the camera.
Definition: Camera.h:176
Camera2DStruct()
Definition: Camera.h:74
void SetModeTo2D()
The mode of the camera (2D or 3D).
Definition: Camera.h:150
void Pan(vtkm::Vec2f_64 direction)
Pans the camera.
Definition: Camera.h:368
Camera2DStruct Camera2D
Definition: Camera.h:587
vtkm::Float32 ViewportTop
Definition: Camera.h:595
vtkm::Vec3f_32 LookAt
Definition: Camera.h:61
Camera3DStruct()
Definition: Camera.h:43
void Azimuth(vtkm::Float64 angleDegrees)
Rotate the camera about the view up vector centered at the focal point.
Definition: Camera.h:465
vtkm::Float32 GetFieldOfView() const
The field of view angle.
Definition: Camera.h:338
void SetMode(vtkm::rendering::Camera::Mode mode)
The mode of the camera (2D or 3D).
Definition: Camera.h:144
vtkm::Float32 FieldOfView
Definition: Camera.h:64
vtkm::Vec3f_32 ViewUp
Definition: Camera.h:63
vtkm::Float32 Zoom
Definition: Camera.h:67
vtkm::Float32 GetXScale() const
The xscale of the camera.
Definition: Camera.h:318
void Zoom(vtkm::Float64 zoom)
Zooms the camera in or out.
Definition: Camera.h:391
vtkm::Vec3f_32 Position
Definition: Camera.h:62
vtkm::Float32 YPan
Definition: Camera.h:99
void SetFieldOfView(vtkm::Float32 fov)
The field of view angle.
Definition: Camera.h:341
void Pan(vtkm::Vec2f_32 direction)
Pans the camera.
Definition: Camera.h:365
vtkm::Float32 XPan
Definition: Camera.h:98
vtkm::Vec2f_32 GetPan() const
Pans the camera.
Definition: Camera.h:371
vtkm::Float32 XPan
Definition: Camera.h:65
vtkm::Bounds GetViewport() const
The viewport of the projection.
Definition: Camera.h:221
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:519
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
Mode
Definition: Camera.h:104
void Dolly(vtkm::Float64 value)
Move the camera toward or away from the focal point.
Definition: Camera.h:507
void SetViewRange2D(const vtkm::Bounds &viewRange)
Definition: Camera.h:576
Mode ModeType
Definition: Camera.h:585
Represent an axis-aligned 3D bounds in space.
Definition: Bounds.h:29
const vtkm::Vec3f_32 & GetLookAt() const
The focal point the camera is looking at in 3D mode.
Definition: Camera.h:258
vtkm::Float32 Right
Definition: Camera.h:94
void SetViewport(vtkm::Float32 left, vtkm::Float32 right, vtkm::Float32 bottom, vtkm::Float32 top)
The viewport of the projection.
Definition: Camera.h:228
void SetLookAt(const vtkm::Vec< Float64, 3 > &lookAt)
The focal point the camera is looking at in 3D mode.
Definition: Camera.h:268
vtkm::rendering::Camera::Mode GetMode() const
The mode of the camera (2D or 3D).
Definition: Camera.h:141
void SetPosition(const vtkm::Vec3f_32 &position)
The spatial position of the camera in 3D mode.
Definition: Camera.h:282
void SetViewRange2D(const vtkm::Range &xRange, const vtkm::Range &yRange)
The viewable region in the x-y plane.
Definition: Camera.h:571
vtkm::Float64 Min
The minumum value of the range (inclusive).
Definition: Range.h:34
void SetViewport(const vtkm::Bounds &viewportBounds)
The viewport of the projection.
Definition: Camera.h:246
vtkm::Float32 Zoom
Definition: Camera.h:100
float Float32
Base type to use for 32-bit floating-point numbers.
Definition: Types.h:157
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:161
void SetClippingRange(vtkm::Float32 nearPlane, vtkm::Float32 farPlane)
The clipping range of the camera.
Definition: Camera.h:169
void GetViewport(vtkm::Float32 &left, vtkm::Float32 &right, vtkm::Float32 &bottom, vtkm::Float32 &top) const
The viewport of the projection.
Definition: Camera.h:197
vtkm::Range X
The range of values in the X direction.
Definition: Bounds.h:33
vtkm::Range Y
The range of values in the Y direction.
Definition: Bounds.h:36
Specifies the viewport for a rendering.
Definition: Camera.h:37
vtkm::Float32 ViewportLeft
Definition: Camera.h:592
void SetFieldOfView(vtkm::Float64 fov)
The field of view angle.
Definition: Camera.h:348
vtkm::Float64 Max
Tha maximum value of the range (inclusive).
Definition: Range.h:36
const vtkm::Vec3f_32 & GetViewUp() const
The up orientation of the camera in 3D mode.
Definition: Camera.h:299
vtkm::Float32 FarPlane
Definition: Camera.h:590
void SetPosition(const vtkm::Vec3f_64 &position)
The spatial position of the camera in 3D mode.
Definition: Camera.h:289
void Pan(vtkm::Float64 dx, vtkm::Float64 dy)
Pans the camera.
Definition: Camera.h:359
void SetViewRange2D(vtkm::Float32 left, vtkm::Float32 right, vtkm::Float32 bottom, vtkm::Float32 top)
The viewable region in the x-y plane.
Definition: Camera.h:542
void GetViewport(vtkm::Float64 &left, vtkm::Float64 &right, vtkm::Float64 &bottom, vtkm::Float64 &top) const
The viewport of the projection.
Definition: Camera.h:209
const vtkm::Vec3f_32 & GetPosition() const
The spatial position of the camera in 3D mode.
Definition: Camera.h:279
void Roll(vtkm::Float64 angleDegrees)
Roll the camera.
Definition: Camera.h:451
void Elevation(vtkm::Float64 angleDegrees)
Rotate the camera vertically around the focal point.
Definition: Camera.h:483
vtkm::Bounds GetViewRange2D() const
The viewable region in the x-y plane.
Definition: Camera.h:531
Represent a continuous scalar range of values.
Definition: Range.h:31