VTK-m
2.2
|
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_32 & | GetLookAt () 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_32 & | GetPosition () 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_32 & | GetViewUp () 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 |
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.
|
strong |
|
inline |
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.
|
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.
vtkm::Matrix<vtkm::Float32, 4, 4> vtkm::rendering::Camera::CreateProjectionMatrix | ( | vtkm::Id | screenWidth, |
vtkm::Id | screenHeight | ||
) | const |
vtkm::Matrix<vtkm::Float32, 4, 4> vtkm::rendering::Camera::CreateViewMatrix | ( | ) | const |
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.
|
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.
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
void vtkm::rendering::Camera::GetRealViewport | ( | vtkm::Id | screenWidth, |
vtkm::Id | screenHeight, | ||
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
inline |
The xscale of the camera.
The xscale forces the 2D curves to be full-frame
Setting the xscale changes the mode to 2D.
|
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.
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.
|
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.
|
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.
|
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.
void vtkm::rendering::Camera::Print | ( | ) | const |
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.
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.
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.
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
inline |
|
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.
|
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.
|
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.
|
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.
|
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.
|
inline |
The xscale of the camera.
The xscale forces the 2D curves to be full-frame
Setting the xscale changes the mode to 2D.
|
inline |
The xscale of the camera.
The xscale forces the 2D curves to be full-frame
Setting the xscale changes the mode to 2D.
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.
|
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.
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.
|
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.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |