Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

vrj::PfApp Class Reference

Encapulates an actual Performer application. More...

#include <PfApp.h>

Inheritance diagram for vrj::PfApp:

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

Collaboration graph
[legend]
List of all members.

Public Methods

 PfApp (Kernel *kern)
 PfApp ()
virtual ~PfApp ()
virtual void initScene ()=0
 Initializes the scene graph. More...

virtual void preForkInit ()
 Called between pfInit and pfConfig. More...

virtual void appChanFunc (pfChannel *chan)
 Function called in application process for each active channel each frame. More...

virtual pfGroup * getScene ()=0
 Returns the current scene graph. More...

virtual void configPWin (pfPipeWindow *pWin)
 Initializes a pWin. More...

virtual std::vector< int > getFrameBufferAttrs ()
 Returns the needed parameters for the performer framebuffer. More...

virtual void drawChan (pfChannel *chan, void *chandata)
 Function called in the channel draw function to do the actual drawing. More...

virtual void preDrawChan (pfChannel *chan, void *chandata)
 Function called by the DEFAULT drawChan function before clearing the channel and drawing the next frame (pfFrame()). More...

virtual void postDrawChan (pfChannel *chan, void *chandata)
 Function called by the DEFAULT drawChan function after clearing the channel and drawing the next frame (pfFrame()). More...

virtual DrawManagergetDrawManager ()
 Gets the Draw Manager to use. More...


Detailed Description

Encapulates an actual Performer application.

This class defines the class that Performer application classes should be derived from. The interface given is the interface that the System expects in order to interface with the application.

Definition at line 57 of file PfApp.h.


Constructor & Destructor Documentation

vrj::PfApp::PfApp Kernel   kern [inline]
 

Definition at line 60 of file PfApp.h.

References vrj::App::App.

00060                        : App(kern)
00061    {
00062       //api.setPerformer();  // Tell everyone that we are Performer
00063    }

vrj::PfApp::PfApp   [inline]
 

Definition at line 65 of file PfApp.h.

00065 {;}

virtual vrj::PfApp::~PfApp   [inline, virtual]
 

Definition at line 67 of file PfApp.h.

00068    {
00069       /* Do nothing. */ ;
00070    }


Member Function Documentation

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

Initializes the scene graph.

Called after pfInit and pfConfig but before apiInit.

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 85 of file PfApp.h.

00085 {;}

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 92 of file PfApp.h.

00092 {;}

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.

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 110 of file PfApp.h.

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.

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

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 139 of file PfApp.h.

References postDrawChan, preDrawChan, and vrjDBG_DRAW_MGR.

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

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 154 of file PfApp.h.

Referenced by drawChan.

00154 {;}

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 160 of file PfApp.h.

Referenced by drawChan.

00160 {;}

virtual DrawManager* vrj::PfApp::getDrawManager   [inline, virtual]
 

Gets the Draw Manager to use.

Returns the Performer Draw Manager.

Implements vrj::App.

Definition at line 166 of file PfApp.h.

00167    { return PfDrawManager::instance(); }


The documentation for this class was generated from the following file:
Generated on Sun May 2 15:11:13 2004 for VR Juggler by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002