vrj::PfApp Class Reference

Encapulates an actual Performer application. More...

#include <vrj/Draw/Pf/PfApp.h>

Inheritance diagram for vrj::PfApp:

Inheritance graph
[legend]
Collaboration diagram for vrj::PfApp:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PfApp (Kernel *kern=NULL)
virtual ~PfApp ()
virtual void initScene ()=0
 Initializes the scene graph.
virtual void preForkInit ()
 Called between pfInit and pfConfig.
virtual void appChanFunc (pfChannel *chan)
 Function called in application process for each active channel each frame.
virtual pfGroup * getScene ()=0
 Returns the current scene graph.
virtual void configPWin (pfPipeWindow *pWin)
 Initializes a pWin.
virtual std::vector< int > getFrameBufferAttrs ()
 Returns the needed parameters for the performer framebuffer.
virtual void drawChan (pfChannel *chan, void *chandata)
 Function called in the channel draw function to do the actual drawing.
virtual void preDrawChan (pfChannel *chan, void *chandata)
 Function called by the DEFAULT drawChan function before clearing the channel and drawing the next frame (pfFrame()).
virtual void postDrawChan (pfChannel *chan, void *chandata)
 Function called by the DEFAULT drawChan function after clearing the channel and drawing the next frame (pfFrame()).
virtual DrawManagergetDrawManager ()
 Gets the Draw Manager to use.

Detailed Description

Encapulates an actual Performer application.

This class defines the class that Performer application classes should be derived from. The interface defined by this class is what the Performer Draw Manager will use to interact with the user's application.

Definition at line 60 of file PfApp.h.


Constructor & Destructor Documentation

vrj::PfApp::PfApp ( Kernel kern = NULL  ) 

Definition at line 42 of file PfApp.cpp.

00042                          : App(kern)
00043 {
00044    /* Do nothing. */ ;
00045 }

vrj::PfApp::~PfApp (  )  [virtual]

Definition at line 47 of file PfApp.cpp.

00048 {
00049    /* Do nothing. */ ;
00050 }


Member Function Documentation

virtual void vrj::PfApp::initScene (  )  [pure virtual]

Initializes the scene graph.

Called after pfInit and pfConfig but before apiInit.

Referenced by vrj::PfDrawManager::initAppGraph().

virtual void vrj::PfApp::preForkInit (  )  [inline, virtual]

Called between pfInit and pfConfig.

This function allows the user application to do any processing that needs to happen before performer forks its processes off but after pfInit().

Note:
Using this function leads to applications that are not "switchable".

Definition at line 80 of file PfApp.h.

Referenced by vrj::PfDrawManager::initAPI().

00080 {;}

virtual void vrj::PfApp::appChanFunc ( pfChannel *  chan  )  [inline, virtual]

Function called in application process for each active channel each frame.

Called immediately before draw (pfFrame()). XXX: Should maybe only call this for one "master" channel each frame.

Definition at line 87 of file PfApp.h.

Referenced by vrj::PfDrawManager::callAppChanFuncs().

00088    {
00089       boost::ignore_unused_variable_warning(chan);
00090    }

virtual pfGroup* vrj::PfApp::getScene (  )  [pure virtual]

Returns the current scene graph.

This function must be defined so that the Performer Draw Manager can get a scene graph to draw.

Note:
Do NOT put model loading and manipulation in this function instead, put that type of thing in initScene().

Make sure that the node returned is NOT a pfScene. If it is, then lighting will NOT work.

Referenced by vrj::PfDrawManager::initAppGraph().

virtual void vrj::PfApp::configPWin ( pfPipeWindow *  pWin  )  [inline, virtual]

Initializes a pWin.

Called by the Performer Draw Manager as soon as the pwin is opened.

Definition at line 108 of file PfApp.h.

Referenced by vrj::PFconfigPWin().

00109    {
00110       boost::ignore_unused_variable_warning(pWin);
00111    }

virtual std::vector<int> vrj::PfApp::getFrameBufferAttrs (  )  [inline, virtual]

Returns the needed parameters for the performer framebuffer.

Note:
Stereo, doublebuffer, depth buffer, and rgba are all requested by default. ex: To request multisampling return a vector containing: [PFB_SAMPLE_BUFFER,1,PFFB_SAMPLES,1]

Definition at line 119 of file PfApp.h.

Referenced by vrj::PfDrawManager::getMonoFBConfig(), and vrj::PfDrawManager::getStereoFBConfig().

00120    {
00121       return std::vector<int>();
00122    }

virtual void vrj::PfApp::drawChan ( pfChannel *  chan,
void *  chandata 
) [inline, virtual]

Function called in the channel draw function to do the actual drawing.

For most programs the default behavior of this function is correct. It simply does the following:
chan->clear();
pfDraw();

Advanced users may want to overide this behavior for advanced rendering effects such as over-lays, or multi-pass rendering. See the Performer man pages about overiding the draw traversal function. This function is the draw traversal function but with the projections set correctly for the given display and eye.

Precondition:
chan is ready to draw.
Postcondition:
Channel should be drawn.

Definition at line 141 of file PfApp.h.

References vrjDBG_DRAW_MGR().

00142    {
00143       vprDEBUG_OutputGuard(vrjDBG_DRAW_MGR, vprDBG_VERB_LVL,
00144                            std::string("--- vrj::PfApp::drawChan() Entered ---\n"),
00145                            std::string("--- vrj::PfApp::drawChan() Exited ---\n"));
00146       this->preDrawChan(chan,chandata);
00147       chan->clear();       // Clear the channel
00148       pfDraw();            // Draw the channel
00149       this->postDrawChan(chan,chandata);
00150    }

virtual void vrj::PfApp::preDrawChan ( pfChannel *  chan,
void *  chandata 
) [inline, virtual]

Function called by the DEFAULT drawChan function before clearing the channel and drawing the next frame (pfFrame()).

Definition at line 156 of file PfApp.h.

00157    {
00158       boost::ignore_unused_variable_warning(chan);
00159       boost::ignore_unused_variable_warning(chandata);
00160    }

virtual void vrj::PfApp::postDrawChan ( pfChannel *  chan,
void *  chandata 
) [inline, virtual]

Function called by the DEFAULT drawChan function after clearing the channel and drawing the next frame (pfFrame()).

Definition at line 166 of file PfApp.h.

00167    {
00168       boost::ignore_unused_variable_warning(chan);
00169       boost::ignore_unused_variable_warning(chandata);
00170    }

DrawManager * vrj::PfApp::getDrawManager (  )  [virtual]

Gets the Draw Manager to use.

Returns the Performer Draw Manager.

Implements vrj::App.

Definition at line 52 of file PfApp.cpp.

00053 {
00054    return PfDrawManager::instance();
00055 }


The documentation for this class was generated from the following files:
Generated on Thu Jan 4 10:58:25 2007 for VR Juggler by  doxygen 1.5.1