OpenCOVER
coLabel.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_LABEL_H
9#define CO_LABEL_H
10
12
13#include <string>
14
15namespace vrui
16{
17
18class coLabelGeometry;
19class vruiUIElementProvider;
20
25class OPENVRUIEXPORT coLabel : public coUIElement
26{
27public:
29 {
30 HORIZONTAL = 0,
31 VERTICAL
32 };
33
35 {
36 LEFT = 0,
38 RIGHT
39 };
40
41 coLabel(const std::string &labelText = "");
42 virtual ~coLabel();
43 void resize();
44 virtual void setPos(float x, float y, float z = 0.0f);
45 virtual void setFontSize(float size);
46 virtual void setJustify(Justify justify);
47 virtual void setString(const std::string &text);
48 virtual void setSize(float size);
49 virtual void setSize(float xs, float ys, float zs);
50 virtual float getWidth() const // see superclass for comment
51 {
52 return myWidth;
53 }
54 virtual float getHeight() const // see superclass for comment
55 {
56 return myHeight;
57 }
58 virtual float getDepth() const // see superclass for comment
59 {
60 return myDepth;
61 }
62 virtual float getXpos() const // see superclass for comment
63 {
64 return myX;
65 }
66 virtual float getYpos() const // see superclass for comment
67 {
68 return myY;
69 }
70 virtual float getZpos() const // see superclass for comment
71 {
72 return myZ;
73 }
74 virtual float getFontSize() const
75 {
76 return fontSize;
77 }
78 virtual Justify getJustify() const
79 {
80 return justify;
81 }
83 {
84 return direction;
85 }
86 virtual const char *getString() const
87 {
88 return labelString.c_str();
89 }
90 virtual void setHighlighted(bool highlighted);
91
92 virtual void resizeGeometry();
93
95 virtual const char *getClassName() const;
97 virtual bool isOfClassName(const char *) const;
98
99protected:
100 float myX;
101 float myY;
102 float myZ;
103 float myHeight;
104 float myWidth;
105 float myDepth;
106
107 // float textColor[4]; ///< components of text color (RGBA)
108 // float textColorHL[4]; ///< components of text color when highlighted (RGBA)
109 // pfGeoState *backgroundTextureState; ///< Performer geostate of background texture
110 // pfText *labelText; ///< label text string in Performer format
111
112 std::string labelString;
113
115 float fontSize;
117
118 //void makeText();
119};
120}
121#endif
collaborative interface manager
Definition: coVRCommunication.h:41
Definition: coLabel.h:26
float myY
y position of label in object space [mm]
Definition: coLabel.h:101
virtual const char * getString() const
Definition: coLabel.h:86
virtual ~coLabel()
virtual float getXpos() const
Returns element x position.
Definition: coLabel.h:62
virtual void setFontSize(float size)
virtual float getDepth() const
Definition: coLabel.h:58
float myHeight
label size in z direction [mm]
Definition: coLabel.h:103
virtual float getHeight() const
Returns element height.
Definition: coLabel.h:54
Justify
Definition: coLabel.h:35
@ CENTER
Definition: coLabel.h:37
virtual void setString(const std::string &text)
virtual float getYpos() const
Returns element y position.
Definition: coLabel.h:66
float myWidth
label size in x direction [mm]
Definition: coLabel.h:104
virtual const char * getClassName() const
get the Element's classname
virtual void setSize(float size)
virtual void setJustify(Justify justify)
float myX
x position of label in object space [mm]
Definition: coLabel.h:100
virtual Justify getJustify() const
Definition: coLabel.h:78
float myZ
z position of label in object space [mm]
Definition: coLabel.h:102
coLabel(const std::string &labelText="")
DirectionsType direction
direction into which the text string is written on the label
Definition: coLabel.h:116
DirectionsType
valid orientations for text string
Definition: coLabel.h:29
virtual void setHighlighted(bool highlighted)
virtual DirectionsType getDirection() const
Definition: coLabel.h:82
virtual float getFontSize() const
Definition: coLabel.h:74
std::string labelString
text string which is displayed on the label
Definition: coLabel.h:112
float fontSize
label text size in mm
Definition: coLabel.h:115
Justify justify
string justification, using Performer format. Default is left alignment.
Definition: coLabel.h:114
virtual bool isOfClassName(const char *) const
check if the Element or any ancestor is this classname
virtual void resizeGeometry()
virtual void setSize(float xs, float ys, float zs)
virtual void setPos(float x, float y, float z=0.0f)
virtual float getWidth() const
Returns element width.
Definition: coLabel.h:50
float myDepth
label size in y direction [mm]
Definition: coLabel.h:105
virtual float getZpos() const
Definition: coLabel.h:70
Definition: coUIElement.h:53