From 7d66324e5d7ed0099160cc93827544be5fef2ac0 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 23 Apr 2015 09:49:16 +0000 Subject: [PATCH] Removed unused method git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14856 16af8721-9629-0410-8352-f15c8da7e697 --- src/osgText/GlyphGeometry.cpp | 94 ++--------------------------------- 1 file changed, 3 insertions(+), 91 deletions(-) diff --git a/src/osgText/GlyphGeometry.cpp b/src/osgText/GlyphGeometry.cpp index fdbc4e5a5..a35a05682 100644 --- a/src/osgText/GlyphGeometry.cpp +++ b/src/osgText/GlyphGeometry.cpp @@ -255,95 +255,7 @@ public: return new_vertex; } - void addBoundaryToGeometry(osg::Geometry* geometry, float targetThickness, bool requireFace) - { - if (_segments.empty()) return; - - if (geometry->getVertexArray()==0) geometry->setVertexArray(new osg::Vec3Array); - osg::Vec3Array* new_vertices = dynamic_cast(geometry->getVertexArray()); - - // allocate the primitive set to store the face geometry - osg::ref_ptr face = new osg::DrawElementsUShort(GL_POLYGON); - face->setName("face"); - - // reserve enough space in the vertex array to accomodate the vertices associated with the segments - new_vertices->reserve(new_vertices->size() + _segments.size()+1 + _elements->size()); - - // create vertices - unsigned int previous_second = _segments[0].second; - osg::Vec3 newPoint = computeBisectorPoint(0, targetThickness); - unsigned int first = new_vertices->size(); - new_vertices->push_back(newPoint); - - unsigned int start = (*_elements)[0]; - unsigned int count = _elements->size(); - - if (_segments[0].first != start) - { - //OSG_NOTICE<<"We have pruned from the start"<push_back(first); - } - } - else - { - face->push_back(first); - } - - - for(unsigned int i=1; i<_segments.size(); ++i) - { - newPoint = computeBisectorPoint(i, targetThickness); - unsigned int vi = new_vertices->size(); - new_vertices->push_back(newPoint); - - if (previous_second != _segments[i].first) - { - //OSG_NOTICE<<"Gap in boundary"<push_back(vi); - } - } - else - { - face->push_back(vi); - } - - previous_second = _segments[i].second; - } - - // fill the end of the polygon with repititions of the first index in the polygon to ensure - // that the orignal and new boundary polygons have the same number and pairing of indices. - // This ensures that the bevel can be created coherently. - while(face->size() < count) - { - face->push_back(first); - } - - - if (requireFace) - { - // add face primitive set for polygon - geometry->addPrimitiveSet(face.get()); - } - - - osg::DrawElementsUShort* bevel = new osg::DrawElementsUShort(GL_QUAD_STRIP); - bevel->setName("bevel"); - bevel->reserve(count*2); - for(unsigned int i=0; isize(); - new_vertices->push_back((*_vertices)[(*_elements)[i]]); - bevel->push_back(vi); - bevel->push_back((*face)[i]); - } - geometry->addPrimitiveSet(bevel); - } - - void newAddBoundaryToGeometry(osg::Geometry* geometry, float targetThickness, const std::string& faceName, const std::string& bevelName) + void addBoundaryToGeometry(osg::Geometry* geometry, float targetThickness, const std::string& faceName, const std::string& bevelName) { if (_segments.empty()) return; @@ -470,11 +382,11 @@ OSGTEXT_EXPORT osg::Geometry* computeGlyphGeometry(const osgText::Glyph3D* glyph { Boundary boundaryInner(orig_vertices, itr->get()); boundaryInner.removeAllSegmentsBelowThickness(bevelThickness); - boundaryInner.newAddBoundaryToGeometry(new_geometry.get(), bevelThickness, "face", "bevel"); + boundaryInner.addBoundaryToGeometry(new_geometry.get(), bevelThickness, "face", "bevel"); Boundary boundaryOuter(orig_vertices, itr->get()); boundaryOuter.removeAllSegmentsAboveThickness(-shellThickness); - boundaryOuter.newAddBoundaryToGeometry(new_geometry.get(), -shellThickness, "", "shell"); + boundaryOuter.addBoundaryToGeometry(new_geometry.get(), -shellThickness, "", "shell"); } }