OpenCOVER
Public Types | 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 Types

enum  NotificationLevel { Info , Warning , Error , Fatal }
 

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 notify (NotificationLevel level, const char *text)
 this function is called when COVER wants to display a message to the user More...
 
virtual void addNode (osg::Node *, const 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 (const RenderObject *container, osg::Group *parent, const RenderObject *geometry, const RenderObject *normals, const RenderObject *colors, const RenderObject *texture)
 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 (const RenderObject *container, coInteractor *it)
 this function is called when COVER gets a new COVISE object with feedback attributes More...
 
virtual bool requestInteraction (coInteractor *inter, osg::Node *triggerNode, bool isMouse)
 this function is called when COVER wants to enable interaction with an interactor, return true if plugin accepts request 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 bool update ()
 
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 toWhom, int type, int length, const void *data)
 
virtual void UDPmessage (covise::UdpMessage *msg)
 
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 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 std::string collaborativeSessionId () const
 for visualisation system plugins: return string identifying collaborative session uniquely 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...
 
virtual bool windowCreate (int num)
 
virtual void windowCheckEvents (int num)
 
virtual void windowUpdateContents (int num)
 
virtual void windowDestroy (int num)
 
virtual void windowFullScreen (int num, bool state)
 
virtual bool updateViewer ()
 let the plugin that has a grab on viewer update viewer matrix 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

Member Enumeration Documentation

◆ NotificationLevel

Enumerator
Info 
Warning 
Error 
Fatal 

Constructor & Destructor Documentation

◆ coVRPlugin()

opencover::coVRPlugin::coVRPlugin ( )

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

◆ ~coVRPlugin()

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

called before plugin is unloaded

Member Function Documentation

◆ addNode()

virtual void opencover::coVRPlugin::addNode ( osg::Node *  ,
const 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

◆ addObject()

virtual void opencover::coVRPlugin::addObject ( const RenderObject container,
osg::Group *  parent,
const RenderObject geometry,
const RenderObject normals,
const RenderObject colors,
const RenderObject texture 
)
inlinevirtual

this function is called whenever a COVISE object is received

◆ becomeCollaborativeMaster()

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

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

◆ button()

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

for Trackingsystem plugins: return the button state of device station

◆ clusterSyncDraw()

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

◆ collaborativeSessionId()

virtual std::string opencover::coVRPlugin::collaborativeSessionId ( ) const
inlinevirtual

for visualisation system plugins: return string identifying collaborative session uniquely

◆ commitTimestep()

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

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

◆ coviseError()

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

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

◆ destroy()

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

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

◆ executeAll()

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

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

◆ expandBoundingSphere()

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

allow plugin to expand bounding sphere

◆ getMatrix()

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

for Trackingsystem plugins: return the Matrix of device station

◆ getName()

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

retrieve the plugin's name

◆ guiToRenderMsg()

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

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

◆ init()

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

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

◆ init2()

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

this function is called when files have been loaded

◆ key()

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

this functions is called when a key is pressed or released

◆ message()

virtual void opencover::coVRPlugin::message ( int  toWhom,
int  type,
int  length,
const void *  data 
)
inlinevirtual

◆ newInteractor()

virtual void opencover::coVRPlugin::newInteractor ( const RenderObject container,
coInteractor it 
)
inlinevirtual

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

Reimplemented in opencover::ModuleFeedbackPlugin.

◆ notify()

virtual void opencover::coVRPlugin::notify ( NotificationLevel  level,
const char *  text 
)
inlinevirtual

this function is called when COVER wants to display a message to the user

◆ param()

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

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

◆ postFrame()

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

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

◆ postSwapBuffers()

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

this function is called from the draw thread after swapbuffers

◆ preDraw()

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)

◆ preFrame()

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

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

Reimplemented in opencover::ModuleFeedbackPlugin.

◆ preSwapBuffers()

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

this function is called from the draw thread before swapbuffers

◆ removeNode()

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

◆ removeObject()

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

this function is called when a COVISE Object is removed

◆ requestInteraction()

virtual bool opencover::coVRPlugin::requestInteraction ( coInteractor inter,
osg::Node *  triggerNode,
bool  isMouse 
)
inlinevirtual

this function is called when COVER wants to enable interaction with an interactor, return true if plugin accepts request

◆ requestQuit()

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

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

◆ requestTimestep()

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

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

◆ sendVisMessage()

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

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

◆ setName()

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

set the plugin's name

◆ setTimestep()

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

◆ UDPmessage()

virtual void opencover::coVRPlugin::UDPmessage ( covise::UdpMessage *  msg)
inlinevirtual

◆ update()

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

this function is called from the main thread after the state for a frame is set up, just before preFrame() return true, if you need the scene to be rendered immediately

◆ updateViewer()

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

let the plugin that has a grab on viewer update viewer matrix

◆ userEvent()

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

this functions is called when a user event arrives

◆ waitForVisMessage()

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

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

◆ wheel()

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

for Trackingsystem plugins: return the wheel state of device station

◆ windowCheckEvents()

virtual void opencover::coVRPlugin::windowCheckEvents ( int  num)
inlinevirtual

◆ windowCreate()

virtual bool opencover::coVRPlugin::windowCreate ( int  num)
inlinevirtual

◆ windowDestroy()

virtual void opencover::coVRPlugin::windowDestroy ( int  num)
inlinevirtual

◆ windowFullScreen()

virtual void opencover::coVRPlugin::windowFullScreen ( int  num,
bool  state 
)
inlinevirtual

◆ windowUpdateContents()

virtual void opencover::coVRPlugin::windowUpdateContents ( int  num)
inlinevirtual

Friends And Related Function Documentation

◆ coVRPluginList

friend class coVRPluginList
friend

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