OpenCOVER
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
12
13#include <string>
14
15#ifdef _WIN32
16typedef unsigned short ushort;
17#endif
18
19namespace vrui
20{
21
28class OPENVRUIEXPORT coFrame : public virtual coUIContainer
29{
30
31public:
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
96protected:
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;
111};
112}
113#endif
unsigned short ushort
abbreviation for unsigned short
Definition: rel_mcast-old.h:76
collaborative interface manager
Definition: coVRCommunication.h:41
Definition: coFrame.h:29
virtual void setPos(float x, float y, float z=0)
virtual float getXpos() const
Returns element x position.
Definition: coFrame.h:50
float myDepth
Frame depth.
Definition: coFrame.h:106
float bh
Border height.
Definition: coFrame.h:108
virtual void setBorderWidth(float)
float bd
Border depth.
Definition: coFrame.h:109
virtual float getZpos() const
Definition: coFrame.h:58
bool fitParent
wether to fit the frame to its parent or child
Definition: coFrame.h:110
virtual void resizeToParent(float, float, float, bool shrink=true)
virtual float getBorderHeight() const
Definition: coFrame.h:66
virtual void fitToChild()
virtual void shrinkToMin()
Set element location in space.
std::string textureName
name of the texture file
Definition: coFrame.h:97
virtual void setSize(float s)
float myWidth
Frame width.
Definition: coFrame.h:104
float myZ
Frame position Z.
Definition: coFrame.h:103
virtual float getBorderWidth() const
Definition: coFrame.h:62
virtual void setWidth(float)
float myX
Frame position X.
Definition: coFrame.h:101
virtual void addElement(coUIElement *)
Appends a child to this container.
virtual void setSize(float nw, float nh, float nd)
float myY
Frame position Y.
Definition: coFrame.h:102
virtual void setHeight(float)
virtual ~coFrame()
virtual const std::string & getTextureName() const
Definition: coFrame.h:71
coFrame(const std::string &textureName="UI/Frame")
virtual void setDepth(float)
virtual float getDepth() const
Definition: coFrame.h:46
virtual float getWidth() const
Returns element width.
Definition: coFrame.h:38
float myHeight
Frame height.
Definition: coFrame.h:105
virtual float getHeight() const
Returns element height.
Definition: coFrame.h:42
virtual void setBorderHeight(float)
virtual bool isOfClassName(const char *) const
check if the Element or any ancestor is this classname
virtual float getYpos() const
Returns element y position.
Definition: coFrame.h:54
virtual void setBorderDepth(float)
virtual void removeElement(coUIElement *)
Removes a child from this container.
virtual void setBorder(float nw, float nh, float nd)
virtual void fitToParent()
float bw
Border width.
Definition: coFrame.h:107
virtual const char * getClassName() const
get the Element's classname
Definition: coUIContainer.h:24
Definition: coUIElement.h:53