This has changed in osg, so reflect that here.
buildEffectProperties(options);
}
-SGMaterial::SGMaterial( const osgDB::ReaderWriter::Options* options,
+SGMaterial::SGMaterial( const osgDB::Options* options,
const SGPropertyNode *props,
SGPropertyNode *prop_root)
{
* state information for the material. This node is usually
* loaded from the $FG_ROOT/materials.xml file.
*/
- SGMaterial( const osgDB::ReaderWriter::Options*,
+ SGMaterial( const osgDB::Options*,
const SGPropertyNode *props,
SGPropertyNode *prop_root);
<< ex.getMessage() );
throw;
}
- osg::ref_ptr<osgDB::ReaderWriter::Options> options
- = new osgDB::ReaderWriter::Options;
- options->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_ALL);
+ osg::ref_ptr<osgDB::Options> options
+ = new osgDB::Options;
+ options->setObjectCacheHint(osgDB::Options::CACHE_ALL);
options->setDatabasePath(fg_root);
int nMaterials = materials.nChildren();
for (int i = 0; i < nMaterials; i++) {
} // namespace
Node* DefaultProcessPolicy::process(Node* node, const string& filename,
- const ReaderWriter::Options* opt)
+ const Options* opt)
{
TextureNameVisitor nameVisitor;
node->accept(nameVisitor);
ReaderWriter::ReadResult
ModelRegistry::readImage(const string& fileName,
- const ReaderWriter::Options* opt)
+ const Options* opt)
{
CallbackMap::iterator iter
= imageCallbackMap.find(getFileExtension(fileName));
osg::Node* DefaultCachePolicy::find(const string& fileName,
- const ReaderWriter::Options* opt)
+ const Options* opt)
{
Registry* registry = Registry::instance();
osg::Node* cached
osg::Node* OptimizeModelPolicy::optimize(osg::Node* node,
const string& fileName,
- const osgDB::ReaderWriter::Options* opt)
+ const osgDB::Options* opt)
{
osgUtil::Optimizer optimizer;
optimizer.optimize(node, _osgOptions);
}
string OSGSubstitutePolicy::substitute(const string& name,
- const ReaderWriter::Options* opt)
+ const Options* opt)
{
string fileSansExtension = getNameLessExtension(name);
string osgFileName = fileSansExtension + ".osg";
ReaderWriter::ReadResult
ModelRegistry::readNode(const string& fileName,
- const ReaderWriter::Options* opt)
+ const Options* opt)
{
ReaderWriter::ReadResult res;
CallbackMap::iterator iter
Referenced::setThreadSafeReferenceCounting(true);
Registry* registry = Registry::instance();
- ReaderWriter::Options* options = new ReaderWriter::Options;
- int cacheOptions = ReaderWriter::Options::CACHE_ALL;
+ Options* options = new Options;
+ int cacheOptions = Options::CACHE_ALL;
options->
- setObjectCacheHint((ReaderWriter::Options::CacheHintOptions)cacheOptions);
+ setObjectCacheHint((Options::CacheHintOptions)cacheOptions);
registry->setOptions(options);
registry->getOrCreateSharedStateManager()->
setShareMode(SharedStateManager::SHARE_STATESETS);
_osgOptions &= ~Optimizer::TRISTRIP_GEOMETRY;
}
Node* optimize(Node* node, const string& fileName,
- const ReaderWriter::Options* opt)
+ const Options* opt)
{
ref_ptr<Node> optimized
= OptimizeModelPolicy::optimize(node, fileName, opt);
struct ACProcessPolicy {
ACProcessPolicy(const string& extension) {}
Node* process(Node* node, const string& filename,
- const ReaderWriter::Options* opt)
+ const Options* opt)
{
Matrix m(1, 0, 0, 0,
0, 0, 1, 0,
}
virtual osgDB::ReaderWriter::ReadResult
readNode(const std::string& fileName,
- const osgDB::ReaderWriter::Options* opt)
+ const osgDB::Options* opt)
{
using namespace osg;
using namespace osgDB;
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);
SGMaterialAnimation::SGMaterialAnimation(const SGPropertyNode* configNode,
SGPropertyNode* modelRoot,
- const osgDB::ReaderWriter::Options*
+ const osgDB::Options*
options) :
SGAnimation(configNode, modelRoot),
texturePathList(options->getDatabasePathList())
public:
SGMaterialAnimation(const SGPropertyNode* configNode,
SGPropertyNode* modelRoot,
- const osgDB::ReaderWriter::Options* options);
+ const osgDB::Options* options);
virtual osg::Group* createAnimationGroup(osg::Group& parent);
virtual void install(osg::Node& node);
static SGPropertyNode_ptr makeEffectProperties(const SGPropertyNode* animProp);
static osg::Node *
sgLoad3DModel_internal(const SGPath& path,
- const osgDB::ReaderWriter::Options* options,
+ const osgDB::Options* options,
SGPropertyNode *overlay = 0);
osgDB::ReaderWriter::ReadResult
SGReaderWriterXML::readNode(const std::string& fileName,
- const osgDB::ReaderWriter::Options* options) const
+ const osgDB::Options* options) const
{
osg::Node *result=0;
try {
static osg::Node *
sgLoad3DModel_internal(const SGPath& path,
- const osgDB::ReaderWriter::Options* options_,
+ const osgDB::Options* options_,
SGPropertyNode *overlay)
{
if (!path.exists()) {
virtual const char* className() const;
virtual ReadResult readNode(const std::string& fileName,
- const osgDB::ReaderWriter::Options* options)
+ const osgDB::Options* options)
const;
};
}
osg::Node * SGText::appendText(const SGPropertyNode* configNode,
- SGPropertyNode* modelRoot, const osgDB::ReaderWriter::Options* options)
+ SGPropertyNode* modelRoot, const osgDB::Options* options)
{
SGConstPropertyNode_ptr p;
class SGText : public osg::NodeCallback
{
public:
- static osg::Node * appendText(const SGPropertyNode* configNode, SGPropertyNode* modelRoot, const osgDB::ReaderWriter::Options* options);
+ static osg::Node * appendText(const SGPropertyNode* configNode, SGPropertyNode* modelRoot, const osgDB::Options* options);
private:
class UpdateCallback;
};
bool
SGAnimation::animate(osg::Node* node, const SGPropertyNode* configNode,
SGPropertyNode* modelRoot,
- const osgDB::ReaderWriter::Options* options)
+ const osgDB::Options* options)
{
std::string type = configNode->getStringValue("type", "none");
if (type == "alpha-test") {
static bool animate(osg::Node* node, const SGPropertyNode* configNode,
SGPropertyNode* modelRoot,
- const osgDB::ReaderWriter::Options* options);
+ const osgDB::Options* options);
protected:
void apply(osg::Node* node);
public:
SGShaderAnimation(const SGPropertyNode* configNode,
SGPropertyNode* modelRoot,
- const osgDB::ReaderWriter::Options* options);
+ const osgDB::Options* options);
virtual osg::Group* createAnimationGroup(osg::Group& parent);
private:
class UpdateCallback;
osg::Texture2D*
SGLoadTexture2D(bool staticTexture, const std::string& path,
- const osgDB::ReaderWriter::Options* options,
+ const osgDB::Options* options,
bool wrapu, bool wrapv, int)
{
osg::Image* image;
osg::Texture2D*
SGLoadTexture2D(bool staticTexture, const std::string& path,
- const osgDB::ReaderWriter::Options* options = 0,
+ const osgDB::Options* options = 0,
bool wrapu = true, bool wrapv = true, int mipmaplevels = -1);
inline osg::Texture2D*
SGLoadTexture2D(const std::string& path,
- const osgDB::ReaderWriter::Options* options = 0,
+ const osgDB::Options* options = 0,
bool wrapu = true, bool wrapv = true, int mipmaplevels = -1)
{
return SGLoadTexture2D(true, path, options, wrapu, wrapv, mipmaplevels);
inline osg::Texture2D*
SGLoadTexture2D(const SGPath& path,
- const osgDB::ReaderWriter::Options* options = 0,
+ const osgDB::Options* options = 0,
bool wrapu = true, bool wrapv = true,
int mipmaplevels = -1)
{
inline osg::Texture2D*
SGLoadTexture2D(bool staticTexture, const SGPath& path,
- const osgDB::ReaderWriter::Options* options = 0,
+ const osgDB::Options* options = 0,
bool wrapu = true, bool wrapv = true,
int mipmaplevels = -1)
{
}
std::string SGModelLib::findDataFile(const std::string& file,
- const osgDB::ReaderWriter::Options* opts,
+ const osgDB::Options* opts,
SGPath currentPath)
{
if (file.empty())
if (SGPath(path).lower_extension() == "ac")
opt->setInstantiateEffects(true);
if (!prop_root || prop_root->getBoolValue("/sim/rendering/cache", true))
- opt->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_ALL);
+ opt->setObjectCacheHint(osgDB::Options::CACHE_ALL);
else
- opt->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_NONE);
+ opt->setObjectCacheHint(osgDB::Options::CACHE_NONE);
proxyNode->setDatabaseOptions(opt.get());
return proxyNode;
if (SGPath(path).lower_extension() == "ac")
opt->setInstantiateEffects(true);
if (!prop_root || prop_root->getBoolValue("/sim/rendering/cache", true))
- opt->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_ALL);
+ opt->setObjectCacheHint(osgDB::Options::CACHE_ALL);
else
- opt->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_NONE);
+ opt->setObjectCacheHint(osgDB::Options::CACHE_NONE);
plod->setDatabaseOptions(opt.get());
return plod;
}
SGModelData *data=0);
static std::string findDataFile(const std::string& file,
- const osgDB::ReaderWriter::Options* opts = NULL,
+ const osgDB::Options* opts = NULL,
SGPath currentDir = SGPath());
protected:
SGModelLib();
osg::Group * Particles::appendParticles(const SGPropertyNode* configNode,
SGPropertyNode* modelRoot,
- const osgDB::ReaderWriter::Options*
+ const osgDB::Options*
options)
{
SG_LOG(SG_GENERAL, SG_DEBUG, "Setting up a particle system!\n");
public:
Particles();
- static osg::Group * appendParticles(const SGPropertyNode* configNode, SGPropertyNode* modelRoot, const osgDB::ReaderWriter::Options* options);
+ static osg::Group * appendParticles(const SGPropertyNode* configNode, SGPropertyNode* modelRoot, const osgDB::Options* options);
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv);
SGShaderAnimation::SGShaderAnimation(const SGPropertyNode* configNode,
SGPropertyNode* modelRoot,
- const osgDB::ReaderWriter::Options*
+ const osgDB::Options*
options) :
SGAnimation(configNode, modelRoot)
{
{
osg::StateSet *stateSet = new osg::StateSet;
- osg::ref_ptr<osgDB::ReaderWriter::Options> options
+ osg::ref_ptr<osgDB::Options> options
= makeOptionsFromPath(path);
stateSet->setTextureAttribute(0, SGLoadTexture2D(colorTexture,
options.get()));
stateSet->setRenderBinDetails(-5, "RenderBin");
// set up the orb state
- osg::ref_ptr<osgDB::ReaderWriter::Options> options
+ osg::ref_ptr<osgDB::Options> options
= makeOptionsFromPath(path);
osg::Texture2D* texture = SGLoadTexture2D("moon.png", options.get());
"texture"),
"image"),
texture);
- ref_ptr<osgDB::ReaderWriter::Options> options
+ ref_ptr<osgDB::Options> options
= makeOptionsFromPath(texture_root);
ref_ptr<SGReaderWriterOptions> sgOptions
= new SGReaderWriterOptions(*options.get());
env_node = property_tree_Node;
- osg::ref_ptr<osgDB::ReaderWriter::Options> options
+ osg::ref_ptr<osgDB::Options> options
= makeOptionsFromPath(path);
// build the ssg scene graph sub tree for the sky and connected
// into the provide scene graph branch
osgDB::ReaderWriter::ReadResult
ReaderWriterSTG::readNode(const std::string& fileName,
- const osgDB::ReaderWriter::Options* options) const
+ const osgDB::Options* options) const
{
osg::Node* result = TileEntry::loadTileByFileName(fileName, options);
// For debugging race conditions
virtual const char* className() const;
virtual ReadResult readNode(const std::string& fileName,
- const osgDB::ReaderWriter::Options* options)
+ const osgDB::Options* options)
const;
};
osgDB::ReaderWriter::ReadResult
SGReaderWriterBTG::readNode(const std::string& fileName,
- const osgDB::ReaderWriter::Options* options) const
+ const osgDB::Options* options) const
{
const SGReaderWriterOptions* sgOptions;
sgOptions = dynamic_cast<const SGReaderWriterOptions*>(options);
virtual bool acceptsExtension(const std::string& /*extension*/) const;
virtual ReadResult readNode(const std::string& fileName,
- const osgDB::ReaderWriter::Options* options)
+ const osgDB::Options* options)
const;
};
}
bool TileEntry::obj_load(const string& path, osg::Group *geometry, bool is_base,
- const osgDB::ReaderWriter::Options* options)
+ const osgDB::Options* options)
{
osg::Node* node = osgDB::readNodeFile(path, options);
if (node)
osg::Node*
TileEntry::loadTileByFileName(const string& fileName,
- const osgDB::ReaderWriter::Options* options)
+ const osgDB::Options* options)
{
std::string index_str = osgDB::getNameLessExtension(fileName);
index_str = osgDB::getSimpleFileName(index_str);
static bool obj_load( const std::string& path,
osg::Group* geometry,
bool is_base,
- const osgDB::ReaderWriter::Options* options);
+ const osgDB::Options* options);
/**
* This value is used by the tile scheduler/loader to load tiles
* Transition to OSG database pager
*/
static osg::Node* loadTileByFileName(const std::string& index_str,
- const osgDB::ReaderWriter::Options*);
+ const osgDB::Options*);
/**
* Return true if the tile entry is loaded, otherwise return false
* indicating that the loading thread is still working on this.
using namespace simgear;
-osgDB::ReaderWriter::Options* simgear::makeOptionsFromPath(const SGPath& path)
+osgDB::Options* simgear::makeOptionsFromPath(const SGPath& path)
{
using namespace osgDB;
- ReaderWriter::Options *options
- = new ReaderWriter::Options(*(Registry::instance()->getOptions()));
+ Options *options
+ = new Options(*(Registry::instance()->getOptions()));
options->setDatabasePath(path.str());
return options;
}
namespace simgear
{
-osgDB::ReaderWriter::Options* makeOptionsFromPath(const SGPath&);
+osgDB::Options* makeOptionsFromPath(const SGPath&);
}
#endif
_instantiateEffects(false)
{ }
SGReaderWriterOptions(const std::string& str) :
- osgDB::ReaderWriter::Options(str),
+ osgDB::Options(str),
_materialLib(0),
_load_panel(0),
_model_data(0),
{ }
SGReaderWriterOptions(const osgDB::Options& options,
const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY) :
- osgDB::ReaderWriter::Options(options, copyop),
+ osgDB::Options(options, copyop),
_materialLib(0),
_load_panel(0),
_model_data(0),
{ }
SGReaderWriterOptions(const SGReaderWriterOptions& options,
const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY) :
- osgDB::ReaderWriter::Options(options, copyop),
+ osgDB::Options(options, copyop),
_propertyNode(options._propertyNode),
_materialLib(options._materialLib),
_load_panel(options._load_panel),