Refactored the Registry::ReadFileCallback, WriteFileCallback and ReaderWriter::Options to they are now defined in their own header and in the osgDB namespace.

Introduced a new FindFileCallback to Registry to compliement the existing ReadFileCallback and WriteFileCallback.

Added support for assign Find, Read and WriteFileCallbacks to osdDB::Options to enable plugins/applications to override the callbacks just for that
read/write call and any nested file operations
This commit is contained in:
Robert Osfield
2009-05-09 08:49:27 +00:00
parent a4ff2c4af7
commit b7b065abe3
43 changed files with 1180 additions and 825 deletions

View File

@@ -68,7 +68,7 @@ class OSGDB_EXPORT Archive : public ReaderWriter
OSGDB_EXPORT Archive* openArchive(const std::string& filename, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint=4096);
/** Open an archive for reading or writing.*/
OSGDB_EXPORT Archive* openArchive(const std::string& filename, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint,ReaderWriter::Options* options);
OSGDB_EXPORT Archive* openArchive(const std::string& filename, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint,Options* options);
}
#endif // OSGDB_ARCHIVE

View File

@@ -28,7 +28,7 @@
#include <osgDB/SharedStateManager>
#include <osgDB/ReaderWriter>
#include <osgDB/Export>
#include <osgDB/Options>
#include <map>
#include <list>
@@ -70,7 +70,7 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
virtual void requestNodeFile(const std::string& fileName,osg::Group* group,
float priority, const osg::FrameStamp* framestamp,
osg::ref_ptr<osg::Referenced>& databaseRequest,
ReaderWriter::Options* loadOptions);
Options* loadOptions);
/** Set the priority of the database pager thread(s).*/
int setSchedulePriority(OpenThreads::Thread::ThreadPriority priority);
@@ -375,7 +375,7 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
osg::observer_ptr<osg::Group> _groupForAddingLoadedSubgraph;
osg::ref_ptr<osg::Node> _loadedModel;
DataToCompileMap _dataToCompileMap;
osg::ref_ptr<ReaderWriter::Options> _loadOptions;
osg::ref_ptr<Options> _loadOptions;
RequestQueue* _requestQueue;
bool isRequestCurrent (int frameNumber) const

View File

@@ -23,23 +23,23 @@ namespace osgDB {
class OSGDB_EXPORT FileCache : public osg::Referenced
{
public:
FileCache(const std::string& path);
const std::string& getFileCachePath() const { return _fileCachePath; }
virtual std::string createCacheFileName(const std::string& originalFileName) const;
virtual bool existsInCache(const std::string& originalFileName) const;
virtual ReaderWriter::ReadResult readNode(const std::string& originalFileName, const osgDB::ReaderWriter::Options* options, bool buildKdTreeIfRequired=true) const;
virtual ReaderWriter::WriteResult writeNode(const osg::Node& node, const std::string& originalFileName, const osgDB::ReaderWriter::Options* options) const;
virtual ReaderWriter::ReadResult readNode(const std::string& originalFileName, const osgDB::Options* options, bool buildKdTreeIfRequired=true) const;
virtual ReaderWriter::WriteResult writeNode(const osg::Node& node, const std::string& originalFileName, const osgDB::Options* options) const;
protected:
virtual ~FileCache();
std::string _fileCachePath;
};

View File

@@ -23,12 +23,6 @@
namespace osgDB {
enum CaseSensitivity
{
CASE_SENSITIVE,
CASE_INSENSITIVE
};
enum FileType
{
FILE_NOT_FOUND,
@@ -86,7 +80,7 @@ extern OSGDB_EXPORT std::string findDataFile(const std::string& filename,CaseSen
/** Search for specified file in file system, checking first the database path set in the Options structure, then the DataFilePathList for possible paths,
* returning the full path of the first valid file found, return an empty string if no string is found.
*/
extern OSGDB_EXPORT std::string findDataFile(const std::string& filename,const ReaderWriter::Options* options, CaseSensitivity caseSensitivity=CASE_SENSITIVE);
extern OSGDB_EXPORT std::string findDataFile(const std::string& filename,const Options* options, CaseSensitivity caseSensitivity=CASE_SENSITIVE);
inline void setLibraryFilePathList(const FilePathList& filepaths) { osgDB::Registry::instance()->setLibraryFilePathList(filepaths); }

View File

@@ -14,11 +14,11 @@
#ifndef OSGDB_IMAGEOPTIONS
#define OSGDB_IMAGEOPTIONS 1
#include <osgDB/ReaderWriter>
#include <osgDB/Options>
namespace osgDB {
class OSGDB_EXPORT ImageOptions : public osgDB::ReaderWriter::Options
class OSGDB_EXPORT ImageOptions : public osgDB::Options
{
public:
@@ -27,7 +27,7 @@ class OSGDB_EXPORT ImageOptions : public osgDB::ReaderWriter::Options
ImageOptions(const std::string& str);
ImageOptions(const ImageOptions& options,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
osgDB::ReaderWriter::Options(options,copyop),
osgDB::Options(options,copyop),
_sourceImageSamplingMode(options._sourceImageSamplingMode),
_sourceImageWindowMode(options._sourceImageWindowMode),
_sourceRatioWindow(options._sourceRatioWindow),

View File

@@ -23,6 +23,7 @@
#include <OpenThreads/Mutex>
#include <osgDB/ReaderWriter>
#include <osgDB/Options>
namespace osgDB
{
@@ -107,7 +108,7 @@ class OSGDB_EXPORT ImagePager : public osg::NodeVisitor::ImageRequestHandler
double _timeToMergeBy;
std::string _fileName;
osg::ref_ptr<ReaderWriter::Options> _loadOptions;
osg::ref_ptr<Options> _loadOptions;
osg::observer_ptr<osg::Object> _attachmentPoint;
int _attachmentIndex;
osg::ref_ptr<osg::Image> _loadedImage;

View File

@@ -23,6 +23,7 @@
#include <osgDB/FieldReaderIterator>
#include <osgDB/ReaderWriter>
#include <osgDB/Options>
#include <map>
#include <string>
@@ -39,8 +40,8 @@ class OSGDB_EXPORT Input : public FieldReaderIterator
Input();
virtual ~Input();
void setOptions(const ReaderWriter::Options* options) { _options = options; }
const ReaderWriter::Options* getOptions() const { return _options.get(); }
void setOptions(const Options* options) { _options = options; }
const Options* getOptions() const { return _options.get(); }
virtual osg::Object* readObjectOfType(const osg::Object& compObj);
virtual osg::Object* readObjectOfType(const basic_type_wrapper &btw);
@@ -87,7 +88,7 @@ class OSGDB_EXPORT Input : public FieldReaderIterator
typedef std::map< std::string, osg::ref_ptr<osg::Object> > UniqueIDToObjectMapping;
UniqueIDToObjectMapping _uniqueIDToObjectMap;
osg::ref_ptr<const ReaderWriter::Options> _options;
osg::ref_ptr<const Options> _options;
};

272
include/osgDB/Options Normal file
View File

@@ -0,0 +1,272 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGDB_OPTIONS
#define OSGDB_OPTIONS 1
#include <osgDB/AuthenticationMap>
#include <osgDB/ReaderWriter>
#include <deque>
#include <list>
#include <iosfwd>
namespace osgDB {
/** list of directories to search through which searching for files. */
typedef std::deque<std::string> FilePathList;
enum CaseSensitivity
{
CASE_SENSITIVE,
CASE_INSENSITIVE
};
// forward decare
class Options;
class OSGDB_EXPORT FindFileCallback : public virtual osg::Referenced
{
public:
virtual std::string findDataFile(const std::string& filename, const Options* options, CaseSensitivity caseSensitivity);
virtual std::string findLibraryFile(const std::string& filename, const Options* options, CaseSensitivity caseSensitivity);
protected:
virtual ~FindFileCallback() {}
};
class OSGDB_EXPORT ReadFileCallback : public virtual osg::Referenced
{
public:
virtual ReaderWriter::ReadResult openArchive(const std::string& filename,ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const Options* useObjectCache);
virtual ReaderWriter::ReadResult readObject(const std::string& filename, const Options* options);
virtual ReaderWriter::ReadResult readImage(const std::string& filename, const Options* options);
virtual ReaderWriter::ReadResult readHeightField(const std::string& filename, const Options* options);
virtual ReaderWriter::ReadResult readNode(const std::string& filename, const Options* options);
virtual ReaderWriter::ReadResult readShader(const std::string& filename, const Options* options);
protected:
virtual ~ReadFileCallback() {}
};
class OSGDB_EXPORT WriteFileCallback : public virtual osg::Referenced
{
public:
virtual ReaderWriter::WriteResult writeObject(const osg::Object& obj, const std::string& fileName,const Options* options);
virtual ReaderWriter::WriteResult writeImage(const osg::Image& obj, const std::string& fileName,const Options* options);
virtual ReaderWriter::WriteResult writeHeightField(const osg::HeightField& obj, const std::string& fileName,const Options* options);
virtual ReaderWriter::WriteResult writeNode(const osg::Node& obj, const std::string& fileName,const Options* options);
virtual ReaderWriter::WriteResult writeShader(const osg::Shader& obj, const std::string& fileName,const Options* options);
protected:
virtual ~WriteFileCallback() {}
};
/** Options base class used for passing options into plugins to control their operation.*/
class Options : public osg::Object
{
public:
/// bit mask for setting up which object types get cached by readObject/Image/HeightField/Node(filename) calls
enum CacheHintOptions
{ /// do not cache objects of any type
CACHE_NONE = 0,
/// cache nodes loaded via readNode(filename)
CACHE_NODES = 1<<0,
/// cache images loaded via readImage(filename)
CACHE_IMAGES = 1<<1,
/// cache heightfield loaded via readHeightField(filename)
CACHE_HEIGHTFIELDS = 1<<2,
/// cache heightfield loaded via readHeightField(filename)
CACHE_ARCHIVES = 1<<3,
/// cache objects loaded via readObject(filename)
CACHE_OBJECTS = 1<<4,
/// cache shaders loaded via readShader(filename)
CACHE_SHADERS = 1<<5,
/// cache on all read*(filename) calls
CACHE_ALL = CACHE_NODES |
CACHE_IMAGES |
CACHE_HEIGHTFIELDS |
CACHE_ARCHIVES |
CACHE_OBJECTS |
CACHE_SHADERS
};
/// range of options of whether to build kdtrees automatically on loading
enum BuildKdTreesHint
{
NO_PREFERENCE,
DO_NOT_BUILD_KDTREES,
BUILD_KDTREES
};
Options():
osg::Object(true),
_objectCacheHint(CACHE_ARCHIVES),
_buildKdTreesHint(NO_PREFERENCE) {}
Options(const std::string& str):
osg::Object(true),
_str(str),
_objectCacheHint(CACHE_ARCHIVES),
_buildKdTreesHint(NO_PREFERENCE) {}
Options(const Options& options,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
osg::Object(options,copyop),
_str(options._str),
_databasePaths(options._databasePaths),
_objectCacheHint(options._objectCacheHint),
_buildKdTreesHint(options._buildKdTreesHint),
_pluginData(options._pluginData),
_pluginStringData(options._pluginStringData){}
META_Object(osgDB,Options);
/** Set the general Options string.*/
void setOptionString(const std::string& str) { _str = str; }
/** Get the general Options string.*/
const std::string& getOptionString() const { return _str; }
/** Set the database path to use a hint of where to look when loading models.*/
void setDatabasePath(const std::string& str) { _databasePaths.clear(); _databasePaths.push_back(str); }
/** Get the database path which is used a hint of where to look when loading models.*/
FilePathList& getDatabasePathList() { return _databasePaths; }
/** Get the const database path which is used a hint of where to look when loading models.*/
const FilePathList& getDatabasePathList() const { return _databasePaths; }
/** Set whether the Registry::ObjectCache should be used by default.*/
void setObjectCacheHint(CacheHintOptions useObjectCache) { _objectCacheHint = useObjectCache; }
/** Get whether the Registry::ObjectCache should be used by default.*/
CacheHintOptions getObjectCacheHint() const { return _objectCacheHint; }
/** Set whether the KdTrees should be built for geometry in the loader model. */
void setBuildKdTreesHint(BuildKdTreesHint hint) { _buildKdTreesHint = hint; }
/** Get whether the KdTrees should be built for geometry in the loader model. */
BuildKdTreesHint getBuildKdTreesHint() const { return _buildKdTreesHint; }
/** Set the password map to be used by plugins when access files from secure locations.*/
void setAuthenticationMap(AuthenticationMap* authenticationMap) { _authenticationMap = authenticationMap; }
/** Get the password map to be used by plugins when access files from secure locations.*/
const AuthenticationMap* getAuthenticationMap() const { return _authenticationMap.get(); }
/** Sets a plugindata value PluginData with a string */
void setPluginData(const std::string& s, void* v) const { _pluginData[s] = v; }
/** Get a value from the PluginData */
void* getPluginData(const std::string& s) { return _pluginData[s]; }
/** Get a value from the PluginData */
const void* getPluginData(const std::string& s) const
{
PluginDataMap::const_iterator itr = _pluginData.find(s);
return (itr == _pluginData.end()) ? 0 : itr->second;
}
/** Remove a value from the PluginData */
void removePluginData(const std::string& s) const { _pluginData.erase(s); }
/** Sets a plugindata value PluginData with a string */
void setPluginStringData(const std::string& s, const std::string& v) const { _pluginStringData[s] = v; }
/** Get a string from the PluginStrData */
std::string getPluginStringData(const std::string& s) { return _pluginStringData[s]; }
/** Get a value from the PluginData */
const std::string getPluginStringData(const std::string& s) const
{
PluginStringDataMap::const_iterator itr = _pluginStringData.find(s);
return (itr == _pluginStringData.end()) ? std::string("") : itr->second;
}
/** Remove a value from the PluginData */
void removePluginStringData(const std::string& s) const { _pluginStringData.erase(s); }
/** Set the find callback to use in place of the default findFile calls.*/
void setFindFileCallback( FindFileCallback* cb) { _findFileCallback = cb; }
/** Get the const findFile callback.*/
FindFileCallback* getFindFileCallback() const { return _findFileCallback.get(); }
/** Set the read callback to use in place of the default readFile calls.*/
void setReadFileCallback( ReadFileCallback* cb) { _readFileCallback = cb; }
/** Get the const readFile callback.*/
ReadFileCallback* getReadFileCallback() const { return _readFileCallback.get(); }
/** Set the Registry callback to use in place of the default writeFile calls.*/
void setWriteFileCallback( WriteFileCallback* cb) { _writeFileCallback = cb; }
/** Get the const writeFile callback.*/
WriteFileCallback* getWriteFileCallback() const { return _writeFileCallback.get(); }
protected:
virtual ~Options() {}
std::string _str;
FilePathList _databasePaths;
CacheHintOptions _objectCacheHint;
BuildKdTreesHint _buildKdTreesHint;
osg::ref_ptr<AuthenticationMap> _authenticationMap;
typedef std::map<std::string,void*> PluginDataMap;
mutable PluginDataMap _pluginData;
typedef std::map<std::string,std::string> PluginStringDataMap;
mutable PluginStringDataMap _pluginStringData;
osg::ref_ptr<FindFileCallback> _findFileCallback;
osg::ref_ptr<ReadFileCallback> _readFileCallback;
osg::ref_ptr<WriteFileCallback> _writeFileCallback;
};
}
#endif // OSGDB_OPTIONS

View File

@@ -36,8 +36,8 @@ class OSGDB_EXPORT Output : public osgDB::ofstream
virtual ~Output();
void setOptions(const ReaderWriter::Options* options);
const ReaderWriter::Options* getOptions() const { return _options.get(); }
void setOptions(const Options* options);
const Options* getOptions() const { return _options.get(); }
void setWriteOutDefaultValues(bool flag) { _writeOutDefaultValues = flag; }
bool getWriteOutDefaultValues() const { return _writeOutDefaultValues; }
@@ -106,7 +106,7 @@ class OSGDB_EXPORT Output : public osgDB::ofstream
virtual void init();
osg::ref_ptr<const ReaderWriter::Options> _options;
osg::ref_ptr<const Options> _options;
int _indent;
int _indentStep;

View File

@@ -33,7 +33,7 @@ namespace osgDB {
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
extern OSGDB_EXPORT osg::Object* readObjectFile(const std::string& filename,const ReaderWriter::Options* options);
extern OSGDB_EXPORT osg::Object* readObjectFile(const std::string& filename,const Options* options);
/** Read an osg::Object from file.
* Return valid osg::Object on success,
@@ -53,7 +53,7 @@ inline osg::Object* readObjectFile(const std::string& filename)
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
extern OSGDB_EXPORT osg::Image* readImageFile(const std::string& filename,const ReaderWriter::Options* options);
extern OSGDB_EXPORT osg::Image* readImageFile(const std::string& filename,const Options* options);
/** Read an osg::Image from file.
* Return valid osg::Image on success,
@@ -73,7 +73,7 @@ inline osg::Image* readImageFile(const std::string& filename)
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
extern OSGDB_EXPORT osg::HeightField* readHeightFieldFile(const std::string& filename,const ReaderWriter::Options* options);
extern OSGDB_EXPORT osg::HeightField* readHeightFieldFile(const std::string& filename,const Options* options);
/** Read an osg::HeightField from file.
* Return valid osg::HeightField on success,
@@ -93,7 +93,7 @@ inline osg::HeightField* readHeightFieldFile(const std::string& filename)
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
extern OSGDB_EXPORT osg::Node* readNodeFile(const std::string& filename,const ReaderWriter::Options* options);
extern OSGDB_EXPORT osg::Node* readNodeFile(const std::string& filename,const Options* options);
/** Read an osg::Node from file.
* Return valid osg::Node on success,
@@ -110,7 +110,7 @@ inline osg::Node* readNodeFile(const std::string& filename)
/** Read an osg::Node subgraph from files, creating a osg::Group to contain the nodes if more
* than one subgraph has been loaded.
* Use the Options object to control cache operations and file search paths in osgDB::Registry.*/
extern OSGDB_EXPORT osg::Node* readNodeFiles(std::vector<std::string>& commandLine,const ReaderWriter::Options* options);
extern OSGDB_EXPORT osg::Node* readNodeFiles(std::vector<std::string>& commandLine,const Options* options);
/** Read an osg::Node subgraph from files, creating a osg::Group to contain the nodes if more
* than one subgraph has been loaded.*/
@@ -123,7 +123,7 @@ inline osg::Node* readNodeFiles(std::vector<std::string>& commandLine)
/** Read an osg::Node subgraph from files, creating a osg::Group to contain the nodes if more
* than one subgraph has been loaded.
* Use the Options object to control cache operations and file search paths in osgDB::Registry.*/
extern OSGDB_EXPORT osg::Node* readNodeFiles(osg::ArgumentParser& parser,const ReaderWriter::Options* options);
extern OSGDB_EXPORT osg::Node* readNodeFiles(osg::ArgumentParser& parser,const Options* options);
/** Read an osg::Node subgraph from files, creating a osg::Group to contain the nodes if more
* than one subgraph has been loaded.*/
@@ -139,7 +139,7 @@ inline osg::Node* readNodeFiles(osg::ArgumentParser& parser)
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
extern OSGDB_EXPORT osg::Shader* readShaderFile(const std::string& filename,const ReaderWriter::Options* options);
extern OSGDB_EXPORT osg::Shader* readShaderFile(const std::string& filename,const Options* options);
/** Read an osg::Shader from file.
* Return valid osg::Shader on success,
@@ -159,7 +159,7 @@ inline osg::Shader* readShaderFile(const std::string& filename)
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
inline osg::Shader* readShaderFile(osg::Shader::Type type, const std::string& filename,const ReaderWriter::Options* options)
inline osg::Shader* readShaderFile(osg::Shader::Type type, const std::string& filename,const Options* options)
{
osg::Shader* shader = readShaderFile(filename, options);
if (shader && type != osg::Shader::UNDEFINED) shader->setType(type);
@@ -184,7 +184,7 @@ inline osg::Shader* readShaderFile(osg::Shader::Type type, const std::string& fi
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
extern OSGDB_EXPORT osg::ref_ptr<osg::Object> readRefObjectFile(const std::string& filename,const ReaderWriter::Options* options);
extern OSGDB_EXPORT osg::ref_ptr<osg::Object> readRefObjectFile(const std::string& filename,const Options* options);
/** Read an osg::Object from file.
* Return an assigned osg::ref_ptr on success,
@@ -204,7 +204,7 @@ inline osg::ref_ptr<osg::Object> readRefObjectFile(const std::string& filename)
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
extern OSGDB_EXPORT osg::ref_ptr<osg::Image> readRefImageFile(const std::string& filename,const ReaderWriter::Options* options);
extern OSGDB_EXPORT osg::ref_ptr<osg::Image> readRefImageFile(const std::string& filename,const Options* options);
/** Read an osg::Image from file.
* Return an assigned osg::ref_ptr on success,
@@ -224,7 +224,7 @@ inline osg::ref_ptr<osg::Image> readRefImageFile(const std::string& filename)
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
extern OSGDB_EXPORT osg::ref_ptr<osg::HeightField> readRefHeightFieldFile(const std::string& filename,const ReaderWriter::Options* options);
extern OSGDB_EXPORT osg::ref_ptr<osg::HeightField> readRefHeightFieldFile(const std::string& filename,const Options* options);
/** Read an osg::HeightField from file.
* Return an assigned osg::ref_ptr on success,
@@ -244,7 +244,7 @@ inline osg::ref_ptr<osg::HeightField> readRefHeightFieldFile(const std::string&
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
extern OSGDB_EXPORT osg::ref_ptr<osg::Node> readRefNodeFile(const std::string& filename,const ReaderWriter::Options* options);
extern OSGDB_EXPORT osg::ref_ptr<osg::Node> readRefNodeFile(const std::string& filename,const Options* options);
/** Read an osg::Node from file.
* Return an assigned osg::ref_ptr on success,
@@ -264,7 +264,7 @@ inline osg::ref_ptr<osg::Node> readRefNodeFile(const std::string& filename)
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
extern OSGDB_EXPORT osg::ref_ptr<osg::Shader> readRefShaderFile(const std::string& filename,const ReaderWriter::Options* options);
extern OSGDB_EXPORT osg::ref_ptr<osg::Shader> readRefShaderFile(const std::string& filename,const Options* options);
/** Read an osg::Shader from file.
* Return an assigned osg::ref_ptr on success,

View File

@@ -31,6 +31,9 @@ class Archive;
/** list of directories to search through which searching for files. */
typedef std::deque<std::string> FilePathList;
// forward declare
class Options;
/** pure virtual base class for reading and writing of non native formats. */
class OSGDB_EXPORT ReaderWriter : public osg::Object
{
@@ -52,10 +55,10 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object
/** return which protocols are supported by ReaderWriter. */
virtual const FormatDescriptionMap& supportedProtocols() const { return _supportedProtocols; }
/** return which list of file extensions supported by ReaderWriter. */
virtual const FormatDescriptionMap& supportedExtensions() const { return _supportedExtensions; }
/** return which list of file extensions supported by ReaderWriter. */
virtual const FormatDescriptionMap& supportedOptions() const { return _supportedOptions; }
@@ -93,164 +96,6 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object
/** return feature as string */
static FeatureList featureAsString(Features feature);
/** Options base class used for passing options into plugins to control their operation.*/
class Options : public osg::Object
{
public:
/// bit mask for setting up which object types get cached by readObject/Image/HeightField/Node(filename) calls
enum CacheHintOptions
{ /// do not cache objects of any type
CACHE_NONE = 0,
/// cache nodes loaded via readNode(filename)
CACHE_NODES = 1<<0,
/// cache images loaded via readImage(filename)
CACHE_IMAGES = 1<<1,
/// cache heightfield loaded via readHeightField(filename)
CACHE_HEIGHTFIELDS = 1<<2,
/// cache heightfield loaded via readHeightField(filename)
CACHE_ARCHIVES = 1<<3,
/// cache objects loaded via readObject(filename)
CACHE_OBJECTS = 1<<4,
/// cache shaders loaded via readShader(filename)
CACHE_SHADERS = 1<<5,
/// cache on all read*(filename) calls
CACHE_ALL = CACHE_NODES |
CACHE_IMAGES |
CACHE_HEIGHTFIELDS |
CACHE_ARCHIVES |
CACHE_OBJECTS |
CACHE_SHADERS
};
/// range of options of whether to build kdtrees automatically on loading
enum BuildKdTreesHint
{
NO_PREFERENCE,
DO_NOT_BUILD_KDTREES,
BUILD_KDTREES
};
Options():
osg::Object(true),
_objectCacheHint(CACHE_ARCHIVES),
_buildKdTreesHint(NO_PREFERENCE) {}
Options(const std::string& str):
osg::Object(true),
_str(str),
_objectCacheHint(CACHE_ARCHIVES),
_buildKdTreesHint(NO_PREFERENCE) {}
Options(const Options& options,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
osg::Object(options,copyop),
_str(options._str),
_databasePaths(options._databasePaths),
_objectCacheHint(options._objectCacheHint),
_buildKdTreesHint(options._buildKdTreesHint),
_pluginData(options._pluginData),
_pluginStringData(options._pluginStringData){}
META_Object(osgDB,Options);
/** Set the general Options string.*/
void setOptionString(const std::string& str) { _str = str; }
/** Get the general Options string.*/
const std::string& getOptionString() const { return _str; }
/** Set the database path to use a hint of where to look when loading models.*/
void setDatabasePath(const std::string& str) { _databasePaths.clear(); _databasePaths.push_back(str); }
/** Get the database path which is used a hint of where to look when loading models.*/
FilePathList& getDatabasePathList() { return _databasePaths; }
/** Get the const database path which is used a hint of where to look when loading models.*/
const FilePathList& getDatabasePathList() const { return _databasePaths; }
/** Set whether the Registry::ObjectCache should be used by default.*/
void setObjectCacheHint(CacheHintOptions useObjectCache) { _objectCacheHint = useObjectCache; }
/** Get whether the Registry::ObjectCache should be used by default.*/
CacheHintOptions getObjectCacheHint() const { return _objectCacheHint; }
/** Set whether the KdTrees should be built for geometry in the loader model. */
void setBuildKdTreesHint(BuildKdTreesHint hint) { _buildKdTreesHint = hint; }
/** Get whether the KdTrees should be built for geometry in the loader model. */
BuildKdTreesHint getBuildKdTreesHint() const { return _buildKdTreesHint; }
/** Set the password map to be used by plugins when access files from secure locations.*/
void setAuthenticationMap(AuthenticationMap* authenticationMap) { _authenticationMap = authenticationMap; }
/** Get the password map to be used by plugins when access files from secure locations.*/
const AuthenticationMap* getAuthenticationMap() const { return _authenticationMap.get(); }
/** Sets a plugindata value PluginData with a string */
void setPluginData(const std::string& s, void* v) const { _pluginData[s] = v; }
/** Get a value from the PluginData */
void* getPluginData(const std::string& s) { return _pluginData[s]; }
/** Get a value from the PluginData */
const void* getPluginData(const std::string& s) const
{
PluginDataMap::const_iterator itr = _pluginData.find(s);
return (itr == _pluginData.end()) ? 0 : itr->second;
}
/** Remove a value from the PluginData */
void removePluginData(const std::string& s) const { _pluginData.erase(s); }
/** Sets a plugindata value PluginData with a string */
void setPluginStringData(const std::string& s, const std::string& v) const { _pluginStringData[s] = v; }
/** Get a string from the PluginStrData */
std::string getPluginStringData(const std::string& s) { return _pluginStringData[s]; }
/** Get a value from the PluginData */
const std::string getPluginStringData(const std::string& s) const
{
PluginStringDataMap::const_iterator itr = _pluginStringData.find(s);
return (itr == _pluginStringData.end()) ? std::string("") : itr->second;
}
/** Remove a value from the PluginData */
void removePluginStringData(const std::string& s) const { _pluginStringData.erase(s); }
protected:
virtual ~Options() {}
std::string _str;
FilePathList _databasePaths;
CacheHintOptions _objectCacheHint;
BuildKdTreesHint _buildKdTreesHint;
osg::ref_ptr<AuthenticationMap> _authenticationMap;
typedef std::map<std::string,void*> PluginDataMap;
mutable PluginDataMap _pluginData;
typedef std::map<std::string,std::string> PluginStringDataMap;
mutable PluginStringDataMap _pluginStringData;
};
class OSGDB_EXPORT ReadResult
@@ -353,6 +198,8 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object
CREATE
};
typedef osgDB::Options Options;
/** open an archive for reading, writing, or to create an empty archive for writing to.*/
virtual ReadResult openArchive(const std::string& /*fileName*/,ArchiveStatus, unsigned int =4096, const Options* =NULL) const { return ReadResult(ReadResult::NOT_IMPLEMENTED); }

View File

@@ -22,6 +22,7 @@
#include <osgDB/DynamicLibrary>
#include <osgDB/ReaderWriter>
#include <osgDB/Options>
#include <osgDB/DotOsgWrapper>
#include <osgDB/DatabasePager>
#include <osgDB/FileCache>
@@ -159,43 +160,38 @@ class OSGDB_EXPORT Registry : public osg::Referenced
bool writeObject(const osg::Object& obj,Output& fw);
class ReadFileCallback : public virtual osg::Referenced
typedef class osgDB::FindFileCallback FindFileCallback;
typedef class osgDB::ReadFileCallback ReadFileCallback;
typedef class osgDB::WriteFileCallback WriteFileCallback;
/** Set the Registry callback to use in place of the default findFile calls.*/
void setFindFileCallback( FindFileCallback* cb) { _findFileCallback = cb; }
/** Get the findFile callback.*/
FindFileCallback* getFindFileCallback() { return _findFileCallback.get(); }
/** Get the const findFile callback.*/
const FindFileCallback* getFindFileCallback() const { return _findFileCallback.get(); }
std::string findDataFile(const std::string& fileName, const Options* options, CaseSensitivity caseSensitivity)
{
public:
virtual ReaderWriter::ReadResult openArchive(const std::string& filename,ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const ReaderWriter::Options* useObjectCache)
{
return osgDB::Registry::instance()->openArchiveImplementation(filename, status, indexBlockSizeHint, useObjectCache);
}
virtual ReaderWriter::ReadResult readObject(const std::string& filename, const ReaderWriter::Options* options)
{
return osgDB::Registry::instance()->readObjectImplementation(filename,options);
}
if (options && options->getFindFileCallback()) return options->getFindFileCallback()->findDataFile(fileName, options, caseSensitivity);
else if (_findFileCallback.valid()) return _findFileCallback->findDataFile(fileName, options, caseSensitivity);
else return findDataFileImplementation(fileName, options, caseSensitivity);
}
std::string findDataFileImplementation(const std::string& fileName, const Options* options, CaseSensitivity caseSensitivity);
std::string findLibraryFile(const std::string& fileName, const Options* options, CaseSensitivity caseSensitivity)
{
if (options && options->getFindFileCallback()) return options->getFindFileCallback()->findLibraryFile(fileName, options, caseSensitivity);
else if (_findFileCallback.valid()) return _findFileCallback->findLibraryFile(fileName, options, caseSensitivity);
else return findLibraryFileImplementation(fileName, options, caseSensitivity);
}
std::string findLibraryFileImplementation(const std::string& fileName, const Options* options, CaseSensitivity caseSensitivity);
virtual ReaderWriter::ReadResult readImage(const std::string& filename, const ReaderWriter::Options* options)
{
return osgDB::Registry::instance()->readImageImplementation(filename,options);
}
virtual ReaderWriter::ReadResult readHeightField(const std::string& filename, const ReaderWriter::Options* options)
{
return osgDB::Registry::instance()->readHeightFieldImplementation(filename,options);
}
virtual ReaderWriter::ReadResult readNode(const std::string& filename, const ReaderWriter::Options* options)
{
return osgDB::Registry::instance()->readNodeImplementation(filename,options);
}
virtual ReaderWriter::ReadResult readShader(const std::string& filename, const ReaderWriter::Options* options)
{
return osgDB::Registry::instance()->readShaderImplementation(filename,options);
}
protected:
virtual ~ReadFileCallback() {}
};
/** Set the Registry callback to use in place of the default readFile calls.*/
void setReadFileCallback( ReadFileCallback* cb) { _readFileCallback = cb; }
@@ -207,93 +203,65 @@ class OSGDB_EXPORT Registry : public osg::Referenced
const ReadFileCallback* getReadFileCallback() const { return _readFileCallback.get(); }
ReaderWriter::ReadResult openArchive(const std::string& fileName,ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const ReaderWriter::Options* options)
ReaderWriter::ReadResult openArchive(const std::string& fileName,ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const Options* options)
{
if (_readFileCallback.valid()) return _readFileCallback->openArchive(fileName, status, indexBlockSizeHint, options);
if (options && options->getReadFileCallback()) return options->getReadFileCallback()->openArchive(fileName, status, indexBlockSizeHint, options);
else if (_readFileCallback.valid()) return _readFileCallback->openArchive(fileName, status, indexBlockSizeHint, options);
else return openArchiveImplementation(fileName, status, indexBlockSizeHint, options);
}
ReaderWriter::ReadResult openArchiveImplementation(const std::string& fileName, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const ReaderWriter::Options* options);
ReaderWriter::ReadResult openArchiveImplementation(const std::string& fileName, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const Options* options);
ReaderWriter::ReadResult readObject(const std::string& fileName,const ReaderWriter::Options* options, bool buildKdTreeIfRequired=true)
ReaderWriter::ReadResult readObject(const std::string& fileName,const Options* options, bool buildKdTreeIfRequired=true)
{
ReaderWriter::ReadResult result = _readFileCallback.valid() ?
_readFileCallback->readObject(fileName,options) :
readObjectImplementation(fileName,options);
ReaderWriter::ReadResult result;
if (options && options->getReadFileCallback()) result = options->getReadFileCallback()->readObject(fileName,options);
else if (_readFileCallback.valid()) result = _readFileCallback->readObject(fileName,options);
else result = readObjectImplementation(fileName,options);
if (buildKdTreeIfRequired) _buildKdTreeIfRequired(result, options);
return result;
}
ReaderWriter::ReadResult readObjectImplementation(const std::string& fileName,const ReaderWriter::Options* options);
ReaderWriter::ReadResult readImage(const std::string& fileName,const ReaderWriter::Options* options)
ReaderWriter::ReadResult readObjectImplementation(const std::string& fileName,const Options* options);
ReaderWriter::ReadResult readImage(const std::string& fileName,const Options* options)
{
if (_readFileCallback.valid()) return _readFileCallback->readImage(fileName,options);
if (options && options->getReadFileCallback()) return options->getReadFileCallback()->readImage(fileName,options);
else if (_readFileCallback.valid()) return _readFileCallback->readImage(fileName,options);
else return readImageImplementation(fileName,options);
}
ReaderWriter::ReadResult readImageImplementation(const std::string& fileName,const ReaderWriter::Options* options);
ReaderWriter::ReadResult readImageImplementation(const std::string& fileName,const Options* options);
ReaderWriter::ReadResult readHeightField(const std::string& fileName,const ReaderWriter::Options* options)
ReaderWriter::ReadResult readHeightField(const std::string& fileName,const Options* options)
{
if (_readFileCallback.valid()) return _readFileCallback->readHeightField(fileName,options);
if (options && options->getReadFileCallback()) return options->getReadFileCallback()->readHeightField(fileName,options);
else if (_readFileCallback.valid()) return _readFileCallback->readHeightField(fileName,options);
else return readHeightFieldImplementation(fileName,options);
}
ReaderWriter::ReadResult readHeightFieldImplementation(const std::string& fileName,const ReaderWriter::Options* options);
ReaderWriter::ReadResult readHeightFieldImplementation(const std::string& fileName,const Options* options);
ReaderWriter::ReadResult readNode(const std::string& fileName,const ReaderWriter::Options* options, bool buildKdTreeIfRequired=true)
ReaderWriter::ReadResult readNode(const std::string& fileName,const Options* options, bool buildKdTreeIfRequired=true)
{
ReaderWriter::ReadResult result = _readFileCallback.valid() ?
_readFileCallback->readNode(fileName,options) :
readNodeImplementation(fileName,options);
ReaderWriter::ReadResult result;
if (options && options->getReadFileCallback()) result = options->getReadFileCallback()->readNode(fileName,options);
else if (_readFileCallback.valid()) result = _readFileCallback->readNode(fileName,options);
else result = readNodeImplementation(fileName,options);
if (buildKdTreeIfRequired) _buildKdTreeIfRequired(result, options);
return result;
}
ReaderWriter::ReadResult readNodeImplementation(const std::string& fileName,const ReaderWriter::Options* options);
ReaderWriter::ReadResult readNodeImplementation(const std::string& fileName,const Options* options);
ReaderWriter::ReadResult readShader(const std::string& fileName,const ReaderWriter::Options* options)
ReaderWriter::ReadResult readShader(const std::string& fileName,const Options* options)
{
if (options && options->getReadFileCallback()) return options->getReadFileCallback()->readShader(fileName,options);
if (_readFileCallback.valid()) return _readFileCallback->readShader(fileName,options);
else return readShaderImplementation(fileName,options);
}
ReaderWriter::ReadResult readShaderImplementation(const std::string& fileName,const ReaderWriter::Options* options);
ReaderWriter::ReadResult readShaderImplementation(const std::string& fileName,const Options* options);
class WriteFileCallback : public virtual osg::Referenced
{
public:
virtual ReaderWriter::WriteResult writeObject(const osg::Object& obj, const std::string& fileName,const ReaderWriter::Options* options)
{
return osgDB::Registry::instance()->writeObjectImplementation(obj,fileName,options);
}
virtual ReaderWriter::WriteResult writeImage(const osg::Image& obj, const std::string& fileName,const ReaderWriter::Options* options)
{
return osgDB::Registry::instance()->writeImageImplementation(obj,fileName,options);
}
virtual ReaderWriter::WriteResult writeHeightField(const osg::HeightField& obj, const std::string& fileName,const ReaderWriter::Options* options)
{
return osgDB::Registry::instance()->writeHeightFieldImplementation(obj,fileName,options);
}
virtual ReaderWriter::WriteResult writeNode(const osg::Node& obj, const std::string& fileName,const ReaderWriter::Options* options)
{
return osgDB::Registry::instance()->writeNodeImplementation(obj,fileName,options);
}
virtual ReaderWriter::WriteResult writeShader(const osg::Shader& obj, const std::string& fileName,const ReaderWriter::Options* options)
{
return osgDB::Registry::instance()->writeShaderImplementation(obj,fileName,options);
}
protected:
virtual ~WriteFileCallback() {}
};
/** Set the Registry callback to use in place of the default writeFile calls.*/
void setWriteFileCallback( WriteFileCallback* cb) { _writeFileCallback = cb; }
@@ -304,47 +272,52 @@ class OSGDB_EXPORT Registry : public osg::Referenced
const WriteFileCallback* getWriteFileCallback() const { return _writeFileCallback.get(); }
ReaderWriter::WriteResult writeObject(const osg::Object& obj, const std::string& fileName,const ReaderWriter::Options* options)
ReaderWriter::WriteResult writeObject(const osg::Object& obj, const std::string& fileName,const Options* options)
{
if (_writeFileCallback.valid()) return _writeFileCallback->writeObject(obj,fileName,options);
if (options && options->getWriteFileCallback()) return options->getWriteFileCallback()->writeObject(obj,fileName,options);
else if (_writeFileCallback.valid()) return _writeFileCallback->writeObject(obj,fileName,options);
else return writeObjectImplementation(obj,fileName,options);
}
ReaderWriter::WriteResult writeObjectImplementation(const osg::Object& obj, const std::string& fileName,const ReaderWriter::Options* options);
ReaderWriter::WriteResult writeObjectImplementation(const osg::Object& obj, const std::string& fileName,const Options* options);
ReaderWriter::WriteResult writeImage(const osg::Image& obj, const std::string& fileName,const ReaderWriter::Options* options)
ReaderWriter::WriteResult writeImage(const osg::Image& obj, const std::string& fileName,const Options* options)
{
if (_writeFileCallback.valid()) return _writeFileCallback->writeImage(obj,fileName,options);
if (options && options->getWriteFileCallback()) return options->getWriteFileCallback()->writeImage(obj,fileName,options);
else if (_writeFileCallback.valid()) return _writeFileCallback->writeImage(obj,fileName,options);
else return writeImageImplementation(obj,fileName,options);
}
ReaderWriter::WriteResult writeImageImplementation(const osg::Image& obj, const std::string& fileName,const ReaderWriter::Options* options);
ReaderWriter::WriteResult writeImageImplementation(const osg::Image& obj, const std::string& fileName,const Options* options);
ReaderWriter::WriteResult writeHeightField(const osg::HeightField& obj, const std::string& fileName,const ReaderWriter::Options* options)
ReaderWriter::WriteResult writeHeightField(const osg::HeightField& obj, const std::string& fileName,const Options* options)
{
if (_writeFileCallback.valid()) return _writeFileCallback->writeHeightField(obj,fileName,options);
if (options && options->getWriteFileCallback()) return options->getWriteFileCallback()->writeHeightField(obj,fileName,options);
else if (_writeFileCallback.valid()) return _writeFileCallback->writeHeightField(obj,fileName,options);
else return writeHeightFieldImplementation(obj,fileName,options);
}
ReaderWriter::WriteResult writeHeightFieldImplementation(const osg::HeightField& obj, const std::string& fileName,const ReaderWriter::Options* options);
ReaderWriter::WriteResult writeHeightFieldImplementation(const osg::HeightField& obj, const std::string& fileName,const Options* options);
ReaderWriter::WriteResult writeNode(const osg::Node& node, const std::string& fileName,const ReaderWriter::Options* options)
ReaderWriter::WriteResult writeNode(const osg::Node& node, const std::string& fileName,const Options* options)
{
if (_writeFileCallback.valid()) return _writeFileCallback->writeNode(node,fileName,options);
if (options && options->getWriteFileCallback()) return options->getWriteFileCallback()->writeNode(node,fileName,options);
else if (_writeFileCallback.valid()) return _writeFileCallback->writeNode(node,fileName,options);
else return writeNodeImplementation(node,fileName,options);
}
ReaderWriter::WriteResult writeNodeImplementation(const osg::Node& node, const std::string& fileName,const ReaderWriter::Options* options);
ReaderWriter::WriteResult writeNodeImplementation(const osg::Node& node, const std::string& fileName,const Options* options);
ReaderWriter::WriteResult writeShader(const osg::Shader& obj, const std::string& fileName,const ReaderWriter::Options* options)
ReaderWriter::WriteResult writeShader(const osg::Shader& obj, const std::string& fileName,const Options* options)
{
if (_writeFileCallback.valid()) return _writeFileCallback->writeShader(obj,fileName,options);
if (options && options->getWriteFileCallback()) return options->getWriteFileCallback()->writeShader(obj,fileName,options);
else if (_writeFileCallback.valid()) return _writeFileCallback->writeShader(obj,fileName,options);
else return writeShaderImplementation(obj,fileName,options);
}
ReaderWriter::WriteResult writeShaderImplementation(const osg::Shader& obj, const std::string& fileName,const ReaderWriter::Options* options);
ReaderWriter::WriteResult writeShaderImplementation(const osg::Shader& obj, const std::string& fileName,const Options* options);
inline void _buildKdTreeIfRequired(ReaderWriter::ReadResult& result, const ReaderWriter::Options* options)
inline void _buildKdTreeIfRequired(ReaderWriter::ReadResult& result, const Options* options)
{
bool doKdTreeBuilder = (options && options->getBuildKdTreesHint()!=ReaderWriter::Options::NO_PREFERENCE) ?
options->getBuildKdTreesHint() == ReaderWriter::Options::BUILD_KDTREES :
_buildKdTreesHint == ReaderWriter::Options::BUILD_KDTREES;
bool doKdTreeBuilder = (options && options->getBuildKdTreesHint()!=Options::NO_PREFERENCE) ?
options->getBuildKdTreesHint() == Options::BUILD_KDTREES :
_buildKdTreesHint == Options::BUILD_KDTREES;
if (doKdTreeBuilder && _kdTreeBuilder.valid() && result.validNode())
{
@@ -355,10 +328,10 @@ class OSGDB_EXPORT Registry : public osg::Referenced
/** Set whether the KdTrees should be built for geometry in the loader model. */
void setBuildKdTreesHint(ReaderWriter::Options::BuildKdTreesHint hint) { _buildKdTreesHint = hint; }
void setBuildKdTreesHint(Options::BuildKdTreesHint hint) { _buildKdTreesHint = hint; }
/** Get whether the KdTrees should be built for geometry in the loader model. */
ReaderWriter::Options::BuildKdTreesHint getBuildKdTreesHint() const { return _buildKdTreesHint; }
Options::BuildKdTreesHint getBuildKdTreesHint() const { return _buildKdTreesHint; }
/** Set the KdTreeBuilder visitor that is used to build KdTree on loaded models.*/
void setKdTreeBuilder(osg::KdTreeBuilder* builder) { _kdTreeBuilder = builder; }
@@ -390,9 +363,9 @@ class OSGDB_EXPORT Registry : public osg::Referenced
bool getCreateNodeFromImage() const { return _createNodeFromImage; }
void setOptions(ReaderWriter::Options* opt) { _options = opt; }
ReaderWriter::Options* getOptions() { return _options.get(); }
const ReaderWriter::Options* getOptions() const { return _options.get(); }
void setOptions(Options* opt) { _options = opt; }
Options* getOptions() { return _options.get(); }
const Options* getOptions() const { return _options.get(); }
/** initialize both the Data and Library FilePaths, by default called by the
@@ -519,7 +492,7 @@ class OSGDB_EXPORT Registry : public osg::Referenced
/** get the attached library with specified name.*/
DynamicLibraryList::iterator getLibraryItr(const std::string& fileName);
ReaderWriter::Options::BuildKdTreesHint _buildKdTreesHint;
Options::BuildKdTreesHint _buildKdTreesHint;
osg::ref_ptr<osg::KdTreeBuilder> _kdTreeBuilder;
osg::ref_ptr<FileCache> _fileCache;
@@ -538,7 +511,7 @@ class OSGDB_EXPORT Registry : public osg::Referenced
/** Functor used in internal implementations.*/
struct ReadFunctor
{
ReadFunctor(const std::string& filename, const ReaderWriter::Options* options):
ReadFunctor(const std::string& filename, const Options* options):
_filename(filename),
_options(options) {}
@@ -548,7 +521,7 @@ class OSGDB_EXPORT Registry : public osg::Referenced
virtual bool isValid(osg::Object* object) const = 0;
std::string _filename;
const ReaderWriter::Options* _options;
const Options* _options;
};
protected:
@@ -573,7 +546,7 @@ class OSGDB_EXPORT Registry : public osg::Referenced
friend struct ReadShaderFunctor;
ReaderWriter::ReadResult read(const ReadFunctor& readFunctor);
ReaderWriter::ReadResult readImplementation(const ReadFunctor& readFunctor,ReaderWriter::Options::CacheHintOptions cacheHint);
ReaderWriter::ReadResult readImplementation(const ReadFunctor& readFunctor,Options::CacheHintOptions cacheHint);
// forward declare helper class
@@ -581,6 +554,7 @@ class OSGDB_EXPORT Registry : public osg::Referenced
friend class AvailableReaderWriterIterator;
osg::ref_ptr<FindFileCallback> _findFileCallback;
osg::ref_ptr<ReadFileCallback> _readFileCallback;
osg::ref_ptr<WriteFileCallback> _writeFileCallback;
@@ -610,7 +584,7 @@ class OSGDB_EXPORT Registry : public osg::Referenced
static std::string trim( const std::string& str );
// options to pass to reader writers.
osg::ref_ptr<ReaderWriter::Options> _options;
osg::ref_ptr<Options> _options;
FilePathList _dataFilePath;
FilePathList _libraryFilePath;

View File

@@ -32,7 +32,7 @@ namespace osgDB {
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to write the specified file.*/
extern OSGDB_EXPORT bool writeObjectFile(const osg::Object& object, const std::string& filename, const ReaderWriter::Options* options );
extern OSGDB_EXPORT bool writeObjectFile(const osg::Object& object, const std::string& filename, const Options* options );
/** Write an osg::Object to file.
* Return true on success,
@@ -52,7 +52,7 @@ inline bool writeObjectFile(const osg::Object& object, const std::string& filena
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to write the specified file.*/
extern OSGDB_EXPORT bool writeImageFile(const osg::Image& image, const std::string& filename, const ReaderWriter::Options* options );
extern OSGDB_EXPORT bool writeImageFile(const osg::Image& image, const std::string& filename, const Options* options );
/** Write an osg::Image to file.
* Return true on success,
@@ -72,7 +72,7 @@ inline bool writeImageFile(const osg::Image& image, const std::string& filename)
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to write the specified file.*/
extern OSGDB_EXPORT bool writeHeightFieldFile(const osg::HeightField& hf, const std::string& filename, const ReaderWriter::Options* options );
extern OSGDB_EXPORT bool writeHeightFieldFile(const osg::HeightField& hf, const std::string& filename, const Options* options );
/** Write an osg::HeightField to file.
* Return true on success,
@@ -92,7 +92,7 @@ inline bool writeHeightFieldFile(const osg::HeightField& hf, const std::string&
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to write the specified file.*/
extern OSGDB_EXPORT bool writeNodeFile(const osg::Node& node, const std::string& filename, const ReaderWriter::Options* options );
extern OSGDB_EXPORT bool writeNodeFile(const osg::Node& node, const std::string& filename, const Options* options );
/** Write an osg::Node to file.
* Return true on success,
@@ -112,7 +112,7 @@ inline bool writeNodeFile(const osg::Node& node, const std::string& filename)
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to write the specified file.*/
extern OSGDB_EXPORT bool writeShaderFile(const osg::Shader& shader, const std::string& filename, const ReaderWriter::Options* options );
extern OSGDB_EXPORT bool writeShaderFile(const osg::Shader& shader, const std::string& filename, const Options* options );
/** Write an osg::Shader to file.
* Return true on success,

View File

@@ -21,8 +21,8 @@ namespace osgDB {
// forward declare
class XmlNode;
/** read an Xml file, find the file in ReaderWriter::Options DataFilePathList.*/
extern OSGDB_EXPORT XmlNode* readXmlFile(const std::string& filename,const ReaderWriter::Options* options);
/** read an Xml file, find the file in Options DataFilePathList.*/
extern OSGDB_EXPORT XmlNode* readXmlFile(const std::string& filename,const Options* options);
/** read an Xml file, find the file in osgDB::Registry's eaderWriter::Options DataFilePathList.*/
inline XmlNode* readXmlFile(const std::string& filename)

View File

@@ -172,7 +172,7 @@ class OSGVOLUME_EXPORT CompositeLayer : public Layer
void clear();
void setFileName(unsigned int i, const std::string& filename) { _layers[i].filename = filename; if (_layers[i].layer.valid()) _layers[i].layer->setFileName(filename); }
void setFileName(unsigned int i, const std::string& filename) { if (i>=_layers.size()) _layers.resize(i+1); _layers[i].filename = filename; if (_layers[i].layer.valid()) _layers[i].layer->setFileName(filename); }
const std::string& getFileName(unsigned int i) const { return _layers[i].layer.valid() ? _layers[i].layer->getFileName() : _layers[i].filename; }
void setLayer(unsigned int i, Layer* layer) { if (i>=_layers.size()) _layers.resize(i+1); _layers[i].layer = layer; }

View File

@@ -121,7 +121,9 @@ Shader::~Shader()
bool Shader::setType( Type t )
{
if( _type != UNDEFINED )
if (_type==t) return true;
if (_type != UNDEFINED)
{
osg::notify(osg::WARN) << "cannot change type of Shader" << std::endl;
return false;

View File

@@ -27,7 +27,7 @@ osgDB::Archive* osgDB::openArchive(const std::string& filename, ReaderWriter::Ar
return openArchive(filename, status, indexBlockSizeHint, Registry::instance()->getOptions());
}
osgDB::Archive* osgDB::openArchive(const std::string& filename, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint,ReaderWriter::Options* options)
osgDB::Archive* osgDB::openArchive(const std::string& filename, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint,Options* options)
{
// ensure archive extension is in the registry list
std::string::size_type dot = filename.find_last_of('.');

View File

@@ -37,6 +37,7 @@ SET(LIB_PUBLIC_HEADERS
${HEADER_PATH}/ImagePager
${HEADER_PATH}/Input
${HEADER_PATH}/Output
${HEADER_PATH}/Options
${HEADER_PATH}/ParameterOutput
${HEADER_PATH}/PluginQuery
${HEADER_PATH}/ReaderWriter
@@ -71,6 +72,7 @@ ADD_LIBRARY(${LIB_NAME}
Input.cpp
MimeTypes.cpp
Output.cpp
Options.cpp
PluginQuery.cpp
ReaderWriter.cpp
ReadFile.cpp

View File

@@ -122,7 +122,7 @@ public:
_changeAnisotropy(changeAnisotropy), _valueAnisotropy(valueAnisotropy),
_drawablePolicy(drawablePolicy), _pager(pager)
{
if (osgDB::Registry::instance()->getBuildKdTreesHint()==osgDB::ReaderWriter::Options::BUILD_KDTREES &&
if (osgDB::Registry::instance()->getBuildKdTreesHint()==osgDB::Options::BUILD_KDTREES &&
osgDB::Registry::instance()->getKdTreeBuilder())
{
_kdTreeBuilder = osgDB::Registry::instance()->getKdTreeBuilder()->clone();
@@ -679,7 +679,7 @@ void DatabasePager::DatabaseThread::run()
else
{
// check to see if we need to run the KdTreeBuilder
if (osgDB::Registry::instance()->getBuildKdTreesHint()==osgDB::ReaderWriter::Options::BUILD_KDTREES &&
if (osgDB::Registry::instance()->getBuildKdTreesHint()==osgDB::Options::BUILD_KDTREES &&
osgDB::Registry::instance()->getKdTreeBuilder())
{
//osg::Timer_t before = osg::Timer::instance()->tick();
@@ -1238,7 +1238,7 @@ void DatabasePager::requestNodeFile(const std::string& fileName,osg::Group* grou
void DatabasePager::requestNodeFile(const std::string& fileName,osg::Group* group,
float priority, const osg::FrameStamp* framestamp,
osg::ref_ptr<osg::Referenced>& databaseRequestRef,
ReaderWriter::Options* loadOptions)
Options* loadOptions)
{
if (!_acceptNewRequests) return;

View File

@@ -46,7 +46,7 @@ bool FileCache::existsInCache(const std::string& originalFileName) const
return osgDB::fileExists(createCacheFileName(originalFileName));
}
ReaderWriter::ReadResult FileCache::readNode(const std::string& originalFileName, const osgDB::ReaderWriter::Options* options, bool buildKdTreeIfRequired) const
ReaderWriter::ReadResult FileCache::readNode(const std::string& originalFileName, const osgDB::Options* options, bool buildKdTreeIfRequired) const
{
std::string cacheFileName = createCacheFileName(originalFileName);
if (!cacheFileName.empty() && osgDB::fileExists(cacheFileName))
@@ -60,7 +60,7 @@ ReaderWriter::ReadResult FileCache::readNode(const std::string& originalFileName
}
}
ReaderWriter::WriteResult FileCache::writeNode(const osg::Node& node, const std::string& originalFileName, const osgDB::ReaderWriter::Options* options) const
ReaderWriter::WriteResult FileCache::writeNode(const osg::Node& node, const std::string& originalFileName, const osgDB::Options* options) const
{
std::string cacheFileName = createCacheFileName(originalFileName);
if (!cacheFileName.empty())

View File

@@ -289,91 +289,17 @@ std::string osgDB::findFileInPath(const std::string& filename, const FilePathLis
std::string osgDB::findDataFile(const std::string& filename,CaseSensitivity caseSensitivity)
{
return findDataFile(filename,static_cast<ReaderWriter::Options*>(0),caseSensitivity);
return findDataFile(filename,static_cast<Options*>(0),caseSensitivity);
}
OSGDB_EXPORT std::string osgDB::findDataFile(const std::string& filename,const ReaderWriter::Options* options, CaseSensitivity caseSensitivity)
OSGDB_EXPORT std::string osgDB::findDataFile(const std::string& filename,const Options* options, CaseSensitivity caseSensitivity)
{
if (filename.empty()) return filename;
if(fileExists(filename))
{
osg::notify(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
return filename;
}
std::string fileFound;
if (options && !options->getDatabasePathList().empty())
{
fileFound = findFileInPath(filename, options->getDatabasePathList(), caseSensitivity);
if (!fileFound.empty()) return fileFound;
}
const FilePathList& filepath = Registry::instance()->getDataFilePathList();
if (!filepath.empty())
{
fileFound = findFileInPath(filename, filepath,caseSensitivity);
if (!fileFound.empty()) return fileFound;
}
// if a directory is included in the filename, get just the (simple) filename itself and try that
std::string simpleFileName = getSimpleFileName(filename);
if (simpleFileName!=filename)
{
if(fileExists(simpleFileName))
{
osg::notify(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
return simpleFileName;
}
if (options && !options->getDatabasePathList().empty())
{
fileFound = findFileInPath(simpleFileName, options->getDatabasePathList(), caseSensitivity);
if (!fileFound.empty()) return fileFound;
}
if (!filepath.empty())
{
fileFound = findFileInPath(simpleFileName, filepath,caseSensitivity);
if (!fileFound.empty()) return fileFound;
}
}
// return empty string.
return std::string();
return Registry::instance()->findDataFile(filename, options, caseSensitivity);
}
std::string osgDB::findLibraryFile(const std::string& filename,CaseSensitivity caseSensitivity)
{
if (filename.empty())
return filename;
const FilePathList& filepath = Registry::instance()->getLibraryFilePathList();
std::string fileFound = findFileInPath(filename, filepath,caseSensitivity);
if (!fileFound.empty())
return fileFound;
if(fileExists(filename))
{
osg::notify(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
return filename;
}
// if a directory is included in the filename, get just the (simple) filename itself and try that
std::string simpleFileName = getSimpleFileName(filename);
if (simpleFileName!=filename)
{
std::string fileFound = findFileInPath(simpleFileName, filepath,caseSensitivity);
if (!fileFound.empty()) return fileFound;
}
// failed return empty string.
return std::string();
return Registry::instance()->findLibraryFile(filename, osgDB::Registry::instance()->getOptions(), caseSensitivity);
}
std::string osgDB::findFileInDirectory(const std::string& fileName,const std::string& dirName,CaseSensitivity caseSensitivity)

94
src/osgDB/Options.cpp Normal file
View File

@@ -0,0 +1,94 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#include <osgDB/Options>
#include <osgDB/Registry>
using namespace osgDB;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// FindFileCallback default implementation
//
std::string FindFileCallback::findDataFile(const std::string& filename, const Options* options, CaseSensitivity caseSensitivity)
{
return osgDB::Registry::instance()->findDataFileImplementation(filename, options, caseSensitivity);
}
std::string FindFileCallback::findLibraryFile(const std::string& filename, const Options* options, CaseSensitivity caseSensitivity)
{
return osgDB::Registry::instance()->findLibraryFileImplementation(filename, options, caseSensitivity);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// ReadFileCallback default implementation
//
ReaderWriter::ReadResult ReadFileCallback::openArchive(const std::string& filename,ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const Options* useObjectCache)
{
return osgDB::Registry::instance()->openArchiveImplementation(filename, status, indexBlockSizeHint, useObjectCache);
}
ReaderWriter::ReadResult ReadFileCallback::readObject(const std::string& filename, const Options* options)
{
return osgDB::Registry::instance()->readObjectImplementation(filename,options);
}
ReaderWriter::ReadResult ReadFileCallback::readImage(const std::string& filename, const Options* options)
{
return osgDB::Registry::instance()->readImageImplementation(filename,options);
}
ReaderWriter::ReadResult ReadFileCallback::readHeightField(const std::string& filename, const Options* options)
{
return osgDB::Registry::instance()->readHeightFieldImplementation(filename,options);
}
ReaderWriter::ReadResult ReadFileCallback::readNode(const std::string& filename, const Options* options)
{
return osgDB::Registry::instance()->readNodeImplementation(filename,options);
}
ReaderWriter::ReadResult ReadFileCallback::readShader(const std::string& filename, const Options* options)
{
return osgDB::Registry::instance()->readShaderImplementation(filename,options);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// WriteFileCallback default implementation
//
ReaderWriter::WriteResult WriteFileCallback::writeObject(const osg::Object& obj, const std::string& fileName,const Options* options)
{
return osgDB::Registry::instance()->writeObjectImplementation(obj,fileName,options);
}
ReaderWriter::WriteResult WriteFileCallback::writeImage(const osg::Image& obj, const std::string& fileName,const Options* options)
{
return osgDB::Registry::instance()->writeImageImplementation(obj,fileName,options);
}
ReaderWriter::WriteResult WriteFileCallback::writeHeightField(const osg::HeightField& obj, const std::string& fileName,const Options* options)
{
return osgDB::Registry::instance()->writeHeightFieldImplementation(obj,fileName,options);
}
ReaderWriter::WriteResult WriteFileCallback::writeNode(const osg::Node& obj, const std::string& fileName,const Options* options)
{
return osgDB::Registry::instance()->writeNodeImplementation(obj,fileName,options);
}
ReaderWriter::WriteResult WriteFileCallback::writeShader(const osg::Shader& obj, const std::string& fileName,const Options* options)
{
return osgDB::Registry::instance()->writeShaderImplementation(obj,fileName,options);
}

View File

@@ -63,7 +63,7 @@ void Output::init()
}
}
void Output::setOptions(const ReaderWriter::Options* options)
void Output::setOptions(const Options* options)
{
_options = options;
}

View File

@@ -29,7 +29,7 @@
using namespace osg;
using namespace osgDB;
Object* osgDB::readObjectFile(const std::string& filename,const ReaderWriter::Options* options)
Object* osgDB::readObjectFile(const std::string& filename,const Options* options)
{
ReaderWriter::ReadResult rr = Registry::instance()->readObject(filename,options);
if (rr.validObject()) return rr.takeObject();
@@ -38,7 +38,7 @@ Object* osgDB::readObjectFile(const std::string& filename,const ReaderWriter::Op
}
Image* osgDB::readImageFile(const std::string& filename,const ReaderWriter::Options* options)
Image* osgDB::readImageFile(const std::string& filename,const Options* options)
{
ReaderWriter::ReadResult rr = Registry::instance()->readImage(filename,options);
if (rr.validImage()) return rr.takeImage();
@@ -46,7 +46,7 @@ Image* osgDB::readImageFile(const std::string& filename,const ReaderWriter::Opti
return NULL;
}
Shader* osgDB::readShaderFile(const std::string& filename,const ReaderWriter::Options* options)
Shader* osgDB::readShaderFile(const std::string& filename,const Options* options)
{
ReaderWriter::ReadResult rr = Registry::instance()->readShader(filename,options);
if (rr.validShader()) return rr.takeShader();
@@ -55,7 +55,7 @@ Shader* osgDB::readShaderFile(const std::string& filename,const ReaderWriter::Op
}
HeightField* osgDB::readHeightFieldFile(const std::string& filename,const ReaderWriter::Options* options)
HeightField* osgDB::readHeightFieldFile(const std::string& filename,const Options* options)
{
ReaderWriter::ReadResult rr = Registry::instance()->readHeightField(filename,options);
if (rr.validHeightField()) return rr.takeHeightField();
@@ -64,7 +64,7 @@ HeightField* osgDB::readHeightFieldFile(const std::string& filename,const Reader
}
Node* osgDB::readNodeFile(const std::string& filename,const ReaderWriter::Options* options)
Node* osgDB::readNodeFile(const std::string& filename,const Options* options)
{
ReaderWriter::ReadResult rr = Registry::instance()->readNode(filename,options);
if (rr.validNode()) return rr.takeNode();
@@ -72,7 +72,7 @@ Node* osgDB::readNodeFile(const std::string& filename,const ReaderWriter::Option
return NULL;
}
Node* osgDB::readNodeFiles(std::vector<std::string>& commandLine,const ReaderWriter::Options* options)
Node* osgDB::readNodeFiles(std::vector<std::string>& commandLine,const Options* options)
{
typedef std::vector<osg::Node*> NodeList;
NodeList nodeList;
@@ -121,7 +121,7 @@ Node* osgDB::readNodeFiles(std::vector<std::string>& commandLine,const ReaderWri
}
Node* osgDB::readNodeFiles(osg::ArgumentParser& arguments,const ReaderWriter::Options* options)
Node* osgDB::readNodeFiles(osg::ArgumentParser& arguments,const Options* options)
{
typedef std::vector< osg::ref_ptr<osg::Node> > NodeList;
@@ -255,7 +255,7 @@ Node* osgDB::readNodeFiles(osg::ArgumentParser& arguments,const ReaderWriter::Op
}
osg::ref_ptr<osg::Object> osgDB::readRefObjectFile(const std::string& filename,const ReaderWriter::Options* options)
osg::ref_ptr<osg::Object> osgDB::readRefObjectFile(const std::string& filename,const Options* options)
{
ReaderWriter::ReadResult rr = Registry::instance()->readObject(filename,options);
if (rr.validObject()) return osg::ref_ptr<osg::Object>(rr.getObject());
@@ -263,7 +263,7 @@ osg::ref_ptr<osg::Object> osgDB::readRefObjectFile(const std::string& filename,c
return NULL;
}
osg::ref_ptr<osg::Image> osgDB::readRefImageFile(const std::string& filename,const ReaderWriter::Options* options)
osg::ref_ptr<osg::Image> osgDB::readRefImageFile(const std::string& filename,const Options* options)
{
ReaderWriter::ReadResult rr = Registry::instance()->readImage(filename,options);
if (rr.validImage()) return osg::ref_ptr<osg::Image>(rr.getImage());
@@ -271,7 +271,7 @@ osg::ref_ptr<osg::Image> osgDB::readRefImageFile(const std::string& filename,con
return NULL;
}
osg::ref_ptr<osg::Shader> osgDB::readRefShaderFile(const std::string& filename,const ReaderWriter::Options* options)
osg::ref_ptr<osg::Shader> osgDB::readRefShaderFile(const std::string& filename,const Options* options)
{
ReaderWriter::ReadResult rr = Registry::instance()->readShader(filename,options);
if (rr.validShader()) return osg::ref_ptr<osg::Shader>(rr.getShader());
@@ -279,7 +279,7 @@ osg::ref_ptr<osg::Shader> osgDB::readRefShaderFile(const std::string& filename,c
return NULL;
}
osg::ref_ptr<osg::HeightField> osgDB::readRefHeightFieldFile(const std::string& filename,const ReaderWriter::Options* options)
osg::ref_ptr<osg::HeightField> osgDB::readRefHeightFieldFile(const std::string& filename,const Options* options)
{
ReaderWriter::ReadResult rr = Registry::instance()->readHeightField(filename,options);
if (rr.validHeightField()) return osg::ref_ptr<osg::HeightField>(rr.getHeightField());
@@ -287,7 +287,7 @@ osg::ref_ptr<osg::HeightField> osgDB::readRefHeightFieldFile(const std::string&
return NULL;
}
osg::ref_ptr<osg::Node> osgDB::readRefNodeFile(const std::string& filename,const ReaderWriter::Options* options)
osg::ref_ptr<osg::Node> osgDB::readRefNodeFile(const std::string& filename,const Options* options)
{
ReaderWriter::ReadResult rr = Registry::instance()->readNode(filename,options);
if (rr.validNode()) return osg::ref_ptr<osg::Node>(rr.getNode());

View File

@@ -12,6 +12,7 @@
*/
#include <osgDB/ReaderWriter>
#include <osgDB/Registry>
#include <osgDB/FileNameUtils>
#include <osgDB/Archive>

View File

@@ -176,15 +176,15 @@ Registry::Registry()
// comment out because it was causing problems under OSX - causing it to crash osgconv when constructing ostream in osg::notify().
// notify(INFO) << "Constructing osg::Registry"<<std::endl;
_buildKdTreesHint = ReaderWriter::Options::NO_PREFERENCE;
_buildKdTreesHint = Options::NO_PREFERENCE;
_kdTreeBuilder = new osg::KdTreeBuilder;
const char* kdtree_str = getenv("OSG_BUILD_KDTREES");
if (kdtree_str)
{
bool switchOff = (strcmp(kdtree_str, "off")==0 || strcmp(kdtree_str, "OFF")==0 || strcmp(kdtree_str, "Off")==0 );
if (switchOff) _buildKdTreesHint = ReaderWriter::Options::DO_NOT_BUILD_KDTREES;
else _buildKdTreesHint = ReaderWriter::Options::BUILD_KDTREES;
if (switchOff) _buildKdTreesHint = Options::DO_NOT_BUILD_KDTREES;
else _buildKdTreesHint = Options::BUILD_KDTREES;
}
const char* fileCachePath = getenv("OSG_FILE_CACHE");
@@ -462,7 +462,7 @@ void Registry::readCommandLine(osg::ArgumentParser& arguments)
while(arguments.read("-O",value))
{
setOptions(new ReaderWriter::Options(value));
setOptions(new Options(value));
}
}
@@ -1417,7 +1417,7 @@ bool Registry::writeObject(const osg::Object& obj,Output& fw)
struct Registry::ReadObjectFunctor : public Registry::ReadFunctor
{
ReadObjectFunctor(const std::string& filename, const ReaderWriter::Options* options):ReadFunctor(filename,options) {}
ReadObjectFunctor(const std::string& filename, const Options* options):ReadFunctor(filename,options) {}
virtual ReaderWriter::ReadResult doRead(ReaderWriter& rw) const { return rw.readObject(_filename, _options); }
virtual bool isValid(ReaderWriter::ReadResult& readResult) const { return readResult.validObject(); }
@@ -1426,7 +1426,7 @@ struct Registry::ReadObjectFunctor : public Registry::ReadFunctor
struct Registry::ReadImageFunctor : public Registry::ReadFunctor
{
ReadImageFunctor(const std::string& filename, const ReaderWriter::Options* options):ReadFunctor(filename,options) {}
ReadImageFunctor(const std::string& filename, const Options* options):ReadFunctor(filename,options) {}
virtual ReaderWriter::ReadResult doRead(ReaderWriter& rw)const { return rw.readImage(_filename, _options); }
virtual bool isValid(ReaderWriter::ReadResult& readResult) const { return readResult.validImage(); }
@@ -1435,7 +1435,7 @@ struct Registry::ReadImageFunctor : public Registry::ReadFunctor
struct Registry::ReadHeightFieldFunctor : public Registry::ReadFunctor
{
ReadHeightFieldFunctor(const std::string& filename, const ReaderWriter::Options* options):ReadFunctor(filename,options) {}
ReadHeightFieldFunctor(const std::string& filename, const Options* options):ReadFunctor(filename,options) {}
virtual ReaderWriter::ReadResult doRead(ReaderWriter& rw) const { return rw.readHeightField(_filename, _options); }
virtual bool isValid(ReaderWriter::ReadResult& readResult) const { return readResult.validHeightField(); }
@@ -1444,7 +1444,7 @@ struct Registry::ReadHeightFieldFunctor : public Registry::ReadFunctor
struct Registry::ReadNodeFunctor : public Registry::ReadFunctor
{
ReadNodeFunctor(const std::string& filename, const ReaderWriter::Options* options):ReadFunctor(filename,options) {}
ReadNodeFunctor(const std::string& filename, const Options* options):ReadFunctor(filename,options) {}
virtual ReaderWriter::ReadResult doRead(ReaderWriter& rw) const { return rw.readNode(_filename, _options); }
virtual bool isValid(ReaderWriter::ReadResult& readResult) const { return readResult.validNode(); }
@@ -1454,7 +1454,7 @@ struct Registry::ReadNodeFunctor : public Registry::ReadFunctor
struct Registry::ReadArchiveFunctor : public Registry::ReadFunctor
{
ReadArchiveFunctor(const std::string& filename, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const ReaderWriter::Options* options):
ReadArchiveFunctor(const std::string& filename, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const Options* options):
ReadFunctor(filename,options),
_status(status),
_indexBlockSizeHint(indexBlockSizeHint) {}
@@ -1470,7 +1470,7 @@ struct Registry::ReadArchiveFunctor : public Registry::ReadFunctor
struct Registry::ReadShaderFunctor : public Registry::ReadFunctor
{
ReadShaderFunctor(const std::string& filename, const ReaderWriter::Options* options):ReadFunctor(filename,options) {}
ReadShaderFunctor(const std::string& filename, const Options* options):ReadFunctor(filename,options) {}
virtual ReaderWriter::ReadResult doRead(ReaderWriter& rw)const { return rw.readShader(_filename, _options); }
virtual bool isValid(ReaderWriter::ReadResult& readResult) const { return readResult.validShader(); }
@@ -1489,6 +1489,92 @@ void Registry::addArchiveExtension(const std::string ext)
_archiveExtList.push_back(ext);
}
std::string Registry::findDataFileImplementation(const std::string& filename, const Options* options, CaseSensitivity caseSensitivity)
{
if (filename.empty()) return filename;
if(fileExists(filename))
{
osg::notify(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
return filename;
}
std::string fileFound;
if (options && !options->getDatabasePathList().empty())
{
fileFound = findFileInPath(filename, options->getDatabasePathList(), caseSensitivity);
if (!fileFound.empty()) return fileFound;
}
const FilePathList& filepath = Registry::instance()->getDataFilePathList();
if (!filepath.empty())
{
fileFound = findFileInPath(filename, filepath,caseSensitivity);
if (!fileFound.empty()) return fileFound;
}
// if a directory is included in the filename, get just the (simple) filename itself and try that
std::string simpleFileName = getSimpleFileName(filename);
if (simpleFileName!=filename)
{
if(fileExists(simpleFileName))
{
osg::notify(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
return simpleFileName;
}
if (options && !options->getDatabasePathList().empty())
{
fileFound = findFileInPath(simpleFileName, options->getDatabasePathList(), caseSensitivity);
if (!fileFound.empty()) return fileFound;
}
if (!filepath.empty())
{
fileFound = findFileInPath(simpleFileName, filepath,caseSensitivity);
if (!fileFound.empty()) return fileFound;
}
}
// return empty string.
return std::string();
}
std::string Registry::findLibraryFileImplementation(const std::string& filename, const Options* options, CaseSensitivity caseSensitivity)
{
if (filename.empty())
return filename;
const FilePathList& filepath = Registry::instance()->getLibraryFilePathList();
std::string fileFound = findFileInPath(filename, filepath,caseSensitivity);
if (!fileFound.empty())
return fileFound;
if(fileExists(filename))
{
osg::notify(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
return filename;
}
// if a directory is included in the filename, get just the (simple) filename itself and try that
std::string simpleFileName = getSimpleFileName(filename);
if (simpleFileName!=filename)
{
std::string fileFound = findFileInPath(simpleFileName, filepath,caseSensitivity);
if (!fileFound.empty()) return fileFound;
}
// failed return empty string.
return std::string();
}
ReaderWriter::ReadResult Registry::read(const ReadFunctor& readFunctor)
{
for(ArchiveExtensionList::iterator aitr=_archiveExtList.begin();
@@ -1514,7 +1600,7 @@ ReaderWriter::ReadResult Registry::read(const ReadFunctor& readFunctor)
osgDB::Archive* archive = result.getArchive();
osg::ref_ptr<ReaderWriter::Options> options = new ReaderWriter::Options;
osg::ref_ptr<Options> options = new Options;
options->setDatabasePath(archiveName);
return archive->readObject(fileName,options.get());
@@ -1650,15 +1736,15 @@ ReaderWriter::ReadResult Registry::read(const ReadFunctor& readFunctor)
return results.front();
}
ReaderWriter::ReadResult Registry::readImplementation(const ReadFunctor& readFunctor,ReaderWriter::Options::CacheHintOptions cacheHint)
ReaderWriter::ReadResult Registry::readImplementation(const ReadFunctor& readFunctor,Options::CacheHintOptions cacheHint)
{
std::string file(readFunctor._filename);
bool useObjectCache=false;
//Note CACHE_ARCHIVES has a different object that it caches to so it will never be used here
if (cacheHint!=ReaderWriter::Options::CACHE_ARCHIVES)
if (cacheHint!=Options::CACHE_ARCHIVES)
{
const ReaderWriter::Options* options=readFunctor._options;
const Options* options=readFunctor._options;
useObjectCache=options ? (options->getObjectCacheHint()&cacheHint)!=0: false;
}
if (useObjectCache)
@@ -1698,17 +1784,17 @@ ReaderWriter::ReadResult Registry::readImplementation(const ReadFunctor& readFun
}
ReaderWriter::ReadResult Registry::openArchiveImplementation(const std::string& fileName, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const ReaderWriter::Options* options)
ReaderWriter::ReadResult Registry::openArchiveImplementation(const std::string& fileName, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const Options* options)
{
osgDB::Archive* archive = getFromArchiveCache(fileName);
if (archive) return archive;
ReaderWriter::ReadResult result = readImplementation(ReadArchiveFunctor(fileName, status, indexBlockSizeHint, options),ReaderWriter::Options::CACHE_ARCHIVES);
ReaderWriter::ReadResult result = readImplementation(ReadArchiveFunctor(fileName, status, indexBlockSizeHint, options),Options::CACHE_ARCHIVES);
// default to using caching archive if no options structure provided, but if options are provided use archives
// only if supplied.
if (result.validArchive() &&
(!options || (options->getObjectCacheHint() & ReaderWriter::Options::CACHE_ARCHIVES)) )
(!options || (options->getObjectCacheHint() & Options::CACHE_ARCHIVES)) )
{
addToArchiveCache(fileName,result.getArchive());
}
@@ -1716,12 +1802,12 @@ ReaderWriter::ReadResult Registry::openArchiveImplementation(const std::string&
}
ReaderWriter::ReadResult Registry::readObjectImplementation(const std::string& fileName,const ReaderWriter::Options* options)
ReaderWriter::ReadResult Registry::readObjectImplementation(const std::string& fileName,const Options* options)
{
return readImplementation(ReadObjectFunctor(fileName, options),ReaderWriter::Options::CACHE_OBJECTS);
return readImplementation(ReadObjectFunctor(fileName, options),Options::CACHE_OBJECTS);
}
ReaderWriter::WriteResult Registry::writeObjectImplementation(const Object& obj,const std::string& fileName,const ReaderWriter::Options* options)
ReaderWriter::WriteResult Registry::writeObjectImplementation(const Object& obj,const std::string& fileName,const Options* options)
{
// record the errors reported by readerwriters.
typedef std::vector<ReaderWriter::WriteResult> Results;
@@ -1768,12 +1854,12 @@ ReaderWriter::WriteResult Registry::writeObjectImplementation(const Object& obj,
ReaderWriter::ReadResult Registry::readImageImplementation(const std::string& fileName,const ReaderWriter::Options* options)
ReaderWriter::ReadResult Registry::readImageImplementation(const std::string& fileName,const Options* options)
{
return readImplementation(ReadImageFunctor(fileName, options),ReaderWriter::Options::CACHE_IMAGES);
return readImplementation(ReadImageFunctor(fileName, options),Options::CACHE_IMAGES);
}
ReaderWriter::WriteResult Registry::writeImageImplementation(const Image& image,const std::string& fileName,const ReaderWriter::Options* options)
ReaderWriter::WriteResult Registry::writeImageImplementation(const Image& image,const std::string& fileName,const Options* options)
{
// record the errors reported by readerwriters.
typedef std::vector<ReaderWriter::WriteResult> Results;
@@ -1821,12 +1907,12 @@ ReaderWriter::WriteResult Registry::writeImageImplementation(const Image& image,
}
ReaderWriter::ReadResult Registry::readHeightFieldImplementation(const std::string& fileName,const ReaderWriter::Options* options)
ReaderWriter::ReadResult Registry::readHeightFieldImplementation(const std::string& fileName,const Options* options)
{
return readImplementation(ReadHeightFieldFunctor(fileName, options),ReaderWriter::Options::CACHE_HEIGHTFIELDS);
return readImplementation(ReadHeightFieldFunctor(fileName, options),Options::CACHE_HEIGHTFIELDS);
}
ReaderWriter::WriteResult Registry::writeHeightFieldImplementation(const HeightField& HeightField,const std::string& fileName,const ReaderWriter::Options* options)
ReaderWriter::WriteResult Registry::writeHeightFieldImplementation(const HeightField& HeightField,const std::string& fileName,const Options* options)
{
// record the errors reported by readerwriters.
typedef std::vector<ReaderWriter::WriteResult> Results;
@@ -1874,24 +1960,24 @@ ReaderWriter::WriteResult Registry::writeHeightFieldImplementation(const HeightF
}
ReaderWriter::ReadResult Registry::readNodeImplementation(const std::string& fileName,const ReaderWriter::Options* options)
ReaderWriter::ReadResult Registry::readNodeImplementation(const std::string& fileName,const Options* options)
{
#if 0
osg::Timer_t startTick = osg::Timer::instance()->tick();
ReaderWriter::ReadResult result = readImplementation(ReadNodeFunctor(fileName, options),ReaderWriter::Options::CACHE_NODES);
ReaderWriter::ReadResult result = readImplementation(ReadNodeFunctor(fileName, options),Options::CACHE_NODES);
osg::Timer_t endTick = osg::Timer::instance()->tick();
osg::notify(osg::NOTICE)<<"time to load "<<fileName<<" "<<osg::Timer::instance()->delta_m(startTick, endTick)<<"ms"<<std::endl;
return result;
#else
return readImplementation(ReadNodeFunctor(fileName, options),ReaderWriter::Options::CACHE_NODES);
return readImplementation(ReadNodeFunctor(fileName, options),Options::CACHE_NODES);
#endif
}
ReaderWriter::WriteResult Registry::writeNodeImplementation(const Node& node,const std::string& fileName,const ReaderWriter::Options* options)
ReaderWriter::WriteResult Registry::writeNodeImplementation(const Node& node,const std::string& fileName,const Options* options)
{
// record the errors reported by readerwriters.
typedef std::vector<ReaderWriter::WriteResult> Results;
@@ -1941,12 +2027,12 @@ ReaderWriter::WriteResult Registry::writeNodeImplementation(const Node& node,con
return results.front();
}
ReaderWriter::ReadResult Registry::readShaderImplementation(const std::string& fileName,const ReaderWriter::Options* options)
ReaderWriter::ReadResult Registry::readShaderImplementation(const std::string& fileName,const Options* options)
{
return readImplementation(ReadShaderFunctor(fileName, options),ReaderWriter::Options::CACHE_SHADERS);
return readImplementation(ReadShaderFunctor(fileName, options),Options::CACHE_SHADERS);
}
ReaderWriter::WriteResult Registry::writeShaderImplementation(const Shader& shader,const std::string& fileName,const ReaderWriter::Options* options)
ReaderWriter::WriteResult Registry::writeShaderImplementation(const Shader& shader,const std::string& fileName,const Options* options)
{
// record the errors reported by readerwriters.
typedef std::vector<ReaderWriter::WriteResult> Results;

View File

@@ -24,7 +24,7 @@
using namespace osg;
using namespace osgDB;
bool osgDB::writeObjectFile(const Object& object,const std::string& filename, const ReaderWriter::Options* options )
bool osgDB::writeObjectFile(const Object& object,const std::string& filename, const Options* options )
{
ReaderWriter::WriteResult wr = Registry::instance()->writeObject( object, filename, options );
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
@@ -32,7 +32,7 @@ bool osgDB::writeObjectFile(const Object& object,const std::string& filename, co
}
bool osgDB::writeImageFile(const Image& image,const std::string& filename, const ReaderWriter::Options* options )
bool osgDB::writeImageFile(const Image& image,const std::string& filename, const Options* options )
{
ReaderWriter::WriteResult wr = Registry::instance()->writeImage( image, filename, options );
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
@@ -40,21 +40,21 @@ bool osgDB::writeImageFile(const Image& image,const std::string& filename, const
}
bool osgDB::writeHeightFieldFile(const HeightField& HeightField,const std::string& filename, const ReaderWriter::Options* options )
bool osgDB::writeHeightFieldFile(const HeightField& HeightField,const std::string& filename, const Options* options )
{
ReaderWriter::WriteResult wr = Registry::instance()->writeHeightField( HeightField, filename, options );
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
return wr.success();
}
bool osgDB::writeNodeFile(const Node& node,const std::string& filename, const ReaderWriter::Options* options )
bool osgDB::writeNodeFile(const Node& node,const std::string& filename, const Options* options )
{
ReaderWriter::WriteResult wr = Registry::instance()->writeNode( node, filename, options );
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
return wr.success();
}
bool osgDB::writeShaderFile(const Shader& shader,const std::string& filename, const ReaderWriter::Options* options )
bool osgDB::writeShaderFile(const Shader& shader,const std::string& filename, const Options* options )
{
ReaderWriter::WriteResult wr = Registry::instance()->writeShader( shader, filename, options );
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;

View File

@@ -18,7 +18,7 @@
using namespace osgDB;
XmlNode* osgDB::readXmlFile(const std::string& filename,const ReaderWriter::Options* options)
XmlNode* osgDB::readXmlFile(const std::string& filename,const Options* options)
{
std::string foundFile = osgDB::findDataFile(filename, options);
if (!foundFile.empty())

View File

@@ -27,6 +27,7 @@
#include <osg/PolygonOffset>
#include <osg/Depth>
#include <osgDB/ReaderWriter>
#include <osgDB/Options>
#include "Types.h"
#include "Record.h"

View File

@@ -21,7 +21,7 @@
#include <osg/Node>
#include <osg/Notify>
#include <osgDB/ReaderWriter>
#include <osgDB/Options>
#include <osgDB/FileNameUtils>
#include <string>
@@ -38,7 +38,7 @@ namespace flt
Features a parser for the Option string as well as getter
methods for supported options.
*/
class ExportOptions : public osgDB::ReaderWriter::Options
class ExportOptions : public osgDB::Options
{
public:
ExportOptions( const Options* opt );

View File

@@ -16,6 +16,8 @@
#include "PagedLOD.h"
#include "Node.h"
#include <osgDB/Options>
using namespace ive;
void PagedLOD::write(DataOutputStream* out)

View File

@@ -1405,6 +1405,15 @@ osgDB::ReaderWriter::ReadResult ReaderWriterP3DXML::readNode(const std::string&
return readNode(input, local_opt);
}
struct MyFindFileCallback : public osgDB::FindFileCallback
{
virtual std::string findDataFile(const std::string& filename, const osgDB::Options* options, osgDB::CaseSensitivity caseSensitivity)
{
osg::notify(osg::NOTICE)<<"find file "<<filename<<std::endl;
return osgDB::Registry::instance()->findDataFileImplementation(filename, options, caseSensitivity);
}
};
osgDB::ReaderWriter::ReadResult ReaderWriterP3DXML::readNode(std::istream& fin, const Options* options) const
{
osgDB::XmlNode::Input input;
@@ -1412,6 +1421,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterP3DXML::readNode(std::istream& fin,
input.readAllDataIntoBuffer();
osg::ref_ptr<osgDB::ReaderWriter::Options> local_opt = options ? static_cast<osgDB::ReaderWriter::Options*>(options->clone(osg::CopyOp::SHALLOW_COPY)) : new Options;
local_opt->setFindFileCallback(new MyFindFileCallback);
return readNode(input, local_opt);
}
@@ -1429,6 +1439,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterP3DXML::readNode(osgDB::XmlNode::Inp
doc->read(input);
// doc->write(std::cout);
if (doc == NULL )

View File

@@ -97,8 +97,13 @@ configure file /osg\/BoundingBox/
end
configure file /osg\/BoundingSphere/
emit before "#include <osg/BoundingBox>
"
emit before "#include <osg/BoundingBox>
"
end
configure file /osgDB\/ReaderWriter/
emit before "#include <osgDB/Options>
"
end
#############################################################################

View File

@@ -23,7 +23,7 @@
#endif
#include <osg/BoundingBox>
TYPE_NAME_ALIAS(osg::BoundingSphereImpl< osg::Vec3f >, osg::BoundingSpheref)
TYPE_NAME_ALIAS(osg::BoundingSphereImpl< osg::Vec3d >, osg::BoundingSphered)

View File

@@ -15,6 +15,7 @@
#include <osg/Object>
#include <osg/Shape>
#include <osgDB/Archive>
#include <osgDB/Options>
#include <osgDB/ReaderWriter>
// Must undefine IN and OUT macros defined in Windows headers
@@ -68,42 +69,42 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osgDB::Archive)
__bool__getFileNames__FileNameList_R1,
"Get the full list of file names available in the archive. ",
"");
I_MethodWithDefaults2(osgDB::ReaderWriter::ReadResult, readObject, IN, const std::string &, x, , IN, const osgDB::ReaderWriter::Options *, x, NULL,
I_MethodWithDefaults2(osgDB::ReaderWriter::ReadResult, readObject, IN, const std::string &, x, , IN, const osgDB::Options *, x, NULL,
Properties::PURE_VIRTUAL,
__ReadResult__readObject__C5_std_string_R1__C5_Options_P1,
"",
"");
I_MethodWithDefaults2(osgDB::ReaderWriter::ReadResult, readImage, IN, const std::string &, x, , IN, const osgDB::ReaderWriter::Options *, x, NULL,
I_MethodWithDefaults2(osgDB::ReaderWriter::ReadResult, readImage, IN, const std::string &, x, , IN, const osgDB::Options *, x, NULL,
Properties::PURE_VIRTUAL,
__ReadResult__readImage__C5_std_string_R1__C5_Options_P1,
"",
"");
I_MethodWithDefaults2(osgDB::ReaderWriter::ReadResult, readHeightField, IN, const std::string &, x, , IN, const osgDB::ReaderWriter::Options *, x, NULL,
I_MethodWithDefaults2(osgDB::ReaderWriter::ReadResult, readHeightField, IN, const std::string &, x, , IN, const osgDB::Options *, x, NULL,
Properties::PURE_VIRTUAL,
__ReadResult__readHeightField__C5_std_string_R1__C5_Options_P1,
"",
"");
I_MethodWithDefaults2(osgDB::ReaderWriter::ReadResult, readNode, IN, const std::string &, x, , IN, const osgDB::ReaderWriter::Options *, x, NULL,
I_MethodWithDefaults2(osgDB::ReaderWriter::ReadResult, readNode, IN, const std::string &, x, , IN, const osgDB::Options *, x, NULL,
Properties::PURE_VIRTUAL,
__ReadResult__readNode__C5_std_string_R1__C5_Options_P1,
"",
"");
I_MethodWithDefaults3(osgDB::ReaderWriter::WriteResult, writeObject, IN, const osg::Object &, x, , IN, const std::string &, x, , IN, const osgDB::ReaderWriter::Options *, x, NULL,
I_MethodWithDefaults3(osgDB::ReaderWriter::WriteResult, writeObject, IN, const osg::Object &, x, , IN, const std::string &, x, , IN, const osgDB::Options *, x, NULL,
Properties::PURE_VIRTUAL,
__WriteResult__writeObject__C5_osg_Object_R1__C5_std_string_R1__C5_Options_P1,
"",
"");
I_MethodWithDefaults3(osgDB::ReaderWriter::WriteResult, writeImage, IN, const osg::Image &, x, , IN, const std::string &, x, , IN, const osgDB::ReaderWriter::Options *, x, NULL,
I_MethodWithDefaults3(osgDB::ReaderWriter::WriteResult, writeImage, IN, const osg::Image &, x, , IN, const std::string &, x, , IN, const osgDB::Options *, x, NULL,
Properties::PURE_VIRTUAL,
__WriteResult__writeImage__C5_osg_Image_R1__C5_std_string_R1__C5_Options_P1,
"",
"");
I_MethodWithDefaults3(osgDB::ReaderWriter::WriteResult, writeHeightField, IN, const osg::HeightField &, x, , IN, const std::string &, x, , IN, const osgDB::ReaderWriter::Options *, x, NULL,
I_MethodWithDefaults3(osgDB::ReaderWriter::WriteResult, writeHeightField, IN, const osg::HeightField &, x, , IN, const std::string &, x, , IN, const osgDB::Options *, x, NULL,
Properties::PURE_VIRTUAL,
__WriteResult__writeHeightField__C5_osg_HeightField_R1__C5_std_string_R1__C5_Options_P1,
"",
"");
I_MethodWithDefaults3(osgDB::ReaderWriter::WriteResult, writeNode, IN, const osg::Node &, x, , IN, const std::string &, x, , IN, const osgDB::ReaderWriter::Options *, x, NULL,
I_MethodWithDefaults3(osgDB::ReaderWriter::WriteResult, writeNode, IN, const osg::Node &, x, , IN, const std::string &, x, , IN, const osgDB::Options *, x, NULL,
Properties::PURE_VIRTUAL,
__WriteResult__writeNode__C5_osg_Node_R1__C5_std_string_R1__C5_Options_P1,
"",

View File

@@ -19,7 +19,7 @@
#include <osg/Referenced>
#include <osg/State>
#include <osgDB/DatabasePager>
#include <osgDB/ReaderWriter>
#include <osgDB/Options>
// Must undefine IN and OUT macros defined in Windows headers
#ifdef IN
@@ -74,9 +74,9 @@ BEGIN_OBJECT_REFLECTOR(osgDB::DatabasePager)
__void__requestNodeFile__C5_std_string_R1__osg_Group_P1__float__C5_osg_FrameStamp_P1__osg_ref_ptrT1_osg_Referenced__R1,
"Add a request to load a node file to end the the database request list. ",
"");
I_Method6(void, requestNodeFile, IN, const std::string &, fileName, IN, osg::Group *, group, IN, float, priority, IN, const osg::FrameStamp *, framestamp, IN, osg::ref_ptr< osg::Referenced > &, databaseRequest, IN, osgDB::ReaderWriter::Options *, loadOptions,
I_Method6(void, requestNodeFile, IN, const std::string &, fileName, IN, osg::Group *, group, IN, float, priority, IN, const osg::FrameStamp *, framestamp, IN, osg::ref_ptr< osg::Referenced > &, databaseRequest, IN, osgDB::Options *, loadOptions,
Properties::VIRTUAL,
__void__requestNodeFile__C5_std_string_R1__osg_Group_P1__float__C5_osg_FrameStamp_P1__osg_ref_ptrT1_osg_Referenced__R1__ReaderWriter_Options_P1,
__void__requestNodeFile__C5_std_string_R1__osg_Group_P1__float__C5_osg_FrameStamp_P1__osg_ref_ptrT1_osg_Referenced__R1__Options_P1,
"",
"");
I_Method1(int, setSchedulePriority, IN, OpenThreads::Thread::ThreadPriority, priority,

View File

@@ -20,12 +20,6 @@
#undef OUT
#endif
BEGIN_ENUM_REFLECTOR(osgDB::CaseSensitivity)
I_DeclaringFile("osgDB/FileUtils");
I_EnumLabel(osgDB::CASE_SENSITIVE);
I_EnumLabel(osgDB::CASE_INSENSITIVE);
END_REFLECTOR
BEGIN_ENUM_REFLECTOR(osgDB::FileType)
I_DeclaringFile("osgDB/FileUtils");
I_EnumLabel(osgDB::FILE_NOT_FOUND);

View File

@@ -38,7 +38,7 @@ END_REFLECTOR
BEGIN_OBJECT_REFLECTOR(osgDB::ImageOptions)
I_DeclaringFile("osgDB/ImageOptions");
I_BaseType(osgDB::ReaderWriter::Options);
I_BaseType(osgDB::Options);
I_Constructor0(____ImageOptions,
"",
"");

View File

@@ -18,7 +18,7 @@
#include <osg/StateAttribute>
#include <osg/Uniform>
#include <osgDB/Input>
#include <osgDB/ReaderWriter>
#include <osgDB/Options>
#include <osgDB/Registry>
// Must undefine IN and OUT macros defined in Windows headers
@@ -37,14 +37,14 @@ BEGIN_OBJECT_REFLECTOR(osgDB::Input)
I_Constructor0(____Input,
"",
"");
I_Method1(void, setOptions, IN, const osgDB::ReaderWriter::Options *, options,
I_Method1(void, setOptions, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__void__setOptions__C5_ReaderWriter_Options_P1,
__void__setOptions__C5_Options_P1,
"",
"");
I_Method0(const osgDB::ReaderWriter::Options *, getOptions,
I_Method0(const osgDB::Options *, getOptions,
Properties::NON_VIRTUAL,
__C5_ReaderWriter_Options_P1__getOptions,
__C5_Options_P1__getOptions,
"",
"");
I_Method1(osg::Object *, readObjectOfType, IN, const osg::Object &, compObj,
@@ -207,8 +207,8 @@ BEGIN_OBJECT_REFLECTOR(osgDB::Input)
__bool__read__C5_char_P1__Parameter__Parameter__Parameter__Parameter__Parameter__Parameter__Parameter__Parameter,
"",
"");
I_SimpleProperty(const osgDB::ReaderWriter::Options *, Options,
__C5_ReaderWriter_Options_P1__getOptions,
__void__setOptions__C5_ReaderWriter_Options_P1);
I_SimpleProperty(const osgDB::Options *, Options,
__C5_Options_P1__getOptions,
__void__setOptions__C5_Options_P1);
END_REFLECTOR

View File

@@ -0,0 +1,350 @@
// ***************************************************************************
//
// Generated automatically by genwrapper.
// Please DO NOT EDIT this file!
//
// ***************************************************************************
#include <osgIntrospection/ReflectionMacros>
#include <osgIntrospection/TypedMethodInfo>
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <osg/CopyOp>
#include <osg/Image>
#include <osg/Node>
#include <osg/Object>
#include <osg/Shader>
#include <osg/Shape>
#include <osgDB/AuthenticationMap>
#include <osgDB/Options>
#include <osgDB/ReaderWriter>
// Must undefine IN and OUT macros defined in Windows headers
#ifdef IN
#undef IN
#endif
#ifdef OUT
#undef OUT
#endif
BEGIN_OBJECT_REFLECTOR(osgDB::FindFileCallback)
I_DeclaringFile("osgDB/Options");
I_VirtualBaseType(osg::Referenced);
I_Constructor0(____FindFileCallback,
"",
"");
I_Method3(std::string, findDataFile, IN, const std::string &, filename, IN, const osgDB::Options *, options, IN, osgDB::CaseSensitivity, caseSensitivity,
Properties::VIRTUAL,
__std_string__findDataFile__C5_std_string_R1__C5_Options_P1__CaseSensitivity,
"",
"");
I_Method3(std::string, findLibraryFile, IN, const std::string &, filename, IN, const osgDB::Options *, options, IN, osgDB::CaseSensitivity, caseSensitivity,
Properties::VIRTUAL,
__std_string__findLibraryFile__C5_std_string_R1__C5_Options_P1__CaseSensitivity,
"",
"");
END_REFLECTOR
BEGIN_ENUM_REFLECTOR(osgDB::Options::CacheHintOptions)
I_DeclaringFile("osgDB/Options");
I_EnumLabel(osgDB::Options::CACHE_NONE);
I_EnumLabel(osgDB::Options::CACHE_NODES);
I_EnumLabel(osgDB::Options::CACHE_IMAGES);
I_EnumLabel(osgDB::Options::CACHE_HEIGHTFIELDS);
I_EnumLabel(osgDB::Options::CACHE_ARCHIVES);
I_EnumLabel(osgDB::Options::CACHE_OBJECTS);
I_EnumLabel(osgDB::Options::CACHE_SHADERS);
I_EnumLabel(osgDB::Options::CACHE_ALL);
END_REFLECTOR
BEGIN_ENUM_REFLECTOR(osgDB::Options::BuildKdTreesHint)
I_DeclaringFile("osgDB/Options");
I_EnumLabel(osgDB::Options::NO_PREFERENCE);
I_EnumLabel(osgDB::Options::DO_NOT_BUILD_KDTREES);
I_EnumLabel(osgDB::Options::BUILD_KDTREES);
END_REFLECTOR
BEGIN_OBJECT_REFLECTOR(osgDB::Options)
I_DeclaringFile("osgDB/Options");
I_BaseType(osg::Object);
I_Constructor0(____Options,
"",
"");
I_Constructor1(IN, const std::string &, str,
Properties::NON_EXPLICIT,
____Options__C5_std_string_R1,
"",
"");
I_ConstructorWithDefaults2(IN, const osgDB::Options &, options, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY,
____Options__C5_Options_R1__C5_osg_CopyOp_R1,
"",
"");
I_Method0(osg::Object *, cloneType,
Properties::VIRTUAL,
__osg_Object_P1__cloneType,
"Clone the type of an object, with Object* return type. ",
"Must be defined by derived classes. ");
I_Method1(osg::Object *, clone, IN, const osg::CopyOp &, x,
Properties::VIRTUAL,
__osg_Object_P1__clone__C5_osg_CopyOp_R1,
"Clone an object, with Object* return type. ",
"Must be defined by derived classes. ");
I_Method1(bool, isSameKindAs, IN, const osg::Object *, obj,
Properties::VIRTUAL,
__bool__isSameKindAs__C5_osg_Object_P1,
"",
"");
I_Method0(const char *, libraryName,
Properties::VIRTUAL,
__C5_char_P1__libraryName,
"return the name of the object's library. ",
"Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name. ");
I_Method0(const char *, className,
Properties::VIRTUAL,
__C5_char_P1__className,
"return the name of the object's class type. ",
"Must be defined by derived classes. ");
I_Method1(void, setOptionString, IN, const std::string &, str,
Properties::NON_VIRTUAL,
__void__setOptionString__C5_std_string_R1,
"Set the general Options string. ",
"");
I_Method0(const std::string &, getOptionString,
Properties::NON_VIRTUAL,
__C5_std_string_R1__getOptionString,
"Get the general Options string. ",
"");
I_Method1(void, setDatabasePath, IN, const std::string &, str,
Properties::NON_VIRTUAL,
__void__setDatabasePath__C5_std_string_R1,
"Set the database path to use a hint of where to look when loading models. ",
"");
I_Method0(osgDB::FilePathList &, getDatabasePathList,
Properties::NON_VIRTUAL,
__FilePathList_R1__getDatabasePathList,
"Get the database path which is used a hint of where to look when loading models. ",
"");
I_Method0(const osgDB::FilePathList &, getDatabasePathList,
Properties::NON_VIRTUAL,
__C5_FilePathList_R1__getDatabasePathList,
"Get the const database path which is used a hint of where to look when loading models. ",
"");
I_Method1(void, setObjectCacheHint, IN, osgDB::Options::CacheHintOptions, useObjectCache,
Properties::NON_VIRTUAL,
__void__setObjectCacheHint__CacheHintOptions,
"Set whether the Registry::ObjectCache should be used by default. ",
"");
I_Method0(osgDB::Options::CacheHintOptions, getObjectCacheHint,
Properties::NON_VIRTUAL,
__CacheHintOptions__getObjectCacheHint,
"Get whether the Registry::ObjectCache should be used by default. ",
"");
I_Method1(void, setBuildKdTreesHint, IN, osgDB::Options::BuildKdTreesHint, hint,
Properties::NON_VIRTUAL,
__void__setBuildKdTreesHint__BuildKdTreesHint,
"Set whether the KdTrees should be built for geometry in the loader model. ",
"");
I_Method0(osgDB::Options::BuildKdTreesHint, getBuildKdTreesHint,
Properties::NON_VIRTUAL,
__BuildKdTreesHint__getBuildKdTreesHint,
"Get whether the KdTrees should be built for geometry in the loader model. ",
"");
I_Method1(void, setAuthenticationMap, IN, osgDB::AuthenticationMap *, authenticationMap,
Properties::NON_VIRTUAL,
__void__setAuthenticationMap__AuthenticationMap_P1,
"Set the password map to be used by plugins when access files from secure locations. ",
"");
I_Method0(const osgDB::AuthenticationMap *, getAuthenticationMap,
Properties::NON_VIRTUAL,
__C5_AuthenticationMap_P1__getAuthenticationMap,
"Get the password map to be used by plugins when access files from secure locations. ",
"");
I_Method2(void, setPluginData, IN, const std::string &, s, IN, void *, v,
Properties::NON_VIRTUAL,
__void__setPluginData__C5_std_string_R1__void_P1,
"Sets a plugindata value PluginData with a string. ",
"");
I_Method1(void *, getPluginData, IN, const std::string &, s,
Properties::NON_VIRTUAL,
__void_P1__getPluginData__C5_std_string_R1,
"Get a value from the PluginData. ",
"");
I_Method1(const void *, getPluginData, IN, const std::string &, s,
Properties::NON_VIRTUAL,
__C5_void_P1__getPluginData__C5_std_string_R1,
"Get a value from the PluginData. ",
"");
I_Method1(void, removePluginData, IN, const std::string &, s,
Properties::NON_VIRTUAL,
__void__removePluginData__C5_std_string_R1,
"Remove a value from the PluginData. ",
"");
I_Method2(void, setPluginStringData, IN, const std::string &, s, IN, const std::string &, v,
Properties::NON_VIRTUAL,
__void__setPluginStringData__C5_std_string_R1__C5_std_string_R1,
"Sets a plugindata value PluginData with a string. ",
"");
I_Method1(std::string, getPluginStringData, IN, const std::string &, s,
Properties::NON_VIRTUAL,
__std_string__getPluginStringData__C5_std_string_R1,
"Get a string from the PluginStrData. ",
"");
I_Method1(const std::string, getPluginStringData, IN, const std::string &, s,
Properties::NON_VIRTUAL,
__C5_std_string__getPluginStringData__C5_std_string_R1,
"Get a value from the PluginData. ",
"");
I_Method1(void, removePluginStringData, IN, const std::string &, s,
Properties::NON_VIRTUAL,
__void__removePluginStringData__C5_std_string_R1,
"Remove a value from the PluginData. ",
"");
I_Method1(void, setFindFileCallback, IN, osgDB::FindFileCallback *, cb,
Properties::NON_VIRTUAL,
__void__setFindFileCallback__FindFileCallback_P1,
"Set the find callback to use in place of the default findFile calls. ",
"");
I_Method0(osgDB::FindFileCallback *, getFindFileCallback,
Properties::NON_VIRTUAL,
__FindFileCallback_P1__getFindFileCallback,
"Get the const findFile callback. ",
"");
I_Method1(void, setReadFileCallback, IN, osgDB::ReadFileCallback *, cb,
Properties::NON_VIRTUAL,
__void__setReadFileCallback__ReadFileCallback_P1,
"Set the read callback to use in place of the default readFile calls. ",
"");
I_Method0(osgDB::ReadFileCallback *, getReadFileCallback,
Properties::NON_VIRTUAL,
__ReadFileCallback_P1__getReadFileCallback,
"Get the const readFile callback. ",
"");
I_Method1(void, setWriteFileCallback, IN, osgDB::WriteFileCallback *, cb,
Properties::NON_VIRTUAL,
__void__setWriteFileCallback__WriteFileCallback_P1,
"Set the Registry callback to use in place of the default writeFile calls. ",
"");
I_Method0(osgDB::WriteFileCallback *, getWriteFileCallback,
Properties::NON_VIRTUAL,
__WriteFileCallback_P1__getWriteFileCallback,
"Get the const writeFile callback. ",
"");
I_SimpleProperty(osgDB::AuthenticationMap *, AuthenticationMap,
0,
__void__setAuthenticationMap__AuthenticationMap_P1);
I_SimpleProperty(osgDB::Options::BuildKdTreesHint, BuildKdTreesHint,
__BuildKdTreesHint__getBuildKdTreesHint,
__void__setBuildKdTreesHint__BuildKdTreesHint);
I_SimpleProperty(const std::string &, DatabasePath,
0,
__void__setDatabasePath__C5_std_string_R1);
I_SimpleProperty(osgDB::FilePathList &, DatabasePathList,
__FilePathList_R1__getDatabasePathList,
0);
I_SimpleProperty(osgDB::FindFileCallback *, FindFileCallback,
__FindFileCallback_P1__getFindFileCallback,
__void__setFindFileCallback__FindFileCallback_P1);
I_SimpleProperty(osgDB::Options::CacheHintOptions, ObjectCacheHint,
__CacheHintOptions__getObjectCacheHint,
__void__setObjectCacheHint__CacheHintOptions);
I_SimpleProperty(const std::string &, OptionString,
__C5_std_string_R1__getOptionString,
__void__setOptionString__C5_std_string_R1);
I_IndexedProperty(void *, PluginData,
__void_P1__getPluginData__C5_std_string_R1,
__void__setPluginData__C5_std_string_R1__void_P1,
0);
I_IndexedProperty(std::string, PluginStringData,
__std_string__getPluginStringData__C5_std_string_R1,
__void__setPluginStringData__C5_std_string_R1__C5_std_string_R1,
0);
I_SimpleProperty(osgDB::ReadFileCallback *, ReadFileCallback,
__ReadFileCallback_P1__getReadFileCallback,
__void__setReadFileCallback__ReadFileCallback_P1);
I_SimpleProperty(osgDB::WriteFileCallback *, WriteFileCallback,
__WriteFileCallback_P1__getWriteFileCallback,
__void__setWriteFileCallback__WriteFileCallback_P1);
END_REFLECTOR
BEGIN_OBJECT_REFLECTOR(osgDB::ReadFileCallback)
I_DeclaringFile("osgDB/Options");
I_VirtualBaseType(osg::Referenced);
I_Constructor0(____ReadFileCallback,
"",
"");
I_Method4(osgDB::ReaderWriter::ReadResult, openArchive, IN, const std::string &, filename, IN, osgDB::ReaderWriter::ArchiveStatus, status, IN, unsigned int, indexBlockSizeHint, IN, const osgDB::Options *, useObjectCache,
Properties::VIRTUAL,
__ReaderWriter_ReadResult__openArchive__C5_std_string_R1__ReaderWriter_ArchiveStatus__unsigned_int__C5_Options_P1,
"",
"");
I_Method2(osgDB::ReaderWriter::ReadResult, readObject, IN, const std::string &, filename, IN, const osgDB::Options *, options,
Properties::VIRTUAL,
__ReaderWriter_ReadResult__readObject__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method2(osgDB::ReaderWriter::ReadResult, readImage, IN, const std::string &, filename, IN, const osgDB::Options *, options,
Properties::VIRTUAL,
__ReaderWriter_ReadResult__readImage__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method2(osgDB::ReaderWriter::ReadResult, readHeightField, IN, const std::string &, filename, IN, const osgDB::Options *, options,
Properties::VIRTUAL,
__ReaderWriter_ReadResult__readHeightField__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method2(osgDB::ReaderWriter::ReadResult, readNode, IN, const std::string &, filename, IN, const osgDB::Options *, options,
Properties::VIRTUAL,
__ReaderWriter_ReadResult__readNode__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method2(osgDB::ReaderWriter::ReadResult, readShader, IN, const std::string &, filename, IN, const osgDB::Options *, options,
Properties::VIRTUAL,
__ReaderWriter_ReadResult__readShader__C5_std_string_R1__C5_Options_P1,
"",
"");
END_REFLECTOR
BEGIN_OBJECT_REFLECTOR(osgDB::WriteFileCallback)
I_DeclaringFile("osgDB/Options");
I_VirtualBaseType(osg::Referenced);
I_Constructor0(____WriteFileCallback,
"",
"");
I_Method3(osgDB::ReaderWriter::WriteResult, writeObject, IN, const osg::Object &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::VIRTUAL,
__ReaderWriter_WriteResult__writeObject__C5_osg_Object_R1__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method3(osgDB::ReaderWriter::WriteResult, writeImage, IN, const osg::Image &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::VIRTUAL,
__ReaderWriter_WriteResult__writeImage__C5_osg_Image_R1__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method3(osgDB::ReaderWriter::WriteResult, writeHeightField, IN, const osg::HeightField &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::VIRTUAL,
__ReaderWriter_WriteResult__writeHeightField__C5_osg_HeightField_R1__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method3(osgDB::ReaderWriter::WriteResult, writeNode, IN, const osg::Node &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::VIRTUAL,
__ReaderWriter_WriteResult__writeNode__C5_osg_Node_R1__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method3(osgDB::ReaderWriter::WriteResult, writeShader, IN, const osg::Shader &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::VIRTUAL,
__ReaderWriter_WriteResult__writeShader__C5_osg_Shader_R1__C5_std_string_R1__C5_Options_P1,
"",
"");
END_REFLECTOR
BEGIN_ENUM_REFLECTOR(osgDB::CaseSensitivity)
I_DeclaringFile("osgDB/Options");
I_EnumLabel(osgDB::CASE_SENSITIVE);
I_EnumLabel(osgDB::CASE_INSENSITIVE);
END_REFLECTOR
TYPE_NAME_ALIAS(std::deque< std::string >, osgDB::FilePathList)
STD_VECTOR_REFLECTOR(std::deque< std::string >)

View File

@@ -11,8 +11,8 @@
#include <osgIntrospection/Attributes>
#include <osg/Object>
#include <osgDB/Options>
#include <osgDB/Output>
#include <osgDB/ReaderWriter>
// Must undefine IN and OUT macros defined in Windows headers
#ifdef IN

View File

@@ -17,7 +17,6 @@
#include <osg/Shader>
#include <osg/Shape>
#include <osgDB/Archive>
#include <osgDB/AuthenticationMap>
#include <osgDB/ReaderWriter>
// Must undefine IN and OUT macros defined in Windows headers
@@ -28,6 +27,8 @@
#undef OUT
#endif
#include <osgDB/Options>
BEGIN_ENUM_REFLECTOR(osgDB::ReaderWriter::Features)
I_DeclaringFile("osgDB/ReaderWriter");
I_EnumLabel(osgDB::ReaderWriter::FEATURE_NONE);
@@ -55,6 +56,8 @@ TYPE_NAME_ALIAS(std::map< std::string COMMA std::string >, osgDB::ReaderWriter:
TYPE_NAME_ALIAS(std::list< std::string >, osgDB::ReaderWriter::FeatureList)
TYPE_NAME_ALIAS(osgDB::Options, osgDB::ReaderWriter::Options)
BEGIN_OBJECT_REFLECTOR(osgDB::ReaderWriter)
I_DeclaringFile("osgDB/ReaderWriter");
I_BaseType(osg::Object);
@@ -249,188 +252,6 @@ BEGIN_OBJECT_REFLECTOR(osgDB::ReaderWriter)
"");
END_REFLECTOR
BEGIN_ENUM_REFLECTOR(osgDB::ReaderWriter::Options::CacheHintOptions)
I_DeclaringFile("osgDB/ReaderWriter");
I_EnumLabel(osgDB::ReaderWriter::Options::CACHE_NONE);
I_EnumLabel(osgDB::ReaderWriter::Options::CACHE_NODES);
I_EnumLabel(osgDB::ReaderWriter::Options::CACHE_IMAGES);
I_EnumLabel(osgDB::ReaderWriter::Options::CACHE_HEIGHTFIELDS);
I_EnumLabel(osgDB::ReaderWriter::Options::CACHE_ARCHIVES);
I_EnumLabel(osgDB::ReaderWriter::Options::CACHE_OBJECTS);
I_EnumLabel(osgDB::ReaderWriter::Options::CACHE_SHADERS);
I_EnumLabel(osgDB::ReaderWriter::Options::CACHE_ALL);
END_REFLECTOR
BEGIN_ENUM_REFLECTOR(osgDB::ReaderWriter::Options::BuildKdTreesHint)
I_DeclaringFile("osgDB/ReaderWriter");
I_EnumLabel(osgDB::ReaderWriter::Options::NO_PREFERENCE);
I_EnumLabel(osgDB::ReaderWriter::Options::DO_NOT_BUILD_KDTREES);
I_EnumLabel(osgDB::ReaderWriter::Options::BUILD_KDTREES);
END_REFLECTOR
BEGIN_OBJECT_REFLECTOR(osgDB::ReaderWriter::Options)
I_DeclaringFile("osgDB/ReaderWriter");
I_BaseType(osg::Object);
I_Constructor0(____Options,
"",
"");
I_Constructor1(IN, const std::string &, str,
Properties::NON_EXPLICIT,
____Options__C5_std_string_R1,
"",
"");
I_ConstructorWithDefaults2(IN, const osgDB::ReaderWriter::Options &, options, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY,
____Options__C5_Options_R1__C5_osg_CopyOp_R1,
"",
"");
I_Method0(osg::Object *, cloneType,
Properties::VIRTUAL,
__osg_Object_P1__cloneType,
"Clone the type of an object, with Object* return type. ",
"Must be defined by derived classes. ");
I_Method1(osg::Object *, clone, IN, const osg::CopyOp &, x,
Properties::VIRTUAL,
__osg_Object_P1__clone__C5_osg_CopyOp_R1,
"Clone an object, with Object* return type. ",
"Must be defined by derived classes. ");
I_Method1(bool, isSameKindAs, IN, const osg::Object *, obj,
Properties::VIRTUAL,
__bool__isSameKindAs__C5_osg_Object_P1,
"",
"");
I_Method0(const char *, libraryName,
Properties::VIRTUAL,
__C5_char_P1__libraryName,
"return the name of the object's library. ",
"Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name. ");
I_Method0(const char *, className,
Properties::VIRTUAL,
__C5_char_P1__className,
"return the name of the object's class type. ",
"Must be defined by derived classes. ");
I_Method1(void, setOptionString, IN, const std::string &, str,
Properties::NON_VIRTUAL,
__void__setOptionString__C5_std_string_R1,
"Set the general Options string. ",
"");
I_Method0(const std::string &, getOptionString,
Properties::NON_VIRTUAL,
__C5_std_string_R1__getOptionString,
"Get the general Options string. ",
"");
I_Method1(void, setDatabasePath, IN, const std::string &, str,
Properties::NON_VIRTUAL,
__void__setDatabasePath__C5_std_string_R1,
"Set the database path to use a hint of where to look when loading models. ",
"");
I_Method0(osgDB::FilePathList &, getDatabasePathList,
Properties::NON_VIRTUAL,
__FilePathList_R1__getDatabasePathList,
"Get the database path which is used a hint of where to look when loading models. ",
"");
I_Method0(const osgDB::FilePathList &, getDatabasePathList,
Properties::NON_VIRTUAL,
__C5_FilePathList_R1__getDatabasePathList,
"Get the const database path which is used a hint of where to look when loading models. ",
"");
I_Method1(void, setObjectCacheHint, IN, osgDB::ReaderWriter::Options::CacheHintOptions, useObjectCache,
Properties::NON_VIRTUAL,
__void__setObjectCacheHint__CacheHintOptions,
"Set whether the Registry::ObjectCache should be used by default. ",
"");
I_Method0(osgDB::ReaderWriter::Options::CacheHintOptions, getObjectCacheHint,
Properties::NON_VIRTUAL,
__CacheHintOptions__getObjectCacheHint,
"Get whether the Registry::ObjectCache should be used by default. ",
"");
I_Method1(void, setBuildKdTreesHint, IN, osgDB::ReaderWriter::Options::BuildKdTreesHint, hint,
Properties::NON_VIRTUAL,
__void__setBuildKdTreesHint__BuildKdTreesHint,
"Set whether the KdTrees should be built for geometry in the loader model. ",
"");
I_Method0(osgDB::ReaderWriter::Options::BuildKdTreesHint, getBuildKdTreesHint,
Properties::NON_VIRTUAL,
__BuildKdTreesHint__getBuildKdTreesHint,
"Get whether the KdTrees should be built for geometry in the loader model. ",
"");
I_Method1(void, setAuthenticationMap, IN, osgDB::AuthenticationMap *, authenticationMap,
Properties::NON_VIRTUAL,
__void__setAuthenticationMap__AuthenticationMap_P1,
"Set the password map to be used by plugins when access files from secure locations. ",
"");
I_Method0(const osgDB::AuthenticationMap *, getAuthenticationMap,
Properties::NON_VIRTUAL,
__C5_AuthenticationMap_P1__getAuthenticationMap,
"Get the password map to be used by plugins when access files from secure locations. ",
"");
I_Method2(void, setPluginData, IN, const std::string &, s, IN, void *, v,
Properties::NON_VIRTUAL,
__void__setPluginData__C5_std_string_R1__void_P1,
"Sets a plugindata value PluginData with a string. ",
"");
I_Method1(void *, getPluginData, IN, const std::string &, s,
Properties::NON_VIRTUAL,
__void_P1__getPluginData__C5_std_string_R1,
"Get a value from the PluginData. ",
"");
I_Method1(const void *, getPluginData, IN, const std::string &, s,
Properties::NON_VIRTUAL,
__C5_void_P1__getPluginData__C5_std_string_R1,
"Get a value from the PluginData. ",
"");
I_Method1(void, removePluginData, IN, const std::string &, s,
Properties::NON_VIRTUAL,
__void__removePluginData__C5_std_string_R1,
"Remove a value from the PluginData. ",
"");
I_Method2(void, setPluginStringData, IN, const std::string &, s, IN, const std::string &, v,
Properties::NON_VIRTUAL,
__void__setPluginStringData__C5_std_string_R1__C5_std_string_R1,
"Sets a plugindata value PluginData with a string. ",
"");
I_Method1(std::string, getPluginStringData, IN, const std::string &, s,
Properties::NON_VIRTUAL,
__std_string__getPluginStringData__C5_std_string_R1,
"Get a string from the PluginStrData. ",
"");
I_Method1(const std::string, getPluginStringData, IN, const std::string &, s,
Properties::NON_VIRTUAL,
__C5_std_string__getPluginStringData__C5_std_string_R1,
"Get a value from the PluginData. ",
"");
I_Method1(void, removePluginStringData, IN, const std::string &, s,
Properties::NON_VIRTUAL,
__void__removePluginStringData__C5_std_string_R1,
"Remove a value from the PluginData. ",
"");
I_SimpleProperty(osgDB::AuthenticationMap *, AuthenticationMap,
0,
__void__setAuthenticationMap__AuthenticationMap_P1);
I_SimpleProperty(osgDB::ReaderWriter::Options::BuildKdTreesHint, BuildKdTreesHint,
__BuildKdTreesHint__getBuildKdTreesHint,
__void__setBuildKdTreesHint__BuildKdTreesHint);
I_SimpleProperty(const std::string &, DatabasePath,
0,
__void__setDatabasePath__C5_std_string_R1);
I_SimpleProperty(osgDB::FilePathList &, DatabasePathList,
__FilePathList_R1__getDatabasePathList,
0);
I_SimpleProperty(osgDB::ReaderWriter::Options::CacheHintOptions, ObjectCacheHint,
__CacheHintOptions__getObjectCacheHint,
__void__setObjectCacheHint__CacheHintOptions);
I_SimpleProperty(const std::string &, OptionString,
__C5_std_string_R1__getOptionString,
__void__setOptionString__C5_std_string_R1);
I_IndexedProperty(void *, PluginData,
__void_P1__getPluginData__C5_std_string_R1,
__void__setPluginData__C5_std_string_R1__void_P1,
0);
I_IndexedProperty(std::string, PluginStringData,
__std_string__getPluginStringData__C5_std_string_R1,
__void__setPluginStringData__C5_std_string_R1__C5_std_string_R1,
0);
END_REFLECTOR
BEGIN_ENUM_REFLECTOR(osgDB::ReaderWriter::ReadResult::ReadStatus)
I_DeclaringFile("osgDB/ReaderWriter");
I_EnumLabel(osgDB::ReaderWriter::ReadResult::NOT_IMPLEMENTED);
@@ -670,7 +491,3 @@ BEGIN_VALUE_REFLECTOR(osgDB::ReaderWriter::WriteResult)
"");
END_REFLECTOR
TYPE_NAME_ALIAS(std::deque< std::string >, osgDB::FilePathList)
STD_VECTOR_REFLECTOR(std::deque< std::string >)

View File

@@ -27,6 +27,7 @@
#include <osgDB/DynamicLibrary>
#include <osgDB/FileCache>
#include <osgDB/Input>
#include <osgDB/Options>
#include <osgDB/Output>
#include <osgDB/ReaderWriter>
#include <osgDB/Registry>
@@ -78,6 +79,12 @@ END_REFLECTOR
TYPE_NAME_ALIAS(std::vector< osg::ref_ptr< osgDB::ReaderWriter > >, osgDB::Registry::ReaderWriterList)
TYPE_NAME_ALIAS(class osgDB::FindFileCallback, osgDB::Registry::FindFileCallback)
TYPE_NAME_ALIAS(class osgDB::ReadFileCallback, osgDB::Registry::ReadFileCallback)
TYPE_NAME_ALIAS(class osgDB::WriteFileCallback, osgDB::Registry::WriteFileCallback)
BEGIN_OBJECT_REFLECTOR(osgDB::Registry)
I_DeclaringFile("osgDB/Registry");
I_BaseType(osg::Referenced);
@@ -225,6 +232,41 @@ BEGIN_OBJECT_REFLECTOR(osgDB::Registry)
__bool__writeObject__C5_osg_Object_R1__Output_R1,
"",
"");
I_Method1(void, setFindFileCallback, IN, osgDB::Registry::FindFileCallback *, cb,
Properties::NON_VIRTUAL,
__void__setFindFileCallback__FindFileCallback_P1,
"Set the Registry callback to use in place of the default findFile calls. ",
"");
I_Method0(osgDB::Registry::FindFileCallback *, getFindFileCallback,
Properties::NON_VIRTUAL,
__FindFileCallback_P1__getFindFileCallback,
"Get the findFile callback. ",
"");
I_Method0(const osgDB::Registry::FindFileCallback *, getFindFileCallback,
Properties::NON_VIRTUAL,
__C5_FindFileCallback_P1__getFindFileCallback,
"Get the const findFile callback. ",
"");
I_Method3(std::string, findDataFile, IN, const std::string &, fileName, IN, const osgDB::Options *, options, IN, osgDB::CaseSensitivity, caseSensitivity,
Properties::NON_VIRTUAL,
__std_string__findDataFile__C5_std_string_R1__C5_Options_P1__CaseSensitivity,
"",
"");
I_Method3(std::string, findDataFileImplementation, IN, const std::string &, fileName, IN, const osgDB::Options *, options, IN, osgDB::CaseSensitivity, caseSensitivity,
Properties::NON_VIRTUAL,
__std_string__findDataFileImplementation__C5_std_string_R1__C5_Options_P1__CaseSensitivity,
"",
"");
I_Method3(std::string, findLibraryFile, IN, const std::string &, fileName, IN, const osgDB::Options *, options, IN, osgDB::CaseSensitivity, caseSensitivity,
Properties::NON_VIRTUAL,
__std_string__findLibraryFile__C5_std_string_R1__C5_Options_P1__CaseSensitivity,
"",
"");
I_Method3(std::string, findLibraryFileImplementation, IN, const std::string &, fileName, IN, const osgDB::Options *, options, IN, osgDB::CaseSensitivity, caseSensitivity,
Properties::NON_VIRTUAL,
__std_string__findLibraryFileImplementation__C5_std_string_R1__C5_Options_P1__CaseSensitivity,
"",
"");
I_Method1(void, setReadFileCallback, IN, osgDB::Registry::ReadFileCallback *, cb,
Properties::NON_VIRTUAL,
__void__setReadFileCallback__ReadFileCallback_P1,
@@ -240,64 +282,64 @@ BEGIN_OBJECT_REFLECTOR(osgDB::Registry)
__C5_ReadFileCallback_P1__getReadFileCallback,
"Get the const readFile callback. ",
"");
I_Method4(osgDB::ReaderWriter::ReadResult, openArchive, IN, const std::string &, fileName, IN, osgDB::ReaderWriter::ArchiveStatus, status, IN, unsigned int, indexBlockSizeHint, IN, const osgDB::ReaderWriter::Options *, options,
I_Method4(osgDB::ReaderWriter::ReadResult, openArchive, IN, const std::string &, fileName, IN, osgDB::ReaderWriter::ArchiveStatus, status, IN, unsigned int, indexBlockSizeHint, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__ReaderWriter_ReadResult__openArchive__C5_std_string_R1__ReaderWriter_ArchiveStatus__unsigned_int__C5_ReaderWriter_Options_P1,
__ReaderWriter_ReadResult__openArchive__C5_std_string_R1__ReaderWriter_ArchiveStatus__unsigned_int__C5_Options_P1,
"",
"");
I_Method4(osgDB::ReaderWriter::ReadResult, openArchiveImplementation, IN, const std::string &, fileName, IN, osgDB::ReaderWriter::ArchiveStatus, status, IN, unsigned int, indexBlockSizeHint, IN, const osgDB::ReaderWriter::Options *, options,
I_Method4(osgDB::ReaderWriter::ReadResult, openArchiveImplementation, IN, const std::string &, fileName, IN, osgDB::ReaderWriter::ArchiveStatus, status, IN, unsigned int, indexBlockSizeHint, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__ReaderWriter_ReadResult__openArchiveImplementation__C5_std_string_R1__ReaderWriter_ArchiveStatus__unsigned_int__C5_ReaderWriter_Options_P1,
__ReaderWriter_ReadResult__openArchiveImplementation__C5_std_string_R1__ReaderWriter_ArchiveStatus__unsigned_int__C5_Options_P1,
"",
"");
I_MethodWithDefaults3(osgDB::ReaderWriter::ReadResult, readObject, IN, const std::string &, fileName, , IN, const osgDB::ReaderWriter::Options *, options, , IN, bool, buildKdTreeIfRequired, true,
I_MethodWithDefaults3(osgDB::ReaderWriter::ReadResult, readObject, IN, const std::string &, fileName, , IN, const osgDB::Options *, options, , IN, bool, buildKdTreeIfRequired, true,
Properties::NON_VIRTUAL,
__ReaderWriter_ReadResult__readObject__C5_std_string_R1__C5_ReaderWriter_Options_P1__bool,
__ReaderWriter_ReadResult__readObject__C5_std_string_R1__C5_Options_P1__bool,
"",
"");
I_Method2(osgDB::ReaderWriter::ReadResult, readObjectImplementation, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
I_Method2(osgDB::ReaderWriter::ReadResult, readObjectImplementation, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__ReaderWriter_ReadResult__readObjectImplementation__C5_std_string_R1__C5_ReaderWriter_Options_P1,
__ReaderWriter_ReadResult__readObjectImplementation__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method2(osgDB::ReaderWriter::ReadResult, readImage, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
I_Method2(osgDB::ReaderWriter::ReadResult, readImage, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__ReaderWriter_ReadResult__readImage__C5_std_string_R1__C5_ReaderWriter_Options_P1,
__ReaderWriter_ReadResult__readImage__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method2(osgDB::ReaderWriter::ReadResult, readImageImplementation, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
I_Method2(osgDB::ReaderWriter::ReadResult, readImageImplementation, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__ReaderWriter_ReadResult__readImageImplementation__C5_std_string_R1__C5_ReaderWriter_Options_P1,
__ReaderWriter_ReadResult__readImageImplementation__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method2(osgDB::ReaderWriter::ReadResult, readHeightField, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
I_Method2(osgDB::ReaderWriter::ReadResult, readHeightField, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__ReaderWriter_ReadResult__readHeightField__C5_std_string_R1__C5_ReaderWriter_Options_P1,
__ReaderWriter_ReadResult__readHeightField__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method2(osgDB::ReaderWriter::ReadResult, readHeightFieldImplementation, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
I_Method2(osgDB::ReaderWriter::ReadResult, readHeightFieldImplementation, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__ReaderWriter_ReadResult__readHeightFieldImplementation__C5_std_string_R1__C5_ReaderWriter_Options_P1,
__ReaderWriter_ReadResult__readHeightFieldImplementation__C5_std_string_R1__C5_Options_P1,
"",
"");
I_MethodWithDefaults3(osgDB::ReaderWriter::ReadResult, readNode, IN, const std::string &, fileName, , IN, const osgDB::ReaderWriter::Options *, options, , IN, bool, buildKdTreeIfRequired, true,
I_MethodWithDefaults3(osgDB::ReaderWriter::ReadResult, readNode, IN, const std::string &, fileName, , IN, const osgDB::Options *, options, , IN, bool, buildKdTreeIfRequired, true,
Properties::NON_VIRTUAL,
__ReaderWriter_ReadResult__readNode__C5_std_string_R1__C5_ReaderWriter_Options_P1__bool,
__ReaderWriter_ReadResult__readNode__C5_std_string_R1__C5_Options_P1__bool,
"",
"");
I_Method2(osgDB::ReaderWriter::ReadResult, readNodeImplementation, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
I_Method2(osgDB::ReaderWriter::ReadResult, readNodeImplementation, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__ReaderWriter_ReadResult__readNodeImplementation__C5_std_string_R1__C5_ReaderWriter_Options_P1,
__ReaderWriter_ReadResult__readNodeImplementation__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method2(osgDB::ReaderWriter::ReadResult, readShader, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
I_Method2(osgDB::ReaderWriter::ReadResult, readShader, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__ReaderWriter_ReadResult__readShader__C5_std_string_R1__C5_ReaderWriter_Options_P1,
__ReaderWriter_ReadResult__readShader__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method2(osgDB::ReaderWriter::ReadResult, readShaderImplementation, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
I_Method2(osgDB::ReaderWriter::ReadResult, readShaderImplementation, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__ReaderWriter_ReadResult__readShaderImplementation__C5_std_string_R1__C5_ReaderWriter_Options_P1,
__ReaderWriter_ReadResult__readShaderImplementation__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method1(void, setWriteFileCallback, IN, osgDB::Registry::WriteFileCallback *, cb,
@@ -315,69 +357,69 @@ BEGIN_OBJECT_REFLECTOR(osgDB::Registry)
__C5_WriteFileCallback_P1__getWriteFileCallback,
"Get the const writeFile callback. ",
"");
I_Method3(osgDB::ReaderWriter::WriteResult, writeObject, IN, const osg::Object &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
I_Method3(osgDB::ReaderWriter::WriteResult, writeObject, IN, const osg::Object &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__ReaderWriter_WriteResult__writeObject__C5_osg_Object_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1,
__ReaderWriter_WriteResult__writeObject__C5_osg_Object_R1__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method3(osgDB::ReaderWriter::WriteResult, writeObjectImplementation, IN, const osg::Object &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
I_Method3(osgDB::ReaderWriter::WriteResult, writeObjectImplementation, IN, const osg::Object &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__ReaderWriter_WriteResult__writeObjectImplementation__C5_osg_Object_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1,
__ReaderWriter_WriteResult__writeObjectImplementation__C5_osg_Object_R1__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method3(osgDB::ReaderWriter::WriteResult, writeImage, IN, const osg::Image &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
I_Method3(osgDB::ReaderWriter::WriteResult, writeImage, IN, const osg::Image &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__ReaderWriter_WriteResult__writeImage__C5_osg_Image_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1,
__ReaderWriter_WriteResult__writeImage__C5_osg_Image_R1__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method3(osgDB::ReaderWriter::WriteResult, writeImageImplementation, IN, const osg::Image &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
I_Method3(osgDB::ReaderWriter::WriteResult, writeImageImplementation, IN, const osg::Image &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__ReaderWriter_WriteResult__writeImageImplementation__C5_osg_Image_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1,
__ReaderWriter_WriteResult__writeImageImplementation__C5_osg_Image_R1__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method3(osgDB::ReaderWriter::WriteResult, writeHeightField, IN, const osg::HeightField &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
I_Method3(osgDB::ReaderWriter::WriteResult, writeHeightField, IN, const osg::HeightField &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__ReaderWriter_WriteResult__writeHeightField__C5_osg_HeightField_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1,
__ReaderWriter_WriteResult__writeHeightField__C5_osg_HeightField_R1__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method3(osgDB::ReaderWriter::WriteResult, writeHeightFieldImplementation, IN, const osg::HeightField &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
I_Method3(osgDB::ReaderWriter::WriteResult, writeHeightFieldImplementation, IN, const osg::HeightField &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__ReaderWriter_WriteResult__writeHeightFieldImplementation__C5_osg_HeightField_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1,
__ReaderWriter_WriteResult__writeHeightFieldImplementation__C5_osg_HeightField_R1__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method3(osgDB::ReaderWriter::WriteResult, writeNode, IN, const osg::Node &, node, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
I_Method3(osgDB::ReaderWriter::WriteResult, writeNode, IN, const osg::Node &, node, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__ReaderWriter_WriteResult__writeNode__C5_osg_Node_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1,
__ReaderWriter_WriteResult__writeNode__C5_osg_Node_R1__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method3(osgDB::ReaderWriter::WriteResult, writeNodeImplementation, IN, const osg::Node &, node, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
I_Method3(osgDB::ReaderWriter::WriteResult, writeNodeImplementation, IN, const osg::Node &, node, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__ReaderWriter_WriteResult__writeNodeImplementation__C5_osg_Node_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1,
__ReaderWriter_WriteResult__writeNodeImplementation__C5_osg_Node_R1__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method3(osgDB::ReaderWriter::WriteResult, writeShader, IN, const osg::Shader &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
I_Method3(osgDB::ReaderWriter::WriteResult, writeShader, IN, const osg::Shader &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__ReaderWriter_WriteResult__writeShader__C5_osg_Shader_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1,
__ReaderWriter_WriteResult__writeShader__C5_osg_Shader_R1__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method3(osgDB::ReaderWriter::WriteResult, writeShaderImplementation, IN, const osg::Shader &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
I_Method3(osgDB::ReaderWriter::WriteResult, writeShaderImplementation, IN, const osg::Shader &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__ReaderWriter_WriteResult__writeShaderImplementation__C5_osg_Shader_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1,
__ReaderWriter_WriteResult__writeShaderImplementation__C5_osg_Shader_R1__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method2(void, _buildKdTreeIfRequired, IN, osgDB::ReaderWriter::ReadResult &, result, IN, const osgDB::ReaderWriter::Options *, options,
I_Method2(void, _buildKdTreeIfRequired, IN, osgDB::ReaderWriter::ReadResult &, result, IN, const osgDB::Options *, options,
Properties::NON_VIRTUAL,
__void___buildKdTreeIfRequired__ReaderWriter_ReadResult_R1__C5_ReaderWriter_Options_P1,
__void___buildKdTreeIfRequired__ReaderWriter_ReadResult_R1__C5_Options_P1,
"",
"");
I_Method1(void, setBuildKdTreesHint, IN, osgDB::ReaderWriter::Options::BuildKdTreesHint, hint,
I_Method1(void, setBuildKdTreesHint, IN, osgDB::Options::BuildKdTreesHint, hint,
Properties::NON_VIRTUAL,
__void__setBuildKdTreesHint__ReaderWriter_Options_BuildKdTreesHint,
__void__setBuildKdTreesHint__Options_BuildKdTreesHint,
"Set whether the KdTrees should be built for geometry in the loader model. ",
"");
I_Method0(osgDB::ReaderWriter::Options::BuildKdTreesHint, getBuildKdTreesHint,
I_Method0(osgDB::Options::BuildKdTreesHint, getBuildKdTreesHint,
Properties::NON_VIRTUAL,
__ReaderWriter_Options_BuildKdTreesHint__getBuildKdTreesHint,
__Options_BuildKdTreesHint__getBuildKdTreesHint,
"Get whether the KdTrees should be built for geometry in the loader model. ",
"");
I_Method1(void, setKdTreeBuilder, IN, osg::KdTreeBuilder *, builder,
@@ -430,19 +472,19 @@ BEGIN_OBJECT_REFLECTOR(osgDB::Registry)
__bool__getCreateNodeFromImage,
"",
"");
I_Method1(void, setOptions, IN, osgDB::ReaderWriter::Options *, opt,
I_Method1(void, setOptions, IN, osgDB::Options *, opt,
Properties::NON_VIRTUAL,
__void__setOptions__ReaderWriter_Options_P1,
__void__setOptions__Options_P1,
"",
"");
I_Method0(osgDB::ReaderWriter::Options *, getOptions,
I_Method0(osgDB::Options *, getOptions,
Properties::NON_VIRTUAL,
__ReaderWriter_Options_P1__getOptions,
__Options_P1__getOptions,
"",
"");
I_Method0(const osgDB::ReaderWriter::Options *, getOptions,
I_Method0(const osgDB::Options *, getOptions,
Properties::NON_VIRTUAL,
__C5_ReaderWriter_Options_P1__getOptions,
__C5_Options_P1__getOptions,
"",
"");
I_Method0(void, initFilePathLists,
@@ -603,18 +645,18 @@ BEGIN_OBJECT_REFLECTOR(osgDB::Registry)
__ReaderWriter_ReadResult__read__C5_ReadFunctor_R1,
"",
"");
I_ProtectedMethod2(osgDB::ReaderWriter::ReadResult, readImplementation, IN, const osgDB::Registry::ReadFunctor &, readFunctor, IN, osgDB::ReaderWriter::Options::CacheHintOptions, cacheHint,
I_ProtectedMethod2(osgDB::ReaderWriter::ReadResult, readImplementation, IN, const osgDB::Registry::ReadFunctor &, readFunctor, IN, osgDB::Options::CacheHintOptions, cacheHint,
Properties::NON_VIRTUAL,
Properties::NON_CONST,
__ReaderWriter_ReadResult__readImplementation__C5_ReadFunctor_R1__ReaderWriter_Options_CacheHintOptions,
__ReaderWriter_ReadResult__readImplementation__C5_ReadFunctor_R1__Options_CacheHintOptions,
"",
"");
I_SimpleProperty(osgDB::AuthenticationMap *, AuthenticationMap,
__AuthenticationMap_P1__getAuthenticationMap,
__void__setAuthenticationMap__AuthenticationMap_P1);
I_SimpleProperty(osgDB::ReaderWriter::Options::BuildKdTreesHint, BuildKdTreesHint,
__ReaderWriter_Options_BuildKdTreesHint__getBuildKdTreesHint,
__void__setBuildKdTreesHint__ReaderWriter_Options_BuildKdTreesHint);
I_SimpleProperty(osgDB::Options::BuildKdTreesHint, BuildKdTreesHint,
__Options_BuildKdTreesHint__getBuildKdTreesHint,
__void__setBuildKdTreesHint__Options_BuildKdTreesHint);
I_SimpleProperty(bool, CreateNodeFromImage,
__bool__getCreateNodeFromImage,
__void__setCreateNodeFromImage__bool);
@@ -624,15 +666,18 @@ BEGIN_OBJECT_REFLECTOR(osgDB::Registry)
I_SimpleProperty(osgDB::FileCache *, FileCache,
__FileCache_P1__getFileCache,
__void__setFileCache__FileCache_P1);
I_SimpleProperty(osgDB::Registry::FindFileCallback *, FindFileCallback,
__FindFileCallback_P1__getFindFileCallback,
__void__setFindFileCallback__FindFileCallback_P1);
I_SimpleProperty(osg::KdTreeBuilder *, KdTreeBuilder,
__osg_KdTreeBuilder_P1__getKdTreeBuilder,
__void__setKdTreeBuilder__osg_KdTreeBuilder_P1);
I_SimpleProperty(const osgDB::FilePathList &, LibraryFilePathList,
__C5_FilePathList_R1__getLibraryFilePathList,
__void__setLibraryFilePathList__C5_FilePathList_R1);
I_SimpleProperty(osgDB::ReaderWriter::Options *, Options,
__ReaderWriter_Options_P1__getOptions,
__void__setOptions__ReaderWriter_Options_P1);
I_SimpleProperty(osgDB::Options *, Options,
__Options_P1__getOptions,
__void__setOptions__Options_P1);
I_SimpleProperty(osgDB::Registry::ReadFileCallback *, ReadFileCallback,
__ReadFileCallback_P1__getReadFileCallback,
__void__setReadFileCallback__ReadFileCallback_P1);
@@ -647,48 +692,10 @@ BEGIN_OBJECT_REFLECTOR(osgDB::Registry)
__void__setWriteFileCallback__WriteFileCallback_P1);
END_REFLECTOR
BEGIN_OBJECT_REFLECTOR(osgDB::Registry::ReadFileCallback)
I_DeclaringFile("osgDB/Registry");
I_VirtualBaseType(osg::Referenced);
I_Constructor0(____ReadFileCallback,
"",
"");
I_Method4(osgDB::ReaderWriter::ReadResult, openArchive, IN, const std::string &, filename, IN, osgDB::ReaderWriter::ArchiveStatus, status, IN, unsigned int, indexBlockSizeHint, IN, const osgDB::ReaderWriter::Options *, useObjectCache,
Properties::VIRTUAL,
__ReaderWriter_ReadResult__openArchive__C5_std_string_R1__ReaderWriter_ArchiveStatus__unsigned_int__C5_ReaderWriter_Options_P1,
"",
"");
I_Method2(osgDB::ReaderWriter::ReadResult, readObject, IN, const std::string &, filename, IN, const osgDB::ReaderWriter::Options *, options,
Properties::VIRTUAL,
__ReaderWriter_ReadResult__readObject__C5_std_string_R1__C5_ReaderWriter_Options_P1,
"",
"");
I_Method2(osgDB::ReaderWriter::ReadResult, readImage, IN, const std::string &, filename, IN, const osgDB::ReaderWriter::Options *, options,
Properties::VIRTUAL,
__ReaderWriter_ReadResult__readImage__C5_std_string_R1__C5_ReaderWriter_Options_P1,
"",
"");
I_Method2(osgDB::ReaderWriter::ReadResult, readHeightField, IN, const std::string &, filename, IN, const osgDB::ReaderWriter::Options *, options,
Properties::VIRTUAL,
__ReaderWriter_ReadResult__readHeightField__C5_std_string_R1__C5_ReaderWriter_Options_P1,
"",
"");
I_Method2(osgDB::ReaderWriter::ReadResult, readNode, IN, const std::string &, filename, IN, const osgDB::ReaderWriter::Options *, options,
Properties::VIRTUAL,
__ReaderWriter_ReadResult__readNode__C5_std_string_R1__C5_ReaderWriter_Options_P1,
"",
"");
I_Method2(osgDB::ReaderWriter::ReadResult, readShader, IN, const std::string &, filename, IN, const osgDB::ReaderWriter::Options *, options,
Properties::VIRTUAL,
__ReaderWriter_ReadResult__readShader__C5_std_string_R1__C5_ReaderWriter_Options_P1,
"",
"");
END_REFLECTOR
BEGIN_ABSTRACT_OBJECT_REFLECTOR(osgDB::Registry::ReadFunctor)
I_DeclaringFile("osgDB/Registry");
I_Constructor2(IN, const std::string &, filename, IN, const osgDB::ReaderWriter::Options *, options,
____ReadFunctor__C5_std_string_R1__C5_ReaderWriter_Options_P1,
I_Constructor2(IN, const std::string &, filename, IN, const osgDB::Options *, options,
____ReadFunctor__C5_std_string_R1__C5_Options_P1,
"",
"");
I_Method1(osgDB::ReaderWriter::ReadResult, doRead, IN, osgDB::ReaderWriter &, rw,
@@ -709,39 +716,6 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osgDB::Registry::ReadFunctor)
I_PublicMemberProperty(std::string, _filename);
END_REFLECTOR
BEGIN_OBJECT_REFLECTOR(osgDB::Registry::WriteFileCallback)
I_DeclaringFile("osgDB/Registry");
I_VirtualBaseType(osg::Referenced);
I_Constructor0(____WriteFileCallback,
"",
"");
I_Method3(osgDB::ReaderWriter::WriteResult, writeObject, IN, const osg::Object &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
Properties::VIRTUAL,
__ReaderWriter_WriteResult__writeObject__C5_osg_Object_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1,
"",
"");
I_Method3(osgDB::ReaderWriter::WriteResult, writeImage, IN, const osg::Image &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
Properties::VIRTUAL,
__ReaderWriter_WriteResult__writeImage__C5_osg_Image_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1,
"",
"");
I_Method3(osgDB::ReaderWriter::WriteResult, writeHeightField, IN, const osg::HeightField &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
Properties::VIRTUAL,
__ReaderWriter_WriteResult__writeHeightField__C5_osg_HeightField_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1,
"",
"");
I_Method3(osgDB::ReaderWriter::WriteResult, writeNode, IN, const osg::Node &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
Properties::VIRTUAL,
__ReaderWriter_WriteResult__writeNode__C5_osg_Node_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1,
"",
"");
I_Method3(osgDB::ReaderWriter::WriteResult, writeShader, IN, const osg::Shader &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options,
Properties::VIRTUAL,
__ReaderWriter_WriteResult__writeShader__C5_osg_Shader_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1,
"",
"");
END_REFLECTOR
BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osgDB::ReaderWriter >)
I_DeclaringFile("osg/ref_ptr");
I_Constructor0(____ref_ptr,