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

COVISE Online Documentation

Next

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

This class provides background panel for GUI elements. More...

#include <coPanel.h>

Inheritance diagram for vrui::coPanel:
vrui::coAction vrui::coUIContainer vrui::coUIElement vrui::coProgressBar

Public Member Functions

 coPanel (coPanelGeometry *geom)
 Constructor. More...
 
virtual ~coPanel ()
 Destructor. More...
 
virtual int hit (vruiHit *hit)
 hit is called whenever the panel is intersected More...
 
virtual void miss ()
 miss is called once after a hit, if the panel is not intersected anymore More...
 
void resize ()
 resizes the panel to accommodate all children More...
 
virtual void addElement (coUIElement *element)
 Appends a child to this container. More...
 
void hide (coUIElement *element)
 hide one of the children More...
 
void show (coUIElement *element)
 show one of the children More...
 
virtual void showElement (coUIElement *element)
 Adds the specified element to the scenegraph. More...
 
void setPos (float x, float y, float z=0.0f)
 
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
 Get z position. More...
 
virtual void setScale (float s)
 set the scale factor of this panel and all its children More...
 
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...
 
- Public Member Functions inherited from vrui::coAction
 coAction ()
 Constructor. More...
 
virtual ~coAction ()
 Destructor. More...
 
virtual int hit (vruiHit *hit)=0
 hit is called whenever the node, or any node underneath the node with this action is intersected return ACTION_CALL_ON_MISS if you want miss to be called otherwise return ACTION_DONE More...
 
virtual void miss ()
 miss is called once after a hit, if the node is not intersected anymore More...
 
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::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 Attributes

vruiTransformNodemyDCS
 
vruiTransformNodemyPosDCS
 Transformation of the panel geometry. More...
 
vruiTransformNodemyChildDCS
 Children origin. More...
 
float scale
 scale factor, scales all children More...
 
float myX
 Panel position X. More...
 
float myY
 Panel position Y. More...
 
float myZ
 Panel position Z. More...
 
float myWidth
 Panel width. More...
 
float myHeight
 Panel height. More...
 
float contentWidth
 Content width. More...
 
float contentHeight
 Content height. More...
 
coPanelGeometrymyGeometry
 Panel geometry. More...
 
- Protected Attributes inherited from vrui::coAction
std::string actionName
 name of this action this can be used to distinguish betwenn different types of actions like touch and intersection actions 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::coAction
enum  Result { ACTION_DONE = 0x00 , ACTION_CALL_ON_MISS = 0x01 , ACTION_UNDEF = 0x02 }
 
- 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...
 
- Protected Member Functions inherited from vrui::coUIContainer
virtual void resizeGeometry ()
 
- Protected Member Functions inherited from vrui::coUIElement
virtual void resizeGeometry ()
 
virtual const vruiMatrixgetTransformMatrix ()
 

Detailed Description

This class provides background panel for GUI elements.

It can contain mutiple GUI elements, it gows to accommodate all children but does not automatically shrink to fit, if a child is removed. This class does not provide any geometry, the actual geometry is defined in a another class,

See also
coPanelGeometry

Constructor & Destructor Documentation

◆ coPanel()

vrui::coPanel::coPanel ( coPanelGeometry geometry)

Constructor.

Parameters
geomPanel geometry

◆ ~coPanel()

vrui::coPanel::~coPanel ( )
virtual

Destructor.

Member Function Documentation

◆ addElement()

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

Appends a child to this container.

Parameters
elelement to add

Reimplemented from vrui::coUIContainer.

◆ getClassName()

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

get the Element's classname

Reimplemented from vrui::coUIContainer.

Reimplemented in vrui::coProgressBar.

◆ getDCS()

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

Reimplemented from vrui::coUIElement.

◆ getHeight()

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

Returns element height.

Implements vrui::coUIElement.

◆ getWidth()

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

Returns element width.

Implements vrui::coUIElement.

◆ getXpos()

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

Returns element x position.

Implements vrui::coUIElement.

◆ getYpos()

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

Returns element y position.

Implements vrui::coUIElement.

◆ getZpos()

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

Get z position.

Returns
z position

Reimplemented from vrui::coUIElement.

◆ hide()

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

hide one of the children

◆ hit()

int vrui::coPanel::hit ( vruiHit hit)
virtual

hit is called whenever the panel is intersected

Parameters
hitPointpoint of intersection in world coordinates
hithit structure to query other information like normal
Returns
ACTION_CALL_ON_MISS if you want miss to be called otherwise return ACTION_DONE

Implements vrui::coAction.

◆ isOfClassName()

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

check if the Element or any ancestor is this classname

Reimplemented from vrui::coUIContainer.

Reimplemented in vrui::coProgressBar.

◆ miss()

void vrui::coPanel::miss ( )
virtual

miss is called once after a hit, if the panel is not intersected anymore

Reimplemented from vrui::coAction.

◆ resize()

void vrui::coPanel::resize ( )

resizes the panel to accommodate all children

◆ setPos()

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

Implements vrui::coUIElement.

◆ setScale()

void vrui::coPanel::setScale ( float  s)
virtual

set the scale factor of this panel and all its children

◆ show()

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

show one of the children

◆ showElement()

void vrui::coPanel::showElement ( coUIElement el)
virtual

Adds the specified element to the scenegraph.

Adds the specified element to the scenegraph if it has previously been removed.

Parameters
elelement to add

Reimplemented from vrui::coUIContainer.

Member Data Documentation

◆ contentHeight

float vrui::coPanel::contentHeight
protected

Content height.

◆ contentWidth

float vrui::coPanel::contentWidth
protected

Content width.

◆ myChildDCS

vruiTransformNode* vrui::coPanel::myChildDCS
protected

Children origin.

◆ myDCS

vruiTransformNode* vrui::coPanel::myDCS
protected

◆ myGeometry

coPanelGeometry* vrui::coPanel::myGeometry
protected

Panel geometry.

◆ myHeight

float vrui::coPanel::myHeight
protected

Panel height.

◆ myPosDCS

vruiTransformNode* vrui::coPanel::myPosDCS
protected

Transformation of the panel geometry.

◆ myWidth

float vrui::coPanel::myWidth
protected

Panel width.

◆ myX

float vrui::coPanel::myX
protected

Panel position X.

◆ myY

float vrui::coPanel::myY
protected

Panel position Y.

◆ myZ

float vrui::coPanel::myZ
protected

Panel position Z.

◆ scale

float vrui::coPanel::scale
protected

scale factor, scales all children


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