OpenCOVER
coUIContainer.h
Go to the documentation of this file.
1/* This file is part of COVISE.
2
3 You can use it under the terms of the GNU Lesser General Public License
4 version 2.1 or later, see lgpl-2.1.txt.
5
6 * License: LGPL 2+ */
7
8#ifndef CO_UICONTAINER_H
9#define CO_UICONTAINER_H
10
12#include <list>
13
20namespace vrui
21{
22
23class OPENVRUIEXPORT coUIContainer : public virtual coUIElement
24{
25public:
27 enum
28 {
29 CENTER = 0,
32 BOTH
33 } alignments;
34
36 virtual ~coUIContainer();
37
38 virtual void setEnabled(bool enabled);
39 virtual void setHighlighted(bool highlighted);
40 virtual void resizeToParent(float x, float y, float z, bool shrink = true);
41 virtual void shrinkToMin();
42 virtual void addElement(coUIElement *element);
43 virtual void removeElement(coUIElement *element);
44 virtual void removeLastElement();
45 virtual void showElement(coUIElement *element);
46 void setXAlignment(int a);
47 void setYAlignment(int a);
48 void setZAlignment(int a);
49
51 virtual const char *getClassName() const;
53 virtual bool isOfClassName(const char *) const;
54
55 float getMaxH() const;
56 float getMaxW() const;
57 float getMaxD() const;
58
59 float getSumH() const;
60 float getSumW() const;
61 float getSumD() const;
62
63 int getSize()
64 {
65 return (int)elements.size();
66 }
67
68protected:
69 virtual void resizeGeometry();
70
78 std::list<coUIElement *> elements;
79
81 float prefWidth, prefHeight;
82};
83}
84#endif
collaborative interface manager
Definition: coVRCommunication.h:41
Definition: coUIContainer.h:24
float getMaxH() const
maximum size in H direction
virtual void resizeGeometry()
virtual void showElement(coUIElement *element)
Adds the specified element to the scenegraph.
float getSumW() const
sum of sizes in W direction
float getSumD() const
sum of sizes in D direction
int xAlignment
alignment on children in X direction
Definition: coUIContainer.h:72
virtual ~coUIContainer()
virtual void resizeToParent(float x, float y, float z, bool shrink=true)
float getMaxD() const
maximum size in D direction
float getSumH() const
sum of sizes in H direction
int getSize()
Definition: coUIContainer.h:63
void setZAlignment(int a)
set the alignment in Z direction of the children
virtual const char * getClassName() const
get the Element's classname
virtual void setHighlighted(bool highlighted)
std::list< coUIElement * > elements
List of children elements.
Definition: coUIContainer.h:78
virtual void addElement(coUIElement *element)
Appends a child to this container.
int yAlignment
alignment on children in Y direction
Definition: coUIContainer.h:74
@ MAX
Definition: coUIContainer.h:31
@ MIN
Definition: coUIContainer.h:30
virtual void setEnabled(bool enabled)
float prefHeight
Definition: coUIContainer.h:81
virtual void removeElement(coUIElement *element)
Removes a child from this container.
float getMaxW() const
maximum size in W direction
void setXAlignment(int a)
set the alignment in X direction of the children
int zAlignment
alignment on children in Z direction
Definition: coUIContainer.h:76
virtual void removeLastElement()
Removes a child from this container.
virtual bool isOfClassName(const char *) const
check if the Element or any ancestor is this classname
virtual void shrinkToMin()
Set element location in space.
void setYAlignment(int a)
set the alignment in Y direction of the children
Definition: coUIElement.h:53