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

COVISE Online Documentation

Next

Public Types | Public Member Functions | Protected Attributes | List of all members
vrui::coLabel Class Reference

Label element. More...

#include <coLabel.h>

Inheritance diagram for vrui::coLabel:
vrui::coUIElement

Public Types

enum  DirectionsType { HORIZONTAL = 0 , VERTICAL }
 valid orientations for text string More...
 
enum  Justify { LEFT = 0 , CENTER , RIGHT }
 
- 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
}
 attachment order is counterclockwise like this and describes the side/border which the item is attached to! More...
 

Public Member Functions

 coLabel (const std::string &labelText="")
 Constructor. More...
 
virtual ~coLabel ()
 Destructor. More...
 
void resize ()
 Resize label to string size. More...
 
virtual void setPos (float x, float y, float z=0.0f)
 Set label position. More...
 
virtual void setFontSize (float size)
 Set label font size. More...
 
virtual void setJustify (Justify justify)
 Set label justification. More...
 
virtual void setString (const std::string &text)
 Set label string. More...
 
virtual void setSize (float size)
 Set label size using one size for all dimensions. More...
 
virtual void setSize (float xs, float ys, float zs)
 Set label size using different sizes for all dimensions. More...
 
virtual float getWidth () const
 Returns element width. More...
 
virtual float getHeight () const
 Returns element height. More...
 
virtual float getDepth () const
 Get z axis object size. More...
 
virtual float getXpos () const
 Returns element x position. More...
 
virtual float getYpos () const
 Returns element y position. More...
 
virtual float getZpos () const
 Get z position. More...
 
virtual float getFontSize () const
 
virtual Justify getJustify () const
 
virtual DirectionsType getDirection () const
 
virtual const char * getString () const
 
virtual void setHighlighted (bool highlighted)
 Set highlight state. More...
 
virtual void resizeGeometry ()
 
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::coUIElement
 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...
 

Protected Attributes

float myX
 x position of label in object space [mm] More...
 
float myY
 y position of label in object space [mm] More...
 
float myZ
 z position of label in object space [mm] More...
 
float myHeight
 label size in z direction [mm] More...
 
float myWidth
 label size in x direction [mm] More...
 
float myDepth
 label size in y direction [mm] More...
 
std::string labelString
 text string which is displayed on the label More...
 
Justify justify
 string justification, using Performer format. Default is left alignment. More...
 
float fontSize
 label text size in mm More...
 
DirectionsType direction
 direction into which the text string is written on the label More...
 
- 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

- Static Public Member Functions inherited from vrui::coUIElement
static vruiMatrixgetMatrixFromPositionHprScale (float x, float y, float z, float h, float p, float r, float scale)
 Constructor. More...
 
- Public Attributes inherited from vrui::coUIElement
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 inherited from vrui::coUIElement
virtual void resizeGeometry ()
 
virtual const vruiMatrixgetTransformMatrix ()
 

Detailed Description

Label element.

A label consists of a text string and a background texture.

Member Enumeration Documentation

◆ DirectionsType

valid orientations for text string

Enumerator
HORIZONTAL 
VERTICAL 

◆ Justify

Enumerator
LEFT 
CENTER 
RIGHT 

Constructor & Destructor Documentation

◆ coLabel()

vrui::coLabel::coLabel ( const std::string &  labelText = "")

Constructor.

◆ ~coLabel()

vrui::coLabel::~coLabel ( )
virtual

Destructor.

Member Function Documentation

◆ getClassName()

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

get the Element's classname

Reimplemented from vrui::coUIElement.

◆ getDepth()

virtual float vrui::coLabel::getDepth ( ) const
inlinevirtual

Get z axis object size.

Returns
z axis object size

Reimplemented from vrui::coUIElement.

◆ getDirection()

virtual DirectionsType vrui::coLabel::getDirection ( ) const
inlinevirtual

◆ getFontSize()

virtual float vrui::coLabel::getFontSize ( ) const
inlinevirtual

◆ getHeight()

virtual float vrui::coLabel::getHeight ( ) const
inlinevirtual

Returns element height.

Implements vrui::coUIElement.

◆ getJustify()

virtual Justify vrui::coLabel::getJustify ( ) const
inlinevirtual

◆ getString()

virtual const char * vrui::coLabel::getString ( ) const
inlinevirtual

◆ getWidth()

virtual float vrui::coLabel::getWidth ( ) const
inlinevirtual

Returns element width.

Implements vrui::coUIElement.

◆ getXpos()

virtual float vrui::coLabel::getXpos ( ) const
inlinevirtual

Returns element x position.

Implements vrui::coUIElement.

◆ getYpos()

virtual float vrui::coLabel::getYpos ( ) const
inlinevirtual

Returns element y position.

Implements vrui::coUIElement.

◆ getZpos()

virtual float vrui::coLabel::getZpos ( ) const
inlinevirtual

Get z position.

Returns
z position

Reimplemented from vrui::coUIElement.

◆ isOfClassName()

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

check if the Element or any ancestor is this classname

Reimplemented from vrui::coUIElement.

◆ resize()

void vrui::coLabel::resize ( )

Resize label to string size.

◆ resizeGeometry()

void vrui::coLabel::resizeGeometry ( )
virtual

Reimplemented from vrui::coUIElement.

◆ setFontSize()

void vrui::coLabel::setFontSize ( float  s)
virtual

Set label font size.

Parameters
slabel text font size [mm]

◆ setHighlighted()

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

Set highlight state.

Parameters
hltrue = element highlighted

Reimplemented from vrui::coUIElement.

◆ setJustify()

void vrui::coLabel::setJustify ( Justify  j)
virtual

Set label justification.

Parameters
jlabel text justification

◆ setPos()

void vrui::coLabel::setPos ( float  x,
float  y,
float  z = 0.0f 
)
virtual

Set label position.

Parameters
x,y,zlabel position in 3D space

Implements vrui::coUIElement.

◆ setSize() [1/2]

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

Set label size using one size for all dimensions.

Parameters
ssize in mm

Reimplemented from vrui::coUIElement.

◆ setSize() [2/2]

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

Set label size using different sizes for all dimensions.

Parameters
xs,ys,zsx/y/z size in mm

Reimplemented from vrui::coUIElement.

◆ setString()

void vrui::coLabel::setString ( const std::string &  s)
virtual

Set label string.

Parameters
szero terminated label string

Member Data Documentation

◆ direction

DirectionsType vrui::coLabel::direction
protected

direction into which the text string is written on the label

◆ fontSize

float vrui::coLabel::fontSize
protected

label text size in mm

◆ justify

Justify vrui::coLabel::justify
protected

string justification, using Performer format. Default is left alignment.

◆ labelString

std::string vrui::coLabel::labelString
protected

text string which is displayed on the label

◆ myDepth

float vrui::coLabel::myDepth
protected

label size in y direction [mm]

◆ myHeight

float vrui::coLabel::myHeight
protected

label size in z direction [mm]

◆ myWidth

float vrui::coLabel::myWidth
protected

label size in x direction [mm]

◆ myX

float vrui::coLabel::myX
protected

x position of label in object space [mm]

◆ myY

float vrui::coLabel::myY
protected

y position of label in object space [mm]

◆ myZ

float vrui::coLabel::myZ
protected

z position of label in object space [mm]


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