#include <osgDB/Registry>
#include <simgear/compiler.h>
-#include <simgear/structure/Singleton.hxx>
+#include <simgear/scene/util/OsgSingleton.hxx>
#include <string>
#include <map>
}
virtual osgDB::ReaderWriter::ReadResult
readNode(const std::string& fileName,
- const osgDB::ReaderWriter::Options* opt)
+ const osgDB::Options* opt)
{
using namespace osg;
using namespace osgDB;
_bvhPolicy.buildBVH(fileName, optimizedNode.get());
_cachePolicy.addToCache(fileName, optimizedNode.get());
}
- return ReaderWriter::ReadResult(optimizedNode);
+ return ReaderWriter::ReadResult(optimizedNode.get());
}
protected:
static osgDB::ReaderWriter::ReadResult
loadUsingReaderWriter(const std::string& fileName,
- const osgDB::ReaderWriter::Options* opt)
+ const osgDB::Options* opt)
{
using namespace osgDB;
ReaderWriter* rw = Registry::instance()
struct DefaultProcessPolicy {
DefaultProcessPolicy(const std::string& extension) {}
osg::Node* process(osg::Node* node, const std::string& filename,
- const osgDB::ReaderWriter::Options* opt);
+ const osgDB::Options* opt);
};
struct DefaultCachePolicy {
DefaultCachePolicy(const std::string& extension) {}
osg::Node* find(const std::string& fileName,
- const osgDB::ReaderWriter::Options* opt);
+ const osgDB::Options* opt);
void addToCache(const std::string& filename, osg::Node* node);
};
struct NoCachePolicy {
NoCachePolicy(const std::string& extension) {}
osg::Node* find(const std::string& fileName,
- const osgDB::ReaderWriter::Options* opt)
+ const osgDB::Options* opt)
{
return 0;
}
public:
OptimizeModelPolicy(const std::string& extension);
osg::Node* optimize(osg::Node* node, const std::string& fileName,
- const osgDB::ReaderWriter::Options* opt);
+ const osgDB::Options* opt);
protected:
unsigned _osgOptions;
};
struct NoOptimizePolicy {
NoOptimizePolicy(const std::string& extension) {}
osg::Node* optimize(osg::Node* node, const std::string& fileName,
- const osgDB::ReaderWriter::Options* opt)
+ const osgDB::Options* opt)
{
return node;
}
struct OSGSubstitutePolicy {
OSGSubstitutePolicy(const std::string& extension) {}
std::string substitute(const std::string& name,
- const osgDB::ReaderWriter::Options* opt);
+ const osgDB::Options* opt);
};
struct NoSubstitutePolicy {
NoSubstitutePolicy(const std::string& extension) {}
std::string substitute(const std::string& name,
- const osgDB::ReaderWriter::Options* opt)
+ const osgDB::Options* opt)
{
return std::string();
}
ModelRegistry();
virtual osgDB::ReaderWriter::ReadResult
readImage(const std::string& fileName,
- const osgDB::ReaderWriter::Options* opt);
+ const osgDB::Options* opt);
virtual osgDB::ReaderWriter::ReadResult
readNode(const std::string& fileName,
- const osgDB::ReaderWriter::Options* opt);
+ const osgDB::Options* opt);
void addImageCallbackForExtension(const std::string& extension,
osgDB::Registry::ReadFileCallback*
callback);