Producer::Camera Class Reference

A Camera provides a programming interface for 3D graphics applications by means of an abstract camera analogy. More...

Inheritance diagram for Producer::Camera:

Producer::Referenced List of all members.

Public Types

typedef double TimeStamp
 BeginCameraFrame
 BeginCull
 BeginPreCullCallbacks
 EndPreCullCallbacks
 BeginInnerCull
 EndInnerCull
 BeginPostCullCallbacks
 EndPostCullCallbacks
 EndCull
 Vsync
 BeginDraw
 BeginClear
 EndClear
 BeginPreDrawCallbacks
 EndPreDrawCallbacks
 BeginInnerDraw
 EndInnerDraw
 BeginPostDrawCallbacks
 EndPostDrawCallbacks
 BeginPostSwapCallbacks
 EndPostSwapCallbacks
 EndDraw
 EndCameraFrame
 LastStatsID
enum  StatsID {
  BeginCameraFrame, BeginCull, BeginPreCullCallbacks, EndPreCullCallbacks,
  BeginInnerCull, EndInnerCull, BeginPostCullCallbacks, EndPostCullCallbacks,
  EndCull, Vsync, BeginDraw, BeginClear,
  EndClear, BeginPreDrawCallbacks, EndPreDrawCallbacks, BeginInnerDraw,
  EndInnerDraw, BeginPostDrawCallbacks, EndPostDrawCallbacks, BeginPostSwapCallbacks,
  EndPostSwapCallbacks, EndDraw, EndCameraFrame, LastStatsID
}

Public Member Functions

 Camera (void)
void enable ()
void disable ()
bool isEnabled () const
void frame (bool doSwap=true)
void setSceneHandler (SceneHandler *sh)
SceneHandlergetSceneHandler ()
const SceneHandlergetSceneHandler () const
void setRenderSurface (RenderSurface *rs)
RenderSurfacegetRenderSurface ()
const RenderSurfacegetRenderSurface () const
void setRenderSurfaceWindowRectangle (int x, int y, unsigned int width, unsigned int height, bool resize=true)
void setLens (Lens *lens)
LensgetLens ()
const LensgetLens () const
void setLensPerspective (double hfov, double vfov, double nearClip, double farClip, double xshear=0, double yshear=0)
void setLensFrustum (double left, double right, double bottom, double top, double nearClip, double farClip, double xshear=0, double yshear=0)
void setLensOrtho (double left, double right, double bottom, double top, double nearClip, double farClip, double xshear=0, double yshear=0)
void setLensShear (double xshear, double yshear)
void getLensShear (double &xshear, double &yshear)
bool convertLensToOrtho (float d)
bool convertLensToPerspective (float d)
Lens::Projection getLensProjectionType ()
void applyLens ()
void getLensParams (double &left, double &right, double &bottom, double &top, double &nearClip, double &farClip, double &xshear, double &yshear)
float getLensHorizontalFov ()
float getLensVerticalFov ()
void getLensMatrix (Matrix::value_type matrix[16])
void setLensAutoAspect (bool ar)
bool getLensAutoAspect ()
void setLensAspectRatio (double aspectRatio)
double getLensAspectRatio ()
void setProjectionRectangle (const float left, const float right, const float bottom, const float top)
void getProjectionRectangle (float &left, float &right, float &bottom, float &top) const
void setProjectionRectangle (int x, int y, unsigned int width, unsigned int height)
void getProjectionRectangle (int &x, int &y, unsigned int &width, unsigned int &height) const
Matrix::value_typegetProjectionMatrix ()
void setViewByLookat (float eyex, float eyey, float eyez, float centerx, float centery, float centerz, float upx, float upy, float upz)
void setViewByLookat (const Vec3 &eye, const Vec3 &center, const Vec3 &up)
void setViewByMatrix (const Matrix &mat)
void setFocalDistance (double focal_distance)
const Matrix::value_typegetViewMatrix (void) const
const Matrix::value_typegetPositionAndAttitudeMatrix (void) const
void applyView ()
void setOffset (const Matrix::value_type matrix[16], Matrix::value_type _xshear=0.0, Matrix::value_type _yshear=0.0)
void setOffset (double _xshear, double _yshear)
void setOffsetMultiplyMethod (Offset::MultiplyMethod method)
void setClearColor (float red, float green, float blue, float alpha)
void getClearColor (float &red, float &green, float &blue, float &alpha)
void clear (void)
void advance (void)
void sync (int n=1)
void setUpdateCallback (UpdateCallback *cb)
void addPreFrameCallback (Callback *cb)
void addPostFrameCallback (Callback *cb)
void addPreCullCallback (Callback *cb)
bool removePreCullCallback (Callback *cb)
void addPostCullCallback (Callback *cb)
bool removePostCullCallback (Callback *cb)
void addPreDrawCallback (Callback *cb)
bool removePreDrawCallback (Callback *cb)
void addPostDrawCallback (Callback *cb)
bool removePostDrawCallback (Callback *cb)
void addPostSwapCallback (Callback *cb)
bool removePostSwapCallback (Callback *cb)
virtual int cancel ()
void run (void)
void setSyncBarrier (Producer::RefBarrier *b)
void setFrameBarrier (Producer::RefBarrier *b)
void setInitTime (Timer_t initTime)
const FrameTimeStampSetgetFrameStats ()
void setInstrumentationMode (bool mode)
bool getInstrumentationMode () const
void setBlockOnVsync (bool block)
bool getBlockOnVsync () const
void setIndex (unsigned int index)
unsigned int getIndex () const
void setShareLens (bool flag)
bool getShareLens ()
void setShareView (bool flag)
bool getShareView ()
double getTimeOfLastVSync ()
double getTimeOfNextVSync ()

Protected Member Functions

virtual ~Camera (void)

Protected Attributes

Producer::ref_ptr< Lens_lens
Producer::ref_ptr< Producer::RenderSurface_rs
Producer::ref_ptr< SceneHandler_sh
unsigned int _index
ref_ptr< UpdateCallback_updateCallback
std::vector< ref_ptr< Callback > > preFrameCallbacks
std::vector< ref_ptr< Callback > > preCullCallbacks
std::vector< ref_ptr< Callback > > postCullCallbacks
std::vector< ref_ptr< Callback > > preDrawCallbacks
std::vector< ref_ptr< Callback > > postDrawCallbacks
std::vector< ref_ptr< Callback > > postSwapCallbacks
std::vector< ref_ptr< Callback > > postFrameCallbacks

Friends

class Producer::CameraGroup

Classes

class  Callback
 Pure virtual class for specifying Camera callbacks. More...
class  FrameTimeStampSet
class  Lens
 A Lens provides control over the PROJECTION matrix. More...
struct  Offset
class  SceneHandler
 A Scene Handler handles the preparation and rendering of a scene for Camera. More...
class  UpdateCallback
 Pure virtual class for specifying Camera callbacks, passed a non-const camera for the purpose of updating the Camera's state. More...

Detailed Description

A Camera provides a programming interface for 3D graphics applications by means of an abstract camera analogy.

The Camera contains a Lens class and has a RenderSurface. Methods are provided to give the programmer control over the OpenGL PROJECTION matrix throught the Lens and over the initial MODELVIEW matrix through the camera's position and attitude.

The programmer must provide a class derived from Camera::SceneHandler to prepare and render the scene. The Camera does not provide direct control over rendering itself.


Member Typedef Documentation

typedef double Producer::Camera::TimeStamp


Member Enumeration Documentation

enum Producer::Camera::StatsID

Enumerator:
BeginCameraFrame 
BeginCull 
BeginPreCullCallbacks 
EndPreCullCallbacks 
BeginInnerCull 
EndInnerCull 
BeginPostCullCallbacks 
EndPostCullCallbacks 
EndCull 
Vsync 
BeginDraw 
BeginClear 
EndClear 
BeginPreDrawCallbacks 
EndPreDrawCallbacks 
BeginInnerDraw 
EndInnerDraw 
BeginPostDrawCallbacks 
EndPostDrawCallbacks 
BeginPostSwapCallbacks 
EndPostSwapCallbacks 
EndDraw 
EndCameraFrame 
LastStatsID 


Constructor & Destructor Documentation

Producer::Camera::Camera ( void   ) 

virtual Producer::Camera::~Camera ( void   )  [protected, virtual]


Member Function Documentation

void Producer::Camera::addPostCullCallback ( Callback cb  )  [inline]

void Producer::Camera::addPostDrawCallback ( Callback cb  )  [inline]

void Producer::Camera::addPostFrameCallback ( Callback cb  )  [inline]

void Producer::Camera::addPostSwapCallback ( Callback cb  )  [inline]

void Producer::Camera::addPreCullCallback ( Callback cb  )  [inline]

void Producer::Camera::addPreDrawCallback ( Callback cb  )  [inline]

void Producer::Camera::addPreFrameCallback ( Callback cb  )  [inline]

void Producer::Camera::advance ( void   ) 

void Producer::Camera::applyLens (  )  [inline]

Convenience method for applying the lens. See Camera::Lens::apply()

void Producer::Camera::applyView (  ) 

virtual int Producer::Camera::cancel (  )  [virtual]

void Producer::Camera::clear ( void   ) 

bool Producer::Camera::convertLensToOrtho ( float  d  )  [inline]

Convenience method for converting the Perpective lens to an Orthographic lens. see Camera::lens:convertToOrtho()

bool Producer::Camera::convertLensToPerspective ( float  d  )  [inline]

Convenience method for converting the Orthographic lens to an Perspective lens. see Camera::lens:convertToPerspective()

void Producer::Camera::disable (  )  [inline]

void Producer::Camera::enable (  )  [inline]

void Producer::Camera::frame ( bool  doSwap = true  ) 

bool Producer::Camera::getBlockOnVsync (  )  const [inline]

void Producer::Camera::getClearColor ( float &  red,
float &  green,
float &  blue,
float &  alpha 
)

const FrameTimeStampSet& Producer::Camera::getFrameStats (  ) 

unsigned int Producer::Camera::getIndex (  )  const [inline]

bool Producer::Camera::getInstrumentationMode (  )  const [inline]

const Lens* Producer::Camera::getLens (  )  const [inline]

Lens* Producer::Camera::getLens (  )  [inline]

double Producer::Camera::getLensAspectRatio (  )  [inline]

bool Producer::Camera::getLensAutoAspect (  )  [inline]

Convenience method for getting AutoAspect on the lens. See Camera::Lens::getAutoAspect()

float Producer::Camera::getLensHorizontalFov (  )  [inline]

Convenience method for getting the Lens Horizontal field of view. See Camera::Lens::getHorizontalFov()

void Producer::Camera::getLensMatrix ( Matrix::value_type  matrix[16]  )  [inline]

Convenience method for getting the Lens ProjectionMatrix. See Camera::Lens::getMatrix()

void Producer::Camera::getLensParams ( double &  left,
double &  right,
double &  bottom,
double &  top,
double &  nearClip,
double &  farClip,
double &  xshear,
double &  yshear 
) [inline]

Convenience method for getting the Lens parameters. See Camera::Lens::apply()

Lens::Projection Producer::Camera::getLensProjectionType (  )  [inline]

Convenience method for getting the lens projection type. See Camera::Lens::setAspectRatio()

void Producer::Camera::getLensShear ( double &  xshear,
double &  yshear 
) [inline]

Convenience method for getting the lens shear. See Camera::Lens::getShear()

float Producer::Camera::getLensVerticalFov (  )  [inline]

Convenience method for getting the Lens Horizontal field of view. See Camera::Lens::getVerticalFov()

const Matrix::value_type* Producer::Camera::getPositionAndAttitudeMatrix ( void   )  const [inline]

Matrix::value_type* Producer::Camera::getProjectionMatrix (  )  [inline]

void Producer::Camera::getProjectionRectangle ( int &  x,
int &  y,
unsigned int &  width,
unsigned int &  height 
) const

void Producer::Camera::getProjectionRectangle ( float &  left,
float &  right,
float &  bottom,
float &  top 
) const

const RenderSurface* Producer::Camera::getRenderSurface (  )  const [inline]

RenderSurface* Producer::Camera::getRenderSurface (  )  [inline]

const SceneHandler* Producer::Camera::getSceneHandler (  )  const [inline]

SceneHandler* Producer::Camera::getSceneHandler (  )  [inline]

bool Producer::Camera::getShareLens (  )  [inline]

bool Producer::Camera::getShareView (  )  [inline]

double Producer::Camera::getTimeOfLastVSync (  )  [inline]

double Producer::Camera::getTimeOfNextVSync (  )  [inline]

const Matrix::value_type* Producer::Camera::getViewMatrix ( void   )  const

bool Producer::Camera::isEnabled (  )  const [inline]

bool Producer::Camera::removePostCullCallback ( Callback cb  ) 

bool Producer::Camera::removePostDrawCallback ( Callback cb  ) 

bool Producer::Camera::removePostSwapCallback ( Callback cb  ) 

bool Producer::Camera::removePreCullCallback ( Callback cb  ) 

bool Producer::Camera::removePreDrawCallback ( Callback cb  ) 

void Producer::Camera::run ( void   ) 

void Producer::Camera::setBlockOnVsync ( bool  block  )  [inline]

void Producer::Camera::setClearColor ( float  red,
float  green,
float  blue,
float  alpha 
)

void Producer::Camera::setFocalDistance ( double  focal_distance  )  [inline]

void Producer::Camera::setFrameBarrier ( Producer::RefBarrier b  ) 

void Producer::Camera::setIndex ( unsigned int  index  )  [inline]

void Producer::Camera::setInitTime ( Timer_t  initTime  )  [inline]

void Producer::Camera::setInstrumentationMode ( bool  mode  )  [inline]

void Producer::Camera::setLens ( Lens lens  )  [inline]

void Producer::Camera::setLensAspectRatio ( double  aspectRatio  )  [inline]

Convenience method for setting the lens Aspect Ratio. See Camera::Lens::setAspectRatio()

void Producer::Camera::setLensAutoAspect ( bool  ar  )  [inline]

Convenience method for setting AutoAspect on the lens. See Camera::Lens::setAutoAspect()

void Producer::Camera::setLensFrustum ( double  left,
double  right,
double  bottom,
double  top,
double  nearClip,
double  farClip,
double  xshear = 0,
double  yshear = 0 
) [inline]

Convenience method for setting the Lens Frustum. See Camera::Lens::setFrustum().

void Producer::Camera::setLensOrtho ( double  left,
double  right,
double  bottom,
double  top,
double  nearClip,
double  farClip,
double  xshear = 0,
double  yshear = 0 
) [inline]

Convenience method for setting the lens Orthographic projection. See Camera::Lens::setOrtho()

void Producer::Camera::setLensPerspective ( double  hfov,
double  vfov,
double  nearClip,
double  farClip,
double  xshear = 0,
double  yshear = 0 
) [inline]

Convenience method for setting the Lens Perspective. See Camera::Lens::setPerspective().

void Producer::Camera::setLensShear ( double  xshear,
double  yshear 
) [inline]

Convenience method for setting the lens shear. See Camera::Lens::setShear()

void Producer::Camera::setOffset ( double  _xshear,
double  _yshear 
)

void Producer::Camera::setOffset ( const Matrix::value_type  matrix[16],
Matrix::value_type  _xshear = 0.0,
Matrix::value_type  _yshear = 0.0 
)

void Producer::Camera::setOffsetMultiplyMethod ( Offset::MultiplyMethod  method  )  [inline]

void Producer::Camera::setProjectionRectangle ( int  x,
int  y,
unsigned int  width,
unsigned int  height 
)

void Producer::Camera::setProjectionRectangle ( const float  left,
const float  right,
const float  bottom,
const float  top 
)

void Producer::Camera::setRenderSurface ( RenderSurface rs  )  [inline]

void Producer::Camera::setRenderSurfaceWindowRectangle ( int  x,
int  y,
unsigned int  width,
unsigned int  height,
bool  resize = true 
) [inline]

void Producer::Camera::setSceneHandler ( SceneHandler sh  )  [inline]

void Producer::Camera::setShareLens ( bool  flag  )  [inline]

void Producer::Camera::setShareView ( bool  flag  )  [inline]

void Producer::Camera::setSyncBarrier ( Producer::RefBarrier b  ) 

void Producer::Camera::setUpdateCallback ( UpdateCallback cb  )  [inline]

void Producer::Camera::setViewByLookat ( const Vec3 eye,
const Vec3 center,
const Vec3 up 
)

void Producer::Camera::setViewByLookat ( float  eyex,
float  eyey,
float  eyez,
float  centerx,
float  centery,
float  centerz,
float  upx,
float  upy,
float  upz 
)

void Producer::Camera::setViewByMatrix ( const Matrix mat  ) 

void Producer::Camera::sync ( int  n = 1  )  [inline]


Friends And Related Function Documentation

friend class Producer::CameraGroup [friend]


Member Data Documentation

unsigned int Producer::Camera::_index [protected]

Producer::ref_ptr<Lens> Producer::Camera::_lens [protected]

Producer::ref_ptr<Producer::RenderSurface> Producer::Camera::_rs [protected]

Producer::ref_ptr<SceneHandler> Producer::Camera::_sh [protected]

ref_ptr<UpdateCallback> Producer::Camera::_updateCallback [protected]

std::vector< ref_ptr<Callback> > Producer::Camera::postCullCallbacks [protected]

std::vector< ref_ptr<Callback> > Producer::Camera::postDrawCallbacks [protected]

std::vector< ref_ptr<Callback> > Producer::Camera::postFrameCallbacks [protected]

std::vector< ref_ptr<Callback> > Producer::Camera::postSwapCallbacks [protected]

std::vector< ref_ptr<Callback> > Producer::Camera::preCullCallbacks [protected]

std::vector< ref_ptr<Callback> > Producer::Camera::preDrawCallbacks [protected]

std::vector< ref_ptr<Callback> > Producer::Camera::preFrameCallbacks [protected]


The documentation for this class was generated from the following file:
Generated on Thu Sep 28 18:43:47 2006 for producer by  doxygen 1.4.7