SPH
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PanoCameraBase Class Reference

Common base for panoramic cameras. More...

#include <Camera.h>

Inheritance diagram for PanoCameraBase:
ICamera Polymorphic FisheyeCamera SphericalCamera

Public Member Functions

 PanoCameraBase (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 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 UNUSED(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...
 
- Public Member Functions inherited from ICamera
virtual Optional< CameraRayunproject (const Coords &coords) const =0
 Returns a ray in particle coordinates corresponding to given coordinates in the image plane. More...
 
virtual void zoom (const Pixel fixedPoint, const float magnitude)=0
 
virtual AutoPtr< ICameraclone () const =0
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Protected Member Functions

virtual void update ()
 

Protected Attributes

CameraParams data
 
AffineMatrix matrix
 

Detailed Description

Common base for panoramic cameras.

Definition at line 287 of file Camera.h.

Constructor & Destructor Documentation

◆ PanoCameraBase()

PanoCameraBase::PanoCameraBase ( const CameraParams data)
explicit

Definition at line 361 of file Camera.cpp.

Member Function Documentation

◆ autoSetup()

void PanoCameraBase::autoSetup ( const Storage storage)
overridevirtual

Initializes the camera, using the provided particle storage.

Implements ICamera.

Definition at line 366 of file Camera.cpp.

◆ getCutoff()

Optional< float > PanoCameraBase::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 396 of file Camera.cpp.

◆ getFrame()

AffineMatrix PanoCameraBase::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 384 of file Camera.cpp.

◆ getSize()

Pixel PanoCameraBase::getSize ( ) const
overridevirtual

Returns the current resolution of the camera.

Implements ICamera.

Definition at line 380 of file Camera.cpp.

◆ getTarget()

Vector PanoCameraBase::getTarget ( ) const
overridevirtual

Returns the current target point of the camera.

Implements ICamera.

Definition at line 388 of file Camera.cpp.

◆ getUpVector()

Vector PanoCameraBase::getUpVector ( ) const
overridevirtual

Returns the reference "up" direction of the camera.

Implements ICamera.

Definition at line 392 of file Camera.cpp.

◆ getWorldToPixel()

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

Returns the world-to-pixel ratio.

Implements ICamera.

Definition at line 401 of file Camera.cpp.

◆ pan()

void PanoCameraBase::pan ( const Pixel  offset)
overridevirtual

Moves the camera by relative offset in image space.

Implements ICamera.

Definition at line 423 of file Camera.cpp.

◆ project()

Optional< ProjectedPoint > PanoCameraBase::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 376 of file Camera.cpp.

◆ resize()

void PanoCameraBase::resize ( const Pixel  newSize)
overridevirtual

Changes the image size.

Implements ICamera.

Definition at line 427 of file Camera.cpp.

◆ setCutoff()

void PanoCameraBase::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 405 of file Camera.cpp.

◆ setPosition()

void PanoCameraBase::setPosition ( const Vector newPosition)
overridevirtual

Moves the camera to new position in world space.

Implements ICamera.

Definition at line 411 of file Camera.cpp.

◆ setTarget()

void PanoCameraBase::setTarget ( const Vector newTarget)
overridevirtual

Implements ICamera.

Definition at line 415 of file Camera.cpp.

◆ transform()

void PanoCameraBase::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 419 of file Camera.cpp.

◆ update()

void PanoCameraBase::update ( )
protectedvirtual

Definition at line 432 of file Camera.cpp.

◆ zoom()

void PanoCameraBase::zoom ( const Pixel   UNUSEDfixedPoint,
const float  magnitude 
)
overridevirtual

Definition at line 407 of file Camera.cpp.

Member Data Documentation

◆ data

CameraParams PanoCameraBase::data
protected

Definition at line 289 of file Camera.h.

◆ matrix

AffineMatrix PanoCameraBase::matrix
protected

Definition at line 290 of file Camera.h.


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