OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Protected Member Functions | Friends | List of all members
opencover::coVRPlugin Class Reference

make sure to clean up properly in the plugin's dtor More...

#include <coVRPlugin.h>

Inheritance diagram for opencover::coVRPlugin:
Inheritance graph
[legend]

Public Member Functions

 coVRPlugin ()
 called early, if loaded from config, before COVER is fully initialized More...
 
virtual ~coVRPlugin ()
 called before plugin is unloaded More...
 
virtual bool init ()
 this function is called when COVER is up and running and the plugin is initialized More...
 
virtual bool init2 ()
 this function is called when files have been loaded More...
 
virtual bool destroy ()
 reimplement to do early cleanup work and return false to prevent unloading More...
 
const char * getName () const
 retrieve the plugin's name More...
 
void setName (const char *sn)
 set the plugin's name More...
 
virtual void addNode (osg::Node *, RenderObject *=NULL)
 
virtual void removeNode (osg::Node *, bool isGroup, osg::Node *realNode)
 this function is called if a node in the scene graph is removed More...
 
virtual void addObject (RenderObject *baseObj, RenderObject *geomObj, RenderObject *normObj, RenderObject *colorObj, RenderObject *texObj, osg::Group *parent, int numCol, int colorBinding, int colorPacking, float *r, float *g, float *b, int *packedCol, int numNormals, int normalBinding, float *xn, float *yn, float *zn, float transparency)
 this function is called whenever a COVISE object is received More...
 
virtual void removeObject (const char *objName, bool replaceFlag)
 this function is called when a COVISE Object is removed More...
 
virtual void newInteractor (RenderObject *container, coInteractor *it)
 this function is called when COVER gets a new COVISE object with feedback attributes More...
 
virtual void coviseError (const char *error)
 this function is called if a error message from the controller is received More...
 
virtual void guiToRenderMsg (const char *msg)
 this function is called if a message from the gui is received More...
 
virtual void prepareFrame ()
 this function is called from the main thread before the state for a frame is set up, before preFrame() More...
 
virtual void preFrame ()
 this function is called from the main thread before rendering a frame More...
 
virtual void postFrame ()
 this function is called from the main thread after a frame was rendered More...
 
virtual void preDraw (osg::RenderInfo &)
 this function is called from the draw thread before drawing the scenegraph (after drawing the AR background) More...
 
virtual void preSwapBuffers (int)
 this function is called from the draw thread before swapbuffers More...
 
virtual void clusterSyncDraw ()
 this function is called from the main thread after rendering has finished on all nodes and before any swap buffers happen More...
 
virtual void postSwapBuffers (int)
 this function is called from the draw thread after swapbuffers More...
 
virtual void param (const char *paramName, bool inMapLoading)
 this function is called whenever a module parameter of the renderer has changed More...
 
virtual void key (int type, int keySym, int mod)
 this functions is called when a key is pressed or released More...
 
virtual void userEvent (int mod)
 this functions is called when a user event arrives More...
 
virtual void message (int type, int length, const void *data)
 
virtual void setTimestep (int t)
 
virtual void requestTimestep (int t)
 
virtual void getMatrix (int station, osg::Matrix &mat)
 for Trackingsystem plugins: return the Matrix of device station More...
 
virtual unsigned int button (int station)
 for Trackingsystem plugins: return the button state of device station More...
 
virtual int wheel (int station)
 for Trackingsystem plugins: return the wheel state of device station More...
 
virtual vrui::coMenuItemgetMenuButton (const std::string &buttonName)
 return button corresponding to command name More...
 
virtual void requestQuit (bool killSession)
 for visualisation system plugins: request to terminate COVER or COVISE session More...
 
virtual bool sendVisMessage (const covise::Message *msg)
 for visualisation system plugins: send message to system - return true if delivered More...
 
virtual bool becomeCollaborativeMaster ()
 for visualisation system plugins: request to become master - return true if delivered More...
 
virtual covise::Message * waitForVisMessage (int messageType)
 for visualisation system plugins: wait for message, return NULL if no such plugin More...
 
virtual bool executeAll ()
 for visualisation system plugins: execute data flow network - return true if delivered More...
 
virtual void expandBoundingSphere (osg::BoundingSphere &bs)
 allow plugin to expand bounding sphere More...
 

Protected Member Functions

void commitTimestep (int t)
 call as a response to requestTimestep(t) when timestep t is prepared More...
 

Friends

class coVRPluginList
 

Detailed Description

make sure to clean up properly in the plugin's dtor

currently, there are these methods to start a plugin:

  1. the plugin is specified in the configuration, then it is initialized in COVER before the render loop starts
  2. a plugin starts another plugin
  3. a Feedback object attached to a COVISE object is received
  4. upon user request from the TabletUI

Constructor & Destructor Documentation

opencover::coVRPlugin::coVRPlugin ( )

called early, if loaded from config, before COVER is fully initialized

virtual opencover::coVRPlugin::~coVRPlugin ( )
virtual

called before plugin is unloaded

Member Function Documentation

virtual void opencover::coVRPlugin::addNode ( osg::Node *  ,
RenderObject = NULL 
)
inlinevirtual

first parameter is a pointer to the scene graph node, second parameter is a pointer to the COVISE object, NULL if not a COVISE object called when COVER adds a new COVISE object to the scenegraph or if other plugins insert a node into the scene graph

virtual void opencover::coVRPlugin::addObject ( RenderObject baseObj,
RenderObject geomObj,
RenderObject normObj,
RenderObject colorObj,
RenderObject texObj,
osg::Group *  parent,
int  numCol,
int  colorBinding,
int  colorPacking,
float *  r,
float *  g,
float *  b,
int *  packedCol,
int  numNormals,
int  normalBinding,
float *  xn,
float *  yn,
float *  zn,
float  transparency 
)
inlinevirtual

this function is called whenever a COVISE object is received

virtual bool opencover::coVRPlugin::becomeCollaborativeMaster ( )
inlinevirtual

for visualisation system plugins: request to become master - return true if delivered

virtual unsigned int opencover::coVRPlugin::button ( int  station)
inlinevirtual

for Trackingsystem plugins: return the button state of device station

virtual void opencover::coVRPlugin::clusterSyncDraw ( )
inlinevirtual

this function is called from the main thread after rendering has finished on all nodes and before any swap buffers happen

void opencover::coVRPlugin::commitTimestep ( int  t)
protected

call as a response to requestTimestep(t) when timestep t is prepared

virtual void opencover::coVRPlugin::coviseError ( const char *  error)
inlinevirtual

this function is called if a error message from the controller is received

virtual bool opencover::coVRPlugin::destroy ( )
inlinevirtual

reimplement to do early cleanup work and return false to prevent unloading

virtual bool opencover::coVRPlugin::executeAll ( )
inlinevirtual

for visualisation system plugins: execute data flow network - return true if delivered

virtual void opencover::coVRPlugin::expandBoundingSphere ( osg::BoundingSphere &  bs)
inlinevirtual

allow plugin to expand bounding sphere

virtual void opencover::coVRPlugin::getMatrix ( int  station,
osg::Matrix &  mat 
)
inlinevirtual

for Trackingsystem plugins: return the Matrix of device station

virtual vrui::coMenuItem* opencover::coVRPlugin::getMenuButton ( const std::string &  buttonName)
inlinevirtual

return button corresponding to command name

const char* opencover::coVRPlugin::getName ( ) const
inline

retrieve the plugin's name

virtual void opencover::coVRPlugin::guiToRenderMsg ( const char *  msg)
inlinevirtual

this function is called if a message from the gui is received

virtual bool opencover::coVRPlugin::init ( )
inlinevirtual

this function is called when COVER is up and running and the plugin is initialized

virtual bool opencover::coVRPlugin::init2 ( )
inlinevirtual

this function is called when files have been loaded

virtual void opencover::coVRPlugin::key ( int  type,
int  keySym,
int  mod 
)
inlinevirtual

this functions is called when a key is pressed or released

virtual void opencover::coVRPlugin::message ( int  type,
int  length,
const void *  data 
)
inlinevirtual
virtual void opencover::coVRPlugin::newInteractor ( RenderObject container,
coInteractor it 
)
inlinevirtual

this function is called when COVER gets a new COVISE object with feedback attributes

Reimplemented in opencover::ModuleFeedbackPlugin.

virtual void opencover::coVRPlugin::param ( const char *  paramName,
bool  inMapLoading 
)
inlinevirtual

this function is called whenever a module parameter of the renderer has changed

virtual void opencover::coVRPlugin::postFrame ( )
inlinevirtual

this function is called from the main thread after a frame was rendered

virtual void opencover::coVRPlugin::postSwapBuffers ( int  )
inlinevirtual

this function is called from the draw thread after swapbuffers

virtual void opencover::coVRPlugin::preDraw ( osg::RenderInfo &  )
inlinevirtual

this function is called from the draw thread before drawing the scenegraph (after drawing the AR background)

virtual void opencover::coVRPlugin::preFrame ( )
inlinevirtual

this function is called from the main thread before rendering a frame

Reimplemented in opencover::ModuleFeedbackPlugin.

virtual void opencover::coVRPlugin::prepareFrame ( )
inlinevirtual

this function is called from the main thread before the state for a frame is set up, before preFrame()

virtual void opencover::coVRPlugin::preSwapBuffers ( int  )
inlinevirtual

this function is called from the draw thread before swapbuffers

virtual void opencover::coVRPlugin::removeNode ( osg::Node *  ,
bool  isGroup,
osg::Node *  realNode 
)
inlinevirtual

this function is called if a node in the scene graph is removed

virtual void opencover::coVRPlugin::removeObject ( const char *  objName,
bool  replaceFlag 
)
inlinevirtual

this function is called when a COVISE Object is removed

virtual void opencover::coVRPlugin::requestQuit ( bool  killSession)
inlinevirtual

for visualisation system plugins: request to terminate COVER or COVISE session

virtual void opencover::coVRPlugin::requestTimestep ( int  t)
inlinevirtual

the plugin should prepare to display timestep t and call commitTimestep(t) when ready

virtual bool opencover::coVRPlugin::sendVisMessage ( const covise::Message *  msg)
inlinevirtual

for visualisation system plugins: send message to system - return true if delivered

void opencover::coVRPlugin::setName ( const char *  sn)

set the plugin's name

virtual void opencover::coVRPlugin::setTimestep ( int  t)
inlinevirtual

this functions is called when the current timestep is changed plugins should display this timestep if possible if there are not enough timesteps available, display the last timestep

virtual void opencover::coVRPlugin::userEvent ( int  mod)
inlinevirtual

this functions is called when a user event arrives

virtual covise::Message* opencover::coVRPlugin::waitForVisMessage ( int  messageType)
inlinevirtual

for visualisation system plugins: wait for message, return NULL if no such plugin

virtual int opencover::coVRPlugin::wheel ( int  station)
inlinevirtual

for Trackingsystem plugins: return the wheel state of device station

Friends And Related Function Documentation

friend class coVRPluginList
friend

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