SPH
Public Member Functions | List of all members
OrthoCamera Class Reference

Orthographic camera. More...

#include <Camera.h>

Inheritance diagram for OrthoCamera:
ICamera Polymorphic

Public Member Functions

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

Detailed Description

Orthographic camera.

Definition at line 168 of file Camera.h.

Constructor & Destructor Documentation

◆ OrthoCamera()

OrthoCamera::OrthoCamera ( const CameraParams data)
explicit

Definition at line 49 of file Camera.cpp.

Member Function Documentation

◆ autoSetup()

void OrthoCamera::autoSetup ( const Storage storage)
overridevirtual

Initializes the camera, using the provided particle storage.

Implements ICamera.

Definition at line 99 of file Camera.cpp.

◆ clone()

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

Implements ICamera.

Definition at line 212 of file Camera.h.

◆ getCutoff()

Optional< float > OrthoCamera::getCutoff ( ) const
overridevirtual

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.

Implements ICamera.

Definition at line 152 of file Camera.cpp.

◆ getFrame()

AffineMatrix OrthoCamera::getFrame ( ) const
overridevirtual

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.

Implements ICamera.

Definition at line 140 of file Camera.cpp.

◆ getSize()

Pixel OrthoCamera::getSize ( ) const
overridevirtual

Returns the current resolution of the camera.

Implements ICamera.

Definition at line 136 of file Camera.cpp.

◆ getTarget()

Vector OrthoCamera::getTarget ( ) const
overridevirtual

Returns the current target point of the camera.

Implements ICamera.

Definition at line 144 of file Camera.cpp.

◆ getUpVector()

Vector OrthoCamera::getUpVector ( ) const
overridevirtual

Returns the reference "up" direction of the camera.

Implements ICamera.

Definition at line 148 of file Camera.cpp.

◆ getWorldToPixel()

Optional< float > OrthoCamera::getWorldToPixel ( ) const
overridevirtual

Returns the world-to-pixel ratio.

Implements ICamera.

Definition at line 156 of file Camera.cpp.

◆ pan()

void OrthoCamera::pan ( const Pixel  offset)
overridevirtual

Moves the camera by relative offset in image space.

Implements ICamera.

Definition at line 202 of file Camera.cpp.

◆ project()

Optional< ProjectedPoint > OrthoCamera::project ( const Vector r) const
overridevirtual

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.

Implements ICamera.

Definition at line 109 of file Camera.cpp.

◆ resize()

void OrthoCamera::resize ( const Pixel  newSize)
overridevirtual

Changes the image size.

Implements ICamera.

Definition at line 209 of file Camera.cpp.

◆ setCutoff()

void OrthoCamera::setCutoff ( const Optional< float >  newCutoff)
overridevirtual

Modifies the clipping distance of the camera.

The clipping can be disabled by passing NOTHING.

Implements ICamera.

Definition at line 160 of file Camera.cpp.

◆ setPosition()

void OrthoCamera::setPosition ( const Vector newPosition)
overridevirtual

Moves the camera to new position in world space.

Implements ICamera.

Definition at line 175 of file Camera.cpp.

◆ setTarget()

void OrthoCamera::setTarget ( const Vector newTarget)
overridevirtual

Implements ICamera.

Definition at line 181 of file Camera.cpp.

◆ transform()

void OrthoCamera::transform ( const AffineMatrix matrix)
overridevirtual

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.

Implements ICamera.

Definition at line 187 of file Camera.cpp.

◆ unproject()

Optional< CameraRay > OrthoCamera::unproject ( const Coords coords) const
overridevirtual

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

Implements ICamera.

Definition at line 132 of file Camera.cpp.

◆ zoom()

void OrthoCamera::zoom ( const Pixel  fixedPoint,
const float  magnitude 
)
overridevirtual
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.

Implements ICamera.

Definition at line 164 of file Camera.cpp.

Member Data Documentation

◆ u

Vector OrthoCamera::u

Definition at line 174 of file Camera.h.

◆ v

Vector OrthoCamera::v

Definition at line 174 of file Camera.h.

◆ w

Vector OrthoCamera::w

Definition at line 174 of file Camera.h.


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