Generates MPEG output that tracks camera motion. More...
#include <Inventor/MPEG/SoMPEGNavRenderer.h>
Public Member Functions | |
SoMPEGNavRenderer (SoNode *node) | |
Constructor. | |
virtual | ~SoMPEGNavRenderer () |
Destructor. | |
virtual void | setSceneGraph (SoNode *node) |
Sets the scene graph used for generating frames in the MPEG output. | |
virtual void | record () |
Starts recording camera movements. | |
virtual void | stop () |
Stops recording camera movements. | |
void | adjustNumFramesPerSecond (SbBool flag) |
Specifies whether the camera movements are adjusted to the number of frames per second. | |
SbBool | isAdjustedNumFramesPerSecond () const |
Returns whether the camera movements are adjusted to the number of frames per second. | |
void | setCamera (SoCamera *camera) |
Specifies the camera to be used by the MPEG renderer. | |
SoCamera * | getCamera () |
Returns the camera currently used by the MPEG renderer. | |
Public Member Functions inherited from SoMPEGRenderer | |
SoMPEGRenderer () | |
Constructor. | |
virtual | ~SoMPEGRenderer () |
Destructor. | |
SbBool | openFile (const char *filename, unsigned int numFrames=10000) |
Specifies the MPEG output file name. | |
void | closeFile () |
Closes the MPEG file previously opened with the openFile() method. | |
void | setFilePointer (FILE *fp) |
Sets the file pointer for the MPEG output. | |
FILE * | getFilePointer () const |
Gets the MPEG file pointer. | |
void | setSize (const SbVec2s &size) |
Sets the frame pixel size. | |
SbVec2s | getSize () const |
Gets the frame pixel size. | |
void | setComponents (const Components components) |
Set the number of color components of the frames recorded. | |
SoMPEGRenderer::Components | getComponents () const |
Returns the number of color components of the frames recorded. | |
SoNode * | getSceneGraph () const |
Gets the scene graph used for generating frames in the MPEG output. | |
void | setBackgroundColor (const SbColor &c) |
Sets the background color for rendering each frame. | |
SbColor | getBackgroundColor () const |
Gets the background color for rendering each frame. | |
void | setGLRenderAction (SoGLRenderAction *ra) |
Sets the GL Render action used to generate each frame. | |
SoGLRenderAction * | getGLRenderAction () const |
Gets the GL Render action used to generate each frame. | |
void | setCompressionRate (float value) |
Compression rate of the MPEG output. | |
float | getCompressionRate () const |
Returns the compression rate. | |
void | setBitPerSec (float mbps) |
This method allows the user to specify a fixed bit rate. | |
void | setNumFramesPerSecond (float num) |
Sets the number of frames per second encoded in the MPEG output. | |
int | getNumFramesPerSecond () |
Gets the number of frames per second to be encoded in the MPEG output. | |
void | addFrame (const unsigned char *frame) |
Low level method to add a new frame to the MPEG output from a buffer of unsigned characters. | |
void | setShareContext (const SbGLShareContext shareCxt) |
Sets the OpenGL context to be shared by the SoMPEGRenderer. | |
const SbGLShareContext | getShareContext () const |
Gets the OpenGL context shared by this object. | |
virtual void | pause () |
Pauses the recording. | |
SbBool | isRecording () const |
Returns true if this renderer is recording. | |
void | setViewerIsIdle (bool isIdle) |
Tells the recorder that the viewer is idle. | |
bool | isViewerIdle () const |
Additional Inherited Members | |
Public Types inherited from SoMPEGRenderer | |
enum | Components { LUMINANCE = 1 , LUMINANCE_TRANSPARENCY = 2 , RGB = 3 , RGB_TRANSPARENCY = 4 } |
Components. More... | |
Generates MPEG output that tracks camera motion.
This class generates MPEG output that tracks (i.e. follows) camera motion – specifically changes in the position, orientation, nearDistance, and farDistance fields. These are the fields that can be modified by mouse movements within a viewer.
After SoMPEGNavRenderer::record() is called, all camera movements are recorded until SoMPEGNavRenderer::stop() is called. At that time, frames corresponding to each camera movement are rendered and stored in the MPEG output.
See the parent class SoMPEGRenderer for methods to specify the file and recording parameters.
SoMPEGRenderer, SoMPEGFrameRenderer
Definition at line 62 of file SoMPEGNavRenderer.h.
SoMPEGNavRenderer::SoMPEGNavRenderer | ( | SoNode * | node | ) |
Constructor.
The method SoMPEGRenderer::setSceneGraph() is called with the given argument. The specified scene graph must contain a camera in order to produce correct results.
|
virtual |
Destructor.
void SoMPEGNavRenderer::adjustNumFramesPerSecond | ( | SbBool | flag | ) |
Specifies whether the camera movements are adjusted to the number of frames per second.
Default is FALSE.
SoCamera * SoMPEGNavRenderer::getCamera | ( | ) |
Returns the camera currently used by the MPEG renderer.
SbBool SoMPEGNavRenderer::isAdjustedNumFramesPerSecond | ( | ) | const |
Returns whether the camera movements are adjusted to the number of frames per second.
|
virtual |
Starts recording camera movements.
All camera movements are recorded until stop() is called.
Reimplemented from SoMPEGRenderer.
void SoMPEGNavRenderer::setCamera | ( | SoCamera * | camera | ) |
Specifies the camera to be used by the MPEG renderer.
Setting the camera is only needed if the first camera found in the scene isn't the one that should be used.
|
virtual |
Sets the scene graph used for generating frames in the MPEG output.
Reimplemented from SoMPEGRenderer.
|
virtual |
Stops recording camera movements.
Each frame corresponding to a camera movement is rendered and added to the MPEG output file.
Reimplemented from SoMPEGRenderer.