SPH
Public Member Functions | List of all members
ICamera Class Referenceabstract

Interface defining a camera or view, used by a renderer. More...

#include <Camera.h>

Inheritance diagram for ICamera:
Polymorphic OrthoCamera PanoCameraBase PerspectiveCamera FisheyeCamera SphericalCamera

Public Member Functions

virtual void autoSetup (const Storage &storage)=0
 Initializes the camera, using the provided particle storage. More...
 
virtual Optional< ProjectedPointproject (const Vector &r) const =0
 Returns projected position of particle on the image. More...
 
virtual Optional< CameraRayunproject (const Coords &coords) const =0
 Returns a ray in particle coordinates corresponding to given coordinates in the image plane. More...
 
virtual Pixel getSize () const =0
 Returns the current resolution of the camera. More...
 
virtual AffineMatrix getFrame () const =0
 Returns the transformation matrix converting camera space to world space. More...
 
virtual Vector getTarget () const =0
 Returns the current target point of the camera. More...
 
virtual Vector getUpVector () const =0
 Returns the reference "up" direction of the camera. More...
 
virtual Optional< float > getCutoff () const =0
 Returns the clipping distance from plane passing through origin, perpendicular to camera direction. More...
 
virtual Optional< float > getWorldToPixel () const =0
 Returns the world-to-pixel ratio. More...
 
virtual void setCutoff (const Optional< float > newCutoff)=0
 Modifies the clipping distance of the camera. More...
 
virtual void zoom (const Pixel fixedPoint, const float magnitude)=0
 
virtual void setPosition (const Vector &newPosition)=0
 Moves the camera to new position in world space. More...
 
virtual void setTarget (const Vector &newTarget)=0
 
virtual void transform (const AffineMatrix &matrix)=0
 Transforms the current view by given matrix. More...
 
virtual void pan (const Pixel offset)=0
 Moves the camera by relative offset in image space. More...
 
virtual void resize (const Pixel newSize)=0
 Changes the image size. More...
 
virtual AutoPtr< ICameraclone () const =0
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Detailed Description

Interface defining a camera or view, used by a renderer.

Definition at line 62 of file Camera.h.

Member Function Documentation

◆ autoSetup()

virtual void ICamera::autoSetup ( const Storage storage)
pure virtual

Initializes the camera, using the provided particle storage.

Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.

◆ clone()

virtual AutoPtr<ICamera> ICamera::clone ( ) const
pure virtual
Todo:
revert to ClonePtr!

Implemented in SphericalCamera, FisheyeCamera, PerspectiveCamera, and OrthoCamera.

◆ getCutoff()

virtual Optional<float> ICamera::getCutoff ( ) const
pure virtual

Returns the clipping distance from plane passing through origin, perpendicular to camera direction.

If no clipping is used, the function returns NOTHING. Useful to view a section through a body rather than its surface.

Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.

◆ getFrame()

virtual AffineMatrix ICamera::getFrame ( ) const
pure virtual

Returns the transformation matrix converting camera space to world space.

In the camera space, camera direction is aligned with the z-axis, y-axis corresponds to the up-vector and x-axis is perpendicular, i.e. left-vector.

Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.

◆ getSize()

virtual Pixel ICamera::getSize ( ) const
pure virtual

Returns the current resolution of the camera.

Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.

◆ getTarget()

virtual Vector ICamera::getTarget ( ) const
pure virtual

Returns the current target point of the camera.

Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.

◆ getUpVector()

virtual Vector ICamera::getUpVector ( ) const
pure virtual

Returns the reference "up" direction of the camera.

Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.

◆ getWorldToPixel()

virtual Optional<float> ICamera::getWorldToPixel ( ) const
pure virtual

Returns the world-to-pixel ratio.

Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.

◆ pan()

virtual void ICamera::pan ( const Pixel  offset)
pure virtual

Moves the camera by relative offset in image space.

Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.

◆ project()

virtual Optional<ProjectedPoint> ICamera::project ( const Vector r) const
pure virtual

Returns projected position of particle on the image.

If the particle is outside of the image region or is clipped by the projection, returns NOTHING.

Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.

◆ resize()

virtual void ICamera::resize ( const Pixel  newSize)
pure virtual

Changes the image size.

Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.

◆ setCutoff()

virtual void ICamera::setCutoff ( const Optional< float >  newCutoff)
pure virtual

Modifies the clipping distance of the camera.

The clipping can be disabled by passing NOTHING.

Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.

◆ setPosition()

virtual void ICamera::setPosition ( const Vector newPosition)
pure virtual

Moves the camera to new position in world space.

Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.

◆ setTarget()

virtual void ICamera::setTarget ( const Vector newTarget)
pure virtual

◆ transform()

virtual void ICamera::transform ( const AffineMatrix matrix)
pure virtual

Transforms the current view by given matrix.

This replaces previous transformation matrix, i.e. subsequent calls do not accumulate.

Parameters
matrixTransform matrix applied to the camera.

Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.

◆ unproject()

virtual Optional<CameraRay> ICamera::unproject ( const Coords coords) const
pure virtual

Returns a ray in particle coordinates corresponding to given coordinates in the image plane.

Implemented in SphericalCamera, FisheyeCamera, PerspectiveCamera, and OrthoCamera.

◆ zoom()

virtual void ICamera::zoom ( const Pixel  fixedPoint,
const float  magnitude 
)
pure virtual
Parameters
Applieszoom to the camera.

This is usually equivalent to transforming the view with scaling matrix, alhough it can be implemented differently.

Parameters
fixedPointPoint that remains fixed after the zoom (for magnitude != 1, there is exactly one)
magnitudeRelative zoom amount, value <1 means zooming out, value >1 means zooming in.

Implemented in OrthoCamera.


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