openscenegraph
include
osgWidget
osgWidget/Label
Go to the documentation of this file.
1
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield
2
*
3
* This library is open source and may be redistributed and/or modified under
4
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5
* (at your option) any later version. The full license is in LICENSE file
6
* included with this distribution, and on the openscenegraph.org website.
7
*
8
* This library is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* OpenSceneGraph Public License for more details.
12
*/
13
14
// Code by: Jeremy Moles (cubicool) 2007-2008
15
16
#ifndef OSGWIDGET_LABEL
17
#define OSGWIDGET_LABEL
18
19
#include <
osgText/Text
>
20
#include <
osgWidget/Widget
>
21
#include <
osgWidget/Window
>
22
23
namespace
osgWidget
{
24
25
class
OSGWIDGET_EXPORT
Label
:
public
Widget
26
{
27
public
:
28
29
META_Object
(
osgWidget
,
Label
);
30
31
Label
(
const
std::string& =
""
,
const
std::string& =
""
);
32
Label
(
const
Label
&,
const
osg::CopyOp
&);
33
34
virtual
void
parented
(
Window
*);
35
virtual
void
unparented
(
Window
*);
36
virtual
void
positioned
();
37
38
void
setLabel
(
const
std::string&);
39
void
setLabel
(
const
osgText::String
&);
40
void
setFont
(
const
std::string&);
41
void
setFontSize
(
unsigned
int
);
42
void
setFontColor
(
const
Color
&);
43
void
setShadow
(
point_type
);
44
45
XYCoord
getTextSize
()
const
;
46
47
std::string
getLabel
()
const
{
return
_text->getText().createUTF8EncodedString(); }
48
49
void
setFontColor
(
point_type
r,
point_type
g,
point_type
b,
point_type
a) {
setFontColor
(
Color
(r, g, b, a)); }
50
51
osgText::Text
*
getText
() {
return
_text.get(); }
52
53
const
osgText::Text
*
getText
()
const
{
return
_text.get(); }
54
55
protected
:
56
57
osg::ref_ptr<osgText::Text>
_text
;
58
unsigned
int
_textIndex
;
59
60
virtual
void
_calculateSize
(
const
XYCoord
&);
61
62
};
63
64
}
65
66
#endif
Text
Window
osgText::String
Definition
String:44
osgText::Text
Definition
Text:27
osgWidget::Label
Definition
osgWidget/Label:26
osgWidget::Label::Label
Label(const Label &, const osg::CopyOp &)
osgWidget::Label::getLabel
std::string getLabel() const
Definition
osgWidget/Label:47
osgWidget::Label::parented
virtual void parented(Window *)
osgWidget::Label::setFontSize
void setFontSize(unsigned int)
osgWidget::Label::setLabel
void setLabel(const std::string &)
osgWidget::Label::setLabel
void setLabel(const osgText::String &)
osgWidget::Label::setFontColor
void setFontColor(point_type r, point_type g, point_type b, point_type a)
Definition
osgWidget/Label:49
osgWidget::Label::getText
osgText::Text * getText()
Definition
osgWidget/Label:51
osgWidget::Label::setFontColor
void setFontColor(const Color &)
osgWidget::Label::META_Object
META_Object(osgWidget, Label)
osgWidget::Label::unparented
virtual void unparented(Window *)
osgWidget::Label::_calculateSize
virtual void _calculateSize(const XYCoord &)
osgWidget::Label::positioned
virtual void positioned()
osgWidget::Label::setFont
void setFont(const std::string &)
osgWidget::Label::_textIndex
unsigned int _textIndex
Definition
osgWidget/Label:58
osgWidget::Label::Label
Label(const std::string &="", const std::string &="")
osgWidget::Label::_text
osg::ref_ptr< osgText::Text > _text
Definition
osgWidget/Label:57
osgWidget::Label::getTextSize
XYCoord getTextSize() const
osgWidget::Label::getText
const osgText::Text * getText() const
Definition
osgWidget/Label:53
osgWidget::Label::setShadow
void setShadow(point_type)
osgWidget::Widget
Definition
osgWidget/Widget:35
osgWidget::Window
Definition
Window:44
osg::CopyOp
Definition
CopyOp:41
osg::Vec2f
Definition
Vec2f:29
osg::ref_ptr
Definition
ref_ptr:32
osgWidget
Definition
Box:21
osgWidget::point_type
Point::value_type point_type
Definition
osgWidget/Types:33
osgWidget::Color
ColorArray::value_type Color
Definition
osgWidget/Types:30
OSGWIDGET_EXPORT
#define OSGWIDGET_EXPORT
Definition
osgWidget/Export:42
Widget
Generated by
1.9.8