OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
10 #include <OpenVRUI/coUIContainer.h>
11 
12 namespace vrui
13 {
14 
15 class vruiTransformNode;
16 
18 class OPENVRUIEXPORT coRowContainer : public coUIContainer
19 {
20 public:
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 
47  vruiTransformNode *getDCS();
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 
86 protected:
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
virtual float getYpos() const
Returns element y position.
Definition: coRowContainer.h:65
float myHeight
Definition: coRowContainer.h:94
Definition: coUIContainer.h:23
Orientation
orientation of this container
Definition: coRowContainer.h:22
virtual float getHeight() const
Returns element height.
Definition: coRowContainer.h:53
float myZ
Definition: coRowContainer.h:93
Definition: vruiTransformNode.h:17
int alignment
alignment of the children
Definition: coRowContainer.h:100
virtual float getWidth() const
Returns element width.
Definition: coRowContainer.h:49
float myWidth
Definition: coRowContainer.h:95
float myDepth
Definition: coRowContainer.h:96
virtual float getXpos() const
Returns element x position.
Definition: coRowContainer.h:61
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
float myX
position and size
Definition: coRowContainer.h:91
virtual float getZpos() const
Definition: coRowContainer.h:69
Definition: coUIElement.h:52
float Vgap
Definition: coRowContainer.h:103
vruiTransformNode * myDCS
transformation node to position this container
Definition: coRowContainer.h:89
float myY
Definition: coRowContainer.h:92
int attachment
Definition: coRowContainer.h:106
virtual float getDepth() const
Definition: coRowContainer.h:57
Container class that aligns its children in a row.
Definition: coRowContainer.h:18
Orientation orientation
layout orientation
Definition: coRowContainer.h:98