diff --git a/examples/osgoscdevice/osgoscdevice.cpp b/examples/osgoscdevice/osgoscdevice.cpp index e4eadf4e1..218a103e4 100755 --- a/examples/osgoscdevice/osgoscdevice.cpp +++ b/examples/osgoscdevice/osgoscdevice.cpp @@ -386,7 +386,7 @@ public: osgViewer::View* view = dynamic_cast(&aa); if (view) - view->addEventHandler(new PickHandler(_device)); + view->addEventHandler(new PickHandler(_device.get())); return true; } } @@ -468,7 +468,7 @@ int main( int argc, char **argv ) osg::ref_ptr device = osgDB::readFile("0.0.0.0:9000.receiver.osc"); if (device.valid() && (device->getCapabilities() & osgGA::Device::RECEIVE_EVENTS)) { - view->addDevice(device); + view->addDevice(device.get()); // add a zeroconf device, advertising the osc-device if(use_zeroconf) @@ -505,7 +505,7 @@ int main( int argc, char **argv ) viewer.addView(view); osg::Group* g = new osg::Group(); - g->addChild(scene); + g->addChild(scene.get()); g->addChild(createHUD()); view->setSceneData(g); view->getCamera()->setName("Cam one"); @@ -535,10 +535,10 @@ int main( int argc, char **argv ) if (device.valid() && (device->getCapabilities() & osgGA::Device::SEND_EVENTS)) { // add as first event handler, so it gets ALL events ... - view->getEventHandlers().push_front(new ForwardToDeviceEventHandler(device)); + view->getEventHandlers().push_front(new ForwardToDeviceEventHandler(device.get())); // add the demo-pick-event-handler - view->addEventHandler(new PickHandler(device)); + view->addEventHandler(new PickHandler(device.get())); } else { OSG_WARN << "could not open osc-device, sending will not work" << std::endl; diff --git a/src/osg/ImageSequence.cpp b/src/osg/ImageSequence.cpp index fa4780d8e..c83c08b63 100644 --- a/src/osg/ImageSequence.cpp +++ b/src/osg/ImageSequence.cpp @@ -372,7 +372,7 @@ void ImageSequence::update(osg::NodeVisitor* nv) if (image.valid()) { OSG_NOTICE<<" Assigning image "<<_imageDataList[i]._filename<acceptsExtension("*")) - result = *i; + result = i->get(); else if ((*i)->acceptsExtension(extension)) - return *i; + return i->get(); } return result ? result : getReaderWriterForExtension("curl"); diff --git a/src/osgPlugins/p3d/ReaderWriterP3D.cpp b/src/osgPlugins/p3d/ReaderWriterP3D.cpp index 3bc7086a1..699918028 100644 --- a/src/osgPlugins/p3d/ReaderWriterP3D.cpp +++ b/src/osgPlugins/p3d/ReaderWriterP3D.cpp @@ -1083,7 +1083,7 @@ bool ReaderWriterP3DXML::parsePropertyAnimation(osgDB::XmlNode* root, osgPresent if (parseProperties(cur, *udc)) { OSG_NOTICE<<"Adding keyframe"<setColorArray(colours); + geometry->setColorArray(colours.get()); } geometry->setColorBinding(osg::Geometry::BIND_PER_VERTEX); colours->resize(vertices->size(), osg::Vec4(0.0,0.0,0.0,0.0)); @@ -82,7 +82,7 @@ struct AssignDirectionColour if (!normals) { normals = new osg::Vec3Array; - geometry->setNormalArray(normals); + geometry->setNormalArray(normals.get()); } geometry->setNormalBinding(osg::Geometry::BIND_PER_VERTEX); normals->resize(vertices->size(), osg::Vec3(0.0,0.0,0.0)); @@ -175,7 +175,7 @@ struct AssignDirectionColour vertexShader = new osg::Shader(osg::Shader::VERTEX, vert_shader_str); } - program->addShader(vertexShader); + program->addShader(vertexShader.get()); stateset->setAttribute(program.get()); } diff --git a/src/osgPresentation/PickEventHandler.cpp b/src/osgPresentation/PickEventHandler.cpp index 807a7f876..a02e75919 100644 --- a/src/osgPresentation/PickEventHandler.cpp +++ b/src/osgPresentation/PickEventHandler.cpp @@ -102,7 +102,7 @@ bool PickEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA { if (ea.getEventType()==osgGA::GUIEventAdapter::PUSH) { - _drawablesOnPush.insert( hitr->drawable ); + _drawablesOnPush.insert( hitr->drawable.get() ); } else if (ea.getEventType()==osgGA::GUIEventAdapter::MOVE) { @@ -110,7 +110,7 @@ bool PickEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA } else if (ea.getEventType()==osgGA::GUIEventAdapter::RELEASE) { - if (_drawablesOnPush.find(hitr->drawable) != _drawablesOnPush.end()) + if (_drawablesOnPush.find(hitr->drawable.get()) != _drawablesOnPush.end()) doOperation(); return true; } diff --git a/src/osgPresentation/SlideShowConstructor.cpp b/src/osgPresentation/SlideShowConstructor.cpp index b0475dc2c..b1835d9d5 100644 --- a/src/osgPresentation/SlideShowConstructor.cpp +++ b/src/osgPresentation/SlideShowConstructor.cpp @@ -462,7 +462,7 @@ void SlideShowConstructor::addLayer(bool inheritPreviousLayers, bool defineAsBas osg::Vec3 localPosition = computePositionInModelCoords(_titlePositionData); osgText::Text* text = new osgText::Text; - text->setFont(osgText::readFontFile(_titleFontData.font, _options)); + text->setFont(osgText::readFontFile(_titleFontData.font, _options.get())); text->setColor(_titleFontData.color); text->setCharacterSize(_titleFontData.characterSize*_slideHeight); text->setFontResolution(110,120); @@ -681,7 +681,7 @@ void SlideShowConstructor::addBullet(const std::string& bullet, PositionData& po osg::Vec3 localPosition = computePositionInModelCoords(positionData); - text->setFont(osgText::readFontFile(fontData.font, _options)); + text->setFont(osgText::readFontFile(fontData.font, _options.get())); text->setColor(fontData.color); text->setCharacterSize(fontData.characterSize*_slideHeight); text->setCharacterSizeMode(fontData.characterSizeMode); @@ -729,7 +729,7 @@ void SlideShowConstructor::addParagraph(const std::string& paragraph, PositionDa osgText::Text* text = new osgText::Text; - text->setFont(osgText::readFontFile(fontData.font, _options)); + text->setFont(osgText::readFontFile(fontData.font, _options.get())); text->setColor(fontData.color); text->setCharacterSize(fontData.characterSize*_slideHeight); text->setCharacterSizeMode(fontData.characterSizeMode); @@ -2572,19 +2572,19 @@ void SlideShowConstructor::addVolume(const std::string& filename, const Position osgVolume::AlphaFuncProperty* ap = new osgVolume::AlphaFuncProperty(0.1f); - setUpVolumeScalarProperty(tile, ap, volumeData.cutoffValue); + setUpVolumeScalarProperty(tile.get(), ap, volumeData.cutoffValue); osgVolume::TransparencyProperty* tp = new osgVolume::TransparencyProperty(1.0f); - setUpVolumeScalarProperty(tile, tp, volumeData.alphaValue); + setUpVolumeScalarProperty(tile.get(), tp, volumeData.alphaValue); osgVolume::SampleDensityProperty* sd = new osgVolume::SampleDensityProperty(0.005); - setUpVolumeScalarProperty(tile, sd, volumeData.sampleDensityValue); + setUpVolumeScalarProperty(tile.get(), sd, volumeData.sampleDensityValue); osgVolume::SampleDensityWhenMovingProperty* sdm = 0; if (!volumeData.sampleDensityWhenMovingValue.empty()) { sdm = new osgVolume::SampleDensityWhenMovingProperty(0.005); - setUpVolumeScalarProperty(tile, sdm, volumeData.sampleDensityWhenMovingValue); + setUpVolumeScalarProperty(tile.get(), sdm, volumeData.sampleDensityWhenMovingValue); } osgVolume::TransferFunctionProperty* tfp = volumeData.transferFunction.valid() ? new osgVolume::TransferFunctionProperty(volumeData.transferFunction.get()) : 0; @@ -2622,7 +2622,7 @@ void SlideShowConstructor::addVolume(const std::string& filename, const Position osgVolume::IsoSurfaceProperty* isp = new osgVolume::IsoSurfaceProperty(0.1); - setUpVolumeScalarProperty(tile, isp, volumeData.alphaValue); + setUpVolumeScalarProperty(tile.get(), isp, volumeData.alphaValue); cp->addProperty(isp); if (sdm) cp->addProperty(sdm); diff --git a/src/osgUtil/Optimizer.cpp b/src/osgUtil/Optimizer.cpp index 90fe4b0d7..53a072f26 100644 --- a/src/osgUtil/Optimizer.cpp +++ b/src/osgUtil/Optimizer.cpp @@ -4675,7 +4675,7 @@ void Optimizer::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor::apply( { parent_group->replaceChild(&transform, group.get()); // also replace the node in the nodepath - _nodePath[nodepathsize-1] = group; + _nodePath[nodepathsize-1] = group.get(); // traverse the new Group traverse(*(group.get())); } @@ -4711,7 +4711,7 @@ void Optimizer::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor::apply( { parent_group->replaceChild(&lod, new_lod.get()); // also replace the node in the nodepath - _nodePath[nodepathsize-1] = new_lod; + _nodePath[nodepathsize-1] = new_lod.get(); // move center point if(!_matrixStack.empty()) new_lod->setCenter(new_lod->getCenter() * _matrixStack.back());