OpenCOVER
coRowContainer.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_ROW_CONTAINER_H
9#define CO_ROW_CONTAINER_H
11
12namespace vrui
13{
14
15class vruiTransformNode;
16
18class OPENVRUIEXPORT coRowContainer : public coUIContainer
19{
20public:
23 {
24 HORIZONTAL = 0,
25 VERTICAL
26 };
27
28 coRowContainer(Orientation orientation = HORIZONTAL);
29 virtual ~coRowContainer();
30
31 virtual void addElement(coUIElement *element);
32 virtual void removeElement(coUIElement *element);
33 virtual void insertElement(coUIElement *element, int pos);
34 virtual void resizeToParent(float, float, float, bool shrink = true);
35 virtual void shrinkToMin();
36 void hide(coUIElement *element);
37 void show(coUIElement *element);
38
39 void setPos(float x, float y, float z = 0.0f);
40 void setOrientation(Orientation orientation);
41 int getOrientation() const;
42 void setAlignment(int alignment);
43 void setHgap(float g);
44 void setVgap(float g);
45 void setDgap(float g);
46
48
49 virtual float getWidth() const
50 {
51 return myWidth;
52 }
53 virtual float getHeight() const
54 {
55 return myHeight;
56 }
57 virtual float getDepth() const
58 {
59 return myDepth;
60 }
61 virtual float getXpos() const
62 {
63 return myX;
64 }
65 virtual float getYpos() const
66 {
67 return myY;
68 }
69 virtual float getZpos() const
70 {
71 return myZ;
72 }
73
74 virtual float getVgap() const;
75 virtual float getHgap() const;
76 virtual float getDgap() const;
77
78 virtual void setAttachment(int attachment);
79 virtual int getAttachment() const;
80
82 virtual const char *getClassName() const;
84 virtual bool isOfClassName(const char *) const;
85
86protected:
87 //virtual void resize();
91 float myX;
92 float myY;
93 float myZ;
94 float myHeight;
95 float myWidth;
96 float myDepth;
102 float Hgap;
103 float Vgap;
104 float Dgap;
105
107
109 float getExtW() const;
110 float getExtH() const;
111};
112}
113#endif
collaborative interface manager
Definition: coVRCommunication.h:41
Container class that aligns its children in a row.
Definition: coRowContainer.h:19
void hide(coUIElement *element)
void setDgap(float g)
int alignment
alignment of the children
Definition: coRowContainer.h:100
virtual void removeElement(coUIElement *element)
Removes a child from this container.
float getExtH() const
float getExtW() const
get my current extension in given direction
float myWidth
Definition: coRowContainer.h:95
virtual float getDepth() const
Definition: coRowContainer.h:57
void setOrientation(Orientation orientation)
vruiTransformNode * myDCS
transformation node to position this container
Definition: coRowContainer.h:89
void setPos(float x, float y, float z=0.0f)
void setHgap(float g)
float myX
position and size
Definition: coRowContainer.h:91
virtual void insertElement(coUIElement *element, int pos)
virtual float getXpos() const
Returns element x position.
Definition: coRowContainer.h:61
virtual float getHeight() const
Returns element height.
Definition: coRowContainer.h:53
virtual float getZpos() const
Definition: coRowContainer.h:69
float myZ
Definition: coRowContainer.h:93
float Dgap
Definition: coRowContainer.h:104
float Hgap
Horizontal-, vertical- and depth-gap, default is 5mm for H and Vgap, 0 for Dgap.
Definition: coRowContainer.h:102
Orientation orientation
layout orientation
Definition: coRowContainer.h:98
virtual float getYpos() const
Returns element y position.
Definition: coRowContainer.h:65
virtual float getDgap() const
Orientation
orientation of this container
Definition: coRowContainer.h:23
virtual float getVgap() const
virtual void setAttachment(int attachment)
sets the attachment border
virtual bool isOfClassName(const char *) const
check if the Element or any ancestor is this classname
virtual float getHgap() const
int getOrientation() const
virtual void addElement(coUIElement *element)
Appends a child to this container.
float myY
Definition: coRowContainer.h:92
float Vgap
Definition: coRowContainer.h:103
virtual float getWidth() const
Returns element width.
Definition: coRowContainer.h:49
void setVgap(float g)
virtual const char * getClassName() const
get the Element's classname
float myDepth
Definition: coRowContainer.h:96
void setAlignment(int alignment)
virtual int getAttachment() const
returns the attachment border
float myHeight
Definition: coRowContainer.h:94
int attachment
Definition: coRowContainer.h:106
void show(coUIElement *element)
virtual void shrinkToMin()
Set element location in space.
virtual void resizeToParent(float, float, float, bool shrink=true)
virtual ~coRowContainer()
coRowContainer(Orientation orientation=HORIZONTAL)
vruiTransformNode * getDCS()
Definition: coUIContainer.h:24
Definition: coUIElement.h:53
Definition: vruiTransformNode.h:18