OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
coFrame.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_FRAME_H
9 #define CO_FRAME_H
10 
11 #include <OpenVRUI/coUIContainer.h>
12 
13 #include <string>
14 
15 #ifdef _WIN32
16 typedef unsigned short ushort;
17 #endif
18 
19 namespace vrui
20 {
21 
28 class OPENVRUIEXPORT coFrame : public virtual coUIContainer
29 {
30 
31 public:
32  coFrame(const std::string &textureName = "UI/Frame");
33  virtual ~coFrame();
34 
35  virtual void addElement(coUIElement *);
36  virtual void removeElement(coUIElement *);
37 
38  virtual float getWidth() const
39  {
40  return myWidth;
41  }
42  virtual float getHeight() const
43  {
44  return myHeight;
45  }
46  virtual float getDepth() const
47  {
48  return myDepth;
49  }
50  virtual float getXpos() const
51  {
52  return myX;
53  }
54  virtual float getYpos() const
55  {
56  return myY;
57  }
58  virtual float getZpos() const
59  {
60  return myZ;
61  }
62  virtual float getBorderWidth() const
63  {
64  return bw;
65  }
66  virtual float getBorderHeight() const
67  {
68  return bw;
69  }
70 
71  virtual const std::string &getTextureName() const
72  {
73  return textureName;
74  }
75 
76  virtual void setPos(float x, float y, float z = 0);
77  virtual void setWidth(float);
78  virtual void setHeight(float);
79  virtual void setDepth(float);
80  virtual void setBorderWidth(float);
81  virtual void setBorderHeight(float);
82  virtual void setBorderDepth(float);
83  virtual void setSize(float s);
84  virtual void setSize(float nw, float nh, float nd);
85  virtual void setBorder(float nw, float nh, float nd);
86  virtual void resizeToParent(float, float, float, bool shrink = true);
87  virtual void shrinkToMin();
88  virtual void fitToParent();
89  virtual void fitToChild();
90 
92  virtual const char *getClassName() const;
94  virtual bool isOfClassName(const char *) const;
95 
96 protected:
97  std::string textureName;
98 
99  //shared coord and color list
100  void realign();
101  float myX;
102  float myY;
103  float myZ;
104  float myWidth;
105  float myHeight;
106  float myDepth;
107  float bw;
108  float bh;
109  float bd;
110  bool fitParent;
111 };
112 }
113 #endif
float myHeight
Frame height.
Definition: coFrame.h:105
virtual float getBorderHeight() const
Definition: coFrame.h:66
Definition: coUIContainer.h:23
float myX
Frame position X.
Definition: coFrame.h:101
virtual float getYpos() const
Returns element y position.
Definition: coFrame.h:54
float bw
Border width.
Definition: coFrame.h:107
virtual float getDepth() const
Definition: coFrame.h:46
float bh
Border height.
Definition: coFrame.h:108
virtual float getBorderWidth() const
Definition: coFrame.h:62
virtual float getHeight() const
Returns element height.
Definition: coFrame.h:42
bool fitParent
wether to fit the frame to its parent or child
Definition: coFrame.h:110
float myZ
Frame position Z.
Definition: coFrame.h:103
float bd
Border depth.
Definition: coFrame.h:109
virtual const std::string & getTextureName() const
Definition: coFrame.h:71
float myDepth
Frame depth.
Definition: coFrame.h:106
Definition: coUIElement.h:52
Definition: coFrame.h:28
virtual float getZpos() const
Definition: coFrame.h:58
float myY
Frame position Y.
Definition: coFrame.h:102
std::string textureName
name of the texture file
Definition: coFrame.h:97
float myWidth
Frame width.
Definition: coFrame.h:104
virtual float getWidth() const
Returns element width.
Definition: coFrame.h:38
unsigned short ushort
abbreviation for unsigned short
Definition: rel_mcast-old.h:76
virtual float getXpos() const
Returns element x position.
Definition: coFrame.h:50