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

#include <cover/coVRPluginSupport.h>

Public Member Functions

bool debugLevel (int level) const
 returns true if level <= debugLevel More...
 
INTERNAL int getNumClipPlanes ()
 return the number of clipPlanes reserved for the kernel, others are available to VRML ClippingPlane Node More...
 
osg::ClipPlane * getClipPlane (int num)
 return pointer to a clipping plane More...
 
bool isClippingOn () const
 returns true if clipping is on More...
 
int getActiveClippingPlane () const
 return number of clipping plane user is possibly interacting with More...
 
void setActiveClippingPlane (int plane)
 set number of clipping plane user is possibly interacting with More...
 
osgShadow::ShadowedScene * getScene () const
 get scene group node More...
 
osg::ClipNode * getObjectsRoot () const
 get the group node for all COVISE and model geometry More...
 
osg::MatrixTransform * getPointer () const
 get the MatrixTransform node of the hand More...
 
const osg::Matrix & getPointerMat () const
 get matrix of hand transform (same as getPointer()->getMatrix()) More...
 
const osg::Matrix & getMouseMat () const
 
osg::MatrixTransform * getObjectsXform () const
 get the MatrixTransform for objects translation and rotation More...
 
const osg::Matrix & getXformMat () const
 same as getObjectsXform()->getMatrix() More...
 
void setXformMat (const osg::Matrix &mat)
 same as getObjectsXform()->setMatrix() More...
 
osg::MatrixTransform * getObjectsScale () const
 get the MatrixTransform for objects scaling More...
 
void setScale (float s)
 set the scale matrix of the scale node More...
 
float getScale () const
 get the scale factor of the scale node More...
 
const osg::Matrix & getBaseMat () const
 transformation matrix from object coordinates to world coordinates More...
 
const osg::Matrix & getInvBaseMat () const
 transformation from world coordinates to object coordinates More...
 
vrui::coUpdateManagergetUpdateManager () const
 
float getSceneSize () const
 get the scene size defined in covise.config More...
 
bool isVRBconnected ()
 
bool sendVrbMessage (const covise::Message *msg) const
 send a message either via COVISE connection or via VRB More...
 
const osg::Matrix & getViewerMat () const
 get the position and orientation of the user in world coordinates More...
 
void setNodesIsectable (osg::Node *n, bool isect)
 search geodes under node and set Visible bit in node mask More...
 
coPointerButtongetPointerButton () const
 returns a pointer to a coPointerButton object for the main button device More...
 
coPointerButtongetMouseButton () const
 returns a pointer to a coPointerButton object representing the mouse buttons state More...
 
vrui::coMenugetMenu () const
 returns the COVER Menu (Pinboard) More...
 
osg::Group * getMenuGroup () const
 return group node of menus More...
 
coVRPluginaddPlugin (const char *name)
 load a new plugin More...
 
coVRPlugingetPlugin (const char *name)
 get plugin called name More...
 
void removePlugin (coVRPlugin *)
 remove the plugin by pointer More...
 
int removePlugin (const char *name)
 remove a plugin by name More...
 
void addedNode (osg::Node *node, coVRPlugin *myPlugin)
 informs other plugins that this plugin extended the scene graph More...
 
bool removeNode (osg::Node *node, bool isGroup=false)
 remove node from the scene graph, More...
 
void sendMessage (coVRPlugin *sender, int toWhom, int type, int len, const void *buf)
 send a message to other plugins More...
 
void sendMessage (coVRPlugin *sender, const char *destination, int type, int len, const void *buf, bool localonly=false)
 send a message to a named plugins More...
 
bool grabKeyboard (coVRPlugin *)
 grab keyboard input More...
 
void releaseKeyboard (coVRPlugin *)
 release keyboard input, all plugins will get key events More...
 
bool isKeyboardGrabbed ()
 check if keyboard is grabbed More...
 
int createUniqueButtonGroupId ()
 returns a new unique button group id More...
 
void addSubmenuButton (const char *buttonName, const char *parentMenuName, const char *subMenuName, int state, ButtonCallback callback, int groupId, void *classPtr)
 
void addToggleButton (const char *buttonName, const char *parentMenuName, int state, ButtonCallback callback, void *classPtr, void *userData=NULL)
 
void addGroupButton (const char *buttonName, const char *parentMenuName, int state, ButtonCallback callback, int groupId, void *classPtr, void *userData=NULL)
 
void addFunctionButton (const char *buttonName, const char *parentMenuName, ButtonCallback callback, void *classPtr, void *userData=NULL)
 
void addSliderButton (const char *buttonName, const char *parentMenuName, float min, float max, float value, ButtonCallback callback, void *classPtr, void *userData=NULL)
 
bool setSliderValue (const char *buttonName, float value)
 
bool setButtonState (const char *buttonName, int state)
 
int getButtonState (const char *buttonName, const char *menuName)
 
float getSliderValue (const char *buttonName, const char *menuName)
 
void removeButton (const char *buttonName, const char *parentMenuName)
 
int isBuiltInFunctionInPinboard (const char *functionName)
 
void setBuiltInFunctionState (const char *functionName, int state)
 
void setBuiltInFunctionValue (const char *functionName, float val)
 
int getBuiltInFunctionState (const char *functionName, int *state)
 
int getBuiltInFunctionValue (const char *functionName, float *val)
 
void callBuiltInFunctionCallback (const char *functionName)
 
vrui::coMenuItemgetBuiltInFunctionMenuItem (const char *functionName)
 
void enableNavigation (const char *navigationName)
 
void disableNavigation (const char *navigationName)
 
void setNavigationValue (const char *navigationName, float value)
 
void addConfigurableButton (const char *functionName, const char *defButtonName, const char *defMenuName, int type, void *callback, void *inst, int groupId=-1, void *userData=NULL)
 
void protectScenegraph ()
 
double frameTime () const
 
double frameDuration () const
 
double frameRealTime () const
 
double currentTime () const
 
osgViewer::GraphicsWindow::MouseCursor getCurrentCursor () const
 get the number of the active cursor shape More...
 
void setCurrentCursor (osgViewer::GraphicsWindow::MouseCursor type)
 
void setCursorVisible (bool visible)
 make the cursor visible or invisible More...
 
osg::Node * getIntersectedNode () const
 get node currently intersected by pointer More...
 
const osg::NodePath & getIntersectedNodePath () const
 get path to node currently intersected by pointer More...
 
const osg::Vec3 & getIntersectionHitPointWorld () const
 get world coordinates of intersection hit point More...
 
const osg::Vec3 & getIntersectionHitPointWorldNormal () const
 get normal of intersection hit More...
 
INTERNAL INTERNAL
vrui::coToolboxMenu
getToolBar ()
 
void setToolBar (vrui::coToolboxMenu *tb)
 
void setFrameTime (double ft)
 use only during coVRPlugin::prepareFrame() More...
 

Friends

class OpenCOVER
 
class coVRMSController
 
class coIntersection
 
class VRPinboard
 

Detailed Description

Provide a stable interface and a single entry point to the most import OpenCOVER functions

Member Function Documentation

void opencover::coVRPluginSupport::addConfigurableButton ( const char *  functionName,
const char *  defButtonName,
const char *  defMenuName,
int  type,
void *  callback,
void *  inst,
int  groupId = -1,
void *  userData = NULL 
)
void opencover::coVRPluginSupport::addedNode ( osg::Node *  node,
coVRPlugin myPlugin 
)

informs other plugins that this plugin extended the scene graph

void opencover::coVRPluginSupport::addFunctionButton ( const char *  buttonName,
const char *  parentMenuName,
ButtonCallback  callback,
void *  classPtr,
void *  userData = NULL 
)

add a function button, a function button just calls the callback

Parameters
buttonNametext on the button
parentMenuNameto which menu it will be appended, NULL = main menu
callbackfunction which is called on press/release
classPtrptr to the class which calls the callback
userDataptr to data to pass to callback
void opencover::coVRPluginSupport::addGroupButton ( const char *  buttonName,
const char *  parentMenuName,
int  state,
ButtonCallback  callback,
int  groupId,
void *  classPtr,
void *  userData = NULL 
)

append a group button to a menu

Parameters
buttonNametext on the button
parentMenuNameto which menu it will be appended, NULL = main menu
statefalse=off, true=on
callbackfunction which is called on press/release
groupIdif a button is in the same group with others it is automatically
classPtrptr to the class which calls the callback
userDataptr to data to pass to callback
coVRPlugin* opencover::coVRPluginSupport::addPlugin ( const char *  name)

load a new plugin

void opencover::coVRPluginSupport::addSliderButton ( const char *  buttonName,
const char *  parentMenuName,
float  min,
float  max,
float  value,
ButtonCallback  callback,
void *  classPtr,
void *  userData = NULL 
)

add a slider to a menu

Parameters
buttonNametext on the slider
parentMenuNameto which menu it will be appended, NULL = main menu
minminimum slider value
maxmaximum slider value
valueinitial slider value
callbackfunction which is called on press/release
classPtrptr to the class which calls the callback
userDataptr to data to pass to callback
void opencover::coVRPluginSupport::addSubmenuButton ( const char *  buttonName,
const char *  parentMenuName,
const char *  subMenuName,
int  state,
ButtonCallback  callback,
int  groupId,
void *  classPtr 
)

append a button to a menu which opens a submenu if switched on

Parameters
buttonNametext on the button
parentMenuNameto which menu it will be appended, NULL = main menu
subMenuNameheader of the submenu
statefalse=off, true=on
callbackfunction which is called on press/release
groupIdif a button is in the same group with others it is automatically switched off if another button is pressed
classPtrptr to the class which calls the callback
void opencover::coVRPluginSupport::addToggleButton ( const char *  buttonName,
const char *  parentMenuName,
int  state,
ButtonCallback  callback,
void *  classPtr,
void *  userData = NULL 
)

append a toggle button to a menu

Parameters
buttonNametext on the button
parentMenuNameto which menu it will be appended, NULL = main menu
statefalse=off, true=on
callbackfunction which is called on press/release
classPtrptr to the class which calls the callback
userDataptr to data to pass to callback
void opencover::coVRPluginSupport::callBuiltInFunctionCallback ( const char *  functionName)
int opencover::coVRPluginSupport::createUniqueButtonGroupId ( )

returns a new unique button group id

if you want to create a new button group you need this id

double opencover::coVRPluginSupport::currentTime ( ) const

returns the current time in seconds since Jan. 1, 1970, if possible, use frameTime() as it does not require a system call

Returns
number of seconds since Jan. 1, 1970
bool opencover::coVRPluginSupport::debugLevel ( int  level) const

returns true if level <= debugLevel

debug levels should be used like this: 0 no output, 1 covise.config entries, coVRInit, 2 constructors, destructors, 3 all functions which are not called continously, 4, 5 all functions which are called continously

void opencover::coVRPluginSupport::disableNavigation ( const char *  navigationName)
void opencover::coVRPluginSupport::enableNavigation ( const char *  navigationName)
double opencover::coVRPluginSupport::frameDuration ( ) const

returns the duration of the last frame in seconds

Returns
render time of the last frame in seconds
double opencover::coVRPluginSupport::frameRealTime ( ) const

returns the time in seconds since Jan. 1, 1970 at the beginning of this frame, use this function if you can since it is faster than currentTime(),

double opencover::coVRPluginSupport::frameTime ( ) const

returns the time in seconds since Jan. 1, 1970 at the beginning of this frame, use this function if you can since it is faster than currentTime(), this is the time for which the rendering should be correct, might differ from system time

Returns
number of seconds since Jan. 1, 1970 at the beginning of this frame
int opencover::coVRPluginSupport::getActiveClippingPlane ( ) const

return number of clipping plane user is possibly interacting with

const osg::Matrix& opencover::coVRPluginSupport::getBaseMat ( ) const
inline

transformation matrix from object coordinates to world coordinates

multiplied matrices from scene node to objects root node

vrui::coMenuItem* opencover::coVRPluginSupport::getBuiltInFunctionMenuItem ( const char *  functionName)
int opencover::coVRPluginSupport::getBuiltInFunctionState ( const char *  functionName,
int *  state 
)
int opencover::coVRPluginSupport::getBuiltInFunctionValue ( const char *  functionName,
float *  val 
)
int opencover::coVRPluginSupport::getButtonState ( const char *  buttonName,
const char *  menuName 
)

get the current state of a button

Parameters
buttonNametext on the button
menuNamename of the button's menu
Returns
current button state
osg::ClipPlane* opencover::coVRPluginSupport::getClipPlane ( int  num)
inline

return pointer to a clipping plane

osgViewer::GraphicsWindow::MouseCursor opencover::coVRPluginSupport::getCurrentCursor ( ) const

get the number of the active cursor shape

osg::Node* opencover::coVRPluginSupport::getIntersectedNode ( ) const

get node currently intersected by pointer

const osg::NodePath& opencover::coVRPluginSupport::getIntersectedNodePath ( ) const

get path to node currently intersected by pointer

const osg::Vec3& opencover::coVRPluginSupport::getIntersectionHitPointWorld ( ) const

get world coordinates of intersection hit point

const osg::Vec3& opencover::coVRPluginSupport::getIntersectionHitPointWorldNormal ( ) const

get normal of intersection hit

const osg::Matrix& opencover::coVRPluginSupport::getInvBaseMat ( ) const

transformation from world coordinates to object coordinates

use this cached value instead of inverting getBaseMat() yourself

vrui::coMenu* opencover::coVRPluginSupport::getMenu ( ) const

returns the COVER Menu (Pinboard)

osg::Group* opencover::coVRPluginSupport::getMenuGroup ( ) const

return group node of menus

coPointerButton* opencover::coVRPluginSupport::getMouseButton ( ) const

returns a pointer to a coPointerButton object representing the mouse buttons state

const osg::Matrix& opencover::coVRPluginSupport::getMouseMat ( ) const

get matrix of current 2D mouse matrix (the same as getPointerMat for MOUSE tracking)

INTERNAL int opencover::coVRPluginSupport::getNumClipPlanes ( )

return the number of clipPlanes reserved for the kernel, others are available to VRML ClippingPlane Node

osg::ClipNode* opencover::coVRPluginSupport::getObjectsRoot ( ) const

get the group node for all COVISE and model geometry

osg::MatrixTransform* opencover::coVRPluginSupport::getObjectsScale ( ) const

get the MatrixTransform for objects scaling

osg::MatrixTransform* opencover::coVRPluginSupport::getObjectsXform ( ) const

get the MatrixTransform for objects translation and rotation

coVRPlugin* opencover::coVRPluginSupport::getPlugin ( const char *  name)

get plugin called name

osg::MatrixTransform* opencover::coVRPluginSupport::getPointer ( ) const

get the MatrixTransform node of the hand

coPointerButton* opencover::coVRPluginSupport::getPointerButton ( ) const

returns a pointer to a coPointerButton object for the main button device

const osg::Matrix& opencover::coVRPluginSupport::getPointerMat ( ) const

get matrix of hand transform (same as getPointer()->getMatrix())

float opencover::coVRPluginSupport::getScale ( ) const

get the scale factor of the scale node

osgShadow::ShadowedScene* opencover::coVRPluginSupport::getScene ( ) const

get scene group node

float opencover::coVRPluginSupport::getSceneSize ( ) const

get the scene size defined in covise.config

float opencover::coVRPluginSupport::getSliderValue ( const char *  buttonName,
const char *  menuName 
)

get the current value of a slider

Parameters
buttonNametext on the slider
menuNamename of the slider's menu
Returns
current slider value
INTERNAL INTERNAL vrui::coToolboxMenu* opencover::coVRPluginSupport::getToolBar ( )
inline
vrui::coUpdateManager* opencover::coVRPluginSupport::getUpdateManager ( ) const
const osg::Matrix& opencover::coVRPluginSupport::getViewerMat ( ) const

get the position and orientation of the user in world coordinates

const osg::Matrix& opencover::coVRPluginSupport::getXformMat ( ) const

same as getObjectsXform()->getMatrix()

bool opencover::coVRPluginSupport::grabKeyboard ( coVRPlugin )

grab keyboard input

other plugins will not get key event notifications, returns true if keyboard could be grabbed, returns false if keyboard is already grabbed by another plugin

int opencover::coVRPluginSupport::isBuiltInFunctionInPinboard ( const char *  functionName)

check if a function is visible in pinboard

Returns
true if this function is built-in and in pinboard
bool opencover::coVRPluginSupport::isClippingOn ( ) const

returns true if clipping is on

bool opencover::coVRPluginSupport::isKeyboardGrabbed ( )

check if keyboard is grabbed

bool opencover::coVRPluginSupport::isVRBconnected ( )
void opencover::coVRPluginSupport::protectScenegraph ( )
void opencover::coVRPluginSupport::releaseKeyboard ( coVRPlugin )

release keyboard input, all plugins will get key events

void opencover::coVRPluginSupport::removeButton ( const char *  buttonName,
const char *  parentMenuName 
)

remove a button name of the button to remove name of submenu, if NULL remove from main menu

bool opencover::coVRPluginSupport::removeNode ( osg::Node *  node,
bool  isGroup = false 
)

remove node from the scene graph,

use this method when removing nodes from the scene graph in order to update OpenCOVER's internal state

Returns
if a node was removed
void opencover::coVRPluginSupport::removePlugin ( coVRPlugin )

remove the plugin by pointer

int opencover::coVRPluginSupport::removePlugin ( const char *  name)

remove a plugin by name

void opencover::coVRPluginSupport::sendMessage ( coVRPlugin sender,
int  toWhom,
int  type,
int  len,
const void *  buf 
)

send a message to other plugins

void opencover::coVRPluginSupport::sendMessage ( coVRPlugin sender,
const char *  destination,
int  type,
int  len,
const void *  buf,
bool  localonly = false 
)

send a message to a named plugins

bool opencover::coVRPluginSupport::sendVrbMessage ( const covise::Message *  msg) const

send a message either via COVISE connection or via VRB

void opencover::coVRPluginSupport::setActiveClippingPlane ( int  plane)

set number of clipping plane user is possibly interacting with

void opencover::coVRPluginSupport::setBuiltInFunctionState ( const char *  functionName,
int  state 
)
void opencover::coVRPluginSupport::setBuiltInFunctionValue ( const char *  functionName,
float  val 
)
bool opencover::coVRPluginSupport::setButtonState ( const char *  buttonName,
int  state 
)

set the state of a button, this doesn't call the callback, set the state of a group, toggle or submenu button

Parameters
buttonNametext on the button
statenew button state
void opencover::coVRPluginSupport::setCurrentCursor ( osgViewer::GraphicsWindow::MouseCursor  type)

set cursor shape

Parameters
typenumber of cursor shape
void opencover::coVRPluginSupport::setCursorVisible ( bool  visible)

make the cursor visible or invisible

void opencover::coVRPluginSupport::setFrameTime ( double  ft)

use only during coVRPlugin::prepareFrame()

void opencover::coVRPluginSupport::setNavigationValue ( const char *  navigationName,
float  value 
)
void opencover::coVRPluginSupport::setNodesIsectable ( osg::Node *  n,
bool  isect 
)

search geodes under node and set Visible bit in node mask

void opencover::coVRPluginSupport::setScale ( float  s)

set the scale matrix of the scale node

bool opencover::coVRPluginSupport::setSliderValue ( const char *  buttonName,
float  value 
)

set slider value

Parameters
buttonNametext on the slider
valuenew slider value
void opencover::coVRPluginSupport::setToolBar ( vrui::coToolboxMenu tb)
inline
void opencover::coVRPluginSupport::setXformMat ( const osg::Matrix &  mat)

same as getObjectsXform()->setMatrix()

Friends And Related Function Documentation

friend class coIntersection
friend
friend class coVRMSController
friend
friend class OpenCOVER
friend
friend class VRPinboard
friend

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