From c006c75615b4d5b71f0d2464cb14cd2f6bc46444 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 24 Sep 2010 12:57:55 +0000 Subject: [PATCH] Moved Style and Bevel classes out into their own include/osgText/Style header. Introduced GlyphGeometry class for handling the geometry data for rendering 3D text --- include/osgText/Font | 1 - include/osgText/Glyph | 64 ++++++++++++-- include/osgText/Style | 112 +++++++++++++++++++++++++ include/osgText/TextNode | 79 +----------------- src/osgText/CMakeLists.txt | 2 + src/osgText/Glyph.cpp | 23 +++++ src/osgText/Style.cpp | 166 +++++++++++++++++++++++++++++++++++++ src/osgText/TextNode.cpp | 127 ---------------------------- 8 files changed, 362 insertions(+), 212 deletions(-) create mode 100644 include/osgText/Style create mode 100644 src/osgText/Style.cpp diff --git a/include/osgText/Font b/include/osgText/Font index 66540ddef..6951b9116 100644 --- a/include/osgText/Font +++ b/include/osgText/Font @@ -246,5 +246,4 @@ public: } - #endif diff --git a/include/osgText/Glyph b/include/osgText/Glyph index c52d31ea1..72878608a 100644 --- a/include/osgText/Glyph +++ b/include/osgText/Glyph @@ -1,4 +1,4 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2010 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or @@ -25,6 +25,7 @@ #include #include +#include #include @@ -33,6 +34,7 @@ namespace osgText { class Font; class Text; class Glyph3D; +class GlyphGeometry; class GlyphTexture; class OSGTEXT_EXPORT Glyph : public osg::Image @@ -95,6 +97,50 @@ protected: }; +class OSGTEXT_EXPORT GlyphGeometry : public osg::Referenced +{ + public: + + GlyphGeometry(); + + void setup(const Glyph* glyph, const Style* style); + + bool match(const Style* style) const; + + osg::Geode* getGeode() const { return _geode.get(); } + osg::Geometry* getGeometry() const { return _geometry.get(); } + + /** Set the VertexArray of the glyph. */ + void setVertexArray(osg::Vec3Array * va) { _vertices = va; } + /** Get the VertexArray of the glyph. */ + osg::Vec3Array * getVertexArray() const { return _vertices.get(); } + + /** Set the VertexArray of the glyph. */ + void setNormalArray(osg::Vec3Array* na) { _normals = na; } + /** Get the NormalArray for the wall face. */ + osg::Vec3Array* getNormalArray() const { return _normals.get(); } + + /** Get the PrimitiveSetList for the front face. */ + osg::Geometry::PrimitiveSetList& getFrontPrimitiveSetList() { return _frontPrimitiveSetList; } + /** Get the PrimitiveSetList for the wall face. */ + osg::Geometry::PrimitiveSetList& getWallPrimitiveSetList() { return _wallPrimitiveSetList; } + /** Get et the PrimitiveSetList for the back face. */ + osg::Geometry::PrimitiveSetList& getBackPrimitiveSetList() { return _backPrimitiveSetList; } + + protected: + + osg::ref_ptr