From 4daad70d173c7135456a709e3e96458b515a4415 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 17 Sep 2010 13:33:09 +0000 Subject: [PATCH] Build fixes for when OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION is disabled --- examples/osgtext3D/osgtext3D.cpp | 2 +- examples/osgtext3D/osgtext3D_test.cpp | 2 +- src/osgPlugins/pov/POVWriterNodeVisitor.cpp | 6 +++--- src/osgText/GlyphGeometry.cpp | 6 +++--- src/osgText/Text3D.cpp | 3 ++- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/examples/osgtext3D/osgtext3D.cpp b/examples/osgtext3D/osgtext3D.cpp index 224ed1cb1..13c91d567 100644 --- a/examples/osgtext3D/osgtext3D.cpp +++ b/examples/osgtext3D/osgtext3D.cpp @@ -75,7 +75,7 @@ int main(int argc, char** argv) while(arguments.read("--flat")) { bevel = new osgText::Bevel; bevel->flatBevel(0.25); } while(arguments.read("--bevel-thickness",r)) { if (bevel.valid()) bevel->setBevelThickness(r); } - style->setBevel(bevel); + style->setBevel(bevel.get()); // set up outline. while(arguments.read("--outline",r)) { style->setOutlineRatio(r); } diff --git a/examples/osgtext3D/osgtext3D_test.cpp b/examples/osgtext3D/osgtext3D_test.cpp index 418a6b9ea..ce88ce153 100644 --- a/examples/osgtext3D/osgtext3D_test.cpp +++ b/examples/osgtext3D/osgtext3D_test.cpp @@ -137,7 +137,7 @@ int main_test(int, char**) osg::Geode* pGeodeSphere = new osg::Geode; pGeodeSphere->addDrawable( new osg::ShapeDrawable( new osg::Sphere(osg::Vec3(0.0f,0.0f,0.0f),0.01f) ) ); rPat->addChild( pGeodeSphere ); - pGroup->addChild( rPat ); + pGroup->addChild( rPat.get() ); osg::Vec3 center(0.0f,0.0f,0.0f); float radius = 1.0f; diff --git a/src/osgPlugins/pov/POVWriterNodeVisitor.cpp b/src/osgPlugins/pov/POVWriterNodeVisitor.cpp index d71cce5d4..86ea79211 100644 --- a/src/osgPlugins/pov/POVWriterNodeVisitor.cpp +++ b/src/osgPlugins/pov/POVWriterNodeVisitor.cpp @@ -93,7 +93,7 @@ void POVWriterNodeVisitor::apply( Geode& node ) itr != dl.end(); ++itr) { // get drawable - const Drawable *d = *itr; + const Drawable *d = itr->get(); // push state set const StateSet *ss = d->getStateSet(); @@ -103,12 +103,12 @@ void POVWriterNodeVisitor::apply( Geode& node ) Matrix m = _transformationStack.top(); // process lights - processLights( _stateSetStack.top(), m ); + processLights( _stateSetStack.top().get(), m ); // process geometry const Geometry *g = d->asGeometry(); if( g ) - processGeometry( g, _stateSetStack.top(), m ); + processGeometry( g, _stateSetStack.top().get(), m ); // pop state set if( ss ) popStateSet( ss ); diff --git a/src/osgText/GlyphGeometry.cpp b/src/osgText/GlyphGeometry.cpp index 12e4556f7..4c5e77b1a 100644 --- a/src/osgText/GlyphGeometry.cpp +++ b/src/osgText/GlyphGeometry.cpp @@ -470,11 +470,11 @@ osg::Geometry* computeGlyphGeometry(osgText::Glyph3D* glyph, float bevelThicknes { Boundary boundaryInner(orig_vertices, itr->get()); boundaryInner.removeAllSegmentsBelowThickness(bevelThickness); - boundaryInner.newAddBoundaryToGeometry(new_geometry, bevelThickness, "face", "bevel"); + boundaryInner.newAddBoundaryToGeometry(new_geometry.get(), bevelThickness, "face", "bevel"); Boundary boundaryOuter(orig_vertices, itr->get()); boundaryOuter.removeAllSegmentsAboveThickness(-shellThickness); - boundaryOuter.newAddBoundaryToGeometry(new_geometry, -shellThickness, "", "shell"); + boundaryOuter.newAddBoundaryToGeometry(new_geometry.get(), -shellThickness, "", "shell"); } } @@ -495,7 +495,7 @@ osg::Geometry* computeGlyphGeometry(osgText::Glyph3D* glyph, float bevelThicknes ++itr) { osg::PrimitiveSet* prim = itr->get(); - if (prim->getName()=="face") face_geometry->addPrimitiveSet(copyop(*itr)); + if (prim->getName()=="face") face_geometry->addPrimitiveSet(copyop(itr->get())); else primitiveSets.push_back(prim); } diff --git a/src/osgText/Text3D.cpp b/src/osgText/Text3D.cpp index c1da5f5d1..639e0fb40 100644 --- a/src/osgText/Text3D.cpp +++ b/src/osgText/Text3D.cpp @@ -111,7 +111,8 @@ void Text3D::setFont(Font* font) void Text3D::setFont(const std::string & fontfile) { - setFont(readRefFontFile(fontfile)); + osg::ref_ptr font = readRefFontFile(fontfile); + setFont(font.get()); } String::iterator Text3D::computeLastCharacterOnLine(osg::Vec2& cursor, String::iterator first,String::iterator last)