Changeset 13041 for OpenSceneGraph/trunk/src/osgText/TextBase.cpp
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/src/osgText/TextBase.cpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgText/TextBase.cpp
r12972 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 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 */ … … 142 142 computeGlyphRepresentation(); 143 143 } 144 144 145 145 146 146 void TextBase::setText(const String& text) 147 147 { 148 148 if (_text==text) return; 149 149 150 150 _text = text; 151 151 computeGlyphRepresentation(); … … 161 161 setText(String(text,encoding)); 162 162 } 163 163 164 164 165 165 void TextBase::setText(const wchar_t* text) … … 179 179 { 180 180 if (_alignment==alignment) return; 181 181 182 182 _alignment = alignment; 183 183 computeGlyphRepresentation(); … … 192 192 case XZ_PLANE: 193 193 setAutoRotateToScreen(false); 194 setRotation(osg::Quat(osg::inDegrees(90.0f),osg::Vec3(1.0f,0.0f,0.0f))); 194 setRotation(osg::Quat(osg::inDegrees(90.0f),osg::Vec3(1.0f,0.0f,0.0f))); 195 195 break; 196 196 case REVERSED_XZ_PLANE: 197 197 setAutoRotateToScreen(false); 198 198 setRotation(osg::Quat(osg::inDegrees(180.0f),osg::Vec3(0.0f,1.0f,0.0f))* 199 osg::Quat(osg::inDegrees(90.0f),osg::Vec3(1.0f,0.0f,0.0f))); 200 break; 201 case YZ_PLANE: 199 osg::Quat(osg::inDegrees(90.0f),osg::Vec3(1.0f,0.0f,0.0f))); 200 break; 201 case YZ_PLANE: 202 202 setAutoRotateToScreen(false); 203 203 setRotation(osg::Quat(osg::inDegrees(90.0f),osg::Vec3(1.0f,0.0f,0.0f))* 204 204 osg::Quat(osg::inDegrees(90.0f),osg::Vec3(0.0f,0.0f,1.0f))); 205 205 break; 206 case REVERSED_YZ_PLANE: 206 case REVERSED_YZ_PLANE: 207 207 setAutoRotateToScreen(false); 208 208 setRotation(osg::Quat(osg::inDegrees(180.0f),osg::Vec3(0.0f,1.0f,0.0f))* … … 236 236 { 237 237 if (_autoRotateToScreen==autoRotateToScreen) return; 238 238 239 239 _autoRotateToScreen = autoRotateToScreen; 240 240 computePositions(); … … 251 251 252 252 253 void TextBase::setDrawMode(unsigned int mode) 254 { 253 void TextBase::setDrawMode(unsigned int mode) 254 { 255 255 if (_drawMode==mode) return; 256 256 … … 318 318 { 319 319 unsigned int size = osg::maximum(osg::DisplaySettings::instance()->getMaxNumberOfGraphicsContexts(),_autoTransformCache.size()); 320 320 321 321 // FIXME: OPTIMIZE: This would be one of the ideal locations to 322 322 // call computeAverageGlyphWidthAndHeight(). It is out of the contextID loop … … 325 325 // or member variables, but we would need a system to know if the values are stale.) 326 326 327 327 328 328 for(unsigned int i=0;i<size;++i) 329 329 {
