OpenCOVER
Public Types | Public Member Functions | Protected Attributes | List of all members
vrui::coMenu Class Referenceabstract

#include <coMenu.h>

Inheritance diagram for vrui::coMenu:
Inheritance graph
[legend]
Collaboration diagram for vrui::coMenu:
Collaboration graph
[legend]

Public Types

enum  { MENU_ONOFF = 0 , MENU_SLIDE }
 
- Public Types inherited from vrui::coAction
enum  Result { ACTION_DONE = 0x00 , ACTION_CALL_ON_MISS = 0x01 , ACTION_UNDEF = 0x02 }
 

Public Member Functions

 coMenu (coMenu *parentMenu, const std::string &name)
 
virtual ~coMenu ()
 Sets the matrix which defines location and orientation. More...
 
virtual void setTransformMatrix (vruiMatrix *matrix)=0
 
virtual void setTransformMatrix (vruiMatrix *matrix, float scale)=0
 
virtual void setScale (float s)=0
 Returns the matrix which defines location and orientation of the menu. More...
 
virtual float getScale () const =0
 Gets the current scaling factor. More...
 
virtual void add (coMenuItem *item)
 
virtual void insert (coMenuItem *item, int location)
 
virtual void setMenuListener (coMenuFocusListener *listener)
 
virtual int hit (vruiHit *hit)
 
virtual void miss ()
 
virtual coUIElementgetUIElement ()
 
virtual void setVisible (bool)
 
virtual void positionAllSubmenus ()
 reposition all submenus, for example after the main menu was repositioned with setTransform matrix More...
 
virtual void remove (coMenuItem *item)
 
virtual void removeAll ()
 
virtual int getItemCount () const
 
virtual void closeMenu ()
 
virtual void selected (bool select)
 Menu is selected via joystick. More...
 
virtual void doActionPress ()
 Action is called via joystick. More...
 
virtual void doActionRelease ()
 Action is called via joystick. More...
 
virtual void doSecondActionPress ()
 Action is called via joystick. More...
 
virtual void doSecondActionRelease ()
 Action is called via joystick. More...
 
virtual void makeVisible (coMenuItem *)
 makes the item visible for joystick interaction More...
 
virtual vruiTransformNodegetDCS ()=0
 Get Transformation Node. More...
 
virtual bool isInteractionActive () const
 
coCombinedButtonInteractiongetInteraction () const
 
coCombinedButtonInteractiongetMoveInteraction () const
 
virtual void show ()=0
 makes the menu visible More...
 
virtual void hide ()=0
 hides this menu More...
 
void setShowMode (int mode)
 
int getShowMode () const
 
virtual void setSubMenuItem (coGenericSubMenuItem *item)
 
coGenericSubMenuItemgetSubMenuItem ()
 
virtual const char * getClassName () const
 get the Element's classname More...
 
virtual bool isOfClassName (const char *) const
 check if the Element or any ancestor is this classname More...
 
void closeAllOtherMenus (coMenuItem *leave=0)
 close all menus: optionally leave one open More...
 
void removeAllAfter (coMenuItem *last)
 remove all items behind a given one More...
 
bool isVisible () const
 check whether menu is currently visible More...
 
const char * getName () const
 get my menu's name More...
 
coMenuItemVector getAllItems ()
 
coMenuItemgetItemByName (const char *name)
 
int index (const coMenuItem *item)
 
void setParent (coMenu *newParent)
 
const coMenugetParent ()
 
virtual void setAttachment (int att)
 
virtual int getAttachment () const
 
bool wasMoved () const
 
void setMoved (bool flag)
 
- Public Member Functions inherited from vrui::coAction
 coAction ()
 Constructor. More...
 
virtual ~coAction ()
 Destructor. More...
 
virtual int hit (vruiHit *hit)=0
 
virtual void miss ()
 
void setFrame (unsigned int frame)
 INTERNAL set the framecounter (used to produce the miss call) More...
 
unsigned int getFrame () const
 INTERNAL get the framecounter (used to produce the miss call) More...
 
void setNode (vruiNode *)
 INTERNAL set the node this action belongs to. More...
 
void addChild (coAction *)
 INTERNAL add a child action. More...
 
virtual int hitAll (vruiHit *hit)
 INTERNAL same as miss/hit, but do it for all children as well. More...
 
virtual void missAll ()
 INTERNAL same as miss/hit, but do it for all children as well. More...
 
- Public Member Functions inherited from vrui::coUpdateable
 coUpdateable ()
 Constructor. More...
 
virtual ~coUpdateable ()
 Destructor. More...
 
virtual bool update ()=0
 

Protected Attributes

std::list< coMenuItem * > items
 list of menu items which can be accessed from this menu More...
 
coMenuparent
 parent menu, NULL if this is the topmost menu More...
 
coGenericSubMenuItemmyMenuItem
 
coMenuFocusListenerlistener
 menu event listener, triggered on menu selection More...
 
int showMode
 how to show and hide this Menu More...
 
bool visible
 
std::string name
 
coCombinedButtonInteractioninteraction
 
coCombinedButtonInteractionmoveInteraction
 
coCombinedButtonInteractionwheelInteraction
 interaction for preventing accidental global wheel interaction More...
 
float scale_
 
vruiMatrixmatrix_
 
int attachment_
 
bool wasMoved_ = false
 
- Protected Attributes inherited from vrui::coAction
std::string actionName
 

Detailed Description

This class provides a general menu for use in 3D space. It does not impose any restrictions on the layout of the menu items. A possible layout is defined in the subclass coRowMenu.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MENU_ONOFF 
MENU_SLIDE 

Constructor & Destructor Documentation

◆ coMenu()

vrui::coMenu::coMenu ( coMenu parentMenu,
const std::string &  name 
)

◆ ~coMenu()

virtual vrui::coMenu::~coMenu ( )
virtual

Sets the matrix which defines location and orientation.

Member Function Documentation

◆ add()

virtual void vrui::coMenu::add ( coMenuItem item)
virtual

Reimplemented in vrui::coToolboxMenu, and vrui::coRowMenu.

◆ closeAllOtherMenus()

void vrui::coMenu::closeAllOtherMenus ( coMenuItem leave = 0)

close all menus: optionally leave one open

◆ closeMenu()

virtual void vrui::coMenu::closeMenu ( )
virtual

◆ doActionPress()

virtual void vrui::coMenu::doActionPress ( )
virtual

Action is called via joystick.

◆ doActionRelease()

virtual void vrui::coMenu::doActionRelease ( )
virtual

Action is called via joystick.

◆ doSecondActionPress()

virtual void vrui::coMenu::doSecondActionPress ( )
virtual

Action is called via joystick.

◆ doSecondActionRelease()

virtual void vrui::coMenu::doSecondActionRelease ( )
virtual

Action is called via joystick.

◆ getAllItems()

coMenuItemVector vrui::coMenu::getAllItems ( )

◆ getAttachment()

virtual int vrui::coMenu::getAttachment ( ) const
inlinevirtual

Reimplemented in vrui::coToolboxMenu.

◆ getClassName()

virtual const char * vrui::coMenu::getClassName ( ) const
virtual

get the Element's classname

Reimplemented in vrui::coRowMenu, and vrui::coToolboxMenu.

◆ getDCS()

virtual vruiTransformNode * vrui::coMenu::getDCS ( )
pure virtual

Get Transformation Node.

Implemented in vrui::coRowMenu, and vrui::coToolboxMenu.

◆ getInteraction()

coCombinedButtonInteraction * vrui::coMenu::getInteraction ( ) const

◆ getItemByName()

coMenuItem * vrui::coMenu::getItemByName ( const char *  name)

◆ getItemCount()

virtual int vrui::coMenu::getItemCount ( ) const
virtual

Reimplemented in vrui::coToolboxMenu.

◆ getMoveInteraction()

coCombinedButtonInteraction * vrui::coMenu::getMoveInteraction ( ) const

◆ getName()

const char * vrui::coMenu::getName ( ) const

get my menu's name

◆ getParent()

const coMenu * vrui::coMenu::getParent ( )
inline

◆ getScale()

virtual float vrui::coMenu::getScale ( ) const
pure virtual

Gets the current scaling factor.

Implemented in vrui::coRowMenu, and vrui::coToolboxMenu.

◆ getShowMode()

int vrui::coMenu::getShowMode ( ) const

◆ getSubMenuItem()

coGenericSubMenuItem * vrui::coMenu::getSubMenuItem ( )

◆ getUIElement()

virtual coUIElement * vrui::coMenu::getUIElement ( )
virtual

Reimplemented in vrui::coRowMenu, and vrui::coToolboxMenu.

◆ hide()

virtual void vrui::coMenu::hide ( )
pure virtual

hides this menu

Implemented in vrui::coRowMenu, and vrui::coToolboxMenu.

◆ hit()

virtual int vrui::coMenu::hit ( vruiHit hit)
virtual

hit is called whenever the node, or any node underneath the node with this action is intersected return ACTION_CALL_ON_MISS if you want miss to be called otherwise return ACTION_DONE

Implements vrui::coAction.

Reimplemented in vrui::coRowMenu.

◆ index()

int vrui::coMenu::index ( const coMenuItem item)

◆ insert()

virtual void vrui::coMenu::insert ( coMenuItem item,
int  location 
)
virtual

Reimplemented in vrui::coToolboxMenu, and vrui::coRowMenu.

◆ isInteractionActive()

virtual bool vrui::coMenu::isInteractionActive ( ) const
virtual

◆ isOfClassName()

virtual bool vrui::coMenu::isOfClassName ( const char *  ) const
virtual

check if the Element or any ancestor is this classname

Reimplemented in vrui::coRowMenu, and vrui::coToolboxMenu.

◆ isVisible()

bool vrui::coMenu::isVisible ( ) const

check whether menu is currently visible

◆ makeVisible()

virtual void vrui::coMenu::makeVisible ( coMenuItem )
virtual

makes the item visible for joystick interaction

Reimplemented in vrui::coRowMenu, and vrui::coToolboxMenu.

◆ miss()

virtual void vrui::coMenu::miss ( )
virtual

miss is called once after a hit, if the node is not intersected anymore

Reimplemented from vrui::coAction.

Reimplemented in vrui::coRowMenu.

◆ positionAllSubmenus()

virtual void vrui::coMenu::positionAllSubmenus ( )
virtual

reposition all submenus, for example after the main menu was repositioned with setTransform matrix

◆ remove()

virtual void vrui::coMenu::remove ( coMenuItem item)
virtual

Reimplemented in vrui::coToolboxMenu, and vrui::coRowMenu.

◆ removeAll()

virtual void vrui::coMenu::removeAll ( )
virtual

Reimplemented in vrui::coToolboxMenu.

◆ removeAllAfter()

void vrui::coMenu::removeAllAfter ( coMenuItem last)

remove all items behind a given one

◆ selected()

virtual void vrui::coMenu::selected ( bool  select)
virtual

Menu is selected via joystick.

Reimplemented in vrui::coRowMenu, and vrui::coToolboxMenu.

◆ setAttachment()

virtual void vrui::coMenu::setAttachment ( int  att)
virtual

Reimplemented in vrui::coToolboxMenu.

◆ setMenuListener()

virtual void vrui::coMenu::setMenuListener ( coMenuFocusListener listener)
virtual

◆ setMoved()

void vrui::coMenu::setMoved ( bool  flag)

◆ setParent()

void vrui::coMenu::setParent ( coMenu newParent)
inline

◆ setScale()

virtual void vrui::coMenu::setScale ( float  s)
pure virtual

Returns the matrix which defines location and orientation of the menu.

Sets an offset matrix which is added to the current transformation Sets the menu size by applying a scaling factor to the default size.

Implemented in vrui::coToolboxMenu, and vrui::coRowMenu.

◆ setShowMode()

void vrui::coMenu::setShowMode ( int  mode)

◆ setSubMenuItem()

virtual void vrui::coMenu::setSubMenuItem ( coGenericSubMenuItem item)
virtual

◆ setTransformMatrix() [1/2]

virtual void vrui::coMenu::setTransformMatrix ( vruiMatrix matrix)
pure virtual

Implemented in vrui::coToolboxMenu, and vrui::coRowMenu.

◆ setTransformMatrix() [2/2]

virtual void vrui::coMenu::setTransformMatrix ( vruiMatrix matrix,
float  scale 
)
pure virtual

of the menu. Sets the matrix which defines location orientation and scale of the menu and the scale factor included in the matrix.

Implemented in vrui::coToolboxMenu, and vrui::coRowMenu.

◆ setVisible()

virtual void vrui::coMenu::setVisible ( bool  )
virtual

Reimplemented in vrui::coToolboxMenu, and vrui::coRowMenu.

◆ show()

virtual void vrui::coMenu::show ( )
pure virtual

makes the menu visible

Implemented in vrui::coRowMenu, and vrui::coToolboxMenu.

◆ wasMoved()

bool vrui::coMenu::wasMoved ( ) const

Member Data Documentation

◆ attachment_

int vrui::coMenu::attachment_
protected

◆ interaction

coCombinedButtonInteraction* vrui::coMenu::interaction
protected

◆ items

std::list<coMenuItem *> vrui::coMenu::items
protected

list of menu items which can be accessed from this menu

◆ listener

coMenuFocusListener* vrui::coMenu::listener
protected

menu event listener, triggered on menu selection

◆ matrix_

vruiMatrix* vrui::coMenu::matrix_
protected

◆ moveInteraction

coCombinedButtonInteraction* vrui::coMenu::moveInteraction
protected

◆ myMenuItem

coGenericSubMenuItem* vrui::coMenu::myMenuItem
protected

◆ name

std::string vrui::coMenu::name
protected

◆ parent

coMenu* vrui::coMenu::parent
protected

parent menu, NULL if this is the topmost menu

◆ scale_

float vrui::coMenu::scale_
protected

◆ showMode

int vrui::coMenu::showMode
protected

how to show and hide this Menu

◆ visible

bool vrui::coMenu::visible
protected

◆ wasMoved_

bool vrui::coMenu::wasMoved_ = false
protected

◆ wheelInteraction

coCombinedButtonInteraction* vrui::coMenu::wheelInteraction
protected

interaction for preventing accidental global wheel interaction


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