VTK-m  2.1
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
vtkm::rendering::Camera Class Reference

Specifies the viewport for a rendering. More...

#include <Camera.h>

Classes

struct  Camera2DStruct
 
struct  Camera3DStruct
 

Public Types

enum  Mode { Mode::TwoD, Mode::ThreeD }
 

Public Member Functions

 Camera (Mode vtype=Camera::Mode::ThreeD)
 
vtkm::Matrix< vtkm::Float32, 4, 4 > CreateViewMatrix () const
 
vtkm::Matrix< vtkm::Float32, 4, 4 > CreateProjectionMatrix (vtkm::Id screenWidth, vtkm::Id screenHeight) const
 
void GetRealViewport (vtkm::Id screenWidth, vtkm::Id screenHeight, vtkm::Float32 &left, vtkm::Float32 &right, vtkm::Float32 &bottom, vtkm::Float32 &top) const
 
vtkm::rendering::Camera::Mode GetMode () const
 The mode of the camera (2D or 3D). More...
 
void SetMode (vtkm::rendering::Camera::Mode mode)
 The mode of the camera (2D or 3D). More...
 
void SetModeTo3D ()
 The mode of the camera (2D or 3D). More...
 
void SetModeTo2D ()
 The mode of the camera (2D or 3D). More...
 
vtkm::Range GetClippingRange () const
 The clipping range of the camera. More...
 
void SetClippingRange (vtkm::Float32 nearPlane, vtkm::Float32 farPlane)
 The clipping range of the camera. More...
 
void SetClippingRange (vtkm::Float64 nearPlane, vtkm::Float64 farPlane)
 The clipping range of the camera. More...
 
void SetClippingRange (const vtkm::Range &nearFarRange)
 The clipping range of the camera. More...
 
void GetViewport (vtkm::Float32 &left, vtkm::Float32 &right, vtkm::Float32 &bottom, vtkm::Float32 &top) const
 The viewport of the projection. More...
 
void GetViewport (vtkm::Float64 &left, vtkm::Float64 &right, vtkm::Float64 &bottom, vtkm::Float64 &top) const
 The viewport of the projection. More...
 
vtkm::Bounds GetViewport () const
 The viewport of the projection. More...
 
void SetViewport (vtkm::Float32 left, vtkm::Float32 right, vtkm::Float32 bottom, vtkm::Float32 top)
 The viewport of the projection. More...
 
void SetViewport (vtkm::Float64 left, vtkm::Float64 right, vtkm::Float64 bottom, vtkm::Float64 top)
 The viewport of the projection. More...
 
void SetViewport (const vtkm::Bounds &viewportBounds)
 The viewport of the projection. More...
 
const vtkm::Vec3f_32GetLookAt () const
 The focal point the camera is looking at in 3D mode. More...
 
void SetLookAt (const vtkm::Vec3f_32 &lookAt)
 The focal point the camera is looking at in 3D mode. More...
 
void SetLookAt (const vtkm::Vec< Float64, 3 > &lookAt)
 The focal point the camera is looking at in 3D mode. More...
 
const vtkm::Vec3f_32GetPosition () const
 The spatial position of the camera in 3D mode. More...
 
void SetPosition (const vtkm::Vec3f_32 &position)
 The spatial position of the camera in 3D mode. More...
 
void SetPosition (const vtkm::Vec3f_64 &position)
 The spatial position of the camera in 3D mode. More...
 
const vtkm::Vec3f_32GetViewUp () const
 The up orientation of the camera in 3D mode. More...
 
void SetViewUp (const vtkm::Vec3f_32 &viewUp)
 The up orientation of the camera in 3D mode. More...
 
void SetViewUp (const vtkm::Vec3f_64 &viewUp)
 The up orientation of the camera in 3D mode. More...
 
vtkm::Float32 GetXScale () const
 The xscale of the camera. More...
 
void SetXScale (vtkm::Float32 xscale)
 The xscale of the camera. More...
 
void SetXScale (vtkm::Float64 xscale)
 The xscale of the camera. More...
 
vtkm::Float32 GetFieldOfView () const
 The field of view angle. More...
 
void SetFieldOfView (vtkm::Float32 fov)
 The field of view angle. More...
 
void SetFieldOfView (vtkm::Float64 fov)
 The field of view angle. More...
 
void Pan (vtkm::Float32 dx, vtkm::Float32 dy)
 Pans the camera. More...
 
void Pan (vtkm::Float64 dx, vtkm::Float64 dy)
 Pans the camera. More...
 
void Pan (vtkm::Vec2f_32 direction)
 Pans the camera. More...
 
void Pan (vtkm::Vec2f_64 direction)
 Pans the camera. More...
 
vtkm::Vec2f_32 GetPan () const
 Pans the camera. More...
 
void Zoom (vtkm::Float32 zoom)
 Zooms the camera in or out. More...
 
void Zoom (vtkm::Float64 zoom)
 Zooms the camera in or out. More...
 
vtkm::Float32 GetZoom () const
 Zooms the camera in or out. More...
 
void TrackballRotate (vtkm::Float32 startX, vtkm::Float32 startY, vtkm::Float32 endX, vtkm::Float32 endY)
 Moves the camera as if a point was dragged along a sphere. More...
 
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. More...
 
void ResetToBounds (const vtkm::Bounds &dataBounds)
 Set up the camera to look at geometry. More...
 
void ResetToBounds (const vtkm::Bounds &dataBounds, vtkm::Float64 dataViewPadding)
 Set up the camera to look at geometry. More...
 
void ResetToBounds (const vtkm::Bounds &dataBounds, vtkm::Float64 XDataViewPadding, vtkm::Float64 YDataViewPadding, vtkm::Float64 ZDataViewPadding)
 Set up the camera to look at geometry. More...
 
void Roll (vtkm::Float32 angleDegrees)
 Roll the camera. More...
 
void Roll (vtkm::Float64 angleDegrees)
 Roll the camera. More...
 
void Azimuth (vtkm::Float32 angleDegrees)
 Rotate the camera about the view up vector centered at the focal point. More...
 
void Azimuth (vtkm::Float64 angleDegrees)
 Rotate the camera about the view up vector centered at the focal point. More...
 
void Elevation (vtkm::Float32 angleDegrees)
 Rotate the camera vertically around the focal point. More...
 
void Elevation (vtkm::Float64 angleDegrees)
 Rotate the camera vertically around the focal point. More...
 
void Dolly (vtkm::Float32 value)
 Move the camera toward or away from the focal point. More...
 
void Dolly (vtkm::Float64 value)
 Move the camera toward or away from the focal point. More...
 
void GetViewRange2D (vtkm::Float32 &left, vtkm::Float32 &right, vtkm::Float32 &bottom, vtkm::Float32 &top) const
 The viewable region in the x-y plane. More...
 
vtkm::Bounds GetViewRange2D () const
 The viewable region in the x-y plane. More...
 
void SetViewRange2D (vtkm::Float32 left, vtkm::Float32 right, vtkm::Float32 bottom, vtkm::Float32 top)
 The viewable region in the x-y plane. More...
 
void SetViewRange2D (vtkm::Float64 left, vtkm::Float64 right, vtkm::Float64 bottom, vtkm::Float64 top)
 The viewable region in the x-y plane. More...
 
void SetViewRange2D (const vtkm::Range &xRange, const vtkm::Range &yRange)
 The viewable region in the x-y plane. More...
 
void SetViewRange2D (const vtkm::Bounds &viewRange)
 
void Print () const
 

Private Attributes

Mode ModeType
 
Camera3DStruct Camera3D
 
Camera2DStruct Camera2D
 
vtkm::Float32 NearPlane
 
vtkm::Float32 FarPlane
 
vtkm::Float32 ViewportLeft
 
vtkm::Float32 ViewportRight
 
vtkm::Float32 ViewportBottom
 
vtkm::Float32 ViewportTop
 

Detailed Description

Specifies the viewport for a rendering.

The vtkm::rendering::View object holds a Camera object to specify from what perspective the rendering should take place.

A Camera operates in one of two major modes: 2D mode or 3D mode. 2D mode is designed for looking at flat geometry (or close to flat geometry) that is parallel to the x-y plane. 3D mode provides the freedom to place the camera anywhere in 3D space.

Member Enumeration Documentation

◆ Mode

Enumerator
TwoD 
ThreeD 

Constructor & Destructor Documentation

◆ Camera()

vtkm::rendering::Camera::Camera ( Mode  vtype = Camera::Mode::ThreeD)
inline

Member Function Documentation

◆ Azimuth() [1/2]

void vtkm::rendering::Camera::Azimuth ( vtkm::Float32  angleDegrees)

Rotate the camera about the view up vector centered at the focal point.

Note that the view up vector is whatever was set via SetViewUp(), and is not necessarily perpendicular to the direction of projection. The angle is given in degrees.

Azimuth() only makes sense for 3D cameras, so the camera mode will be set to 3D when this method is called.

◆ Azimuth() [2/2]

void vtkm::rendering::Camera::Azimuth ( vtkm::Float64  angleDegrees)
inline

Rotate the camera about the view up vector centered at the focal point.

Note that the view up vector is whatever was set via SetViewUp(), and is not necessarily perpendicular to the direction of projection. The angle is given in degrees.

Azimuth() only makes sense for 3D cameras, so the camera mode will be set to 3D when this method is called.

◆ CreateProjectionMatrix()

vtkm::Matrix<vtkm::Float32, 4, 4> vtkm::rendering::Camera::CreateProjectionMatrix ( vtkm::Id  screenWidth,
vtkm::Id  screenHeight 
) const

◆ CreateViewMatrix()

vtkm::Matrix<vtkm::Float32, 4, 4> vtkm::rendering::Camera::CreateViewMatrix ( ) const

◆ Dolly() [1/2]

void vtkm::rendering::Camera::Dolly ( vtkm::Float32  value)

Move the camera toward or away from the focal point.

Specifically, this divides the camera's distance from the focal point (LookAt) by the given value. Use a value greater than one to dolly in toward the focal point, and use a value less than one to dolly-out away from the focal point.

Dolly() has a similar effect as Zoom() since an object will appear larger when the camera is closer. However, because you are moving the camera, Dolly() can change the perspective relative to objects such as moving inside an object for an interior perspective whereas Zoom() will just change the size of the visible objects.

Dolly() only makes sense for 3D cameras, so the camera mode will be set to 3D when this method is called.

◆ Dolly() [2/2]

void vtkm::rendering::Camera::Dolly ( vtkm::Float64  value)
inline

Move the camera toward or away from the focal point.

Specifically, this divides the camera's distance from the focal point (LookAt) by the given value. Use a value greater than one to dolly in toward the focal point, and use a value less than one to dolly-out away from the focal point.

Dolly() has a similar effect as Zoom() since an object will appear larger when the camera is closer. However, because you are moving the camera, Dolly() can change the perspective relative to objects such as moving inside an object for an interior perspective whereas Zoom() will just change the size of the visible objects.

Dolly() only makes sense for 3D cameras, so the camera mode will be set to 3D when this method is called.

◆ Elevation() [1/2]

void vtkm::rendering::Camera::Elevation ( vtkm::Float32  angleDegrees)

Rotate the camera vertically around the focal point.

Specifically, this rotates the camera about the cross product of the negative of the direction of projection and the view up vector, using the focal point (LookAt) as the center of rotation. The angle is given in degrees.

Elevation() only makes sense for 3D cameras, so the camera mode will be set to 3D when this method is called.

◆ Elevation() [2/2]

void vtkm::rendering::Camera::Elevation ( vtkm::Float64  angleDegrees)
inline

Rotate the camera vertically around the focal point.

Specifically, this rotates the camera about the cross product of the negative of the direction of projection and the view up vector, using the focal point (LookAt) as the center of rotation. The angle is given in degrees.

Elevation() only makes sense for 3D cameras, so the camera mode will be set to 3D when this method is called.

◆ GetClippingRange()

vtkm::Range vtkm::rendering::Camera::GetClippingRange ( ) const
inline

The clipping range of the camera.

The clipping range establishes the near and far clipping planes. These clipping planes are parallel to the viewing plane. The planes are defined by simply specifying the distance from the viewpoint. Renderers can (and usually do) remove any geometry closer than the near plane and further than the far plane.

For precision purposes, it is best to place the near plane as far away as possible (while still being in front of any geometry). The far plane usually has less effect on the depth precision, so can be placed well far behind the geometry.

◆ GetFieldOfView()

vtkm::Float32 vtkm::rendering::Camera::GetFieldOfView ( ) const
inline

The field of view angle.

The field of view defines the angle (in degrees) that are visible from the camera position.

Setting the field of view changes the mode to 3D.

◆ GetLookAt()

const vtkm::Vec3f_32& vtkm::rendering::Camera::GetLookAt ( ) const
inline

The focal point the camera is looking at in 3D mode.

When in 3D mode, the camera is set up to be facing the LookAt position. If LookAt is set, the mode is changed to 3D mode.

◆ GetMode()

vtkm::rendering::Camera::Mode vtkm::rendering::Camera::GetMode ( ) const
inline

The mode of the camera (2D or 3D).

vtkm::rendering::Camera can be set to a 2D or 3D mode. 2D mode is used for looking at data in the x-y plane. 3D mode allows the camera to be positioned anywhere and pointing at any place in 3D.

◆ GetPan()

vtkm::Vec2f_32 vtkm::rendering::Camera::GetPan ( ) const
inline

Pans the camera.

Panning the camera shifts the view horizontially and/or vertically with respect to the image plane.

Panning works in either 2D or 3D mode.

◆ GetPosition()

const vtkm::Vec3f_32& vtkm::rendering::Camera::GetPosition ( ) const
inline

The spatial position of the camera in 3D mode.

When in 3D mode, the camera is modeled to be at a particular location. If Position is set, the mode is changed to 3D mode.

◆ GetRealViewport()

void vtkm::rendering::Camera::GetRealViewport ( vtkm::Id  screenWidth,
vtkm::Id  screenHeight,
vtkm::Float32 left,
vtkm::Float32 right,
vtkm::Float32 bottom,
vtkm::Float32 top 
) const

◆ GetViewport() [1/3]

vtkm::Bounds vtkm::rendering::Camera::GetViewport ( ) const
inline

The viewport of the projection.

The projection of the camera can be offset to be centered around a subset of the rendered image. This is established with a "viewport," which is defined by the left/right and bottom/top of this viewport. The values of the viewport are relative to the rendered image's bounds. The left and bottom of the image are at -1 and the right and top are at 1.

◆ GetViewport() [2/3]

void vtkm::rendering::Camera::GetViewport ( vtkm::Float32 left,
vtkm::Float32 right,
vtkm::Float32 bottom,
vtkm::Float32 top 
) const
inline

The viewport of the projection.

The projection of the camera can be offset to be centered around a subset of the rendered image. This is established with a "viewport," which is defined by the left/right and bottom/top of this viewport. The values of the viewport are relative to the rendered image's bounds. The left and bottom of the image are at -1 and the right and top are at 1.

◆ GetViewport() [3/3]

void vtkm::rendering::Camera::GetViewport ( vtkm::Float64 left,
vtkm::Float64 right,
vtkm::Float64 bottom,
vtkm::Float64 top 
) const
inline

The viewport of the projection.

The projection of the camera can be offset to be centered around a subset of the rendered image. This is established with a "viewport," which is defined by the left/right and bottom/top of this viewport. The values of the viewport are relative to the rendered image's bounds. The left and bottom of the image are at -1 and the right and top are at 1.

◆ GetViewRange2D() [1/2]

vtkm::Bounds vtkm::rendering::Camera::GetViewRange2D ( ) const
inline

The viewable region in the x-y plane.

When the camera is in 2D, it is looking at some region of the x-y plane. The region being looked at is defined by the range in x (determined by the left and right sides) and by the range in y (determined by the bottom and top sides).

SetViewRange2D() changes the camera mode to 2D.

◆ GetViewRange2D() [2/2]

void vtkm::rendering::Camera::GetViewRange2D ( vtkm::Float32 left,
vtkm::Float32 right,
vtkm::Float32 bottom,
vtkm::Float32 top 
) const
inline

The viewable region in the x-y plane.

When the camera is in 2D, it is looking at some region of the x-y plane. The region being looked at is defined by the range in x (determined by the left and right sides) and by the range in y (determined by the bottom and top sides).

SetViewRange2D() changes the camera mode to 2D.

◆ GetViewUp()

const vtkm::Vec3f_32& vtkm::rendering::Camera::GetViewUp ( ) const
inline

The up orientation of the camera in 3D mode.

When in 3D mode, the camera is modeled to be at a particular location and looking at a particular spot. The view up vector orients the rotation of the image so that the top of the image is in the direction pointed to by view up. If ViewUp is set, the mode is changed to 3D mode.

◆ GetXScale()

vtkm::Float32 vtkm::rendering::Camera::GetXScale ( ) const
inline

The xscale of the camera.

The xscale forces the 2D curves to be full-frame

Setting the xscale changes the mode to 2D.

◆ GetZoom()

vtkm::Float32 vtkm::rendering::Camera::GetZoom ( ) const
inline

Zooms the camera in or out.

Zooming the camera scales everything in the image up or down. Positive zoom makes the geometry look bigger or closer. Negative zoom has the opposite effect. A zoom of 0 has no effect.

Zooming works in either 2D or 3D mode.

◆ Pan() [1/4]

void vtkm::rendering::Camera::Pan ( vtkm::Float32  dx,
vtkm::Float32  dy 
)

Pans the camera.

Panning the camera shifts the view horizontially and/or vertically with respect to the image plane.

Panning works in either 2D or 3D mode.

◆ Pan() [2/4]

void vtkm::rendering::Camera::Pan ( vtkm::Float64  dx,
vtkm::Float64  dy 
)
inline

Pans the camera.

Panning the camera shifts the view horizontially and/or vertically with respect to the image plane.

Panning works in either 2D or 3D mode.

◆ Pan() [3/4]

void vtkm::rendering::Camera::Pan ( vtkm::Vec2f_32  direction)
inline

Pans the camera.

Panning the camera shifts the view horizontially and/or vertically with respect to the image plane.

Panning works in either 2D or 3D mode.

◆ Pan() [4/4]

void vtkm::rendering::Camera::Pan ( vtkm::Vec2f_64  direction)
inline

Pans the camera.

Panning the camera shifts the view horizontially and/or vertically with respect to the image plane.

Panning works in either 2D or 3D mode.

◆ Print()

void vtkm::rendering::Camera::Print ( ) const

◆ ResetToBounds() [1/3]

void vtkm::rendering::Camera::ResetToBounds ( const vtkm::Bounds dataBounds)

Set up the camera to look at geometry.

ResetToBounds() takes a vtkm::Bounds structure containing the bounds in 3D space that contain the geometry being rendered. This method sets up the camera so that it is looking at this region in space. The view direction is preserved. ResetToBounds() can also take optional padding that the viewpoint should preserve around the object. Padding is specified as the fraction of the bounds to add as padding.

◆ ResetToBounds() [2/3]

void vtkm::rendering::Camera::ResetToBounds ( const vtkm::Bounds dataBounds,
vtkm::Float64  dataViewPadding 
)

Set up the camera to look at geometry.

ResetToBounds() takes a vtkm::Bounds structure containing the bounds in 3D space that contain the geometry being rendered. This method sets up the camera so that it is looking at this region in space. The view direction is preserved. ResetToBounds() can also take optional padding that the viewpoint should preserve around the object. Padding is specified as the fraction of the bounds to add as padding.

◆ ResetToBounds() [3/3]

void vtkm::rendering::Camera::ResetToBounds ( const vtkm::Bounds dataBounds,
vtkm::Float64  XDataViewPadding,
vtkm::Float64  YDataViewPadding,
vtkm::Float64  ZDataViewPadding 
)

Set up the camera to look at geometry.

ResetToBounds() takes a vtkm::Bounds structure containing the bounds in 3D space that contain the geometry being rendered. This method sets up the camera so that it is looking at this region in space. The view direction is preserved. ResetToBounds() can also take optional padding that the viewpoint should preserve around the object. Padding is specified as the fraction of the bounds to add as padding.

◆ Roll() [1/2]

void vtkm::rendering::Camera::Roll ( vtkm::Float32  angleDegrees)

Roll the camera.

Rotates the camera around the view direction by the given angle. The angle is given in degrees.

Roll is currently only supported for 3D cameras.

◆ Roll() [2/2]

void vtkm::rendering::Camera::Roll ( vtkm::Float64  angleDegrees)
inline

Roll the camera.

Rotates the camera around the view direction by the given angle. The angle is given in degrees.

Roll is currently only supported for 3D cameras.

◆ SetClippingRange() [1/3]

void vtkm::rendering::Camera::SetClippingRange ( const vtkm::Range nearFarRange)
inline

The clipping range of the camera.

The clipping range establishes the near and far clipping planes. These clipping planes are parallel to the viewing plane. The planes are defined by simply specifying the distance from the viewpoint. Renderers can (and usually do) remove any geometry closer than the near plane and further than the far plane.

For precision purposes, it is best to place the near plane as far away as possible (while still being in front of any geometry). The far plane usually has less effect on the depth precision, so can be placed well far behind the geometry.

◆ SetClippingRange() [2/3]

void vtkm::rendering::Camera::SetClippingRange ( vtkm::Float32  nearPlane,
vtkm::Float32  farPlane 
)
inline

The clipping range of the camera.

The clipping range establishes the near and far clipping planes. These clipping planes are parallel to the viewing plane. The planes are defined by simply specifying the distance from the viewpoint. Renderers can (and usually do) remove any geometry closer than the near plane and further than the far plane.

For precision purposes, it is best to place the near plane as far away as possible (while still being in front of any geometry). The far plane usually has less effect on the depth precision, so can be placed well far behind the geometry.

◆ SetClippingRange() [3/3]

void vtkm::rendering::Camera::SetClippingRange ( vtkm::Float64  nearPlane,
vtkm::Float64  farPlane 
)
inline

The clipping range of the camera.

The clipping range establishes the near and far clipping planes. These clipping planes are parallel to the viewing plane. The planes are defined by simply specifying the distance from the viewpoint. Renderers can (and usually do) remove any geometry closer than the near plane and further than the far plane.

For precision purposes, it is best to place the near plane as far away as possible (while still being in front of any geometry). The far plane usually has less effect on the depth precision, so can be placed well far behind the geometry.

◆ SetFieldOfView() [1/2]

void vtkm::rendering::Camera::SetFieldOfView ( vtkm::Float32  fov)
inline

The field of view angle.

The field of view defines the angle (in degrees) that are visible from the camera position.

Setting the field of view changes the mode to 3D.

◆ SetFieldOfView() [2/2]

void vtkm::rendering::Camera::SetFieldOfView ( vtkm::Float64  fov)
inline

The field of view angle.

The field of view defines the angle (in degrees) that are visible from the camera position.

Setting the field of view changes the mode to 3D.

◆ SetLookAt() [1/2]

void vtkm::rendering::Camera::SetLookAt ( const vtkm::Vec3f_32 lookAt)
inline

The focal point the camera is looking at in 3D mode.

When in 3D mode, the camera is set up to be facing the LookAt position. If LookAt is set, the mode is changed to 3D mode.

◆ SetLookAt() [2/2]

void vtkm::rendering::Camera::SetLookAt ( const vtkm::Vec< Float64, 3 > &  lookAt)
inline

The focal point the camera is looking at in 3D mode.

When in 3D mode, the camera is set up to be facing the LookAt position. If LookAt is set, the mode is changed to 3D mode.

◆ SetMode()

void vtkm::rendering::Camera::SetMode ( vtkm::rendering::Camera::Mode  mode)
inline

The mode of the camera (2D or 3D).

vtkm::rendering::Camera can be set to a 2D or 3D mode. 2D mode is used for looking at data in the x-y plane. 3D mode allows the camera to be positioned anywhere and pointing at any place in 3D.

◆ SetModeTo2D()

void vtkm::rendering::Camera::SetModeTo2D ( )
inline

The mode of the camera (2D or 3D).

vtkm::rendering::Camera can be set to a 2D or 3D mode. 2D mode is used for looking at data in the x-y plane. 3D mode allows the camera to be positioned anywhere and pointing at any place in 3D.

◆ SetModeTo3D()

void vtkm::rendering::Camera::SetModeTo3D ( )
inline

The mode of the camera (2D or 3D).

vtkm::rendering::Camera can be set to a 2D or 3D mode. 2D mode is used for looking at data in the x-y plane. 3D mode allows the camera to be positioned anywhere and pointing at any place in 3D.

◆ SetPosition() [1/2]

void vtkm::rendering::Camera::SetPosition ( const vtkm::Vec3f_32 position)
inline

The spatial position of the camera in 3D mode.

When in 3D mode, the camera is modeled to be at a particular location. If Position is set, the mode is changed to 3D mode.

◆ SetPosition() [2/2]

void vtkm::rendering::Camera::SetPosition ( const vtkm::Vec3f_64 position)
inline

The spatial position of the camera in 3D mode.

When in 3D mode, the camera is modeled to be at a particular location. If Position is set, the mode is changed to 3D mode.

◆ SetViewport() [1/3]

void vtkm::rendering::Camera::SetViewport ( const vtkm::Bounds viewportBounds)
inline

The viewport of the projection.

The projection of the camera can be offset to be centered around a subset of the rendered image. This is established with a "viewport," which is defined by the left/right and bottom/top of this viewport. The values of the viewport are relative to the rendered image's bounds. The left and bottom of the image are at -1 and the right and top are at 1.

◆ SetViewport() [2/3]

void vtkm::rendering::Camera::SetViewport ( vtkm::Float32  left,
vtkm::Float32  right,
vtkm::Float32  bottom,
vtkm::Float32  top 
)
inline

The viewport of the projection.

The projection of the camera can be offset to be centered around a subset of the rendered image. This is established with a "viewport," which is defined by the left/right and bottom/top of this viewport. The values of the viewport are relative to the rendered image's bounds. The left and bottom of the image are at -1 and the right and top are at 1.

◆ SetViewport() [3/3]

void vtkm::rendering::Camera::SetViewport ( vtkm::Float64  left,
vtkm::Float64  right,
vtkm::Float64  bottom,
vtkm::Float64  top 
)
inline

The viewport of the projection.

The projection of the camera can be offset to be centered around a subset of the rendered image. This is established with a "viewport," which is defined by the left/right and bottom/top of this viewport. The values of the viewport are relative to the rendered image's bounds. The left and bottom of the image are at -1 and the right and top are at 1.

◆ SetViewRange2D() [1/4]

void vtkm::rendering::Camera::SetViewRange2D ( const vtkm::Bounds viewRange)
inline

◆ SetViewRange2D() [2/4]

void vtkm::rendering::Camera::SetViewRange2D ( const vtkm::Range xRange,
const vtkm::Range yRange 
)
inline

The viewable region in the x-y plane.

When the camera is in 2D, it is looking at some region of the x-y plane. The region being looked at is defined by the range in x (determined by the left and right sides) and by the range in y (determined by the bottom and top sides).

SetViewRange2D() changes the camera mode to 2D.

◆ SetViewRange2D() [3/4]

void vtkm::rendering::Camera::SetViewRange2D ( vtkm::Float32  left,
vtkm::Float32  right,
vtkm::Float32  bottom,
vtkm::Float32  top 
)
inline

The viewable region in the x-y plane.

When the camera is in 2D, it is looking at some region of the x-y plane. The region being looked at is defined by the range in x (determined by the left and right sides) and by the range in y (determined by the bottom and top sides).

SetViewRange2D() changes the camera mode to 2D.

◆ SetViewRange2D() [4/4]

void vtkm::rendering::Camera::SetViewRange2D ( vtkm::Float64  left,
vtkm::Float64  right,
vtkm::Float64  bottom,
vtkm::Float64  top 
)
inline

The viewable region in the x-y plane.

When the camera is in 2D, it is looking at some region of the x-y plane. The region being looked at is defined by the range in x (determined by the left and right sides) and by the range in y (determined by the bottom and top sides).

SetViewRange2D() changes the camera mode to 2D.

◆ SetViewUp() [1/2]

void vtkm::rendering::Camera::SetViewUp ( const vtkm::Vec3f_32 viewUp)
inline

The up orientation of the camera in 3D mode.

When in 3D mode, the camera is modeled to be at a particular location and looking at a particular spot. The view up vector orients the rotation of the image so that the top of the image is in the direction pointed to by view up. If ViewUp is set, the mode is changed to 3D mode.

◆ SetViewUp() [2/2]

void vtkm::rendering::Camera::SetViewUp ( const vtkm::Vec3f_64 viewUp)
inline

The up orientation of the camera in 3D mode.

When in 3D mode, the camera is modeled to be at a particular location and looking at a particular spot. The view up vector orients the rotation of the image so that the top of the image is in the direction pointed to by view up. If ViewUp is set, the mode is changed to 3D mode.

◆ SetXScale() [1/2]

void vtkm::rendering::Camera::SetXScale ( vtkm::Float32  xscale)
inline

The xscale of the camera.

The xscale forces the 2D curves to be full-frame

Setting the xscale changes the mode to 2D.

◆ SetXScale() [2/2]

void vtkm::rendering::Camera::SetXScale ( vtkm::Float64  xscale)
inline

The xscale of the camera.

The xscale forces the 2D curves to be full-frame

Setting the xscale changes the mode to 2D.

◆ TrackballRotate() [1/2]

void vtkm::rendering::Camera::TrackballRotate ( vtkm::Float32  startX,
vtkm::Float32  startY,
vtkm::Float32  endX,
vtkm::Float32  endY 
)

Moves the camera as if a point was dragged along a sphere.

TrackballRotate() takes the normalized screen coordinates (in the range -1 to 1) and rotates the camera around the LookAt position. The rotation first projects the points to a sphere around the LookAt position. The camera is then rotated as if the start point was dragged to the end point along with the world.

TrackballRotate() changes the mode to 3D.

◆ TrackballRotate() [2/2]

void vtkm::rendering::Camera::TrackballRotate ( vtkm::Float64  startX,
vtkm::Float64  startY,
vtkm::Float64  endX,
vtkm::Float64  endY 
)
inline

Moves the camera as if a point was dragged along a sphere.

TrackballRotate() takes the normalized screen coordinates (in the range -1 to 1) and rotates the camera around the LookAt position. The rotation first projects the points to a sphere around the LookAt position. The camera is then rotated as if the start point was dragged to the end point along with the world.

TrackballRotate() changes the mode to 3D.

◆ Zoom() [1/2]

void vtkm::rendering::Camera::Zoom ( vtkm::Float32  zoom)

Zooms the camera in or out.

Zooming the camera scales everything in the image up or down. Positive zoom makes the geometry look bigger or closer. Negative zoom has the opposite effect. A zoom of 0 has no effect.

Zooming works in either 2D or 3D mode.

◆ Zoom() [2/2]

void vtkm::rendering::Camera::Zoom ( vtkm::Float64  zoom)
inline

Zooms the camera in or out.

Zooming the camera scales everything in the image up or down. Positive zoom makes the geometry look bigger or closer. Negative zoom has the opposite effect. A zoom of 0 has no effect.

Zooming works in either 2D or 3D mode.

Member Data Documentation

◆ Camera2D

Camera2DStruct vtkm::rendering::Camera::Camera2D
private

◆ Camera3D

Camera3DStruct vtkm::rendering::Camera::Camera3D
private

◆ FarPlane

vtkm::Float32 vtkm::rendering::Camera::FarPlane
private

◆ ModeType

Mode vtkm::rendering::Camera::ModeType
private

◆ NearPlane

vtkm::Float32 vtkm::rendering::Camera::NearPlane
private

◆ ViewportBottom

vtkm::Float32 vtkm::rendering::Camera::ViewportBottom
private

◆ ViewportLeft

vtkm::Float32 vtkm::rendering::Camera::ViewportLeft
private

◆ ViewportRight

vtkm::Float32 vtkm::rendering::Camera::ViewportRight
private

◆ ViewportTop

vtkm::Float32 vtkm::rendering::Camera::ViewportTop
private

The documentation for this class was generated from the following file: