Changed build OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION to ON and then fixed all the resulting build errors.

This commit is contained in:
Robert Osfield 2009-06-17 10:39:39 +00:00
parent 7c4225e574
commit ad8f2d8974
17 changed files with 48 additions and 48 deletions

View File

@ -1710,7 +1710,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterP3DXML::readNode(const std::string&
input.open(fileName);
input.readAllDataIntoBuffer();
return readNode(input, local_opt);
return readNode(input, local_opt.get());
}
osgDB::ReaderWriter::ReadResult ReaderWriterP3DXML::readNode(std::istream& fin, const Options* options) const
@ -1723,7 +1723,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterP3DXML::readNode(std::istream& fin,
//local_opt->setFindFileCallback(new MyFindFileCallback);
local_opt->setReadFileCallback(new MyReadFileCallback);
return readNode(input, local_opt);
return readNode(input, local_opt.get());
}
osgDB::ReaderWriter::ReadResult ReaderWriterP3DXML::readNode(osgDB::XmlNode::Input& input, osgDB::ReaderWriter::Options* options) const

View File

@ -93,7 +93,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterPaths::readObject(const std::string&
std::ifstream input(fileName.c_str());
return readObject(input, local_opt);
return readObject(input, local_opt.get());
}
osgDB::ReaderWriter::ReadResult ReaderWriterPaths::readObject(std::istream& fin, const osgDB::Options* options) const
@ -234,12 +234,12 @@ osgDB::ReaderWriter::ReadResult ReaderWriterPaths::read_rotation_path(std::istre
localValue.azim = currValue.azim *r + prevValue.azim * (1.0f-r);
localValue.elevation = currValue.elevation *r + prevValue.elevation * (1.0f-r);
localValue.addToPath(animation);
localValue.addToPath(animation.get());
}
}
else
{
currValue.addToPath(animation);
currValue.addToPath(animation.get());
}
prevValue = currValue;
first = false;

View File

@ -68,7 +68,7 @@ osg::Shader * VirtualProgram::setShader
shaderCurrent = shaderNew;
}
return shaderCurrent;
return shaderCurrent.release();
}
////////////////////////////////////////////////////////////////////////////////
void VirtualProgram::apply( osg::State & state ) const
@ -170,7 +170,7 @@ void VirtualProgram::apply( osg::State & state ) const
#endif
}
state.applyAttribute( program );
state.applyAttribute( program.get() );
} else {
Program::apply( state );
}

View File

@ -93,14 +93,14 @@ public:
// osg::notify(osg::NOTICE)<<"LoadAndCompileOperation "<<_filename<<std::endl;
_loadedModel = osgDB::readNodeFile(_filename);
if (_loadedModel.valid() && _incrementalCompileOperation.valid())
{
osg::ref_ptr<osgUtil::IncrementalCompileOperation::CompileSet> compileSet =
new osgUtil::IncrementalCompileOperation::CompileSet(_loadedModel);
new osgUtil::IncrementalCompileOperation::CompileSet(_loadedModel.get());
compileSet->_compileCompletedCallback = new ReleaseBlockOnCompileCompleted(_block.get());
_incrementalCompileOperation->add(compileSet.get());
}
else

View File

@ -36,7 +36,7 @@ namespace osgAnimation
StatsActionVisitor(osg::Stats* stats, unsigned int frame);
void reset();
const std::vector<std::string>& getChannels() const { return _channels; }
osg::Stats* getStats() { return _stats; }
osg::Stats* getStats() { return _stats.get(); }
void setStats(osg::Stats* stats) { _stats = stats; }
void setFrame(unsigned int frame) { _frame = frame; }
void apply(Timeline& action);

View File

@ -105,7 +105,7 @@ class OSGDB_EXPORT DatabaseRevisions : public osg::Object
void addRevision(DatabaseRevision* revision);
void removeRevision(DatabaseRevision* revision);
DatabaseRevision* getDatabaseRevision(unsigned int i) { return i<_revisionList.size() ? _revisionList[i] : 0; }
DatabaseRevision* getDatabaseRevision(unsigned int i) { return i<_revisionList.size() ? _revisionList[i].get() : 0; }
DatabaseRevisionList& getDatabaseRevisionList() { return _revisionList; }
const DatabaseRevisionList& getDatabaseRevisionList() const { return _revisionList; }

View File

@ -26,7 +26,7 @@ osgAnimation::Action::Callback* osgAnimation::Action::getFrameCallback(unsigned
{
if (_framesCallback.find(frame) != _framesCallback.end())
{
return _framesCallback[frame];
return _framesCallback[frame].get();
}
return 0;
}

View File

@ -146,7 +146,7 @@ void osgAnimation::ClearActionVisitor::apply(Timeline& tm)
_remove.clear();
tm.traverse(*this);
for (int i = 0; i < (int)_remove.size(); i++)
tm.removeAction(_remove[i]);
tm.removeAction(_remove[i].get());
}
void osgAnimation::ClearActionVisitor::apply(Action& action)
{

View File

@ -377,7 +377,7 @@ struct ValueTextDrawCallback : public virtual osg::Drawable::DrawCallback
timeLabelValue->setPosition(pos + osg::Vec3(startBlocks, 0,0));
timeLabelValue->setText("0.0");
timeLabelValue->setDrawCallback(new ValueTextDrawCallback(stats,"Timeline"));
timeLabelValue->setDrawCallback(new ValueTextDrawCallback(stats.get(),"Timeline"));
}
}
{
@ -389,11 +389,11 @@ struct ValueTextDrawCallback : public virtual osg::Drawable::DrawCallback
_statsWidth - 2 * backgroundMargin,
(3 + 4.5 * 1) * characterSize + 2 * backgroundMargin,
backgroundColor);
geode->addDrawable(_background);
geode->addDrawable(_background.get());
_group->addChild(geode);
}
return _group;
return _group.get();
}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
@ -435,7 +435,7 @@ struct ValueTextDrawCallback : public virtual osg::Drawable::DrawCallback
if (_actions.find(name) == _actions.end()) {
osg::Vec4 color(getRandomValueinRange(255)/255.0, getRandomValueinRange(255)/255.0, getRandomValueinRange(255)/255.0, 1.0);
_actions[name].init(visitor->getStats(), name, pos, width, height, color);
_group->addChild(_actions[name]._group);
_group->addChild(_actions[name]._group.get());
//_actions[name].touch();
} else {
_actions[name].setPosition(pos);
@ -624,7 +624,7 @@ void StatsHandler::setUpHUDCamera(osgViewer::ViewerBase* viewer)
_camera->setAllowEventFocus(false);
_camera->setCullMask(0x1);
osgViewer::Viewer* v = dynamic_cast<osgViewer::Viewer*>(viewer);
v->getSceneData()->asGroup()->addChild(_camera);
v->getSceneData()->asGroup()->addChild(_camera.get());
_initialized = true;
}
@ -647,11 +647,11 @@ void StatsHandler::setUpScene(osgViewer::Viewer* viewer)
_group = new osg::Group;
_camera->addChild(_switch.get());
_switch->addChild(_group);
_switch->addChild(_group.get());
for (int i = 0; i < (int)finder._timelines.size(); i++) {
StatsTimeline* s = new StatsTimeline;
osg::MatrixTransform* m = s->createStatsForTimeline(finder._timelines[i]);
osg::MatrixTransform* m = s->createStatsForTimeline(finder._timelines[i].get());
m->setUpdateCallback(s);
_group->addChild(m);
}
@ -671,7 +671,7 @@ void StatAction::init(osg::Stats* stats, const std::string& name, const osg::Vec
_label = new osg::Geode;
_textLabel = new osgText::Text;
_label->addDrawable(_textLabel);
_label->addDrawable(_textLabel.get());
_textLabel->setDataVariance(osg::Object::DYNAMIC);
_textLabel->setColor(color);
_textLabel->setFont(font);
@ -684,8 +684,8 @@ void StatAction::init(osg::Stats* stats, const std::string& name, const osg::Vec
graph->addStatGraph(stats, stats, color, 1.0, name);
_graph = graph;
_group->addChild(_label);
_group->addChild(_graph);
_group->addChild(_label.get());
_group->addChild(_graph.get());
}
void StatAction::setAlpha(float v)
{

View File

@ -71,9 +71,9 @@ void osgAnimation::Timeline::traverse(ActionVisitor& visitor)
void osgAnimation::Timeline::setStats(osg::Stats* stats) { _stats = stats;}
osg::Stats* osgAnimation::Timeline::getStats() { return _stats;}
osg::Stats* osgAnimation::Timeline::getStats() { return _stats.get();}
void osgAnimation::Timeline::collectStats(bool state) { _collectStats = state;}
osgAnimation::StatsActionVisitor* osgAnimation::Timeline::getStatsVisitor() { return _statsVisitor; }
osgAnimation::StatsActionVisitor* osgAnimation::Timeline::getStatsVisitor() { return _statsVisitor.get(); }
void osgAnimation::Timeline::clearActions()
{
@ -98,7 +98,7 @@ void osgAnimation::Timeline::update(double simulationTime)
{
if (!_statsVisitor)
_statsVisitor = new osgAnimation::StatsActionVisitor();
_statsVisitor->setStats(_stats);
_statsVisitor->setStats(_stats.get());
_statsVisitor->setFrame(_currentFrame);
_statsVisitor->reset();
accept(*_statsVisitor);
@ -123,7 +123,7 @@ void osgAnimation::Timeline::update(double simulationTime)
{
if (!_statsVisitor)
_statsVisitor = new StatsActionVisitor;
_statsVisitor->setStats(_stats);
_statsVisitor->setStats(_stats.get());
_statsVisitor->setFrame(_currentFrame);
_statsVisitor->reset();
accept(*_statsVisitor);

View File

@ -161,7 +161,7 @@ osg::Node* daeReader::processVisualScene( domVisual_scene *scene )
}
}
}
retVal->setStateSet(_rootStateSet);
retVal->setStateSet(_rootStateSet.get());
return retVal;
}

View File

@ -1710,7 +1710,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterP3DXML::readNode(const std::string&
input.open(fileName);
input.readAllDataIntoBuffer();
return readNode(input, local_opt);
return readNode(input, local_opt.get());
}
osgDB::ReaderWriter::ReadResult ReaderWriterP3DXML::readNode(std::istream& fin, const Options* options) const
@ -1723,7 +1723,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterP3DXML::readNode(std::istream& fin,
//local_opt->setFindFileCallback(new MyFindFileCallback);
local_opt->setReadFileCallback(new MyReadFileCallback);
return readNode(input, local_opt);
return readNode(input, local_opt.get());
}
osgDB::ReaderWriter::ReadResult ReaderWriterP3DXML::readNode(osgDB::XmlNode::Input& input, osgDB::ReaderWriter::Options* options) const

View File

@ -93,7 +93,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterPaths::readObject(const std::string&
std::ifstream input(fileName.c_str());
return readObject(input, local_opt);
return readObject(input, local_opt.get());
}
osgDB::ReaderWriter::ReadResult ReaderWriterPaths::readObject(std::istream& fin, const osgDB::Options* options) const
@ -234,12 +234,12 @@ osgDB::ReaderWriter::ReadResult ReaderWriterPaths::read_rotation_path(std::istre
localValue.azim = currValue.azim *r + prevValue.azim * (1.0f-r);
localValue.elevation = currValue.elevation *r + prevValue.elevation * (1.0f-r);
localValue.addToPath(animation);
localValue.addToPath(animation.get());
}
}
else
{
currValue.addToPath(animation);
currValue.addToPath(animation.get());
}
prevValue = currValue;
first = false;

View File

@ -126,15 +126,15 @@ class ReaderWriterFreeType : public osgDB::ReaderWriter
if (ext=="added")
{
dbRevision->setFilesAdded(fileList);
dbRevision->setFilesAdded(fileList.get());
}
else if (ext=="removed")
{
dbRevision->setFilesRemoved(fileList);
dbRevision->setFilesRemoved(fileList.get());
}
else if (ext=="modified")
{
dbRevision->setFilesModified(fileList);
dbRevision->setFilesModified(fileList.get());
}
}
}
@ -144,7 +144,7 @@ class ReaderWriterFreeType : public osgDB::ReaderWriter
itr != revisionMap.end();
++itr)
{
revisions->addRevision(itr->second);
revisions->addRevision(itr->second.get());
}
return revisions.get();

View File

@ -214,7 +214,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterVRML2::readNode(const std::string &f
for (unsigned i = 0; i < mfn.size(); i++)
{
openvrml::node *vrml_node = mfn[i].get();
osg_root->addChild(convertFromVRML(vrml_node).get());
osg_root->addChild(convertFromVRML(vrml_node));
}
osgDB::getDataFilePathList().pop_front();
return osg_root.get();
@ -225,7 +225,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterVRML2::readNode(const std::string &f
catch (std::invalid_argument) { return ReadResult::FILE_NOT_HANDLED; }
}
osg::ref_ptr<osg::Node> ReaderWriterVRML2::convertFromVRML(openvrml::node *obj) const
osg::Node* ReaderWriterVRML2::convertFromVRML(openvrml::node *obj) const
{
//static int osgLightNum = 0; //light
@ -285,7 +285,7 @@ osg::ref_ptr<osg::Node> ReaderWriterVRML2::convertFromVRML(openvrml::node *obj)
for (it_npv = node_ptr_vector.begin(); it_npv != node_ptr_vector.end(); it_npv++)
{
openvrml::node *node = (*(it_npv)).get();
osg_m->addChild(convertFromVRML(node).get());
osg_m->addChild(convertFromVRML(node));
}
}
}
@ -294,7 +294,7 @@ osg::ref_ptr<osg::Node> ReaderWriterVRML2::convertFromVRML(openvrml::node *obj)
// no children
}
return osg_m.get();
return osg_m.release();
}
@ -467,7 +467,7 @@ osg::ref_ptr<osg::Node> ReaderWriterVRML2::convertFromVRML(openvrml::node *obj)
}
}
return osg_geode.get();
return osg_geode.release();
}
else
{

View File

@ -83,7 +83,7 @@ private:
typedef std::map<QuadricKey, osg::ref_ptr<osg::Geometry> > ConeLibrary;
typedef std::map<QuadricKey, osg::ref_ptr<osg::Geometry> > CylinderLibrary;
osg::ref_ptr<osg::Node> convertFromVRML(openvrml::node *obj) const;
osg::Node* convertFromVRML(openvrml::node *obj) const;
osg::ref_ptr<osg::Geometry> convertVRML97IndexedFaceSet(openvrml::node *vrml_ifs) const;

View File

@ -71,7 +71,7 @@ class ReaderWriterZIP : public osgDB::ReaderWriter
local_opt->getDatabasePathList().push_front(osgDB::getFilePath(file));
// Now pass through to memory zip handler
rresult = readNode(tmpStrmBuffer,local_opt);
rresult = readNode(tmpStrmBuffer,local_opt.get());
// Clean up options
local_opt->getDatabasePathList().pop_front();
@ -81,7 +81,7 @@ class ReaderWriterZIP : public osgDB::ReaderWriter
return rresult;
}
virtual ReadResult readNode(std::istream& fin,const osgDB::Options* options =NULL) const
virtual ReadResult readNode(std::istream& fin,const osgDB::Options* options) const
{
ReadResult result = ReadResult(ReadResult::FILE_NOT_HANDLED);
@ -145,7 +145,7 @@ class ReaderWriterZIP : public osgDB::ReaderWriter
local_opt->setPluginStringData("STREAM_FILENAME",osgDB::getSimpleFileName(StreamName));
result = rw->readNode(buffer,local_opt);
result = rw->readNode(buffer,local_opt.get());
if (result.validNode())
{
grp->addChild( result.takeNode() );