diff --git a/src/osgManipulator/ScaleAxisDragger.cpp b/src/osgManipulator/ScaleAxisDragger.cpp index c59ad0e3d..6a44d587a 100644 --- a/src/osgManipulator/ScaleAxisDragger.cpp +++ b/src/osgManipulator/ScaleAxisDragger.cpp @@ -66,20 +66,20 @@ void ScaleAxisDragger::setupDefaultGeometry() { _lineWidth = new osg::LineWidth(); _lineWidth->setWidth(_axisLineWidth); - _lineGeode->getOrCreateStateSet()->setAttributeAndModes(_lineWidth, osg::StateAttribute::ON); + _lineGeode->getOrCreateStateSet()->setAttributeAndModes(_lineWidth.get(), osg::StateAttribute::ON); _lineGeode->getOrCreateStateSet()->setMode(GL_LIGHTING,osg::StateAttribute::OFF); } // Add line to all the individual 1D draggers. - _xDragger->addChild(_lineGeode); - _yDragger->addChild(_lineGeode); - _zDragger->addChild(_lineGeode); + _xDragger->addChild(_lineGeode.get()); + _yDragger->addChild(_lineGeode.get()); + _zDragger->addChild(_lineGeode.get()); osg::Geode* geode = new osg::Geode; // Create a box. _box = new osg::Box(osg::Vec3(1.0f,0.0f,0.0f), _boxSize); - geode->addDrawable(new osg::ShapeDrawable(_box)); + geode->addDrawable(new osg::ShapeDrawable(_box.get())); // This ensures correct lighting for scaled draggers. #if !defined(OSG_GLES2_AVAILABLE) diff --git a/src/osgManipulator/TrackballDragger.cpp b/src/osgManipulator/TrackballDragger.cpp index 7b1b816d0..f60337851 100644 --- a/src/osgManipulator/TrackballDragger.cpp +++ b/src/osgManipulator/TrackballDragger.cpp @@ -123,7 +123,7 @@ void TrackballDragger::setupDefaultGeometry() _cylinder = new osg::Cylinder; _cylinder->setHeight(_pickCylinderHeight); - osg::ShapeDrawable* cylinderDrawable = new osg::ShapeDrawable(_cylinder, hints); + osg::ShapeDrawable* cylinderDrawable = new osg::ShapeDrawable(_cylinder.get(), hints); _geode->addDrawable(cylinderDrawable); setDrawableToAlwaysCull(*cylinderDrawable); _geode->addDrawable(createCircleGeometry(1.0f, 100)); @@ -135,7 +135,7 @@ void TrackballDragger::setupDefaultGeometry() polymode->setMode(osg::PolygonMode::FRONT_AND_BACK,osg::PolygonMode::LINE); _geode->getOrCreateStateSet()->setAttributeAndModes(polymode,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON); _lineWidth = new osg::LineWidth(_axisLineWidth); - _geode->getOrCreateStateSet()->setAttributeAndModes(_lineWidth, osg::StateAttribute::ON); + _geode->getOrCreateStateSet()->setAttributeAndModes(_lineWidth.get(), osg::StateAttribute::ON); #if !defined(OSG_GLES2_AVAILABLE) _geode->getOrCreateStateSet()->setMode(GL_NORMALIZE, osg::StateAttribute::ON); @@ -144,9 +144,9 @@ void TrackballDragger::setupDefaultGeometry() } // Add line to all the individual 1D draggers. - _xDragger->addChild(_geode); - _yDragger->addChild(_geode); - _zDragger->addChild(_geode); + _xDragger->addChild(_geode.get()); + _yDragger->addChild(_geode.get()); + _zDragger->addChild(_geode.get()); // Rotate X-axis dragger appropriately. diff --git a/src/osgManipulator/TranslateAxisDragger.cpp b/src/osgManipulator/TranslateAxisDragger.cpp index e109cb9c5..d32718c9f 100644 --- a/src/osgManipulator/TranslateAxisDragger.cpp +++ b/src/osgManipulator/TranslateAxisDragger.cpp @@ -67,21 +67,21 @@ void TranslateAxisDragger::setupDefaultGeometry() { _lineWidth = new osg::LineWidth(); _lineWidth->setWidth(_axisLineWidth); - _lineGeode->getOrCreateStateSet()->setAttributeAndModes(_lineWidth, osg::StateAttribute::ON); + _lineGeode->getOrCreateStateSet()->setAttributeAndModes(_lineWidth.get(), osg::StateAttribute::ON); _lineGeode->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF); } // Add line to all the individual 1D draggers. - _xDragger->addChild(_lineGeode); - _yDragger->addChild(_lineGeode); - _zDragger->addChild(_lineGeode); + _xDragger->addChild(_lineGeode.get()); + _yDragger->addChild(_lineGeode.get()); + _zDragger->addChild(_lineGeode.get()); osg::Geode* geode = new osg::Geode; // Create a cone. { _cone = new osg::Cone (osg::Vec3(0.0f, 0.0f, 1.0f), _coneHeight * 0.25f, _coneHeight); - osg::ShapeDrawable* coneDrawable = new osg::ShapeDrawable(_cone); + osg::ShapeDrawable* coneDrawable = new osg::ShapeDrawable(_cone.get()); // coneDrawable->setColor(osg::Vec4(0.0f,0.0f,1.0f,1.0f)); geode->addDrawable(coneDrawable); @@ -94,7 +94,7 @@ void TranslateAxisDragger::setupDefaultGeometry() // Create an invisible cylinder for picking the line. { _cylinder = new osg::Cylinder (osg::Vec3(0.0f,0.0f,0.5f), _pickCylinderRadius, 1.0f); - osg::Drawable* geometry = new osg::ShapeDrawable(_cylinder); + osg::Drawable* geometry = new osg::ShapeDrawable(_cylinder.get()); setDrawableToAlwaysCull(*geometry); geode->addDrawable(geometry); }