OpenCOVER
Public Member Functions | Protected Attributes | List of all members
vrui::coToggleButton Class Reference

#include <coButton.h>

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

Public Member Functions

 coToggleButton (coButtonGeometry *geom, coButtonActor *actor)
 
virtual ~coToggleButton ()
 
virtual void onPress ()
 
virtual void onRelease ()
 
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...
 
- Public Member Functions inherited from vrui::coButton
 coButton (coButtonGeometry *geom, coButtonActor *actor)
 
virtual ~coButton ()
 
void setState (bool state, bool generateEvent=false)
 
bool getState () const
 
void updateSwitch ()
 
bool isPressed () const
 
void setPos (float x, float y, float z=0)
 
virtual int hit (vruiHit *hit)
 
virtual void miss ()
 
virtual void onPress ()
 
virtual void onRelease ()
 
virtual void setSize (float, float, float)
 
virtual void setSize (float)
 
virtual float getWidth () const
 Returns element width. More...
 
virtual float getHeight () const
 Returns element height. More...
 
virtual float getXpos () const
 Returns element x position. More...
 
virtual float getYpos () const
 Returns element y position. More...
 
virtual float getZpos () const
 
virtual vruiTransformNodegetDCS ()
 
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...
 
virtual bool update ()
 
virtual void setActive (bool a)
 functions activates or deactivates the item More...
 
- 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::coUIElement
 coUIElement ()
 
virtual ~coUIElement ()
 
virtual void createGeometry ()
 
virtual void setParent (coUIContainer *)
 
virtual coUIContainergetParent ()
 
virtual void setEnabled (bool enabled)
 
virtual void setHighlighted (bool highlighted)
 
virtual void setVisible (bool visible)
 
virtual bool isEnabled () const
 
virtual bool isHighlighted () const
 
virtual bool isVisible () const
 
virtual float getWidth () const =0
 Returns element width. More...
 
virtual float getHeight () const =0
 Returns element height. More...
 
virtual float getDepth () const
 
virtual float getXpos () const =0
 Returns element x position. More...
 
virtual float getYpos () const =0
 Returns element y position. More...
 
virtual float getZpos () const
 
virtual void childResized (bool shrink=true)
 
virtual void resizeToParent (float, float, float, bool shrink=true)
 
virtual void shrinkToMin ()
 Set element location in space. More...
 
virtual void setPos (float, float, float)=0
 
virtual void setSize (float, float, float)
 
virtual void setSize (float)
 
virtual float getResizePref ()
 
virtual void setUserData (coUIUserData *)
 
virtual coUIUserDatagetUserData () const
 
virtual vruiTransformNodegetDCS ()
 
virtual vruiUIElementProvidergetUIElementProvider () const
 
virtual void setAttachment (int)
 sets the attachment border More...
 
virtual int getAttachment () const
 returns the attachment border More...
 
void setUniqueName (const char *)
 
const char * getUniqueName () const
 
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...
 
- Public Member Functions inherited from vrui::coUpdateable
 coUpdateable ()
 Constructor. More...
 
virtual ~coUpdateable ()
 Destructor. More...
 
virtual bool update ()=0
 

Protected Attributes

bool wasReleased
 
- Protected Attributes inherited from vrui::coButton
bool selectionState
 true if button is selected by the user More...
 
bool pressState
 true if the button is currently pressed More...
 
coButtonGeometrymyGeometry
 information about visual appearance More...
 
coButtonActormyActor
 action listener, triggered on button press More...
 
float myX
 button x position More...
 
float myY
 button y position More...
 
float myZ
 button z position More...
 
coCombinedButtonInteractioninteractionA
 button interaction More...
 
bool unregister
 try to unregister interactions More...
 
bool active_
 flag if button is active More...
 
- Protected Attributes inherited from vrui::coAction
std::string actionName
 
- Protected Attributes inherited from vrui::coUIElement
float xScaleFactor
 UI element x axis scale factor. More...
 
float yScaleFactor
 UI element y axis scale factor. More...
 
float zScaleFactor
 UI element z axis scale factor. More...
 
bool enabled
 true if UI element is enabled, false if UI element cannot be used More...
 
bool highlighted
 true if highlighted More...
 
bool visible
 true if UI element is visible, false if not visible but still present in scene tree More...
 
vruiUIElementProvideruiElementProvider
 

Additional Inherited Members

- Public Types inherited from vrui::coAction
enum  Result { ACTION_DONE = 0x00 , ACTION_CALL_ON_MISS = 0x01 , ACTION_UNDEF = 0x02 }
 
- Public Types inherited from vrui::coUIElement
enum  Material {
  RED = 0 , GREEN , BLUE , YELLOW ,
  GREY , WHITE , BLACK , DARK_YELLOW ,
  WHITE_NL , ITEM_BACKGROUND_NORMAL , ITEM_BACKGROUND_HIGHLIGHTED , ITEM_BACKGROUND_DISABLED ,
  HANDLE_BACKGROUND_NORMAL , HANDLE_BACKGROUND_HIGHLIGHTED , HANDLE_BACKGROUND_DISABLED , BACKGROUND ,
  NUM_MATERIALS
}
 Color definitions, to be used whenever a material is needed. More...
 
enum  {
  LEFT = 0 , TOP , RIGHT , BOTTOM ,
  REPLACE
}
 
- Static Public Member Functions inherited from vrui::coUIElement
static vruiMatrixgetMatrixFromPositionHprScale (float x, float y, float z, float h, float p, float r, float scale)
 
- Public Attributes inherited from vrui::coUIElement
enum vrui::coUIElement:: { ... }  Attachments
 
- Protected Member Functions inherited from vrui::coButton
virtual void createGeometry ()
 
virtual void resizeGeometry ()
 
- Protected Member Functions inherited from vrui::coUIElement
virtual void resizeGeometry ()
 
virtual const vruiMatrixgetTransformMatrix ()
 

Detailed Description

This class provides a specific coButton to be used as a toggle button. This means it can be pressed and will remain pressed when the pointer is released. Only another pointer button press and release will restore its original state.

Constructor & Destructor Documentation

◆ coToggleButton()

vrui::coToggleButton::coToggleButton ( coButtonGeometry geom,
coButtonActor actor 
)

◆ ~coToggleButton()

virtual vrui::coToggleButton::~coToggleButton ( )
virtual

Member Function Documentation

◆ getClassName()

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

get the Element's classname

Reimplemented from vrui::coButton.

◆ isOfClassName()

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

check if the Element or any ancestor is this classname

Reimplemented from vrui::coButton.

◆ onPress()

virtual void vrui::coToggleButton::onPress ( )
virtual

Reimplemented from vrui::coButton.

◆ onRelease()

virtual void vrui::coToggleButton::onRelease ( )
virtual

Reimplemented from vrui::coButton.

Member Data Documentation

◆ wasReleased

bool vrui::coToggleButton::wasReleased
protected

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