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

COVISE Online Documentation

Next

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

Container class that aligns its children in a row. More...

#include <coRowContainer.h>

Inheritance diagram for vrui::coRowContainer:
vrui::coUIContainer vrui::coUIElement vrui::coMenuContainer vrui::coPopupHandle vrui::coRowMenuHandle vrui::coToolboxMenuHandle

Public Types

enum  Orientation { HORIZONTAL = 0 , VERTICAL }
 orientation of this container More...
 
- Public Types inherited from vrui::coUIContainer
enum  { CENTER = 0 , MIN , MAX , BOTH }
 Alignment specification for children. More...
 
- 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

 coRowContainer (Orientation orientation=HORIZONTAL)
 Constructor. More...
 
virtual ~coRowContainer ()
 Destructor, does not delete its children. More...
 
virtual void addElement (coUIElement *element)
 Appends a child to this container. More...
 
virtual void removeElement (coUIElement *element)
 Removes a child from this container. More...
 
virtual void insertElement (coUIElement *element, int pos)
 Inserts a child into this 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 ()
 shrink all children. More...
 
void hide (coUIElement *element)
 Hide one of the children. More...
 
void show (coUIElement *element)
 Show one of the children. More...
 
void setPos (float x, float y, float z=0.0f)
 
void setOrientation (Orientation orientation)
 Change the orientation of the container. More...
 
int getOrientation () const
 Retrieve the orientation of the container. More...
 
void setAlignment (int alignment)
 Change the alignment of the children. More...
 
void setHgap (float g)
 Change the horizontal gap between children. More...
 
void setVgap (float g)
 Change the vertical gap between children. More...
 
void setDgap (float g)
 Change the depth gap between children. More...
 
vruiTransformNodegetDCS ()
 
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 getVgap () const
 
virtual float getHgap () const
 
virtual float getDgap () const
 
virtual void setAttachment (int attachment)
 sets the attachment border More...
 
virtual int getAttachment () const
 returns the attachment border More...
 
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::coUIContainer
 coUIContainer ()
 Constructor. More...
 
virtual ~coUIContainer ()
 Destructor. More...
 
virtual void setEnabled (bool enabled)
 Set activation state of this container and all its children. More...
 
virtual void setHighlighted (bool highlighted)
 Set highlight state of this container and all its children. More...
 
virtual void resizeToParent (float x, float y, float z, 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 addElement (coUIElement *element)
 Appends a child to this container. More...
 
virtual void removeElement (coUIElement *element)
 Removes a child from this container. More...
 
virtual void removeLastElement ()
 Removes a child from this container. More...
 
virtual void showElement (coUIElement *element)
 Adds the specified element to the scenegraph. More...
 
void setXAlignment (int a)
 set the alignment in X direction of the children More...
 
void setYAlignment (int a)
 set the alignment in Y direction of the children More...
 
void setZAlignment (int a)
 set the alignment in Z direction of the children More...
 
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...
 
float getMaxH () const
 maximum size in H direction More...
 
float getMaxW () const
 maximum size in W direction More...
 
float getMaxD () const
 maximum size in D direction More...
 
float getSumH () const
 sum of sizes in H direction More...
 
float getSumW () const
 sum of sizes in W direction More...
 
float getSumD () const
 sum of sizes in D direction More...
 
int getSize ()
 
- 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 Member Functions

float getExtW () const
 get my current extension in given direction More...
 
float getExtH () const
 
- Protected Member Functions inherited from vrui::coUIContainer
virtual void resizeGeometry ()
 
- Protected Member Functions inherited from vrui::coUIElement
virtual void resizeGeometry ()
 
virtual const vruiMatrixgetTransformMatrix ()
 

Protected Attributes

vruiTransformNodemyDCS
 transformation node to position this container More...
 
float myX
 position and size More...
 
float myY
 
float myZ
 
float myHeight
 
float myWidth
 
float myDepth
 
Orientation orientation
 layout orientation More...
 
int alignment
 alignment of the children More...
 
float Hgap
 Horizontal-, vertical- and depth-gap, default is 5mm for H and Vgap, 0 for Dgap. More...
 
float Vgap
 
float Dgap
 
int attachment
 
- Protected Attributes inherited from vrui::coUIContainer
int xAlignment
 alignment on children in X direction More...
 
int yAlignment
 alignment on children in Y direction More...
 
int zAlignment
 alignment on children in Z direction More...
 
std::list< coUIElement * > elements
 List of children elements. More...
 
float prefWidth
 try to get That high/wide if possible More...
 
float prefHeight
 
- 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::coUIContainer
enum vrui::coUIContainer:: { ... }  alignments
 Alignment specification for children. 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...
 

Detailed Description

Container class that aligns its children in a row.

Member Enumeration Documentation

◆ Orientation

orientation of this container

Enumerator
HORIZONTAL 
VERTICAL 

Constructor & Destructor Documentation

◆ coRowContainer()

vrui::coRowContainer::coRowContainer ( Orientation  orientation = HORIZONTAL)

Constructor.

◆ ~coRowContainer()

vrui::coRowContainer::~coRowContainer ( )
virtual

Destructor, does not delete its children.

Member Function Documentation

◆ addElement()

void vrui::coRowContainer::addElement ( coUIElement element)
virtual

Appends a child to this container.

the size of the container is adjusted to accommodate all chidren

Parameters
elelement to add

Reimplemented from vrui::coUIContainer.

◆ getAttachment()

int vrui::coRowContainer::getAttachment ( ) const
virtual

returns the attachment border

Reimplemented from vrui::coUIElement.

◆ getClassName()

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

get the Element's classname

Reimplemented from vrui::coUIContainer.

Reimplemented in vrui::coMenuContainer, vrui::coPopupHandle, vrui::coRowMenuHandle, and vrui::coToolboxMenuHandle.

◆ getDCS()

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

Reimplemented from vrui::coUIElement.

◆ getDepth()

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

Get z axis object size.

Returns
z axis object size

Reimplemented from vrui::coUIElement.

◆ getDgap()

float vrui::coRowContainer::getDgap ( ) const
virtual

◆ getExtH()

float vrui::coRowContainer::getExtH ( ) const
protected

◆ getExtW()

float vrui::coRowContainer::getExtW ( ) const
protected

get my current extension in given direction

◆ getHeight()

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

Returns element height.

Implements vrui::coUIElement.

◆ getHgap()

float vrui::coRowContainer::getHgap ( ) const
virtual

◆ getOrientation()

int vrui::coRowContainer::getOrientation ( ) const

Retrieve the orientation of the container.

◆ getVgap()

float vrui::coRowContainer::getVgap ( ) const
virtual

◆ getWidth()

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

Returns element width.

Implements vrui::coUIElement.

◆ getXpos()

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

Returns element x position.

Implements vrui::coUIElement.

◆ getYpos()

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

Returns element y position.

Implements vrui::coUIElement.

◆ getZpos()

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

Get z position.

Returns
z position

Reimplemented from vrui::coUIElement.

◆ hide()

void vrui::coRowContainer::hide ( coUIElement element)

Hide one of the children.

Parameters
elelement to hide

◆ insertElement()

void vrui::coRowContainer::insertElement ( coUIElement element,
int  pos 
)
virtual

Inserts a child into this container.

the size of the container is adjusted to accommodate all chidren

Parameters
elelement to add
posposition in the list of elements if pos is larger than the number of elements in the list, it is appended as last element, if it is less or equal 0, it is inserted as first element.

◆ isOfClassName()

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

check if the Element or any ancestor is this classname

Reimplemented from vrui::coUIContainer.

Reimplemented in vrui::coMenuContainer, vrui::coPopupHandle, vrui::coRowMenuHandle, and vrui::coToolboxMenuHandle.

◆ removeElement()

void vrui::coRowContainer::removeElement ( coUIElement element)
virtual

Removes a child from this container.

the size of the container is adjusted after removing the element

Parameters
elelement to remove

Reimplemented from vrui::coUIContainer.

◆ resizeToParent()

void vrui::coRowContainer::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 from vrui::coUIContainer.

Reimplemented in vrui::coMenuContainer, vrui::coPopupHandle, and vrui::coRowMenuHandle.

◆ setAlignment()

void vrui::coRowContainer::setAlignment ( int  alignment)

Change the alignment of the children.

Parameters
anew alignment

◆ setAttachment()

void vrui::coRowContainer::setAttachment ( int  )
virtual

sets the attachment border

Reimplemented from vrui::coUIElement.

◆ setDgap()

void vrui::coRowContainer::setDgap ( float  g)

Change the depth gap between children.

Parameters
ggap size

◆ setHgap()

void vrui::coRowContainer::setHgap ( float  g)

Change the horizontal gap between children.

Parameters
ggap size

◆ setOrientation()

void vrui::coRowContainer::setOrientation ( Orientation  orientation)

Change the orientation of the container.

Parameters
orinew orientation default orientation is HORIZONTAL

◆ setPos()

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

Implements vrui::coUIElement.

◆ setVgap()

void vrui::coRowContainer::setVgap ( float  g)

Change the vertical gap between children.

Parameters
ggap size

◆ show()

void vrui::coRowContainer::show ( coUIElement element)

Show one of the children.

Parameters
elelement to show

◆ shrinkToMin()

void vrui::coRowContainer::shrinkToMin ( )
virtual

shrink all children.

adapt own size on maximum of them?

Reimplemented from vrui::coUIContainer.

Reimplemented in vrui::coPopupHandle, and vrui::coRowMenuHandle.

Member Data Documentation

◆ alignment

int vrui::coRowContainer::alignment
protected

alignment of the children

◆ attachment

int vrui::coRowContainer::attachment
protected

◆ Dgap

float vrui::coRowContainer::Dgap
protected

◆ Hgap

float vrui::coRowContainer::Hgap
protected

Horizontal-, vertical- and depth-gap, default is 5mm for H and Vgap, 0 for Dgap.

◆ myDCS

vruiTransformNode* vrui::coRowContainer::myDCS
protected

transformation node to position this container

◆ myDepth

float vrui::coRowContainer::myDepth
protected

◆ myHeight

float vrui::coRowContainer::myHeight
protected

◆ myWidth

float vrui::coRowContainer::myWidth
protected

◆ myX

float vrui::coRowContainer::myX
protected

position and size

◆ myY

float vrui::coRowContainer::myY
protected

◆ myZ

float vrui::coRowContainer::myZ
protected

◆ orientation

Orientation vrui::coRowContainer::orientation
protected

layout orientation

◆ Vgap

float vrui::coRowContainer::Vgap
protected

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