Overview | All Modules | Tutorial | User's Guide | Programming Guide
Previous

COVISE Online Documentation

Next

Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
vrui::coUIElement Class Referenceabstract

Basic VRUI GUI element. More...

#include <coUIElement.h>

Inheritance diagram for vrui::coUIElement:
vrui::coButton vrui::coLabel vrui::coRotButton vrui::coSlider vrui::coUIContainer vrui::coValuePoti vrui::coPushButton vrui::coToggleButton vrui::coRotPushButton vrui::coRotToggleButton vrui::coBackground vrui::coFrame vrui::coPanel vrui::coRowContainer vrui::coSlopePoti

Public Types

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
}
 attachment order is counterclockwise like this and describes the side/border which the item is attached to! More...
 

Public Member Functions

 coUIElement ()
 
virtual ~coUIElement ()
 Destructor. More...
 
virtual void createGeometry ()
 
virtual void setParent (coUIContainer *)
 Set parent container. More...
 
virtual coUIContainergetParent ()
 Get parent container. More...
 
virtual void setEnabled (bool enabled)
 Set activation state. More...
 
virtual void setHighlighted (bool highlighted)
 Set highlight state. More...
 
virtual void setVisible (bool visible)
 Set element visibility. More...
 
virtual bool isEnabled () const
 Get activation state. More...
 
virtual bool isHighlighted () const
 Get highlight state. More...
 
virtual bool isVisible () const
 Get visibility state. More...
 
virtual float getWidth () const =0
 Returns element width. More...
 
virtual float getHeight () const =0
 Returns element height. More...
 
virtual float getDepth () const
 Get z axis object size. More...
 
virtual float getXpos () const =0
 Returns element x position. More...
 
virtual float getYpos () const =0
 Returns element y position. More...
 
virtual float getZpos () const
 Get z position. More...
 
virtual void childResized (bool shrink=true)
 This method is called by children whenever they change their size Implementations of this method should call the childResized() of their parent container. More...
 
virtual void resizeToParent (float, float, float, bool shrink=true)
 This method is called by containers after they resized to allow children to adjust their geometry to the new parents' size Children must not call childResized() of their parent here, as this could lead to an infinite loop. More...
 
virtual void shrinkToMin ()
 Set element location in space. More...
 
virtual void setPos (float, float, float)=0
 
virtual void setSize (float, float, float)
 Set UI element size. More...
 
virtual void setSize (float)
 Set UI element size, use equal values for all dimensions. More...
 
virtual float getResizePref ()
 
virtual void setUserData (coUIUserData *)
 Set the current userdata object. More...
 
virtual coUIUserDatagetUserData () const
 Returns the current userdata object. More...
 
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...
 

Static Public Member Functions

static vruiMatrixgetMatrixFromPositionHprScale (float x, float y, float z, float h, float p, float r, float scale)
 Constructor. More...
 

Public Attributes

enum vrui::coUIElement:: { ... }  Attachments
 attachment order is counterclockwise like this and describes the side/border which the item is attached to! More...
 

Protected Member Functions

virtual void resizeGeometry ()
 
virtual const vruiMatrixgetTransformMatrix ()
 

Protected Attributes

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
 

Detailed Description

Basic VRUI GUI element.

This class provides functionality for all VRUI elements like position, size, font, visibility, availability, parent, etc.
At least this class should be subclassed for any new GUI element types.
All inheritable functions are defined virtual so that they can be overwritten by subclasses.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

attachment order is counterclockwise like this and describes the side/border which the item is attached to!

Enumerator
LEFT 
TOP 
RIGHT 
BOTTOM 
REPLACE 

◆ Material

Color definitions, to be used whenever a material is needed.

Enumerator
RED 
GREEN 
BLUE 
YELLOW 
GREY 
WHITE 
BLACK 
DARK_YELLOW 
WHITE_NL 

self illuminated white (NL = no lighting)

ITEM_BACKGROUND_NORMAL 
ITEM_BACKGROUND_HIGHLIGHTED 
ITEM_BACKGROUND_DISABLED 
HANDLE_BACKGROUND_NORMAL 
HANDLE_BACKGROUND_HIGHLIGHTED 
HANDLE_BACKGROUND_DISABLED 
BACKGROUND 
NUM_MATERIALS 

this entry must always be the last one in the list

Constructor & Destructor Documentation

◆ coUIElement()

vrui::coUIElement::coUIElement ( )

◆ ~coUIElement()

vrui::coUIElement::~coUIElement ( )
virtual

Destructor.

Member Function Documentation

◆ childResized()

void vrui::coUIElement::childResized ( bool  shrink = true)
virtual

This method is called by children whenever they change their size Implementations of this method should call the childResized() of their parent container.

This method calls shrinkToMin if shrink is true (the default) and resizeToParent to trigger a resize on all children if this is the topmost element in the tree

◆ createGeometry()

void vrui::coUIElement::createGeometry ( )
virtual

◆ getAttachment()

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

returns the attachment border

Reimplemented in vrui::coRowContainer.

◆ getClassName()

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

◆ getDCS()

vruiTransformNode * vrui::coUIElement::getDCS ( )
virtual

◆ getDepth()

float vrui::coUIElement::getDepth ( ) const
virtual

Get z axis object size.

Returns
z axis object size

Reimplemented in vrui::coBackground, vrui::coFrame, vrui::coLabel, and vrui::coRowContainer.

◆ getHeight()

virtual float vrui::coUIElement::getHeight ( ) const
pure virtual

◆ getMatrixFromPositionHprScale()

vruiMatrix * vrui::coUIElement::getMatrixFromPositionHprScale ( float  x,
float  y,
float  z,
float  h,
float  p,
float  r,
float  scale 
)
static

Constructor.

◆ getParent()

coUIContainer * vrui::coUIElement::getParent ( )
virtual

Get parent container.

Returns
parent container

◆ getResizePref()

virtual float vrui::coUIElement::getResizePref ( )
inlinevirtual

◆ getTransformMatrix()

const vruiMatrix * vrui::coUIElement::getTransformMatrix ( )
protectedvirtual

◆ getUIElementProvider()

virtual vruiUIElementProvider * vrui::coUIElement::getUIElementProvider ( ) const
inlinevirtual

◆ getUniqueName()

const char * vrui::coUIElement::getUniqueName ( ) const

◆ getUserData()

coUIUserData * vrui::coUIElement::getUserData ( ) const
virtual

Returns the current userdata object.

Returns
userdata object, default NULL

◆ getWidth()

virtual float vrui::coUIElement::getWidth ( ) const
pure virtual

◆ getXpos()

virtual float vrui::coUIElement::getXpos ( ) const
pure virtual

◆ getYpos()

virtual float vrui::coUIElement::getYpos ( ) const
pure virtual

◆ getZpos()

float vrui::coUIElement::getZpos ( ) const
virtual

◆ isEnabled()

bool vrui::coUIElement::isEnabled ( ) const
virtual

Get activation state.

Returns
activation state (true = enabled)

◆ isHighlighted()

bool vrui::coUIElement::isHighlighted ( ) const
virtual

Get highlight state.

Returns
highlight state (true = highlighted)

◆ isOfClassName()

bool vrui::coUIElement::isOfClassName ( const char *  classname) const
virtual

◆ isVisible()

bool vrui::coUIElement::isVisible ( ) const
virtual

Get visibility state.

Returns
visibility state (true = visible)

◆ resizeGeometry()

void vrui::coUIElement::resizeGeometry ( )
protectedvirtual

◆ resizeToParent()

void vrui::coUIElement::resizeToParent ( float  ,
float  ,
float  ,
bool  shrink = true 
)
virtual

This method is called by containers after they resized to allow children to adjust their geometry to the new parents' size Children must not call childResized() of their parent here, as this could lead to an infinite loop.

Derived elements do not have to implement this method.

Parameters
newWidth,newHeight,newDepthdesired size

Reimplemented in vrui::coProgressBar, vrui::coUIContainer, vrui::coBackground, vrui::coFrame, vrui::coMenuContainer, vrui::coPopupHandle, vrui::coRowContainer, and vrui::coRowMenuHandle.

◆ setAttachment()

virtual void vrui::coUIElement::setAttachment ( int  )
inlinevirtual

sets the attachment border

Reimplemented in vrui::coRowContainer.

◆ setEnabled()

void vrui::coUIElement::setEnabled ( bool  en)
virtual

Set activation state.

Parameters
entrue = element enabled

Reimplemented in vrui::coTexturedBackground, vrui::coTextureRectBackground, vrui::coBackground, vrui::coColoredBackground, vrui::coUIContainer, and vrui::coValuePoti.

◆ setHighlighted()

void vrui::coUIElement::setHighlighted ( bool  hl)
virtual

Set highlight state.

Parameters
hltrue = element highlighted

Reimplemented in vrui::coBackground, vrui::coColoredBackground, vrui::coLabel, vrui::coSlider, vrui::coUIContainer, vrui::coTexturedBackground, and vrui::coTextureRectBackground.

◆ setParent()

void vrui::coUIElement::setParent ( coUIContainer c)
virtual

Set parent container.

Parameters
cparent container

◆ setPos()

virtual void vrui::coUIElement::setPos ( float  ,
float  ,
float   
)
pure virtual

◆ setSize() [1/2]

void vrui::coUIElement::setSize ( float  s)
virtual

Set UI element size, use equal values for all dimensions.

Parameters
ssize = scaling factor (1 is default)

Reimplemented in vrui::coFrame, vrui::coBackground, vrui::coLabel, vrui::coRotButton, vrui::coSlider, vrui::coValuePoti, and vrui::coButton.

◆ setSize() [2/2]

void vrui::coUIElement::setSize ( float  xs,
float  ys,
float  zs 
)
virtual

Set UI element size.

Use different values for all dimensions.

Parameters
xs,ys,zssize = scaling factor for respective dimension (1 is default)

Reimplemented in vrui::coBackground, vrui::coFrame, vrui::coValuePoti, vrui::coRotButton, vrui::coSlider, vrui::coLabel, and vrui::coButton.

◆ setUniqueName()

void vrui::coUIElement::setUniqueName ( const char *  newname)

◆ setUserData()

void vrui::coUIElement::setUserData ( coUIUserData user)
virtual

Set the current userdata object.

Parameters
usernew userdata object

◆ setVisible()

void vrui::coUIElement::setVisible ( bool  newState)
virtual

Set element visibility.

Parameters
newStatetrue = element visible

◆ shrinkToMin()

void vrui::coUIElement::shrinkToMin ( )
virtual

Set element location in space.

This method is called to shrink the element to its smallest size.

Usually this is done before resizing containers.

Reimplemented in vrui::coBackground, vrui::coFrame, vrui::coPopupHandle, vrui::coRowContainer, vrui::coRowMenuHandle, vrui::coTexturedBackground, and vrui::coUIContainer.

Member Data Documentation

◆ 

enum { ... } vrui::coUIElement::Attachments

attachment order is counterclockwise like this and describes the side/border which the item is attached to!

◆ enabled

bool vrui::coUIElement::enabled
protected

true if UI element is enabled, false if UI element cannot be used

◆ highlighted

bool vrui::coUIElement::highlighted
protected

true if highlighted

◆ uiElementProvider

vruiUIElementProvider* vrui::coUIElement::uiElementProvider
protected

◆ visible

bool vrui::coUIElement::visible
protected

true if UI element is visible, false if not visible but still present in scene tree

◆ xScaleFactor

float vrui::coUIElement::xScaleFactor
protected

UI element x axis scale factor.

◆ yScaleFactor

float vrui::coUIElement::yScaleFactor
protected

UI element y axis scale factor.

◆ zScaleFactor

float vrui::coUIElement::zScaleFactor
protected

UI element z axis scale factor.


The documentation for this class was generated from the following files:
PreviousNext

Authors: Martin Aumüller, Ruth Lang, Daniela Rainer, Jürgen Schulze-Döbold, Andreas Werner, Peter Wolf, Uwe Wössner
Copyright © 1993-2009 HLRS, 2004-2009 RRZK, 2005-2009 Visenso
COVISE Version 6.5 Academic