version 3.3

VRS::CameraPathRecorder Class Reference

#include <vrs/sg/camerapathrecorder.h>

Inheritance diagram for VRS::CameraPathRecorder:

VRS::BehaviorNode VRS::SharedObj VRS::Visitable

List of all members.

Public Types

enum  State { OFF, RECORDING, PLAYING }

Public Member Functions

 CameraPathRecorder (SO< VRS::LookAt > lookAt)
void setMaxFramesPerSecond (unsigned int frames)
unsigned int getMaxFramesPerSecond () const
 VRS_SERIALIZABLE_CLASS_ENUM (State)
State getState () const
 Indicates what the CameraPathRecorder is currently doing.
void startRecording ()
void startPlaying ()
void stop ()
void savePath (const std::string &fileName)
void loadPath (const std::string &fileName)
void enableKeys (unsigned char recordKey, unsigned char playKey, unsigned char stopKey, unsigned char loadKey, unsigned char saveKey, const std::string &file)
 Enables key control of the recorder.
void disableKeys ()
void recordVideo (SO< Canvas > canvas, unsigned int frameRate=25, unsigned int width=800, unsigned int height=600, const std::string &exportDirectory="", const std::string &exportImageFileName="image", const std::string &exportImageFormat=".bmp", PathNavigation *pathNavigation=0, VRS::VideoCompressor *compressor=NULL)
void enableVideoExport (unsigned char recordKey, SO< Canvas > canvas, unsigned int frameRate=25, unsigned int width=800, unsigned int height=600, const std::string &exportDirectory="", const std::string &exportImageFileName="image", const std::string &exportImageFormat=".bmp")
void disableVideoExport ()
SO< Iterator< Vector > > getKeyPositions () const
SO< Iterator< Vector > > getKeyDirections () const
SO< Iterator< double > > getKeyTimes () const
void setKeyFrames (SO< Iterator< Vector > > keyPositions, SO< Iterator< Vector > > keyDirections, SO< Iterator< double > > keyTimes)
 This method allows for using a camera path recorder to play paths that have been created or changed externally.
void setPBufferEnabled (bool yesNo=false)
 If the camerapath is recorded using the application canvas, occluding other windows will cause errors in the recorded video.
bool getPBufferEnabled () const
bool getInterpolatedView (double elapsedTime, SO< LookAt > target) const
 Writes an interpolated position for a given time into the target lookat.
 VRS_TYPEINFO (CameraPathRecorder, BehaviorNode)
 VRS_SERIALIZABLE (CameraPathRecorder)


Detailed Description

A CameraPathRecorder enables to capture the 'from' and 'direction' vectors of a LookAt and to replay it later as a camera path. By the method recordVideo() an image sequence written according to the specified camera path.

Member Enumeration Documentation

Enumerator:
OFF 
RECORDING 
PLAYING 

Reimplemented from VRS::BehaviorNode.


Constructor & Destructor Documentation

VRS::CameraPathRecorder::CameraPathRecorder ( SO< VRS::LookAt lookAt  ) 


Member Function Documentation

void VRS::CameraPathRecorder::setMaxFramesPerSecond ( unsigned int  frames  ) 

The CameraPathRecorder stores one value per frame. In order to control the amount of stored data, a maximum number of frames can be specified for the case of a very high frame rate.

unsigned int VRS::CameraPathRecorder::getMaxFramesPerSecond (  )  const

VRS::CameraPathRecorder::VRS_SERIALIZABLE_CLASS_ENUM ( State   ) 

State VRS::CameraPathRecorder::getState (  )  const

Indicates what the CameraPathRecorder is currently doing.

void VRS::CameraPathRecorder::startRecording (  ) 

Start Recording of a CameraPath. All previously stored data is cleared. Note: Currently the CameraPathRecorder allows only one (continuous) path, i.e. it is impossible to pause the recording.

void VRS::CameraPathRecorder::startPlaying (  ) 

Plays a recorded camera path.

void VRS::CameraPathRecorder::stop (  ) 

Stops a currently running record or play process.

void VRS::CameraPathRecorder::savePath ( const std::string &  fileName  ) 

void VRS::CameraPathRecorder::loadPath ( const std::string &  fileName  ) 

Saves/Loads the recorded path in a simple ASCII file.

void VRS::CameraPathRecorder::enableKeys ( unsigned char  recordKey,
unsigned char  playKey,
unsigned char  stopKey,
unsigned char  loadKey,
unsigned char  saveKey,
const std::string &  file 
)

Enables key control of the recorder.

void VRS::CameraPathRecorder::disableKeys (  ) 

void VRS::CameraPathRecorder::recordVideo ( SO< Canvas canvas,
unsigned int  frameRate = 25,
unsigned int  width = 800,
unsigned int  height = 600,
const std::string &  exportDirectory = "",
const std::string &  exportImageFileName = "image",
const std::string &  exportImageFormat = ".bmp",
PathNavigation pathNavigation = 0,
VRS::VideoCompressor compressor = NULL 
)

Renders a video according to the stored camera path as a sequence of image files.

  • 'exportDirectory' must specify an existing directoy.
  • 'exportImageFormat' must define a standard grafics file format, e.g. ".bmp", ".gif", ".jpg" etc.
  • 'canvas' must be a canvas that contains this CameraPathRecorder. Currently, only GLCanvasses are supported.
  • pathNavigation can be used to get a smoothed movement

The exported images will be named as: "<exportImageFileName> + <image number> + <exportImageFormat>"

void VRS::CameraPathRecorder::enableVideoExport ( unsigned char  recordKey,
SO< Canvas canvas,
unsigned int  frameRate = 25,
unsigned int  width = 800,
unsigned int  height = 600,
const std::string &  exportDirectory = "",
const std::string &  exportImageFileName = "image",
const std::string &  exportImageFormat = ".bmp" 
)

void VRS::CameraPathRecorder::disableVideoExport (  ) 

Allows the activation of recordVideo via key. Note that the application will be blocked for the time of the recordVideo call.

SO<Iterator<Vector> > VRS::CameraPathRecorder::getKeyPositions (  )  const

SO<Iterator<Vector> > VRS::CameraPathRecorder::getKeyDirections (  )  const

SO<Iterator<double> > VRS::CameraPathRecorder::getKeyTimes (  )  const

Accessor methods for key frame data. Can be used to feed camera path into a PathNavigation. Please note, that a PathNavigation does not use timing information.

void VRS::CameraPathRecorder::setKeyFrames ( SO< Iterator< Vector > >  keyPositions,
SO< Iterator< Vector > >  keyDirections,
SO< Iterator< double > >  keyTimes 
)

This method allows for using a camera path recorder to play paths that have been created or changed externally.

All iterators must have the same length and must not be NULL.

void VRS::CameraPathRecorder::setPBufferEnabled ( bool  yesNo = false  ) 

If the camerapath is recorded using the application canvas, occluding other windows will cause errors in the recorded video.

Using the pbuffer avoids this problem but might cause other problems.

bool VRS::CameraPathRecorder::getPBufferEnabled (  )  const

bool VRS::CameraPathRecorder::getInterpolatedView ( double  elapsedTime,
SO< LookAt target 
) const

Writes an interpolated position for a given time into the target lookat.

If 'elapsedTime' is earlier than the path end, the return value is true. If elapsedTime exceeds the target length, the end view ist written to target and false is returned, true otherwise. If elapsedTime is smaller than the first time stamp, the first key frame is written.

VRS::CameraPathRecorder::VRS_TYPEINFO ( CameraPathRecorder  ,
BehaviorNode   
)

VRS::CameraPathRecorder::VRS_SERIALIZABLE ( CameraPathRecorder   ) 


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

Generated on Mon May 21 06:00:25 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact