class CAVERN_perfGui_c : public pfGroup

Class for creating Performer-based menus

Inheritance:


Public Fields

static const int OK
Return status OK
static const int FAILED
Return status FAILED
static const int STATIONARY_MENU
Set menu type to stationary menu
static const int TETHERED_MENU
Set menu type to tethered menu

Public Methods

CAVERN_perfGui_c ()
Constructor
void hide ()
Hide the whole menu.
void show ()
Show the whole menu.
int hideMenuItem (const char* ptr_MenuName)
Hide the menu item
int showMenuItem (const char* ptr_MenuName)
Show the menu item
void setMenuPos (double x, double y, double z)
Set the menu's position
void setMenuOrientation (double, double, double)
Set the menu's orientation
int setTrigger (char*, void(*f1)(void* userdata))
set the tigger function for the menu item
int setTriggerData (char*, void* )
set the userdata for the menu item
void setIntersectionMask (long mask)
Set menu Performer intersection mask
void setMenuType (int itype)
Set the menu type
int addMenuItem (char* ptr_MenuItemName, char* ptr_FileName, char* ptr_FileNameChg, void (* functioncall)(void* userData), void*userData)
Add an Item to this menu
void addMenuFrame (char* ptr_FileName, char* ptr_FileNameChg)
Add a Frame to the menu
void setCAVEButton (int val)
Set the CAVE wand button to use to trigger menu
~CAVERN_perfGui_c ()
Destructor

Documentation

Class for creating Performer-based menus.

To use it you first need to initialize it with:

CAVERN_perfGui_c::init();

just before pfInit();

Then you create an object of this type and add the object to your Performer scene graph. In general you add it to the head of the scene graph before your navigational DCS.

See the demo program for an example.

You have to design the actual buttons and frame for the menu. These can be an object of any model format that Performer will read. In general you create 2 shapes for the frame and each button, one for how it looks unactivated and one for when the user points at it with the wand. The frame acts as a backing for the buttons so that you can click and drag the menu as a whole. The demo/menu subdirectory contains an example.

int hideMenuItem(const char* ptr_MenuName)
Hide the menu item. ptr_MenuName specify which menu item will be hide.

Returns:
CAVERN_perfGui_c::OK or FAILED.

int showMenuItem(const char* ptr_MenuName)
Show the menu item. ptr_MenuName specify which menu item will be shown.

Returns:
CAVERN_perfGui_c::OK or FAILED.

int setTrigger(char*, void(*f1)(void* userdata))
set the tigger function for the menu item. the first parameter indicate the menu item's name, and the second parameter indicate the callback trigger function.

Returns:
CAVERN_perfGui_c::OK or FAILED.

int setTriggerData(char*, void* )
set the userdata for the menu item. the first parameter indicate the menu item's name, the second parameter indicate the userdata.

Returns:
CAVERN_perfGui_c::OK or FAILED.

void setIntersectionMask(long mask)
Set menu Performer intersection mask. By default this is set at 0x2.
Parameters:
mask - represented as a hex number.

void setMenuType(int itype)
Set the menu type. There are 2 types of menu could be defined, one is STATIONARY_MENU and the other is TETHERED_MENU. itype should be one of these 2 values. A STATIONARY_MENU is a menu that is located in a fixed position in the world. A TETHERED_MENU is one which follows the user.

int addMenuItem(char* ptr_MenuItemName, char* ptr_FileName, char* ptr_FileNameChg, void (* functioncall)(void* userData), void*userData)
Add an Item to this menu. ptr_MenuItemName specify the MenuItem's name, the ptr_FileName specify the menu model' file name, for example menuread.iv. the ptr_FileNameChg specify another model file name, when the intersection with the menu item happens, the menu model will switch from the old model to the new one. when the intersection ends, the menu model will switch to the first model again. functioncall is a callback function. when the menu item is triggered, this function will be called userdate is the data for the functioncall. It can be set as NULL.

Returns:
CAVERN_perfGui_c::OK or FAILED.

void addMenuFrame(char* ptr_FileName, char* ptr_FileNameChg)
Add a Frame to the menu. ptr_FileName specify the model file name of the menu frame ptr_FileNameChg specify another model file name to be used when the intersection happens

void setCAVEButton(int val)
Set the CAVE wand button to use to trigger menu
Parameters:
val - should be set to 1, 2, or 3 corresponding to left, middle, right buttons.

~CAVERN_perfGui_c()
Destructor. p


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de