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

COVISE Online Documentation

Next

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

This class provides a flat textured frame arround objects. More...

#include <coFrame.h>

Inheritance diagram for vrui::coFrame:
vrui::coUIContainer vrui::coUIElement

Public Member Functions

 coFrame (const std::string &textureName="UI/Frame")
 Constructor. More...
 
virtual ~coFrame ()
 Destructor. More...
 
virtual void addElement (coUIElement *)
 Appends a child to this container. More...
 
virtual void removeElement (coUIElement *)
 Removes a child from this container. 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 getBorderWidth () const
 
virtual float getBorderHeight () const
 
virtual const std::string & getTextureName () const
 
virtual void setPos (float x, float y, float z=0)
 
virtual void setWidth (float)
 set the width of the frame explicitely More...
 
virtual void setHeight (float)
 set the height of the frame explicitely More...
 
virtual void setDepth (float)
 set the depth of the frame explicitely More...
 
virtual void setBorderWidth (float)
 Change the border width. More...
 
virtual void setBorderHeight (float)
 Change the border height. More...
 
virtual void setBorderDepth (float)
 Change the border depth. More...
 
virtual void setSize (float s)
 Set UI element size, use equal values for all dimensions. More...
 
virtual void setSize (float nw, float nh, float nd)
 Set UI element size. More...
 
virtual void setBorder (float nw, float nh, float nd)
 Change the border width, hight and depth. 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 ()
 Shrinks itself! This includes shrinking all children. More...
 
virtual void fitToParent ()
 maximize its size to always fit into its parent container More...
 
virtual void fitToChild ()
 fit tight around its child, this is the default behaviour 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

void realign ()
 reposition the children to fit into the frame More...
 
- 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

std::string textureName
 name of the texture file More...
 
float myX
 Frame position X. More...
 
float myY
 Frame position Y. More...
 
float myZ
 Frame position Z. More...
 
float myWidth
 Frame width. More...
 
float myHeight
 Frame height. More...
 
float myDepth
 Frame depth. More...
 
float bw
 Border width. More...
 
float bh
 Border height. More...
 
float bd
 Border depth. More...
 
bool fitParent
 wether to fit the frame to its parent or child More...
 
- 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

- 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...
 
- 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

This class provides a flat textured frame arround objects.

A frame should contain only one child, use another container to layout multiple chlidren inside the frame. A frame can be configured to fit tight around its child or to maximize its size to always fit into its parent container

Constructor & Destructor Documentation

◆ coFrame()

vrui::coFrame::coFrame ( const std::string &  textureName = "UI/Frame")

Constructor.

Parameters
nameTexture name, default is "UI/Frame", a white frame with round edges

◆ ~coFrame()

vrui::coFrame::~coFrame ( )
virtual

Destructor.

Member Function Documentation

◆ addElement()

void vrui::coFrame::addElement ( coUIElement el)
virtual

Appends a child to this container.

Parameters
elelement to add

Reimplemented from vrui::coUIContainer.

◆ fitToChild()

void vrui::coFrame::fitToChild ( )
virtual

fit tight around its child, this is the default behaviour

◆ fitToParent()

void vrui::coFrame::fitToParent ( )
virtual

maximize its size to always fit into its parent container

◆ getBorderHeight()

virtual float vrui::coFrame::getBorderHeight ( ) const
inlinevirtual

◆ getBorderWidth()

virtual float vrui::coFrame::getBorderWidth ( ) const
inlinevirtual

◆ getClassName()

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

get the Element's classname

Reimplemented from vrui::coUIContainer.

◆ getDepth()

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

Get z axis object size.

Returns
z axis object size

Reimplemented from vrui::coUIElement.

◆ getHeight()

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

Returns element height.

Implements vrui::coUIElement.

◆ getTextureName()

virtual const std::string & vrui::coFrame::getTextureName ( ) const
inlinevirtual

◆ getWidth()

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

Returns element width.

Implements vrui::coUIElement.

◆ getXpos()

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

Returns element x position.

Implements vrui::coUIElement.

◆ getYpos()

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

Returns element y position.

Implements vrui::coUIElement.

◆ getZpos()

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

Get z position.

Returns
z position

Reimplemented from vrui::coUIElement.

◆ isOfClassName()

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

check if the Element or any ancestor is this classname

Reimplemented from vrui::coUIContainer.

◆ realign()

void vrui::coFrame::realign ( )
protected

reposition the children to fit into the frame

◆ removeElement()

void vrui::coFrame::removeElement ( coUIElement el)
virtual

Removes a child from this container.

Parameters
elelement to remove

Reimplemented from vrui::coUIContainer.

◆ resizeToParent()

void vrui::coFrame::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

change the geometry to fit around the child

Reimplemented from vrui::coUIContainer.

◆ setBorder()

void vrui::coFrame::setBorder ( float  nw,
float  nh,
float  nd 
)
virtual

Change the border width, hight and depth.

Parameters
nwnew border width
nhnew border hight
ndnew border depth

◆ setBorderDepth()

void vrui::coFrame::setBorderDepth ( float  f)
virtual

Change the border depth.

Parameters
fnew border depth

◆ setBorderHeight()

void vrui::coFrame::setBorderHeight ( float  f)
virtual

Change the border height.

Parameters
fnew border height

◆ setBorderWidth()

void vrui::coFrame::setBorderWidth ( float  f)
virtual

Change the border width.

Parameters
fnew border width

◆ setDepth()

void vrui::coFrame::setDepth ( float  f)
virtual

set the depth of the frame explicitely

Parameters
fouter depth

◆ setHeight()

void vrui::coFrame::setHeight ( float  f)
virtual

set the height of the frame explicitely

Parameters
fouter height

◆ setPos()

void vrui::coFrame::setPos ( float  x,
float  y,
float  z = 0 
)
virtual

Implements vrui::coUIElement.

◆ setSize() [1/2]

void vrui::coFrame::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 from vrui::coUIElement.

◆ setSize() [2/2]

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

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

Parameters
ssize = scaling factor (1 is default)

Reimplemented from vrui::coUIElement.

◆ setWidth()

void vrui::coFrame::setWidth ( float  f)
virtual

set the width of the frame explicitely

Parameters
fouter width

◆ shrinkToMin()

void vrui::coFrame::shrinkToMin ( )
virtual

Shrinks itself! This includes shrinking all children.

Reimplemented from vrui::coUIContainer.

Member Data Documentation

◆ bd

float vrui::coFrame::bd
protected

Border depth.

◆ bh

float vrui::coFrame::bh
protected

Border height.

◆ bw

float vrui::coFrame::bw
protected

Border width.

◆ fitParent

bool vrui::coFrame::fitParent
protected

wether to fit the frame to its parent or child

◆ myDepth

float vrui::coFrame::myDepth
protected

Frame depth.

◆ myHeight

float vrui::coFrame::myHeight
protected

Frame height.

◆ myWidth

float vrui::coFrame::myWidth
protected

Frame width.

◆ myX

float vrui::coFrame::myX
protected

Frame position X.

◆ myY

float vrui::coFrame::myY
protected

Frame position Y.

◆ myZ

float vrui::coFrame::myZ
protected

Frame position Z.

◆ textureName

std::string vrui::coFrame::textureName
protected

name of the texture file


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