Go to the documentation of this file.
18 #ifndef viskores_rendering_Camera_h
19 #define viskores_rendering_Camera_h
45 class VISKORES_RENDERING_EXPORT
Camera
52 : LookAt(0.0f, 0.0f, 0.0f)
53 , Position(0.0f, 0.0f, 1.0f)
54 , ViewUp(0.0f, 1.0f, 0.0f)
125 , ViewportLeft(-1.0f)
126 , ViewportRight(1.0f)
127 , ViewportBottom(-1.0f)
184 this->NearPlane = nearPlane;
185 this->FarPlane = farPlane;
198 this->SetClippingRange(nearFarRange.
Min, nearFarRange.
Max);
215 left = this->ViewportLeft;
216 right = this->ViewportRight;
217 bottom = this->ViewportBottom;
218 top = this->ViewportTop;
227 left = this->ViewportLeft;
228 right = this->ViewportRight;
229 bottom = this->ViewportBottom;
230 top = this->ViewportTop;
237 this->ViewportLeft, this->ViewportRight, this->ViewportBottom, this->ViewportTop, 0.0, 0.0);
246 this->ViewportLeft = left;
247 this->ViewportRight = right;
248 this->ViewportBottom = bottom;
249 this->ViewportTop = top;
268 viewportBounds.
X.
Min, viewportBounds.
X.
Max, viewportBounds.
Y.
Min, viewportBounds.
Y.
Max);
283 this->Camera3D.LookAt = lookAt;
304 this->Camera3D.Position = position;
327 this->Camera3D.ViewUp = viewUp;
346 this->Camera2D.XScale = xscale;
369 this->Camera3D.FieldOfView = fov;
403 pan[0] = this->Camera3D.XPan;
404 pan[1] = this->Camera3D.YPan;
555 left = this->Camera2D.Left;
556 right = this->Camera2D.Right;
557 bottom = this->Camera2D.Bottom;
558 top = this->Camera2D.Top;
565 this->Camera2D.Right,
566 this->Camera2D.Bottom,
579 this->Camera2D.Left = left;
580 this->Camera2D.Right = right;
581 this->Camera2D.Bottom = bottom;
582 this->Camera2D.Top = top;
584 this->Camera2D.XPan = 0;
585 this->Camera2D.YPan = 0;
586 this->Camera2D.Zoom = 1;
604 this->SetViewRange2D(xRange.
Min, xRange.
Max, yRange.
Min, yRange.
Max);
609 this->SetViewRange2D(viewRange.
X, viewRange.
Y);
631 #endif // viskores_rendering_Camera_h
viskores::Float32 XScale
Definition: Camera.h:107
viskores::Float32 FieldOfView
Definition: Camera.h:73
viskores::Float32 YPan
Definition: Camera.h:109
viskores::rendering::Camera::Mode GetMode() const
The mode of the camera (2D or 3D).
Definition: Camera.h:151
viskores::Float32 ViewportLeft
Definition: Camera.h:623
const viskores::Vec3f_32 & GetViewUp() const
The up orientation of the camera in 3D mode.
Definition: Camera.h:321
const viskores::Vec3f_32 & GetPosition() const
The spatial position of the camera in 3D mode.
Definition: Camera.h:298
viskores::Float32 ViewportTop
Definition: Camera.h:626
viskores::Float32 Zoom
Definition: Camera.h:76
void GetViewRange2D(viskores::Float32 &left, viskores::Float32 &right, viskores::Float32 &bottom, viskores::Float32 &top) const
The viewable region in the x-y plane.
Definition: Camera.h:550
viskores::Float32 Top
Definition: Camera.h:106
void SetViewUp(const viskores::Vec3f_32 &viewUp)
The up orientation of the camera in 3D mode.
Definition: Camera.h:324
Camera(Mode vtype=Camera::Mode::ThreeD)
Definition: Camera.h:121
void SetModeTo2D()
The mode of the camera (2D or 3D).
Definition: Camera.h:160
void Pan(viskores::Vec2f_64 direction)
Pans the camera.
Definition: Camera.h:396
Represent an axis-aligned 3D bounds in space.
Definition: Bounds.h:37
Camera2DStruct()
Definition: Camera.h:83
viskores::Bounds GetViewRange2D() const
The viewable region in the x-y plane.
Definition: Camera.h:562
void Pan(viskores::Vec2f_32 direction)
Pans the camera.
Definition: Camera.h:393
viskores::Float32 GetFieldOfView() const
The field of view angle.
Definition: Camera.h:363
viskores::Float64 Min
The minumum value of the range (inclusive).
Definition: Range.h:42
Camera2DStruct Camera2D
Definition: Camera.h:618
void TrackballRotate(viskores::Float64 startX, viskores::Float64 startY, viskores::Float64 endX, viskores::Float64 endY)
Moves the camera as if a point was dragged along a sphere.
Definition: Camera.h:440
viskores::Float32 ViewportBottom
Definition: Camera.h:625
void SetLookAt(const viskores::Vec< Float64, 3 > &lookAt)
The focal point the camera is looking at in 3D mode.
Definition: Camera.h:287
viskores::Float32 FarPlane
Definition: Camera.h:621
viskores::Float32 GetXScale() const
The xscale of the camera.
Definition: Camera.h:340
void SetModeTo3D()
The mode of the camera (2D or 3D).
Definition: Camera.h:157
void SetViewRange2D(viskores::Float64 left, viskores::Float64 right, viskores::Float64 bottom, viskores::Float64 top)
The viewable region in the x-y plane.
Definition: Camera.h:590
void Pan(viskores::Float64 dx, viskores::Float64 dy)
Pans the camera.
Definition: Camera.h:387
Camera3DStruct Camera3D
Definition: Camera.h:617
void SetViewRange2D(viskores::Float32 left, viskores::Float32 right, viskores::Float32 bottom, viskores::Float32 top)
The viewable region in the x-y plane.
Definition: Camera.h:573
void Azimuth(viskores::Float64 angleDegrees)
Rotate the camera about the view up vector centered at the focal point.
Definition: Camera.h:496
viskores::Bounds GetViewport() const
The viewport of the projection.
Definition: Camera.h:234
void SetFieldOfView(viskores::Float64 fov)
The field of view angle.
Definition: Camera.h:373
viskores::Float64 Max
Tha maximum value of the range (inclusive).
Definition: Range.h:44
viskores::Float32 Zoom
Definition: Camera.h:110
void SetViewport(viskores::Float64 left, viskores::Float64 right, viskores::Float64 bottom, viskores::Float64 top)
The viewport of the projection.
Definition: Camera.h:253
Camera3DStruct()
Definition: Camera.h:51
void SetPosition(const viskores::Vec3f_32 &position)
The spatial position of the camera in 3D mode.
Definition: Camera.h:301
viskores::Float32 GetZoom() const
Zooms the camera in or out.
Definition: Camera.h:422
Mode ModeType
Definition: Camera.h:616
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
void SetViewRange2D(const viskores::Range &xRange, const viskores::Range &yRange)
The viewable region in the x-y plane.
Definition: Camera.h:602
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores::Vec2f_32 GetPan() const
Pans the camera.
Definition: Camera.h:399
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::Float32 XPan
Definition: Camera.h:74
void SetXScale(viskores::Float32 xscale)
The xscale of the camera.
Definition: Camera.h:343
const viskores::Vec3f_32 & GetLookAt() const
The focal point the camera is looking at in 3D mode.
Definition: Camera.h:277
float Float32
Base type to use for 32-bit floating-point numbers.
Definition: Types.h:165
void SetLookAt(const viskores::Vec3f_32 &lookAt)
The focal point the camera is looking at in 3D mode.
Definition: Camera.h:280
void SetXScale(viskores::Float64 xscale)
The xscale of the camera.
Definition: Camera.h:350
void SetClippingRange(viskores::Float64 nearPlane, viskores::Float64 farPlane)
The clipping range of the camera.
Definition: Camera.h:189
viskores::Float32 XPan
Definition: Camera.h:108
void SetViewport(const viskores::Bounds &viewportBounds)
The viewport of the projection.
Definition: Camera.h:265
void Elevation(viskores::Float64 angleDegrees)
Rotate the camera vertically around the focal point.
Definition: Camera.h:514
void SetPosition(const viskores::Vec3f_64 &position)
The spatial position of the camera in 3D mode.
Definition: Camera.h:308
viskores::Vec3f_32 ViewUp
Definition: Camera.h:72
viskores::Vec3f_32 Position
Definition: Camera.h:71
void GetViewport(viskores::Float32 &left, viskores::Float32 &right, viskores::Float32 &bottom, viskores::Float32 &top) const
The viewport of the projection.
Definition: Camera.h:210
void SetViewport(viskores::Float32 left, viskores::Float32 right, viskores::Float32 bottom, viskores::Float32 top)
The viewport of the projection.
Definition: Camera.h:241
viskores::Float32 YPan
Definition: Camera.h:75
void SetClippingRange(viskores::Float32 nearPlane, viskores::Float32 farPlane)
The clipping range of the camera.
Definition: Camera.h:182
Represent a continuous scalar range of values.
Definition: Range.h:39
Specifies the viewport for a rendering.
Definition: Camera.h:45
void Zoom(viskores::Float64 zoom)
Zooms the camera in or out.
Definition: Camera.h:419
void GetViewport(viskores::Float64 &left, viskores::Float64 &right, viskores::Float64 &bottom, viskores::Float64 &top) const
The viewport of the projection.
Definition: Camera.h:222
void SetClippingRange(const viskores::Range &nearFarRange)
The clipping range of the camera.
Definition: Camera.h:196
viskores::Range Y
The range of values in the Y direction.
Definition: Bounds.h:44
void SetViewUp(const viskores::Vec3f_64 &viewUp)
The up orientation of the camera in 3D mode.
Definition: Camera.h:331
void Dolly(viskores::Float64 value)
Move the camera toward or away from the focal point.
Definition: Camera.h:538
viskores::Float32 Right
Definition: Camera.h:104
void SetViewRange2D(const viskores::Bounds &viewRange)
Definition: Camera.h:607
Mode
Definition: Camera.h:114
viskores::Float32 NearPlane
Definition: Camera.h:620
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:169
viskores::Range GetClippingRange() const
The clipping range of the camera.
Definition: Camera.h:176
viskores::Float32 Bottom
Definition: Camera.h:105
void SetMode(viskores::rendering::Camera::Mode mode)
The mode of the camera (2D or 3D).
Definition: Camera.h:154
void SetFieldOfView(viskores::Float32 fov)
The field of view angle.
Definition: Camera.h:366
viskores::Vec3f_32 LookAt
Definition: Camera.h:70
viskores::Float32 ViewportRight
Definition: Camera.h:624
viskores::Range X
The range of values in the X direction.
Definition: Bounds.h:41
viskores::Float32 Left
Definition: Camera.h:103
void Roll(viskores::Float64 angleDegrees)
Roll the camera.
Definition: Camera.h:479