Changeset 10636
- Timestamp:
- 10/10/09 13:06:30 (4 years ago)
- Location:
- OpenSceneGraph/trunk
- Files:
-
- 2 modified
-
include/osgWidget/Label (modified) (2 diffs)
-
src/osgWidget/Label.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgWidget/Label
r9438 r10636 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield 2 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 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 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 37 37 38 38 void setLabel (const std::string&); 39 void setLabel (const osgText::String&); 39 40 void setFont (const std::string&); 40 41 void setFontSize (unsigned int); -
OpenSceneGraph/trunk/src/osgWidget/Label.cpp
r9287 r10636 9 9 Label::Label(const std::string& name, const std::string& label): 10 10 Widget (name, 0, 0), 11 _text (new osgText::Text()), 11 _text (new osgText::Text()), 12 12 _textIndex (0) { 13 13 _text->setAlignment(osgText::Text::LEFT_BOTTOM); … … 44 44 45 45 if(getWidth() < size.x()) setWidth(size.x()); 46 46 47 47 if(getHeight() < size.y()) setHeight(size.y()); 48 48 } … … 57 57 // currently cloned object. In this case, we'll need to check to be SURE. 58 58 osgText::Text* text = dynamic_cast<osgText::Text*>(geode->getDrawable(_textIndex)); 59 59 60 60 if(text) parent->getGeode()->setDrawable(_textIndex, _text.get()); 61 61 … … 109 109 } 110 110 111 void Label::setLabel(const osgText::String& label) 112 { 113 _text->setText(label); 114 115 _calculateSize(getTextSize()); 116 } 117 111 118 void Label::setFont(const std::string& font) { 112 119 _text->setFont(font); 113 120 114 121 _calculateSize(getTextSize()); 115 122 } … … 118 125 _text->setCharacterSize(size); 119 126 _text->setFontResolution(size, size); 120 127 121 128 _calculateSize(getTextSize()); 122 129 }
