Changeset 10171

Show
Ignore:
Timestamp:
05/09/09 10:49:27 (6 years ago)
Author:
robert
Message:

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

Location:
OpenSceneGraph/trunk
Files:
3 added
40 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osgDB/Archive

    r8584 r10171  
    6969 
    7070/** Open an archive for reading or writing.*/ 
    71 OSGDB_EXPORT Archive* openArchive(const std::string& filename, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint,ReaderWriter::Options* options); 
     71OSGDB_EXPORT Archive* openArchive(const std::string& filename, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint,Options* options); 
    7272} 
    7373 
  • OpenSceneGraph/trunk/include/osgDB/DatabasePager

    r9947 r10171  
    2929#include <osgDB/SharedStateManager> 
    3030#include <osgDB/ReaderWriter> 
    31 #include <osgDB/Export> 
     31#include <osgDB/Options> 
    3232 
    3333#include <map> 
     
    7171                                     float priority, const osg::FrameStamp* framestamp, 
    7272                                     osg::ref_ptr<osg::Referenced>& databaseRequest, 
    73                                      ReaderWriter::Options* loadOptions); 
     73                                     Options* loadOptions); 
    7474 
    7575        /** Set the priority of the database pager thread(s).*/ 
     
    376376            osg::ref_ptr<osg::Node>             _loadedModel; 
    377377            DataToCompileMap                    _dataToCompileMap; 
    378             osg::ref_ptr<ReaderWriter::Options> _loadOptions; 
     378            osg::ref_ptr<Options> _loadOptions; 
    379379            RequestQueue*                       _requestQueue; 
    380380 
  • OpenSceneGraph/trunk/include/osgDB/FileCache

    r9038 r10171  
    2424{ 
    2525    public:  
    26      
     26 
    2727        FileCache(const std::string& path); 
    2828 
     
    3030 
    3131        virtual std::string createCacheFileName(const std::string& originalFileName) const; 
    32          
     32 
    3333        virtual bool existsInCache(const std::string& originalFileName) const; 
    34          
    35         virtual ReaderWriter::ReadResult readNode(const std::string& originalFileName, const osgDB::ReaderWriter::Options* options, bool buildKdTreeIfRequired=true) const; 
    36          
    37         virtual ReaderWriter::WriteResult writeNode(const osg::Node& node, const std::string& originalFileName, const osgDB::ReaderWriter::Options* options) const; 
     34 
     35        virtual ReaderWriter::ReadResult readNode(const std::string& originalFileName, const osgDB::Options* options, bool buildKdTreeIfRequired=true) const; 
     36 
     37        virtual ReaderWriter::WriteResult writeNode(const osg::Node& node, const std::string& originalFileName, const osgDB::Options* options) const; 
    3838 
    3939    protected: 
    4040 
    4141        virtual ~FileCache(); 
    42          
     42 
    4343        std::string _fileCachePath; 
    4444 
  • OpenSceneGraph/trunk/include/osgDB/FileUtils

    r9475 r10171  
    2323 
    2424namespace osgDB { 
    25  
    26 enum CaseSensitivity 
    27 { 
    28     CASE_SENSITIVE, 
    29     CASE_INSENSITIVE 
    30 }; 
    3125 
    3226enum FileType 
     
    8781  * returning the full path of the first valid file found, return an empty string if no string is found. 
    8882  */ 
    89 extern OSGDB_EXPORT std::string findDataFile(const std::string& filename,const ReaderWriter::Options* options, CaseSensitivity caseSensitivity=CASE_SENSITIVE); 
     83extern OSGDB_EXPORT std::string findDataFile(const std::string& filename,const Options* options, CaseSensitivity caseSensitivity=CASE_SENSITIVE); 
    9084 
    9185inline void setLibraryFilePathList(const FilePathList& filepaths) { osgDB::Registry::instance()->setLibraryFilePathList(filepaths); } 
  • OpenSceneGraph/trunk/include/osgDB/ImageOptions

    r6481 r10171  
    1515#define OSGDB_IMAGEOPTIONS 1 
    1616 
    17 #include <osgDB/ReaderWriter> 
     17#include <osgDB/Options> 
    1818 
    1919namespace osgDB { 
    2020 
    21 class OSGDB_EXPORT ImageOptions : public osgDB::ReaderWriter::Options 
     21class OSGDB_EXPORT ImageOptions : public osgDB::Options 
    2222{ 
    2323    public: 
     
    2828             
    2929        ImageOptions(const ImageOptions& options,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY): 
    30             osgDB::ReaderWriter::Options(options,copyop), 
     30            osgDB::Options(options,copyop), 
    3131            _sourceImageSamplingMode(options._sourceImageSamplingMode), 
    3232            _sourceImageWindowMode(options._sourceImageWindowMode), 
  • OpenSceneGraph/trunk/include/osgDB/ImagePager

    r8991 r10171  
    2424 
    2525#include <osgDB/ReaderWriter> 
     26#include <osgDB/Options> 
    2627 
    2728namespace osgDB 
     
    108109            double                              _timeToMergeBy; 
    109110            std::string                         _fileName; 
    110             osg::ref_ptr<ReaderWriter::Options> _loadOptions; 
     111            osg::ref_ptr<Options> _loadOptions; 
    111112            osg::observer_ptr<osg::Object>      _attachmentPoint; 
    112113            int                                 _attachmentIndex; 
  • OpenSceneGraph/trunk/include/osgDB/Input

    r7908 r10171  
    2424#include <osgDB/FieldReaderIterator> 
    2525#include <osgDB/ReaderWriter> 
     26#include <osgDB/Options> 
    2627 
    2728#include <map> 
     
    4041        virtual ~Input(); 
    4142         
    42         void setOptions(const ReaderWriter::Options* options) { _options = options; } 
    43         const ReaderWriter::Options* getOptions() const { return _options.get(); } 
     43        void setOptions(const Options* options) { _options = options; } 
     44        const Options* getOptions() const { return _options.get(); } 
    4445 
    4546        virtual osg::Object*         readObjectOfType(const osg::Object& compObj); 
     
    8889        UniqueIDToObjectMapping _uniqueIDToObjectMap; 
    8990         
    90         osg::ref_ptr<const ReaderWriter::Options> _options; 
     91        osg::ref_ptr<const Options> _options; 
    9192 
    9293}; 
  • OpenSceneGraph/trunk/include/osgDB/Output

    r9124 r10171  
    3737 
    3838        
    39         void setOptions(const ReaderWriter::Options* options); 
    40         const ReaderWriter::Options* getOptions() const { return _options.get(); } 
     39        void setOptions(const Options* options); 
     40        const Options* getOptions() const { return _options.get(); } 
    4141 
    4242        void setWriteOutDefaultValues(bool flag) { _writeOutDefaultValues = flag; } 
     
    107107        virtual void init(); 
    108108 
    109         osg::ref_ptr<const ReaderWriter::Options> _options; 
     109        osg::ref_ptr<const Options> _options; 
    110110 
    111111        int _indent; 
  • OpenSceneGraph/trunk/include/osgDB/ReadFile

    r8938 r10171  
    3434  * for the filename extension, and this plugin then handles the request 
    3535  * to read the specified file.*/ 
    36 extern OSGDB_EXPORT osg::Object* readObjectFile(const std::string& filename,const ReaderWriter::Options* options); 
     36extern OSGDB_EXPORT osg::Object* readObjectFile(const std::string& filename,const Options* options); 
    3737 
    3838/** Read an osg::Object from file.  
     
    5454  * for the filename extension, and this plugin then handles the request 
    5555  * to read the specified file.*/ 
    56 extern OSGDB_EXPORT osg::Image*  readImageFile(const std::string& filename,const ReaderWriter::Options* options); 
     56extern OSGDB_EXPORT osg::Image*  readImageFile(const std::string& filename,const Options* options); 
    5757 
    5858/** Read an osg::Image from file.  
     
    7474  * for the filename extension, and this plugin then handles the request 
    7575  * to read the specified file.*/ 
    76 extern OSGDB_EXPORT osg::HeightField*  readHeightFieldFile(const std::string& filename,const ReaderWriter::Options* options); 
     76extern OSGDB_EXPORT osg::HeightField*  readHeightFieldFile(const std::string& filename,const Options* options); 
    7777 
    7878/** Read an osg::HeightField from file.  
     
    9494  * for the filename extension, and this plugin then handles the request 
    9595  * to read the specified file.*/ 
    96 extern OSGDB_EXPORT osg::Node*  readNodeFile(const std::string& filename,const ReaderWriter::Options* options); 
     96extern OSGDB_EXPORT osg::Node*  readNodeFile(const std::string& filename,const Options* options); 
    9797 
    9898/** Read an osg::Node from file.  
     
    111111  * than one subgraph has been loaded. 
    112112  * Use the Options object to control cache operations and file search paths in osgDB::Registry.*/ 
    113 extern OSGDB_EXPORT osg::Node* readNodeFiles(std::vector<std::string>& commandLine,const ReaderWriter::Options* options); 
     113extern OSGDB_EXPORT osg::Node* readNodeFiles(std::vector<std::string>& commandLine,const Options* options); 
    114114 
    115115/** Read an osg::Node subgraph from files, creating a osg::Group to contain the nodes if more 
     
    124124  * than one subgraph has been loaded. 
    125125  * Use the Options object to control cache operations and file search paths in osgDB::Registry.*/ 
    126 extern OSGDB_EXPORT osg::Node* readNodeFiles(osg::ArgumentParser& parser,const ReaderWriter::Options* options); 
     126extern OSGDB_EXPORT osg::Node* readNodeFiles(osg::ArgumentParser& parser,const Options* options); 
    127127 
    128128/** Read an osg::Node subgraph from files, creating a osg::Group to contain the nodes if more 
     
    140140  * for the filename extension, and this plugin then handles the request 
    141141  * to read the specified file.*/ 
    142 extern OSGDB_EXPORT osg::Shader*  readShaderFile(const std::string& filename,const ReaderWriter::Options* options); 
     142extern OSGDB_EXPORT osg::Shader*  readShaderFile(const std::string& filename,const Options* options); 
    143143 
    144144/** Read an osg::Shader from file.  
     
    160160  * for the filename extension, and this plugin then handles the request 
    161161  * to read the specified file.*/ 
    162 inline osg::Shader* readShaderFile(osg::Shader::Type type, const std::string& filename,const ReaderWriter::Options* options) 
     162inline osg::Shader* readShaderFile(osg::Shader::Type type, const std::string& filename,const Options* options) 
    163163{ 
    164164    osg::Shader* shader = readShaderFile(filename, options); 
     
    185185  * for the filename extension, and this plugin then handles the request 
    186186  * to read the specified file.*/ 
    187 extern OSGDB_EXPORT osg::ref_ptr<osg::Object> readRefObjectFile(const std::string& filename,const ReaderWriter::Options* options); 
     187extern OSGDB_EXPORT osg::ref_ptr<osg::Object> readRefObjectFile(const std::string& filename,const Options* options); 
    188188 
    189189/** Read an osg::Object from file.  
     
    205205  * for the filename extension, and this plugin then handles the request 
    206206  * to read the specified file.*/ 
    207 extern OSGDB_EXPORT osg::ref_ptr<osg::Image>  readRefImageFile(const std::string& filename,const ReaderWriter::Options* options); 
     207extern OSGDB_EXPORT osg::ref_ptr<osg::Image>  readRefImageFile(const std::string& filename,const Options* options); 
    208208 
    209209/** Read an osg::Image from file.  
     
    225225  * for the filename extension, and this plugin then handles the request 
    226226  * to read the specified file.*/ 
    227 extern OSGDB_EXPORT osg::ref_ptr<osg::HeightField>  readRefHeightFieldFile(const std::string& filename,const ReaderWriter::Options* options); 
     227extern OSGDB_EXPORT osg::ref_ptr<osg::HeightField>  readRefHeightFieldFile(const std::string& filename,const Options* options); 
    228228 
    229229/** Read an osg::HeightField from file.  
     
    245245  * for the filename extension, and this plugin then handles the request 
    246246  * to read the specified file.*/ 
    247 extern OSGDB_EXPORT osg::ref_ptr<osg::Node>  readRefNodeFile(const std::string& filename,const ReaderWriter::Options* options); 
     247extern OSGDB_EXPORT osg::ref_ptr<osg::Node>  readRefNodeFile(const std::string& filename,const Options* options); 
    248248 
    249249/** Read an osg::Node from file.  
     
    265265  * for the filename extension, and this plugin then handles the request 
    266266  * to read the specified file.*/ 
    267 extern OSGDB_EXPORT osg::ref_ptr<osg::Shader>  readRefShaderFile(const std::string& filename,const ReaderWriter::Options* options); 
     267extern OSGDB_EXPORT osg::ref_ptr<osg::Shader>  readRefShaderFile(const std::string& filename,const Options* options); 
    268268 
    269269/** Read an osg::Shader from file.  
  • OpenSceneGraph/trunk/include/osgDB/ReaderWriter

    r10057 r10171  
    3232typedef std::deque<std::string> FilePathList; 
    3333 
     34// forward declare 
     35class Options; 
     36 
    3437/** pure virtual base class for reading and writing of non native formats. */ 
    3538class OSGDB_EXPORT ReaderWriter : public osg::Object 
     
    5356        /** return which protocols are supported by ReaderWriter. */ 
    5457        virtual const FormatDescriptionMap& supportedProtocols() const { return _supportedProtocols; } 
    55          
     58 
    5659        /** return which list of file extensions supported by ReaderWriter. */ 
    5760        virtual const FormatDescriptionMap& supportedExtensions() const { return _supportedExtensions; } 
    58          
     61 
    5962        /** return which list of file extensions supported by ReaderWriter. */ 
    6063        virtual const FormatDescriptionMap& supportedOptions() const { return _supportedOptions; } 
     
    9497        static FeatureList featureAsString(Features feature); 
    9598 
    96         /** Options base class used for passing options into plugins to control their operation.*/ 
    97         class Options : public osg::Object 
    98         { 
    99             public: 
    100              
    101              
    102                 /// bit mask for setting up which object types get cached by readObject/Image/HeightField/Node(filename) calls 
    103                 enum CacheHintOptions 
    104                 {   /// do not cache objects of any type 
    105                     CACHE_NONE          = 0, 
    106  
    107                     /// cache nodes loaded via readNode(filename) 
    108                     CACHE_NODES         = 1<<0, 
    109  
    110                     /// cache images loaded via readImage(filename) 
    111                     CACHE_IMAGES        = 1<<1, 
    112  
    113                     /// cache heightfield loaded via readHeightField(filename) 
    114                     CACHE_HEIGHTFIELDS  = 1<<2,  
    115  
    116                     /// cache heightfield loaded via readHeightField(filename) 
    117                     CACHE_ARCHIVES      = 1<<3,  
    118  
    119                     /// cache objects loaded via readObject(filename) 
    120                     CACHE_OBJECTS       = 1<<4,  
    121  
    122                     /// cache shaders loaded via readShader(filename) 
    123                     CACHE_SHADERS       = 1<<5, 
    124  
    125                     /// cache on all read*(filename) calls 
    126                     CACHE_ALL           = CACHE_NODES | 
    127                                           CACHE_IMAGES | 
    128                                           CACHE_HEIGHTFIELDS | 
    129                                           CACHE_ARCHIVES | 
    130                                           CACHE_OBJECTS | 
    131                                           CACHE_SHADERS 
    132                 }; 
    133                  
    134                 /// range of options of whether to build kdtrees automatically on loading 
    135                 enum BuildKdTreesHint 
    136                 { 
    137                     NO_PREFERENCE, 
    138                     DO_NOT_BUILD_KDTREES, 
    139                     BUILD_KDTREES 
    140                 }; 
    141              
    142  
    143                 Options(): 
    144                     osg::Object(true), 
    145                     _objectCacheHint(CACHE_ARCHIVES), 
    146                     _buildKdTreesHint(NO_PREFERENCE) {} 
    147                      
    148                 Options(const std::string& str): 
    149                     osg::Object(true), 
    150                     _str(str),  
    151                     _objectCacheHint(CACHE_ARCHIVES), 
    152                     _buildKdTreesHint(NO_PREFERENCE) {} 
    153                  
    154                 Options(const Options& options,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY): 
    155                     osg::Object(options,copyop), 
    156                     _str(options._str), 
    157                     _databasePaths(options._databasePaths), 
    158                     _objectCacheHint(options._objectCacheHint), 
    159                     _buildKdTreesHint(options._buildKdTreesHint), 
    160                     _pluginData(options._pluginData), 
    161                     _pluginStringData(options._pluginStringData){} 
    162  
    163                 META_Object(osgDB,Options); 
    164  
    165                 /** Set the general Options string.*/ 
    166                 void setOptionString(const std::string& str) { _str = str; } 
    167  
    168                 /** Get the general Options string.*/ 
    169                 const std::string& getOptionString() const { return _str; } 
    170  
    171                 /** Set the database path to use a hint of where to look when loading models.*/ 
    172                 void setDatabasePath(const std::string& str) { _databasePaths.clear();  _databasePaths.push_back(str); } 
    173  
    174                 /** Get the database path which is used a hint of where to look when loading models.*/ 
    175                 FilePathList& getDatabasePathList() { return _databasePaths; } 
    176  
    177                 /** Get the const database path which is used a hint of where to look when loading models.*/ 
    178                 const FilePathList& getDatabasePathList() const { return _databasePaths; } 
    179  
    180  
    181                 /** Set whether the Registry::ObjectCache should be used by default.*/ 
    182                 void setObjectCacheHint(CacheHintOptions useObjectCache) { _objectCacheHint = useObjectCache; } 
    183  
    184                 /** Get whether the Registry::ObjectCache should be used by default.*/ 
    185                 CacheHintOptions getObjectCacheHint() const { return _objectCacheHint; } 
    186  
    187  
    188                 /** Set whether the KdTrees should be built for geometry in the loader model. */ 
    189                 void setBuildKdTreesHint(BuildKdTreesHint hint) { _buildKdTreesHint = hint; } 
    190  
    191                 /** Get whether the KdTrees should be built for geometry in the loader model. */ 
    192                 BuildKdTreesHint getBuildKdTreesHint() const { return _buildKdTreesHint; } 
    193  
    194  
    195                 /** Set the password map to be used by plugins when access files from secure locations.*/ 
    196                 void setAuthenticationMap(AuthenticationMap* authenticationMap) { _authenticationMap = authenticationMap; } 
    197  
    198                 /** Get the password map to be used by plugins when access files from secure locations.*/ 
    199                 const AuthenticationMap* getAuthenticationMap() const { return _authenticationMap.get(); } 
    200  
    201  
    202                 /** Sets a plugindata value PluginData with a string */ 
    203                 void setPluginData(const std::string& s, void* v) const { _pluginData[s] = v; } 
    204  
    205                 /** Get a value from the PluginData */ 
    206                 void* getPluginData(const std::string& s) { return _pluginData[s]; } 
    207  
    208                 /** Get a value from the PluginData */ 
    209                 const void* getPluginData(const std::string& s) const 
    210                 { 
    211                     PluginDataMap::const_iterator itr = _pluginData.find(s); 
    212                     return (itr == _pluginData.end()) ? 0 : itr->second; 
    213                 } 
    214  
    215                 /** Remove a value from the PluginData */ 
    216                 void removePluginData(const std::string& s) const { _pluginData.erase(s); } 
    217  
    218  
    219                 /** Sets a plugindata value PluginData with a string */ 
    220                 void setPluginStringData(const std::string& s, const std::string& v) const { _pluginStringData[s] = v; } 
    221  
    222                 /** Get a string from the PluginStrData */ 
    223                 std::string getPluginStringData(const std::string& s) { return _pluginStringData[s]; } 
    224  
    225                 /** Get a value from the PluginData */ 
    226                 const std::string getPluginStringData(const std::string& s) const 
    227                 { 
    228                     PluginStringDataMap::const_iterator itr = _pluginStringData.find(s); 
    229                     return (itr == _pluginStringData.end()) ? std::string("") : itr->second; 
    230                 } 
    231  
    232                 /** Remove a value from the PluginData */ 
    233                 void removePluginStringData(const std::string& s) const { _pluginStringData.erase(s); } 
    234  
    235  
    236  
    237  
    238             protected: 
    239  
    240                 virtual ~Options() {} 
    241  
    242                 std::string                     _str; 
    243                 FilePathList                    _databasePaths; 
    244                 CacheHintOptions                _objectCacheHint; 
    245                 BuildKdTreesHint                _buildKdTreesHint; 
    246                 osg::ref_ptr<AuthenticationMap> _authenticationMap; 
    247  
    248                 typedef std::map<std::string,void*> PluginDataMap; 
    249                 mutable PluginDataMap _pluginData; 
    250                 typedef std::map<std::string,std::string> PluginStringDataMap; 
    251                 mutable PluginStringDataMap _pluginStringData; 
    252  
    253         }; 
    25499 
    255100 
     
    354199        }; 
    355200 
     201        typedef osgDB::Options Options; 
     202 
    356203        /** open an archive for reading, writing, or to create an empty archive for writing to.*/  
    357204        virtual ReadResult openArchive(const std::string& /*fileName*/,ArchiveStatus, unsigned int =4096, const Options* =NULL) const { return ReadResult(ReadResult::NOT_IMPLEMENTED); } 
  • OpenSceneGraph/trunk/include/osgDB/Registry

    r10000 r10171  
    2323#include <osgDB/DynamicLibrary> 
    2424#include <osgDB/ReaderWriter> 
     25#include <osgDB/Options> 
    2526#include <osgDB/DotOsgWrapper> 
    2627#include <osgDB/DatabasePager> 
     
    160161        bool                 writeObject(const osg::Object& obj,Output& fw); 
    161162 
    162         class ReadFileCallback : public virtual osg::Referenced 
    163         { 
    164         public: 
    165          
    166             virtual ReaderWriter::ReadResult openArchive(const std::string& filename,ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const ReaderWriter::Options* useObjectCache) 
    167             { 
    168                 return osgDB::Registry::instance()->openArchiveImplementation(filename, status, indexBlockSizeHint, useObjectCache); 
    169             } 
    170              
    171             virtual ReaderWriter::ReadResult readObject(const std::string& filename, const ReaderWriter::Options* options) 
    172             { 
    173                 return osgDB::Registry::instance()->readObjectImplementation(filename,options); 
    174             } 
    175  
    176             virtual ReaderWriter::ReadResult readImage(const std::string& filename, const ReaderWriter::Options* options) 
    177             { 
    178                 return osgDB::Registry::instance()->readImageImplementation(filename,options); 
    179             } 
    180              
    181             virtual ReaderWriter::ReadResult readHeightField(const std::string& filename, const ReaderWriter::Options* options) 
    182             { 
    183                 return osgDB::Registry::instance()->readHeightFieldImplementation(filename,options); 
    184             } 
    185              
    186             virtual ReaderWriter::ReadResult readNode(const std::string& filename, const ReaderWriter::Options* options) 
    187             { 
    188                 return osgDB::Registry::instance()->readNodeImplementation(filename,options); 
    189             } 
    190  
    191             virtual ReaderWriter::ReadResult readShader(const std::string& filename, const ReaderWriter::Options* options) 
    192             { 
    193                 return osgDB::Registry::instance()->readShaderImplementation(filename,options); 
    194             } 
    195              
    196         protected: 
    197                virtual ~ReadFileCallback() {} 
    198         }; 
     163 
     164        typedef class osgDB::FindFileCallback FindFileCallback; 
     165        typedef class osgDB::ReadFileCallback ReadFileCallback; 
     166        typedef class osgDB::WriteFileCallback WriteFileCallback; 
     167 
     168        /** Set the Registry callback to use in place of the default findFile calls.*/ 
     169        void setFindFileCallback( FindFileCallback* cb) { _findFileCallback = cb; } 
     170 
     171        /** Get the findFile callback.*/ 
     172        FindFileCallback* getFindFileCallback() { return _findFileCallback.get(); } 
     173 
     174        /** Get the const findFile callback.*/ 
     175        const FindFileCallback* getFindFileCallback() const { return _findFileCallback.get(); } 
     176 
     177 
     178        std::string findDataFile(const std::string& fileName, const Options* options, CaseSensitivity caseSensitivity) 
     179        { 
     180            if (options && options->getFindFileCallback()) return options->getFindFileCallback()->findDataFile(fileName, options, caseSensitivity); 
     181            else if (_findFileCallback.valid()) return _findFileCallback->findDataFile(fileName, options, caseSensitivity); 
     182            else return findDataFileImplementation(fileName, options, caseSensitivity); 
     183        } 
     184        std::string findDataFileImplementation(const std::string& fileName, const Options* options, CaseSensitivity caseSensitivity); 
     185 
     186        std::string findLibraryFile(const std::string& fileName, const Options* options, CaseSensitivity caseSensitivity) 
     187        { 
     188            if (options && options->getFindFileCallback()) return options->getFindFileCallback()->findLibraryFile(fileName, options, caseSensitivity); 
     189            else if (_findFileCallback.valid()) return _findFileCallback->findLibraryFile(fileName, options, caseSensitivity); 
     190            else return findLibraryFileImplementation(fileName, options, caseSensitivity); 
     191        } 
     192        std::string findLibraryFileImplementation(const std::string& fileName, const Options* options, CaseSensitivity caseSensitivity); 
     193 
     194 
    199195 
    200196        /** Set the Registry callback to use in place of the default readFile calls.*/ 
     
    208204 
    209205 
    210         ReaderWriter::ReadResult openArchive(const std::string& fileName,ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const ReaderWriter::Options* options) 
    211         { 
    212             if (_readFileCallback.valid()) return _readFileCallback->openArchive(fileName, status, indexBlockSizeHint, options); 
     206        ReaderWriter::ReadResult openArchive(const std::string& fileName,ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const Options* options) 
     207        { 
     208            if (options && options->getReadFileCallback()) return options->getReadFileCallback()->openArchive(fileName, status, indexBlockSizeHint, options); 
     209            else if (_readFileCallback.valid()) return _readFileCallback->openArchive(fileName, status, indexBlockSizeHint, options); 
    213210            else return openArchiveImplementation(fileName, status, indexBlockSizeHint, options); 
    214211        } 
    215         ReaderWriter::ReadResult openArchiveImplementation(const std::string& fileName, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const ReaderWriter::Options* options); 
    216  
    217         ReaderWriter::ReadResult readObject(const std::string& fileName,const ReaderWriter::Options* options, bool buildKdTreeIfRequired=true) 
    218         { 
    219             ReaderWriter::ReadResult result = _readFileCallback.valid() ? 
    220                     _readFileCallback->readObject(fileName,options) : 
    221                     readObjectImplementation(fileName,options); 
    222                      
     212        ReaderWriter::ReadResult openArchiveImplementation(const std::string& fileName, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const Options* options); 
     213 
     214        ReaderWriter::ReadResult readObject(const std::string& fileName,const Options* options, bool buildKdTreeIfRequired=true) 
     215        { 
     216            ReaderWriter::ReadResult result; 
     217            if (options && options->getReadFileCallback()) result = options->getReadFileCallback()->readObject(fileName,options); 
     218            else if (_readFileCallback.valid()) result = _readFileCallback->readObject(fileName,options); 
     219            else result = readObjectImplementation(fileName,options); 
     220 
    223221            if (buildKdTreeIfRequired) _buildKdTreeIfRequired(result, options); 
    224                      
     222 
    225223            return result; 
    226224        } 
    227         ReaderWriter::ReadResult readObjectImplementation(const std::string& fileName,const ReaderWriter::Options* options); 
    228          
    229         ReaderWriter::ReadResult readImage(const std::string& fileName,const ReaderWriter::Options* options) 
    230         { 
    231             if (_readFileCallback.valid()) return _readFileCallback->readImage(fileName,options); 
     225        ReaderWriter::ReadResult readObjectImplementation(const std::string& fileName,const Options* options); 
     226 
     227        ReaderWriter::ReadResult readImage(const std::string& fileName,const Options* options) 
     228        { 
     229            if (options && options->getReadFileCallback()) return options->getReadFileCallback()->readImage(fileName,options); 
     230            else if (_readFileCallback.valid()) return _readFileCallback->readImage(fileName,options); 
    232231            else return readImageImplementation(fileName,options); 
    233232        } 
    234         ReaderWriter::ReadResult readImageImplementation(const std::string& fileName,const ReaderWriter::Options* options); 
    235  
    236         ReaderWriter::ReadResult readHeightField(const std::string& fileName,const ReaderWriter::Options* options) 
    237         { 
    238             if (_readFileCallback.valid()) return _readFileCallback->readHeightField(fileName,options); 
     233        ReaderWriter::ReadResult readImageImplementation(const std::string& fileName,const Options* options); 
     234 
     235        ReaderWriter::ReadResult readHeightField(const std::string& fileName,const Options* options) 
     236        { 
     237            if (options && options->getReadFileCallback()) return options->getReadFileCallback()->readHeightField(fileName,options); 
     238            else if (_readFileCallback.valid()) return _readFileCallback->readHeightField(fileName,options); 
    239239            else return readHeightFieldImplementation(fileName,options); 
    240240        } 
    241         ReaderWriter::ReadResult readHeightFieldImplementation(const std::string& fileName,const ReaderWriter::Options* options); 
    242  
    243         ReaderWriter::ReadResult readNode(const std::string& fileName,const ReaderWriter::Options* options, bool buildKdTreeIfRequired=true) 
    244         { 
    245             ReaderWriter::ReadResult result = _readFileCallback.valid() ? 
    246                     _readFileCallback->readNode(fileName,options) : 
    247                     readNodeImplementation(fileName,options); 
    248                      
     241        ReaderWriter::ReadResult readHeightFieldImplementation(const std::string& fileName,const Options* options); 
     242 
     243        ReaderWriter::ReadResult readNode(const std::string& fileName,const Options* options, bool buildKdTreeIfRequired=true) 
     244        { 
     245            ReaderWriter::ReadResult result; 
     246            if (options && options->getReadFileCallback()) result = options->getReadFileCallback()->readNode(fileName,options); 
     247            else if (_readFileCallback.valid()) result = _readFileCallback->readNode(fileName,options); 
     248            else result = readNodeImplementation(fileName,options); 
     249 
    249250            if (buildKdTreeIfRequired) _buildKdTreeIfRequired(result, options); 
    250                      
     251 
    251252            return result; 
    252253        } 
    253         ReaderWriter::ReadResult readNodeImplementation(const std::string& fileName,const ReaderWriter::Options* options); 
    254  
    255         ReaderWriter::ReadResult readShader(const std::string& fileName,const ReaderWriter::Options* options) 
    256         { 
     254        ReaderWriter::ReadResult readNodeImplementation(const std::string& fileName,const Options* options); 
     255 
     256        ReaderWriter::ReadResult readShader(const std::string& fileName,const Options* options) 
     257        { 
     258            if (options && options->getReadFileCallback()) return options->getReadFileCallback()->readShader(fileName,options); 
    257259            if (_readFileCallback.valid()) return _readFileCallback->readShader(fileName,options); 
    258260            else return readShaderImplementation(fileName,options); 
    259261        } 
    260         ReaderWriter::ReadResult readShaderImplementation(const std::string& fileName,const ReaderWriter::Options* options); 
    261  
    262  
    263  
    264         class WriteFileCallback : public virtual osg::Referenced 
    265         { 
    266         public: 
    267          
    268             virtual ReaderWriter::WriteResult writeObject(const osg::Object& obj, const std::string& fileName,const ReaderWriter::Options* options) 
    269             { 
    270                 return osgDB::Registry::instance()->writeObjectImplementation(obj,fileName,options); 
    271             } 
    272  
    273             virtual ReaderWriter::WriteResult writeImage(const osg::Image& obj, const std::string& fileName,const ReaderWriter::Options* options) 
    274             { 
    275                 return osgDB::Registry::instance()->writeImageImplementation(obj,fileName,options); 
    276             } 
    277              
    278             virtual ReaderWriter::WriteResult writeHeightField(const osg::HeightField& obj, const std::string& fileName,const ReaderWriter::Options* options) 
    279             { 
    280                 return osgDB::Registry::instance()->writeHeightFieldImplementation(obj,fileName,options); 
    281             } 
    282              
    283             virtual ReaderWriter::WriteResult writeNode(const osg::Node& obj, const std::string& fileName,const ReaderWriter::Options* options) 
    284             { 
    285                 return osgDB::Registry::instance()->writeNodeImplementation(obj,fileName,options); 
    286             } 
    287  
    288             virtual ReaderWriter::WriteResult writeShader(const osg::Shader& obj, const std::string& fileName,const ReaderWriter::Options* options) 
    289             { 
    290                 return osgDB::Registry::instance()->writeShaderImplementation(obj,fileName,options); 
    291             } 
    292              
    293         protected: 
    294                virtual ~WriteFileCallback() {} 
    295         }; 
     262        ReaderWriter::ReadResult readShaderImplementation(const std::string& fileName,const Options* options); 
     263 
    296264 
    297265        /** Set the Registry callback to use in place of the default writeFile calls.*/ 
     
    305273 
    306274 
    307         ReaderWriter::WriteResult writeObject(const osg::Object& obj, const std::string& fileName,const ReaderWriter::Options* options) 
    308         { 
    309             if (_writeFileCallback.valid()) return _writeFileCallback->writeObject(obj,fileName,options); 
     275        ReaderWriter::WriteResult writeObject(const osg::Object& obj, const std::string& fileName,const Options* options) 
     276        { 
     277            if (options && options->getWriteFileCallback()) return options->getWriteFileCallback()->writeObject(obj,fileName,options); 
     278            else if (_writeFileCallback.valid()) return _writeFileCallback->writeObject(obj,fileName,options); 
    310279            else return writeObjectImplementation(obj,fileName,options); 
    311280        } 
    312         ReaderWriter::WriteResult writeObjectImplementation(const osg::Object& obj, const std::string& fileName,const ReaderWriter::Options* options); 
    313  
    314         ReaderWriter::WriteResult writeImage(const osg::Image& obj, const std::string& fileName,const ReaderWriter::Options* options) 
    315         { 
    316             if (_writeFileCallback.valid()) return _writeFileCallback->writeImage(obj,fileName,options); 
     281        ReaderWriter::WriteResult writeObjectImplementation(const osg::Object& obj, const std::string& fileName,const Options* options); 
     282 
     283        ReaderWriter::WriteResult writeImage(const osg::Image& obj, const std::string& fileName,const Options* options) 
     284        { 
     285            if (options && options->getWriteFileCallback()) return options->getWriteFileCallback()->writeImage(obj,fileName,options); 
     286            else if (_writeFileCallback.valid()) return _writeFileCallback->writeImage(obj,fileName,options); 
    317287            else return writeImageImplementation(obj,fileName,options); 
    318288        } 
    319         ReaderWriter::WriteResult writeImageImplementation(const osg::Image& obj, const std::string& fileName,const ReaderWriter::Options* options); 
    320  
    321         ReaderWriter::WriteResult writeHeightField(const osg::HeightField& obj, const std::string& fileName,const ReaderWriter::Options* options) 
    322         { 
    323             if (_writeFileCallback.valid()) return _writeFileCallback->writeHeightField(obj,fileName,options); 
     289        ReaderWriter::WriteResult writeImageImplementation(const osg::Image& obj, const std::string& fileName,const Options* options); 
     290 
     291        ReaderWriter::WriteResult writeHeightField(const osg::HeightField& obj, const std::string& fileName,const Options* options) 
     292        { 
     293            if (options && options->getWriteFileCallback()) return options->getWriteFileCallback()->writeHeightField(obj,fileName,options); 
     294            else if (_writeFileCallback.valid()) return _writeFileCallback->writeHeightField(obj,fileName,options); 
    324295            else return writeHeightFieldImplementation(obj,fileName,options); 
    325296        } 
    326         ReaderWriter::WriteResult writeHeightFieldImplementation(const osg::HeightField& obj, const std::string& fileName,const ReaderWriter::Options* options); 
    327  
    328         ReaderWriter::WriteResult writeNode(const osg::Node& node, const std::string& fileName,const ReaderWriter::Options* options) 
    329         { 
    330             if (_writeFileCallback.valid()) return _writeFileCallback->writeNode(node,fileName,options); 
     297        ReaderWriter::WriteResult writeHeightFieldImplementation(const osg::HeightField& obj, const std::string& fileName,const Options* options); 
     298 
     299        ReaderWriter::WriteResult writeNode(const osg::Node& node, const std::string& fileName,const Options* options) 
     300        { 
     301            if (options && options->getWriteFileCallback()) return options->getWriteFileCallback()->writeNode(node,fileName,options); 
     302            else if (_writeFileCallback.valid()) return _writeFileCallback->writeNode(node,fileName,options); 
    331303            else return writeNodeImplementation(node,fileName,options); 
    332304        } 
    333         ReaderWriter::WriteResult writeNodeImplementation(const osg::Node& node, const std::string& fileName,const ReaderWriter::Options* options); 
    334          
    335         ReaderWriter::WriteResult writeShader(const osg::Shader& obj, const std::string& fileName,const ReaderWriter::Options* options) 
    336         { 
    337             if (_writeFileCallback.valid()) return _writeFileCallback->writeShader(obj,fileName,options); 
     305        ReaderWriter::WriteResult writeNodeImplementation(const osg::Node& node, const std::string& fileName,const Options* options); 
     306         
     307        ReaderWriter::WriteResult writeShader(const osg::Shader& obj, const std::string& fileName,const Options* options) 
     308        { 
     309            if (options && options->getWriteFileCallback()) return options->getWriteFileCallback()->writeShader(obj,fileName,options); 
     310            else if (_writeFileCallback.valid()) return _writeFileCallback->writeShader(obj,fileName,options); 
    338311            else return writeShaderImplementation(obj,fileName,options); 
    339312        } 
    340         ReaderWriter::WriteResult writeShaderImplementation(const osg::Shader& obj, const std::string& fileName,const ReaderWriter::Options* options); 
    341          
    342  
    343         inline void _buildKdTreeIfRequired(ReaderWriter::ReadResult& result, const ReaderWriter::Options* options) 
    344         { 
    345             bool doKdTreeBuilder = (options && options->getBuildKdTreesHint()!=ReaderWriter::Options::NO_PREFERENCE) ? 
    346                 options->getBuildKdTreesHint() == ReaderWriter::Options::BUILD_KDTREES : 
    347                 _buildKdTreesHint == ReaderWriter::Options::BUILD_KDTREES; 
     313        ReaderWriter::WriteResult writeShaderImplementation(const osg::Shader& obj, const std::string& fileName,const Options* options); 
     314         
     315 
     316        inline void _buildKdTreeIfRequired(ReaderWriter::ReadResult& result, const Options* options) 
     317        { 
     318            bool doKdTreeBuilder = (options && options->getBuildKdTreesHint()!=Options::NO_PREFERENCE) ? 
     319                options->getBuildKdTreesHint() == Options::BUILD_KDTREES : 
     320                _buildKdTreesHint == Options::BUILD_KDTREES; 
    348321 
    349322            if (doKdTreeBuilder && _kdTreeBuilder.valid() && result.validNode())  
     
    356329 
    357330        /** Set whether the KdTrees should be built for geometry in the loader model. */ 
    358         void setBuildKdTreesHint(ReaderWriter::Options::BuildKdTreesHint hint) { _buildKdTreesHint = hint; } 
     331        void setBuildKdTreesHint(Options::BuildKdTreesHint hint) { _buildKdTreesHint = hint; } 
    359332 
    360333        /** Get whether the KdTrees should be built for geometry in the loader model. */ 
    361         ReaderWriter::Options::BuildKdTreesHint getBuildKdTreesHint() const { return _buildKdTreesHint; } 
     334        Options::BuildKdTreesHint getBuildKdTreesHint() const { return _buildKdTreesHint; } 
    362335 
    363336        /** Set the KdTreeBuilder visitor that is used to build KdTree on loaded models.*/ 
     
    391364         
    392365 
    393         void setOptions(ReaderWriter::Options* opt) { _options = opt; } 
    394         ReaderWriter::Options* getOptions() { return _options.get(); } 
    395         const ReaderWriter::Options*  getOptions() const { return _options.get(); } 
     366        void setOptions(Options* opt) { _options = opt; } 
     367        Options* getOptions() { return _options.get(); } 
     368        const Options*  getOptions() const { return _options.get(); } 
    396369 
    397370 
     
    520493        DynamicLibraryList::iterator getLibraryItr(const std::string& fileName); 
    521494 
    522         ReaderWriter::Options::BuildKdTreesHint     _buildKdTreesHint; 
     495        Options::BuildKdTreesHint     _buildKdTreesHint; 
    523496        osg::ref_ptr<osg::KdTreeBuilder>            _kdTreeBuilder; 
    524497         
     
    539512        struct ReadFunctor 
    540513        { 
    541             ReadFunctor(const std::string& filename, const ReaderWriter::Options* options): 
     514            ReadFunctor(const std::string& filename, const Options* options): 
    542515                _filename(filename), 
    543516                _options(options) {} 
     
    549522 
    550523            std::string _filename; 
    551             const ReaderWriter::Options* _options; 
     524            const Options* _options; 
    552525        }; 
    553526 
     
    574547 
    575548        ReaderWriter::ReadResult read(const ReadFunctor& readFunctor); 
    576         ReaderWriter::ReadResult readImplementation(const ReadFunctor& readFunctor,ReaderWriter::Options::CacheHintOptions cacheHint); 
     549        ReaderWriter::ReadResult readImplementation(const ReadFunctor& readFunctor,Options::CacheHintOptions cacheHint); 
    577550 
    578551 
     
    582555 
    583556 
     557        osg::ref_ptr<FindFileCallback>      _findFileCallback; 
    584558        osg::ref_ptr<ReadFileCallback>      _readFileCallback; 
    585559        osg::ref_ptr<WriteFileCallback>     _writeFileCallback; 
     
    611585         
    612586        // options to pass to reader writers. 
    613         osg::ref_ptr<ReaderWriter::Options>     _options; 
     587        osg::ref_ptr<Options>     _options; 
    614588         
    615589        FilePathList                            _dataFilePath; 
  • OpenSceneGraph/trunk/include/osgDB/WriteFile

    r7908 r10171  
    3333  * for the filename extension, and this plugin then handles the request 
    3434  * to write the specified file.*/ 
    35 extern OSGDB_EXPORT bool writeObjectFile(const osg::Object& object, const std::string& filename, const ReaderWriter::Options* options ); 
     35extern OSGDB_EXPORT bool writeObjectFile(const osg::Object& object, const std::string& filename, const Options* options ); 
    3636 
    3737/** Write an osg::Object to file.  
     
    5353  * for the filename extension, and this plugin then handles the request 
    5454  * to write the specified file.*/ 
    55 extern OSGDB_EXPORT bool writeImageFile(const osg::Image& image, const std::string& filename, const ReaderWriter::Options* options ); 
     55extern OSGDB_EXPORT bool writeImageFile(const osg::Image& image, const std::string& filename, const Options* options ); 
    5656 
    5757/** Write an osg::Image to file.  
     
    7373  * for the filename extension, and this plugin then handles the request 
    7474  * to write the specified file.*/ 
    75 extern OSGDB_EXPORT bool writeHeightFieldFile(const osg::HeightField& hf, const std::string& filename, const ReaderWriter::Options* options ); 
     75extern OSGDB_EXPORT bool writeHeightFieldFile(const osg::HeightField& hf, const std::string& filename, const Options* options ); 
    7676 
    7777/** Write an osg::HeightField to file.  
     
    9393  * for the filename extension, and this plugin then handles the request 
    9494  * to write the specified file.*/ 
    95 extern OSGDB_EXPORT bool writeNodeFile(const osg::Node& node, const std::string& filename, const ReaderWriter::Options* options ); 
     95extern OSGDB_EXPORT bool writeNodeFile(const osg::Node& node, const std::string& filename, const Options* options ); 
    9696 
    9797/** Write an osg::Node to file.  
     
    113113  * for the filename extension, and this plugin then handles the request 
    114114  * to write the specified file.*/ 
    115 extern OSGDB_EXPORT bool writeShaderFile(const osg::Shader& shader, const std::string& filename, const ReaderWriter::Options* options ); 
     115extern OSGDB_EXPORT bool writeShaderFile(const osg::Shader& shader, const std::string& filename, const Options* options ); 
    116116 
    117117/** Write an osg::Shader to file.  
  • OpenSceneGraph/trunk/include/osgDB/XmlParser

    r10130 r10171  
    2222class XmlNode; 
    2323 
    24 /** read an Xml file, find the file in ReaderWriter::Options DataFilePathList.*/ 
    25 extern OSGDB_EXPORT XmlNode* readXmlFile(const std::string& filename,const ReaderWriter::Options* options); 
     24/** read an Xml file, find the file in Options DataFilePathList.*/ 
     25extern OSGDB_EXPORT XmlNode* readXmlFile(const std::string& filename,const Options* options); 
    2626 
    2727/** read an Xml file, find the file in osgDB::Registry's eaderWriter::Options DataFilePathList.*/ 
  • OpenSceneGraph/trunk/include/osgVolume/Layer

    r9748 r10171  
    173173        void clear(); 
    174174 
    175         void setFileName(unsigned int i, const std::string& filename) { _layers[i].filename = filename; if (_layers[i].layer.valid()) _layers[i].layer->setFileName(filename); } 
     175        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); } 
    176176        const std::string& getFileName(unsigned int i) const { return _layers[i].layer.valid() ? _layers[i].layer->getFileName() : _layers[i].filename; } 
    177177 
  • OpenSceneGraph/trunk/src/osg/Shader.cpp

    r7908 r10171  
    122122bool Shader::setType( Type t ) 
    123123{ 
    124     if( _type != UNDEFINED ) 
     124    if (_type==t) return true; 
     125 
     126    if (_type != UNDEFINED) 
    125127    { 
    126128        osg::notify(osg::WARN) << "cannot change type of Shader" << std::endl; 
  • OpenSceneGraph/trunk/src/osgDB/Archive.cpp

    r8584 r10171  
    2828} 
    2929 
    30 osgDB::Archive* osgDB::openArchive(const std::string& filename, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint,ReaderWriter::Options* options) 
     30osgDB::Archive* osgDB::openArchive(const std::string& filename, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint,Options* options) 
    3131{ 
    3232    // ensure archive extension is in the registry list 
  • OpenSceneGraph/trunk/src/osgDB/CMakeLists.txt

    r10122 r10171  
    3838    ${HEADER_PATH}/Input 
    3939    ${HEADER_PATH}/Output 
     40    ${HEADER_PATH}/Options 
    4041    ${HEADER_PATH}/ParameterOutput 
    4142    ${HEADER_PATH}/PluginQuery 
     
    7273    MimeTypes.cpp 
    7374    Output.cpp 
     75    Options.cpp 
    7476    PluginQuery.cpp 
    7577    ReaderWriter.cpp 
  • OpenSceneGraph/trunk/src/osgDB/DatabasePager.cpp

    r10054 r10171  
    123123            _drawablePolicy(drawablePolicy), _pager(pager) 
    124124    { 
    125         if (osgDB::Registry::instance()->getBuildKdTreesHint()==osgDB::ReaderWriter::Options::BUILD_KDTREES && 
     125        if (osgDB::Registry::instance()->getBuildKdTreesHint()==osgDB::Options::BUILD_KDTREES && 
    126126            osgDB::Registry::instance()->getKdTreeBuilder()) 
    127127        { 
     
    680680                { 
    681681                    // check to see if we need to run the KdTreeBuilder 
    682                     if (osgDB::Registry::instance()->getBuildKdTreesHint()==osgDB::ReaderWriter::Options::BUILD_KDTREES && 
     682                    if (osgDB::Registry::instance()->getBuildKdTreesHint()==osgDB::Options::BUILD_KDTREES && 
    683683                        osgDB::Registry::instance()->getKdTreeBuilder()) 
    684684                    { 
     
    12391239                                    float priority, const osg::FrameStamp* framestamp, 
    12401240                                    osg::ref_ptr<osg::Referenced>& databaseRequestRef, 
    1241                                     ReaderWriter::Options* loadOptions) 
     1241                                    Options* loadOptions) 
    12421242{ 
    12431243    if (!_acceptNewRequests) return; 
  • OpenSceneGraph/trunk/src/osgDB/FileCache.cpp

    r9038 r10171  
    4747} 
    4848 
    49 ReaderWriter::ReadResult FileCache::readNode(const std::string& originalFileName, const osgDB::ReaderWriter::Options* options, bool buildKdTreeIfRequired) const 
     49ReaderWriter::ReadResult FileCache::readNode(const std::string& originalFileName, const osgDB::Options* options, bool buildKdTreeIfRequired) const 
    5050{ 
    5151    std::string cacheFileName = createCacheFileName(originalFileName); 
     
    6161} 
    6262 
    63 ReaderWriter::WriteResult FileCache::writeNode(const osg::Node& node, const std::string& originalFileName, const osgDB::ReaderWriter::Options* options) const 
     63ReaderWriter::WriteResult FileCache::writeNode(const osg::Node& node, const std::string& originalFileName, const osgDB::Options* options) const 
    6464{ 
    6565    std::string cacheFileName = createCacheFileName(originalFileName); 
  • OpenSceneGraph/trunk/src/osgDB/FileUtils.cpp

    r10129 r10171  
    290290std::string osgDB::findDataFile(const std::string& filename,CaseSensitivity caseSensitivity) 
    291291{ 
    292     return findDataFile(filename,static_cast<ReaderWriter::Options*>(0),caseSensitivity); 
    293 } 
    294  
    295 OSGDB_EXPORT std::string osgDB::findDataFile(const std::string& filename,const ReaderWriter::Options* options, CaseSensitivity caseSensitivity) 
    296 { 
    297     if (filename.empty()) return filename; 
    298      
    299     if(fileExists(filename))  
    300     { 
    301         osg::notify(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl; 
    302         return filename; 
    303     } 
    304  
    305     std::string fileFound; 
    306      
    307     if (options && !options->getDatabasePathList().empty()) 
    308     { 
    309         fileFound = findFileInPath(filename, options->getDatabasePathList(), caseSensitivity); 
    310         if (!fileFound.empty()) return fileFound; 
    311     } 
    312  
    313     const FilePathList& filepath = Registry::instance()->getDataFilePathList(); 
    314     if (!filepath.empty()) 
    315     { 
    316         fileFound = findFileInPath(filename, filepath,caseSensitivity); 
    317         if (!fileFound.empty()) return fileFound; 
    318     } 
    319      
    320  
    321     // if a directory is included in the filename, get just the (simple) filename itself and try that 
    322     std::string simpleFileName = getSimpleFileName(filename); 
    323     if (simpleFileName!=filename) 
    324     { 
    325  
    326         if(fileExists(simpleFileName))  
    327         { 
    328             osg::notify(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl; 
    329             return simpleFileName; 
    330         } 
    331  
    332         if (options && !options->getDatabasePathList().empty()) 
    333         { 
    334             fileFound = findFileInPath(simpleFileName, options->getDatabasePathList(), caseSensitivity); 
    335             if (!fileFound.empty()) return fileFound; 
    336         } 
    337  
    338         if (!filepath.empty()) 
    339         { 
    340             fileFound = findFileInPath(simpleFileName, filepath,caseSensitivity); 
    341             if (!fileFound.empty()) return fileFound; 
    342         } 
    343  
    344     } 
    345  
    346     // return empty string. 
    347     return std::string(); 
     292    return findDataFile(filename,static_cast<Options*>(0),caseSensitivity); 
     293} 
     294 
     295OSGDB_EXPORT std::string osgDB::findDataFile(const std::string& filename,const Options* options, CaseSensitivity caseSensitivity) 
     296{ 
     297    return Registry::instance()->findDataFile(filename, options, caseSensitivity); 
    348298} 
    349299 
    350300std::string osgDB::findLibraryFile(const std::string& filename,CaseSensitivity caseSensitivity) 
    351301{ 
    352     if (filename.empty())  
    353         return filename;  
    354  
    355     const FilePathList& filepath = Registry::instance()->getLibraryFilePathList(); 
    356  
    357     std::string fileFound = findFileInPath(filename, filepath,caseSensitivity); 
    358     if (!fileFound.empty())  
    359         return fileFound; 
    360  
    361     if(fileExists(filename))  
    362     { 
    363         osg::notify(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl; 
    364         return filename; 
    365     } 
    366  
    367     // if a directory is included in the filename, get just the (simple) filename itself and try that 
    368     std::string simpleFileName = getSimpleFileName(filename); 
    369     if (simpleFileName!=filename) 
    370     { 
    371         std::string fileFound = findFileInPath(simpleFileName, filepath,caseSensitivity); 
    372         if (!fileFound.empty()) return fileFound; 
    373     } 
    374  
    375     // failed return empty string. 
    376     return std::string(); 
     302    return Registry::instance()->findLibraryFile(filename, osgDB::Registry::instance()->getOptions(), caseSensitivity); 
    377303} 
    378304 
  • OpenSceneGraph/trunk/src/osgDB/Output.cpp

    r9343 r10171  
    6464} 
    6565 
    66 void Output::setOptions(const ReaderWriter::Options* options) 
     66void Output::setOptions(const Options* options) 
    6767{ 
    6868    _options = options; 
  • OpenSceneGraph/trunk/src/osgDB/ReadFile.cpp

    r9858 r10171  
    3030using namespace osgDB; 
    3131 
    32 Object* osgDB::readObjectFile(const std::string& filename,const ReaderWriter::Options* options) 
     32Object* osgDB::readObjectFile(const std::string& filename,const Options* options) 
    3333{ 
    3434    ReaderWriter::ReadResult rr = Registry::instance()->readObject(filename,options); 
     
    3939 
    4040 
    41 Image* osgDB::readImageFile(const std::string& filename,const ReaderWriter::Options* options) 
     41Image* osgDB::readImageFile(const std::string& filename,const Options* options) 
    4242{ 
    4343    ReaderWriter::ReadResult rr = Registry::instance()->readImage(filename,options); 
     
    4747} 
    4848 
    49 Shader* osgDB::readShaderFile(const std::string& filename,const ReaderWriter::Options* options) 
     49Shader* osgDB::readShaderFile(const std::string& filename,const Options* options) 
    5050{ 
    5151    ReaderWriter::ReadResult rr = Registry::instance()->readShader(filename,options); 
     
    5656 
    5757 
    58 HeightField* osgDB::readHeightFieldFile(const std::string& filename,const ReaderWriter::Options* options) 
     58HeightField* osgDB::readHeightFieldFile(const std::string& filename,const Options* options) 
    5959{ 
    6060    ReaderWriter::ReadResult rr = Registry::instance()->readHeightField(filename,options); 
     
    6565 
    6666 
    67 Node* osgDB::readNodeFile(const std::string& filename,const ReaderWriter::Options* options) 
     67Node* osgDB::readNodeFile(const std::string& filename,const Options* options) 
    6868{ 
    6969    ReaderWriter::ReadResult rr = Registry::instance()->readNode(filename,options); 
     
    7373} 
    7474 
    75 Node* osgDB::readNodeFiles(std::vector<std::string>& commandLine,const ReaderWriter::Options* options) 
     75Node* osgDB::readNodeFiles(std::vector<std::string>& commandLine,const Options* options) 
    7676{ 
    7777    typedef std::vector<osg::Node*> NodeList; 
     
    122122} 
    123123 
    124 Node* osgDB::readNodeFiles(osg::ArgumentParser& arguments,const ReaderWriter::Options* options) 
     124Node* osgDB::readNodeFiles(osg::ArgumentParser& arguments,const Options* options) 
    125125{ 
    126126 
     
    256256} 
    257257 
    258 osg::ref_ptr<osg::Object> osgDB::readRefObjectFile(const std::string& filename,const ReaderWriter::Options* options) 
     258osg::ref_ptr<osg::Object> osgDB::readRefObjectFile(const std::string& filename,const Options* options) 
    259259{ 
    260260    ReaderWriter::ReadResult rr = Registry::instance()->readObject(filename,options); 
     
    264264} 
    265265 
    266 osg::ref_ptr<osg::Image> osgDB::readRefImageFile(const std::string& filename,const ReaderWriter::Options* options) 
     266osg::ref_ptr<osg::Image> osgDB::readRefImageFile(const std::string& filename,const Options* options) 
    267267{ 
    268268    ReaderWriter::ReadResult rr = Registry::instance()->readImage(filename,options); 
     
    272272} 
    273273 
    274 osg::ref_ptr<osg::Shader> osgDB::readRefShaderFile(const std::string& filename,const ReaderWriter::Options* options) 
     274osg::ref_ptr<osg::Shader> osgDB::readRefShaderFile(const std::string& filename,const Options* options) 
    275275{ 
    276276    ReaderWriter::ReadResult rr = Registry::instance()->readShader(filename,options); 
     
    280280} 
    281281 
    282 osg::ref_ptr<osg::HeightField> osgDB::readRefHeightFieldFile(const std::string& filename,const ReaderWriter::Options* options) 
     282osg::ref_ptr<osg::HeightField> osgDB::readRefHeightFieldFile(const std::string& filename,const Options* options) 
    283283{ 
    284284    ReaderWriter::ReadResult rr = Registry::instance()->readHeightField(filename,options); 
     
    288288} 
    289289 
    290 osg::ref_ptr<osg::Node> osgDB::readRefNodeFile(const std::string& filename,const ReaderWriter::Options* options) 
     290osg::ref_ptr<osg::Node> osgDB::readRefNodeFile(const std::string& filename,const Options* options) 
    291291{ 
    292292    ReaderWriter::ReadResult rr = Registry::instance()->readNode(filename,options); 
  • OpenSceneGraph/trunk/src/osgDB/ReaderWriter.cpp

    r9890 r10171  
    1313 
    1414#include <osgDB/ReaderWriter> 
     15#include <osgDB/Registry> 
    1516#include <osgDB/FileNameUtils> 
    1617#include <osgDB/Archive> 
  • OpenSceneGraph/trunk/src/osgDB/Registry.cpp

    r10150 r10171  
    177177    // notify(INFO) << "Constructing osg::Registry"<<std::endl; 
    178178 
    179     _buildKdTreesHint = ReaderWriter::Options::NO_PREFERENCE; 
     179    _buildKdTreesHint = Options::NO_PREFERENCE; 
    180180    _kdTreeBuilder = new osg::KdTreeBuilder; 
    181181     
     
    184184    { 
    185185        bool switchOff = (strcmp(kdtree_str, "off")==0 || strcmp(kdtree_str, "OFF")==0 || strcmp(kdtree_str, "Off")==0 ); 
    186         if (switchOff) _buildKdTreesHint = ReaderWriter::Options::DO_NOT_BUILD_KDTREES; 
    187         else _buildKdTreesHint = ReaderWriter::Options::BUILD_KDTREES; 
     186        if (switchOff) _buildKdTreesHint = Options::DO_NOT_BUILD_KDTREES; 
     187        else _buildKdTreesHint = Options::BUILD_KDTREES; 
    188188    } 
    189189 
     
    463463    while(arguments.read("-O",value)) 
    464464    { 
    465         setOptions(new ReaderWriter::Options(value)); 
     465        setOptions(new Options(value)); 
    466466    } 
    467467} 
     
    14181418struct Registry::ReadObjectFunctor : public Registry::ReadFunctor 
    14191419{ 
    1420     ReadObjectFunctor(const std::string& filename, const ReaderWriter::Options* options):ReadFunctor(filename,options) {} 
     1420    ReadObjectFunctor(const std::string& filename, const Options* options):ReadFunctor(filename,options) {} 
    14211421 
    14221422    virtual ReaderWriter::ReadResult doRead(ReaderWriter& rw) const { return rw.readObject(_filename, _options); }     
     
    14271427struct Registry::ReadImageFunctor : public Registry::ReadFunctor 
    14281428{ 
    1429     ReadImageFunctor(const std::string& filename, const ReaderWriter::Options* options):ReadFunctor(filename,options) {} 
     1429    ReadImageFunctor(const std::string& filename, const Options* options):ReadFunctor(filename,options) {} 
    14301430 
    14311431    virtual ReaderWriter::ReadResult doRead(ReaderWriter& rw)const  { return rw.readImage(_filename, _options); }     
     
    14361436struct Registry::ReadHeightFieldFunctor : public Registry::ReadFunctor 
    14371437{ 
    1438     ReadHeightFieldFunctor(const std::string& filename, const ReaderWriter::Options* options):ReadFunctor(filename,options) {} 
     1438    ReadHeightFieldFunctor(const std::string& filename, const Options* options):ReadFunctor(filename,options) {} 
    14391439 
    14401440    virtual ReaderWriter::ReadResult doRead(ReaderWriter& rw) const { return rw.readHeightField(_filename, _options); }     
     
    14451445struct Registry::ReadNodeFunctor : public Registry::ReadFunctor 
    14461446{ 
    1447     ReadNodeFunctor(const std::string& filename, const ReaderWriter::Options* options):ReadFunctor(filename,options) {} 
     1447    ReadNodeFunctor(const std::string& filename, const Options* options):ReadFunctor(filename,options) {} 
    14481448 
    14491449    virtual ReaderWriter::ReadResult doRead(ReaderWriter& rw) const { return rw.readNode(_filename, _options); }     
     
    14551455struct Registry::ReadArchiveFunctor : public Registry::ReadFunctor 
    14561456{ 
    1457     ReadArchiveFunctor(const std::string& filename, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const ReaderWriter::Options* options): 
     1457    ReadArchiveFunctor(const std::string& filename, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const Options* options): 
    14581458        ReadFunctor(filename,options), 
    14591459        _status(status), 
     
    14711471struct Registry::ReadShaderFunctor : public Registry::ReadFunctor 
    14721472{ 
    1473     ReadShaderFunctor(const std::string& filename, const ReaderWriter::Options* options):ReadFunctor(filename,options) {} 
     1473    ReadShaderFunctor(const std::string& filename, const Options* options):ReadFunctor(filename,options) {} 
    14741474 
    14751475    virtual ReaderWriter::ReadResult doRead(ReaderWriter& rw)const  { return rw.readShader(_filename, _options); }     
     
    14891489    _archiveExtList.push_back(ext); 
    14901490} 
     1491 
     1492std::string Registry::findDataFileImplementation(const std::string& filename, const Options* options, CaseSensitivity caseSensitivity) 
     1493{ 
     1494    if (filename.empty()) return filename; 
     1495 
     1496    if(fileExists(filename)) 
     1497    { 
     1498        osg::notify(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl; 
     1499        return filename; 
     1500    } 
     1501 
     1502    std::string fileFound; 
     1503 
     1504    if (options && !options->getDatabasePathList().empty()) 
     1505    { 
     1506        fileFound = findFileInPath(filename, options->getDatabasePathList(), caseSensitivity); 
     1507        if (!fileFound.empty()) return fileFound; 
     1508    } 
     1509 
     1510    const FilePathList& filepath = Registry::instance()->getDataFilePathList(); 
     1511    if (!filepath.empty()) 
     1512    { 
     1513        fileFound = findFileInPath(filename, filepath,caseSensitivity); 
     1514        if (!fileFound.empty()) return fileFound; 
     1515    } 
     1516 
     1517 
     1518    // if a directory is included in the filename, get just the (simple) filename itself and try that 
     1519    std::string simpleFileName = getSimpleFileName(filename); 
     1520    if (simpleFileName!=filename) 
     1521    { 
     1522 
     1523        if(fileExists(simpleFileName)) 
     1524        { 
     1525            osg::notify(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl; 
     1526            return simpleFileName; 
     1527        } 
     1528 
     1529        if (options && !options->getDatabasePathList().empty()) 
     1530        { 
     1531            fileFound = findFileInPath(simpleFileName, options->getDatabasePathList(), caseSensitivity); 
     1532            if (!fileFound.empty()) return fileFound; 
     1533        } 
     1534 
     1535        if (!filepath.empty()) 
     1536        { 
     1537            fileFound = findFileInPath(simpleFileName, filepath,caseSensitivity); 
     1538            if (!fileFound.empty()) return fileFound; 
     1539        } 
     1540 
     1541    } 
     1542 
     1543    // return empty string. 
     1544    return std::string(); 
     1545} 
     1546 
     1547std::string Registry::findLibraryFileImplementation(const std::string& filename, const Options* options, CaseSensitivity caseSensitivity) 
     1548{ 
     1549    if (filename.empty()) 
     1550        return filename; 
     1551 
     1552    const FilePathList& filepath = Registry::instance()->getLibraryFilePathList(); 
     1553 
     1554    std::string fileFound = findFileInPath(filename, filepath,caseSensitivity); 
     1555    if (!fileFound.empty()) 
     1556        return fileFound; 
     1557 
     1558    if(fileExists(filename)) 
     1559    { 
     1560        osg::notify(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl; 
     1561        return filename; 
     1562    } 
     1563 
     1564    // if a directory is included in the filename, get just the (simple) filename itself and try that 
     1565    std::string simpleFileName = getSimpleFileName(filename); 
     1566    if (simpleFileName!=filename) 
     1567    { 
     1568        std::string fileFound = findFileInPath(simpleFileName, filepath,caseSensitivity); 
     1569        if (!fileFound.empty()) return fileFound; 
     1570    } 
     1571 
     1572    // failed return empty string. 
     1573    return std::string(); 
     1574} 
     1575 
     1576 
    14911577 
    14921578ReaderWriter::ReadResult Registry::read(const ReadFunctor& readFunctor) 
     
    15151601            osgDB::Archive* archive = result.getArchive(); 
    15161602         
    1517             osg::ref_ptr<ReaderWriter::Options> options = new ReaderWriter::Options; 
     1603            osg::ref_ptr<Options> options = new Options; 
    15181604            options->setDatabasePath(archiveName); 
    15191605 
     
    16511737} 
    16521738 
    1653 ReaderWriter::ReadResult Registry::readImplementation(const ReadFunctor& readFunctor,ReaderWriter::Options::CacheHintOptions cacheHint) 
     1739ReaderWriter::ReadResult Registry::readImplementation(const ReadFunctor& readFunctor,Options::CacheHintOptions cacheHint) 
    16541740{ 
    16551741    std::string file(readFunctor._filename); 
     
    16571743    bool useObjectCache=false; 
    16581744    //Note CACHE_ARCHIVES has a different object that it caches to so it will never be used here 
    1659     if (cacheHint!=ReaderWriter::Options::CACHE_ARCHIVES) 
    1660     { 
    1661         const ReaderWriter::Options* options=readFunctor._options; 
     1745    if (cacheHint!=Options::CACHE_ARCHIVES) 
     1746    { 
     1747        const Options* options=readFunctor._options; 
    16621748        useObjectCache=options ? (options->getObjectCacheHint()&cacheHint)!=0: false; 
    16631749    } 
     
    16991785 
    17001786 
    1701 ReaderWriter::ReadResult Registry::openArchiveImplementation(const std::string& fileName, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const ReaderWriter::Options* options) 
     1787ReaderWriter::ReadResult Registry::openArchiveImplementation(const std::string& fileName, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const Options* options) 
    17021788{ 
    17031789    osgDB::Archive* archive = getFromArchiveCache(fileName); 
    17041790    if (archive) return archive; 
    17051791 
    1706     ReaderWriter::ReadResult result = readImplementation(ReadArchiveFunctor(fileName, status, indexBlockSizeHint, options),ReaderWriter::Options::CACHE_ARCHIVES); 
     1792    ReaderWriter::ReadResult result = readImplementation(ReadArchiveFunctor(fileName, status, indexBlockSizeHint, options),Options::CACHE_ARCHIVES); 
    17071793 
    17081794    // default to using caching archive if no options structure provided, but if options are provided use archives 
    17091795    // only if supplied. 
    17101796    if (result.validArchive() && 
    1711         (!options || (options->getObjectCacheHint() & ReaderWriter::Options::CACHE_ARCHIVES)) ) 
     1797        (!options || (options->getObjectCacheHint() & Options::CACHE_ARCHIVES)) ) 
    17121798    { 
    17131799        addToArchiveCache(fileName,result.getArchive()); 
     
    17171803 
    17181804 
    1719 ReaderWriter::ReadResult Registry::readObjectImplementation(const std::string& fileName,const ReaderWriter::Options* options) 
    1720 { 
    1721     return readImplementation(ReadObjectFunctor(fileName, options),ReaderWriter::Options::CACHE_OBJECTS); 
    1722 } 
    1723  
    1724 ReaderWriter::WriteResult Registry::writeObjectImplementation(const Object& obj,const std::string& fileName,const ReaderWriter::Options* options) 
     1805ReaderWriter::ReadResult Registry::readObjectImplementation(const std::string& fileName,const Options* options) 
     1806{ 
     1807    return readImplementation(ReadObjectFunctor(fileName, options),Options::CACHE_OBJECTS); 
     1808} 
     1809 
     1810ReaderWriter::WriteResult Registry::writeObjectImplementation(const Object& obj,const std::string& fileName,const Options* options) 
    17251811{ 
    17261812    // record the errors reported by readerwriters. 
     
    17691855 
    17701856 
    1771 ReaderWriter::ReadResult Registry::readImageImplementation(const std::string& fileName,const ReaderWriter::Options* options) 
    1772 { 
    1773     return readImplementation(ReadImageFunctor(fileName, options),ReaderWriter::Options::CACHE_IMAGES); 
    1774 } 
    1775  
    1776 ReaderWriter::WriteResult Registry::writeImageImplementation(const Image& image,const std::string& fileName,const ReaderWriter::Options* options) 
     1857ReaderWriter::ReadResult Registry::readImageImplementation(const std::string& fileName,const Options* options) 
     1858{ 
     1859    return readImplementation(ReadImageFunctor(fileName, options),Options::CACHE_IMAGES); 
     1860} 
     1861 
     1862ReaderWriter::WriteResult Registry::writeImageImplementation(const Image& image,const std::string& fileName,const Options* options) 
    17771863{ 
    17781864    // record the errors reported by readerwriters. 
     
    18221908 
    18231909 
    1824 ReaderWriter::ReadResult Registry::readHeightFieldImplementation(const std::string& fileName,const ReaderWriter::Options* options) 
    1825 { 
    1826     return readImplementation(ReadHeightFieldFunctor(fileName, options),ReaderWriter::Options::CACHE_HEIGHTFIELDS); 
    1827 } 
    1828  
    1829 ReaderWriter::WriteResult Registry::writeHeightFieldImplementation(const HeightField& HeightField,const std::string& fileName,const ReaderWriter::Options* options) 
     1910ReaderWriter::ReadResult Registry::readHeightFieldImplementation(const std::string& fileName,const Options* options) 
     1911{ 
     1912    return readImplementation(ReadHeightFieldFunctor(fileName, options),Options::CACHE_HEIGHTFIELDS); 
     1913} 
     1914 
     1915ReaderWriter::WriteResult Registry::writeHeightFieldImplementation(const HeightField& HeightField,const std::string& fileName,const Options* options) 
    18301916{ 
    18311917    // record the errors reported by readerwriters. 
     
    18751961 
    18761962 
    1877 ReaderWriter::ReadResult Registry::readNodeImplementation(const std::string& fileName,const ReaderWriter::Options* options) 
     1963ReaderWriter::ReadResult Registry::readNodeImplementation(const std::string& fileName,const Options* options) 
    18781964{ 
    18791965#if 0 
    18801966 
    18811967    osg::Timer_t startTick = osg::Timer::instance()->tick(); 
    1882     ReaderWriter::ReadResult result = readImplementation(ReadNodeFunctor(fileName, options),ReaderWriter::Options::CACHE_NODES); 
     1968    ReaderWriter::ReadResult result = readImplementation(ReadNodeFunctor(fileName, options),Options::CACHE_NODES); 
    18831969    osg::Timer_t endTick = osg::Timer::instance()->tick(); 
    18841970    osg::notify(osg::NOTICE)<<"time to load "<<fileName<<" "<<osg::Timer::instance()->delta_m(startTick, endTick)<<"ms"<<std::endl; 
     
    18871973#else 
    18881974 
    1889     return readImplementation(ReadNodeFunctor(fileName, options),ReaderWriter::Options::CACHE_NODES); 
     1975    return readImplementation(ReadNodeFunctor(fileName, options),Options::CACHE_NODES); 
    18901976                               
    18911977#endif 
    18921978} 
    18931979 
    1894 ReaderWriter::WriteResult Registry::writeNodeImplementation(const Node& node,const std::string& fileName,const ReaderWriter::Options* options) 
     1980ReaderWriter::WriteResult Registry::writeNodeImplementation(const Node& node,const std::string& fileName,const Options* options) 
    18951981{ 
    18961982    // record the errors reported by readerwriters. 
     
    19422028} 
    19432029 
    1944 ReaderWriter::ReadResult Registry::readShaderImplementation(const std::string& fileName,const ReaderWriter::Options* options) 
    1945 { 
    1946     return readImplementation(ReadShaderFunctor(fileName, options),ReaderWriter::Options::CACHE_SHADERS); 
    1947 } 
    1948  
    1949 ReaderWriter::WriteResult Registry::writeShaderImplementation(const Shader& shader,const std::string& fileName,const ReaderWriter::Options* options) 
     2030ReaderWriter::ReadResult Registry::readShaderImplementation(const std::string& fileName,const Options* options) 
     2031{ 
     2032    return readImplementation(ReadShaderFunctor(fileName, options),Options::CACHE_SHADERS); 
     2033} 
     2034 
     2035ReaderWriter::WriteResult Registry::writeShaderImplementation(const Shader& shader,const std::string& fileName,const Options* options) 
    19502036{ 
    19512037    // record the errors reported by readerwriters. 
  • OpenSceneGraph/trunk/src/osgDB/WriteFile.cpp

    r7908 r10171  
    2525using namespace osgDB; 
    2626 
    27 bool osgDB::writeObjectFile(const Object& object,const std::string& filename, const ReaderWriter::Options* options ) 
     27bool osgDB::writeObjectFile(const Object& object,const std::string& filename, const Options* options ) 
    2828{ 
    2929    ReaderWriter::WriteResult wr = Registry::instance()->writeObject( object, filename, options ); 
     
    3333 
    3434 
    35 bool osgDB::writeImageFile(const Image& image,const std::string& filename, const ReaderWriter::Options* options ) 
     35bool osgDB::writeImageFile(const Image& image,const std::string& filename, const Options* options ) 
    3636{ 
    3737    ReaderWriter::WriteResult wr = Registry::instance()->writeImage( image, filename, options ); 
     
    4141 
    4242 
    43 bool osgDB::writeHeightFieldFile(const HeightField& HeightField,const std::string& filename, const ReaderWriter::Options* options ) 
     43bool osgDB::writeHeightFieldFile(const HeightField& HeightField,const std::string& filename, const Options* options ) 
    4444{ 
    4545    ReaderWriter::WriteResult wr = Registry::instance()->writeHeightField( HeightField, filename, options ); 
     
    4848} 
    4949 
    50 bool osgDB::writeNodeFile(const Node& node,const std::string& filename, const ReaderWriter::Options* options ) 
     50bool osgDB::writeNodeFile(const Node& node,const std::string& filename, const Options* options ) 
    5151{ 
    5252    ReaderWriter::WriteResult wr = Registry::instance()->writeNode( node, filename, options ); 
     
    5555} 
    5656 
    57 bool osgDB::writeShaderFile(const Shader& shader,const std::string& filename, const ReaderWriter::Options* options ) 
     57bool osgDB::writeShaderFile(const Shader& shader,const std::string& filename, const Options* options ) 
    5858{ 
    5959    ReaderWriter::WriteResult wr = Registry::instance()->writeShader( shader, filename, options ); 
  • OpenSceneGraph/trunk/src/osgDB/XmlParser.cpp

    r10124 r10171  
    1919using namespace osgDB; 
    2020 
    21 XmlNode* osgDB::readXmlFile(const std::string& filename,const ReaderWriter::Options* options) 
     21XmlNode* osgDB::readXmlFile(const std::string& filename,const Options* options) 
    2222{ 
    2323    std::string foundFile = osgDB::findDataFile(filename, options); 
  • OpenSceneGraph/trunk/src/osgPlugins/OpenFlight/Document.h

    r10084 r10171  
    2828#include <osg/Depth> 
    2929#include <osgDB/ReaderWriter> 
     30#include <osgDB/Options> 
    3031 
    3132#include "Types.h" 
  • OpenSceneGraph/trunk/src/osgPlugins/OpenFlight/ExportOptions.h

    r8003 r10171  
    2222#include <osg/Node> 
    2323#include <osg/Notify> 
    24 #include <osgDB/ReaderWriter> 
     24#include <osgDB/Options> 
    2525#include <osgDB/FileNameUtils> 
    2626 
     
    3939   methods for supported options. 
    4040 */ 
    41 class ExportOptions : public osgDB::ReaderWriter::Options 
     41class ExportOptions : public osgDB::Options 
    4242{ 
    4343public: 
  • OpenSceneGraph/trunk/src/osgPlugins/ive/PagedLOD.cpp

    r8975 r10171  
    1616#include "PagedLOD.h" 
    1717#include "Node.h" 
     18 
     19#include <osgDB/Options> 
    1820 
    1921using namespace ive; 
  • OpenSceneGraph/trunk/src/osgPlugins/p3d/ReaderWriterP3D.cpp

    r10164 r10171  
    14061406} 
    14071407 
     1408struct MyFindFileCallback : public osgDB::FindFileCallback 
     1409{ 
     1410    virtual std::string findDataFile(const std::string& filename, const osgDB::Options* options, osgDB::CaseSensitivity caseSensitivity) 
     1411    { 
     1412        osg::notify(osg::NOTICE)<<"find file "<<filename<<std::endl; 
     1413        return osgDB::Registry::instance()->findDataFileImplementation(filename, options, caseSensitivity); 
     1414    } 
     1415}; 
     1416 
    14081417osgDB::ReaderWriter::ReadResult ReaderWriterP3DXML::readNode(std::istream& fin, const Options* options) const 
    14091418{ 
     
    14131422 
    14141423    osg::ref_ptr<osgDB::ReaderWriter::Options> local_opt = options ? static_cast<osgDB::ReaderWriter::Options*>(options->clone(osg::CopyOp::SHALLOW_COPY)) : new Options; 
     1424    local_opt->setFindFileCallback(new MyFindFileCallback); 
    14151425 
    14161426    return readNode(input, local_opt); 
     
    14291439 
    14301440    doc->read(input); 
     1441 
    14311442 
    14321443    // doc->write(std::cout); 
  • OpenSceneGraph/trunk/src/osgWrappers/genwrapper.conf

    r9945 r10171  
    9898 
    9999configure file /osg\/BoundingSphere/ 
    100         emit before "#include <osg/BoundingBox> 
    101         " 
     100        emit before "#include <osg/BoundingBox> 
     101        " 
     102end 
     103 
     104configure file /osgDB\/ReaderWriter/ 
     105        emit before "#include <osgDB/Options> 
     106        " 
    102107end 
    103108 
  • OpenSceneGraph/trunk/src/osgWrappers/osg/BoundingSphere.cpp

    r9775 r10171  
    2424 
    2525#include <osg/BoundingBox> 
    26          
     26         
    2727TYPE_NAME_ALIAS(osg::BoundingSphereImpl< osg::Vec3f >, osg::BoundingSpheref) 
    2828 
  • OpenSceneGraph/trunk/src/osgWrappers/osgDB/Archive.cpp

    r8583 r10171  
    1616#include <osg/Shape> 
    1717#include <osgDB/Archive> 
     18#include <osgDB/Options> 
    1819#include <osgDB/ReaderWriter> 
    1920 
     
    6970                  "Get the full list of file names available in the archive. ", 
    7071                  ""); 
    71         I_MethodWithDefaults2(osgDB::ReaderWriter::ReadResult, readObject, IN, const std::string &, x, , IN, const osgDB::ReaderWriter::Options *, x, NULL, 
     72        I_MethodWithDefaults2(osgDB::ReaderWriter::ReadResult, readObject, IN, const std::string &, x, , IN, const osgDB::Options *, x, NULL, 
    7273                              Properties::PURE_VIRTUAL, 
    7374                              __ReadResult__readObject__C5_std_string_R1__C5_Options_P1, 
    7475                              "", 
    7576                              ""); 
    76         I_MethodWithDefaults2(osgDB::ReaderWriter::ReadResult, readImage, IN, const std::string &, x, , IN, const osgDB::ReaderWriter::Options *, x, NULL, 
     77        I_MethodWithDefaults2(osgDB::ReaderWriter::ReadResult, readImage, IN, const std::string &, x, , IN, const osgDB::Options *, x, NULL, 
    7778                              Properties::PURE_VIRTUAL, 
    7879                              __ReadResult__readImage__C5_std_string_R1__C5_Options_P1, 
    7980                              "", 
    8081                              ""); 
    81         I_MethodWithDefaults2(osgDB::ReaderWriter::ReadResult, readHeightField, IN, const std::string &, x, , IN, const osgDB::ReaderWriter::Options *, x, NULL, 
     82        I_MethodWithDefaults2(osgDB::ReaderWriter::ReadResult, readHeightField, IN, const std::string &, x, , IN, const osgDB::Options *, x, NULL, 
    8283                              Properties::PURE_VIRTUAL, 
    8384                              __ReadResult__readHeightField__C5_std_string_R1__C5_Options_P1, 
    8485                              "", 
    8586                              ""); 
    86         I_MethodWithDefaults2(osgDB::ReaderWriter::ReadResult, readNode, IN, const std::string &, x, , IN, const osgDB::ReaderWriter::Options *, x, NULL, 
     87        I_MethodWithDefaults2(osgDB::ReaderWriter::ReadResult, readNode, IN, const std::string &, x, , IN, const osgDB::Options *, x, NULL, 
    8788                              Properties::PURE_VIRTUAL, 
    8889                              __ReadResult__readNode__C5_std_string_R1__C5_Options_P1, 
    8990                              "", 
    9091                              ""); 
    91         I_MethodWithDefaults3(osgDB::ReaderWriter::WriteResult, writeObject, IN, const osg::Object &, x, , IN, const std::string &, x, , IN, const osgDB::ReaderWriter::Options *, x, NULL, 
     92        I_MethodWithDefaults3(osgDB::ReaderWriter::WriteResult, writeObject, IN, const osg::Object &, x, , IN, const std::string &, x, , IN, const osgDB::Options *, x, NULL, 
    9293                              Properties::PURE_VIRTUAL, 
    9394                              __WriteResult__writeObject__C5_osg_Object_R1__C5_std_string_R1__C5_Options_P1, 
    9495                              "", 
    9596                              ""); 
    96         I_MethodWithDefaults3(osgDB::ReaderWriter::WriteResult, writeImage, IN, const osg::Image &, x, , IN, const std::string &, x, , IN, const osgDB::ReaderWriter::Options *, x, NULL, 
     97        I_MethodWithDefaults3(osgDB::ReaderWriter::WriteResult, writeImage, IN, const osg::Image &, x, , IN, const std::string &, x, , IN, const osgDB::Options *, x, NULL, 
    9798                              Properties::PURE_VIRTUAL, 
    9899                              __WriteResult__writeImage__C5_osg_Image_R1__C5_std_string_R1__C5_Options_P1, 
    99100                              "", 
    100101                              ""); 
    101         I_MethodWithDefaults3(osgDB::ReaderWriter::WriteResult, writeHeightField, IN, const osg::HeightField &, x, , IN, const std::string &, x, , IN, const osgDB::ReaderWriter::Options *, x, NULL, 
     102        I_MethodWithDefaults3(osgDB::ReaderWriter::WriteResult, writeHeightField, IN, const osg::HeightField &, x, , IN, const std::string &, x, , IN, const osgDB::Options *, x, NULL, 
    102103                              Properties::PURE_VIRTUAL, 
    103104                              __WriteResult__writeHeightField__C5_osg_HeightField_R1__C5_std_string_R1__C5_Options_P1, 
    104105                              "", 
    105106                              ""); 
    106         I_MethodWithDefaults3(osgDB::ReaderWriter::WriteResult, writeNode, IN, const osg::Node &, x, , IN, const std::string &, x, , IN, const osgDB::ReaderWriter::Options *, x, NULL, 
     107        I_MethodWithDefaults3(osgDB::ReaderWriter::WriteResult, writeNode, IN, const osg::Node &, x, , IN, const std::string &, x, , IN, const osgDB::Options *, x, NULL, 
    107108                              Properties::PURE_VIRTUAL, 
    108109                              __WriteResult__writeNode__C5_osg_Node_R1__C5_std_string_R1__C5_Options_P1, 
  • OpenSceneGraph/trunk/src/osgWrappers/osgDB/DatabasePager.cpp

    r9775 r10171  
    2020#include <osg/State> 
    2121#include <osgDB/DatabasePager> 
    22 #include <osgDB/ReaderWriter> 
     22#include <osgDB/Options> 
    2323 
    2424// Must undefine IN and OUT macros defined in Windows headers 
     
    7575                  "Add a request to load a node file to end the the database request list. ", 
    7676                  ""); 
    77         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, 
    78                   Properties::VIRTUAL, 
    79                   __void__requestNodeFile__C5_std_string_R1__osg_Group_P1__float__C5_osg_FrameStamp_P1__osg_ref_ptrT1_osg_Referenced__R1__ReaderWriter_Options_P1, 
     77        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, 
     78                  Properties::VIRTUAL, 
     79                  __void__requestNodeFile__C5_std_string_R1__osg_Group_P1__float__C5_osg_FrameStamp_P1__osg_ref_ptrT1_osg_Referenced__R1__Options_P1, 
    8080                  "", 
    8181                  ""); 
  • OpenSceneGraph/trunk/src/osgWrappers/osgDB/FileUtils.cpp

    r9775 r10171  
    2121#endif 
    2222 
    23 BEGIN_ENUM_REFLECTOR(osgDB::CaseSensitivity) 
    24         I_DeclaringFile("osgDB/FileUtils"); 
    25         I_EnumLabel(osgDB::CASE_SENSITIVE); 
    26         I_EnumLabel(osgDB::CASE_INSENSITIVE); 
    27 END_REFLECTOR 
    28  
    2923BEGIN_ENUM_REFLECTOR(osgDB::FileType) 
    3024        I_DeclaringFile("osgDB/FileUtils"); 
  • OpenSceneGraph/trunk/src/osgWrappers/osgDB/ImageOptions.cpp

    r9775 r10171  
    3939BEGIN_OBJECT_REFLECTOR(osgDB::ImageOptions) 
    4040        I_DeclaringFile("osgDB/ImageOptions"); 
    41         I_BaseType(osgDB::ReaderWriter::Options); 
     41        I_BaseType(osgDB::Options); 
    4242        I_Constructor0(____ImageOptions, 
    4343                       "", 
  • OpenSceneGraph/trunk/src/osgWrappers/osgDB/Input.cpp

    r7908 r10171  
    1919#include <osg/Uniform> 
    2020#include <osgDB/Input> 
    21 #include <osgDB/ReaderWriter> 
     21#include <osgDB/Options> 
    2222#include <osgDB/Registry> 
    2323 
     
    3838                       "", 
    3939                       ""); 
    40         I_Method1(void, setOptions, IN, const osgDB::ReaderWriter::Options *, options, 
    41                   Properties::NON_VIRTUAL, 
    42                   __void__setOptions__C5_ReaderWriter_Options_P1, 
    43                   "", 
    44                   ""); 
    45         I_Method0(const osgDB::ReaderWriter::Options *, getOptions, 
    46                   Properties::NON_VIRTUAL, 
    47                   __C5_ReaderWriter_Options_P1__getOptions, 
     40        I_Method1(void, setOptions, IN, const osgDB::Options *, options, 
     41                  Properties::NON_VIRTUAL, 
     42                  __void__setOptions__C5_Options_P1, 
     43                  "", 
     44                  ""); 
     45        I_Method0(const osgDB::Options *, getOptions, 
     46                  Properties::NON_VIRTUAL, 
     47                  __C5_Options_P1__getOptions, 
    4848                  "", 
    4949                  ""); 
     
    208208                  "", 
    209209                  ""); 
    210         I_SimpleProperty(const osgDB::ReaderWriter::Options *, Options,  
    211                          __C5_ReaderWriter_Options_P1__getOptions,  
    212                          __void__setOptions__C5_ReaderWriter_Options_P1); 
     210        I_SimpleProperty(const osgDB::Options *, Options,  
     211                         __C5_Options_P1__getOptions,  
     212                         __void__setOptions__C5_Options_P1); 
    213213END_REFLECTOR 
    214214 
  • OpenSceneGraph/trunk/src/osgWrappers/osgDB/Output.cpp

    r6903 r10171  
    1212 
    1313#include <osg/Object> 
     14#include <osgDB/Options> 
    1415#include <osgDB/Output> 
    15 #include <osgDB/ReaderWriter> 
    1616 
    1717// Must undefine IN and OUT macros defined in Windows headers 
  • OpenSceneGraph/trunk/src/osgWrappers/osgDB/ReaderWriter.cpp

    r10058 r10171  
    1818#include <osg/Shape> 
    1919#include <osgDB/Archive> 
    20 #include <osgDB/AuthenticationMap> 
    2120#include <osgDB/ReaderWriter> 
    2221 
     
    2928#endif 
    3029 
     30#include <osgDB/Options> 
     31         
    3132BEGIN_ENUM_REFLECTOR(osgDB::ReaderWriter::Features) 
    3233        I_DeclaringFile("osgDB/ReaderWriter"); 
     
    5556 
    5657TYPE_NAME_ALIAS(std::list< std::string >, osgDB::ReaderWriter::FeatureList) 
     58 
     59TYPE_NAME_ALIAS(osgDB::Options, osgDB::ReaderWriter::Options) 
    5760 
    5861BEGIN_OBJECT_REFLECTOR(osgDB::ReaderWriter) 
     
    250253END_REFLECTOR 
    251254 
    252 BEGIN_ENUM_REFLECTOR(osgDB::ReaderWriter::Options::CacheHintOptions) 
    253         I_DeclaringFile("osgDB/ReaderWriter"); 
    254         I_EnumLabel(osgDB::ReaderWriter::Options::CACHE_NONE); 
    255         I_EnumLabel(osgDB::ReaderWriter::Options::CACHE_NODES); 
    256         I_EnumLabel(osgDB::ReaderWriter::Options::CACHE_IMAGES); 
    257         I_EnumLabel(osgDB::ReaderWriter::Options::CACHE_HEIGHTFIELDS); 
    258         I_EnumLabel(osgDB::ReaderWriter::Options::CACHE_ARCHIVES); 
    259         I_EnumLabel(osgDB::ReaderWriter::Options::CACHE_OBJECTS); 
    260         I_EnumLabel(osgDB::ReaderWriter::Options::CACHE_SHADERS); 
    261         I_EnumLabel(osgDB::ReaderWriter::Options::CACHE_ALL); 
    262 END_REFLECTOR 
    263  
    264 BEGIN_ENUM_REFLECTOR(osgDB::ReaderWriter::Options::BuildKdTreesHint) 
    265         I_DeclaringFile("osgDB/ReaderWriter"); 
    266         I_EnumLabel(osgDB::ReaderWriter::Options::NO_PREFERENCE); 
    267         I_EnumLabel(osgDB::ReaderWriter::Options::DO_NOT_BUILD_KDTREES); 
    268         I_EnumLabel(osgDB::ReaderWriter::Options::BUILD_KDTREES); 
    269 END_REFLECTOR 
    270  
    271 BEGIN_OBJECT_REFLECTOR(osgDB::ReaderWriter::Options) 
    272         I_DeclaringFile("osgDB/ReaderWriter"); 
    273         I_BaseType(osg::Object); 
    274         I_Constructor0(____Options, 
    275                        "", 
    276                        ""); 
    277         I_Constructor1(IN, const std::string &, str, 
    278                        Properties::NON_EXPLICIT, 
    279                        ____Options__C5_std_string_R1, 
    280                        "", 
    281                        ""); 
    282         I_ConstructorWithDefaults2(IN, const osgDB::ReaderWriter::Options &, options, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY, 
    283                                    ____Options__C5_Options_R1__C5_osg_CopyOp_R1, 
    284                                    "", 
    285                                    ""); 
    286         I_Method0(osg::Object *, cloneType, 
    287                   Properties::VIRTUAL, 
    288                   __osg_Object_P1__cloneType, 
    289                   "Clone the type of an object, with Object* return type. ", 
    290                   "Must be defined by derived classes. "); 
    291         I_Method1(osg::Object *, clone, IN, const osg::CopyOp &, x, 
    292                   Properties::VIRTUAL, 
    293                   __osg_Object_P1__clone__C5_osg_CopyOp_R1, 
    294                   "Clone an object, with Object* return type. ", 
    295                   "Must be defined by derived classes. "); 
    296         I_Method1(bool, isSameKindAs, IN, const osg::Object *, obj, 
    297                   Properties::VIRTUAL, 
    298                   __bool__isSameKindAs__C5_osg_Object_P1, 
    299                   "", 
    300                   ""); 
    301         I_Method0(const char *, libraryName, 
    302                   Properties::VIRTUAL, 
    303                   __C5_char_P1__libraryName, 
    304                   "return the name of the object's library. ", 
    305                   "Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name. "); 
    306         I_Method0(const char *, className, 
    307                   Properties::VIRTUAL, 
    308                   __C5_char_P1__className, 
    309                   "return the name of the object's class type. ", 
    310                   "Must be defined by derived classes. "); 
    311         I_Method1(void, setOptionString, IN, const std::string &, str, 
    312                   Properties::NON_VIRTUAL, 
    313                   __void__setOptionString__C5_std_string_R1, 
    314                   "Set the general Options string. ", 
    315                   ""); 
    316         I_Method0(const std::string &, getOptionString, 
    317                   Properties::NON_VIRTUAL, 
    318                   __C5_std_string_R1__getOptionString, 
    319                   "Get the general Options string. ", 
    320                   ""); 
    321         I_Method1(void, setDatabasePath, IN, const std::string &, str, 
    322                   Properties::NON_VIRTUAL, 
    323                   __void__setDatabasePath__C5_std_string_R1, 
    324                   "Set the database path to use a hint of where to look when loading models. ", 
    325                   ""); 
    326         I_Method0(osgDB::FilePathList &, getDatabasePathList, 
    327                   Properties::NON_VIRTUAL, 
    328                   __FilePathList_R1__getDatabasePathList, 
    329                   "Get the database path which is used a hint of where to look when loading models. ", 
    330                   ""); 
    331         I_Method0(const osgDB::FilePathList &, getDatabasePathList, 
    332                   Properties::NON_VIRTUAL, 
    333                   __C5_FilePathList_R1__getDatabasePathList, 
    334                   "Get the const database path which is used a hint of where to look when loading models. ", 
    335                   ""); 
    336         I_Method1(void, setObjectCacheHint, IN, osgDB::ReaderWriter::Options::CacheHintOptions, useObjectCache, 
    337                   Properties::NON_VIRTUAL, 
    338                   __void__setObjectCacheHint__CacheHintOptions, 
    339                   "Set whether the Registry::ObjectCache should be used by default. ", 
    340                   ""); 
    341         I_Method0(osgDB::ReaderWriter::Options::CacheHintOptions, getObjectCacheHint, 
    342                   Properties::NON_VIRTUAL, 
    343                   __CacheHintOptions__getObjectCacheHint, 
    344                   "Get whether the Registry::ObjectCache should be used by default. ", 
    345                   ""); 
    346         I_Method1(void, setBuildKdTreesHint, IN, osgDB::ReaderWriter::Options::BuildKdTreesHint, hint, 
    347                   Properties::NON_VIRTUAL, 
    348                   __void__setBuildKdTreesHint__BuildKdTreesHint, 
    349                   "Set whether the KdTrees should be built for geometry in the loader model. ", 
    350                   ""); 
    351         I_Method0(osgDB::ReaderWriter::Options::BuildKdTreesHint, getBuildKdTreesHint, 
    352                   Properties::NON_VIRTUAL, 
    353                   __BuildKdTreesHint__getBuildKdTreesHint, 
    354                   "Get whether the KdTrees should be built for geometry in the loader model. ", 
    355                   ""); 
    356         I_Method1(void, setAuthenticationMap, IN, osgDB::AuthenticationMap *, authenticationMap, 
    357                   Properties::NON_VIRTUAL, 
    358                   __void__setAuthenticationMap__AuthenticationMap_P1, 
    359                   "Set the password map to be used by plugins when access files from secure locations. ", 
    360                   ""); 
    361         I_Method0(const osgDB::AuthenticationMap *, getAuthenticationMap, 
    362                   Properties::NON_VIRTUAL, 
    363                   __C5_AuthenticationMap_P1__getAuthenticationMap, 
    364                   "Get the password map to be used by plugins when access files from secure locations. ", 
    365                   ""); 
    366         I_Method2(void, setPluginData, IN, const std::string &, s, IN, void *, v, 
    367                   Properties::NON_VIRTUAL, 
    368                   __void__setPluginData__C5_std_string_R1__void_P1, 
    369                   "Sets a plugindata value PluginData with a string. ", 
    370                   ""); 
    371         I_Method1(void *, getPluginData, IN, const std::string &, s, 
    372                   Properties::NON_VIRTUAL, 
    373                   __void_P1__getPluginData__C5_std_string_R1, 
    374                   "Get a value from the PluginData. ", 
    375                   ""); 
    376         I_Method1(const void *, getPluginData, IN, const std::string &, s, 
    377                   Properties::NON_VIRTUAL, 
    378                   __C5_void_P1__getPluginData__C5_std_string_R1, 
    379                   "Get a value from the PluginData. ", 
    380                   ""); 
    381         I_Method1(void, removePluginData, IN, const std::string &, s, 
    382                   Properties::NON_VIRTUAL, 
    383                   __void__removePluginData__C5_std_string_R1, 
    384                   "Remove a value from the PluginData. ", 
    385                   ""); 
    386         I_Method2(void, setPluginStringData, IN, const std::string &, s, IN, const std::string &, v, 
    387                   Properties::NON_VIRTUAL, 
    388                   __void__setPluginStringData__C5_std_string_R1__C5_std_string_R1, 
    389                   "Sets a plugindata value PluginData with a string. ", 
    390                   ""); 
    391         I_Method1(std::string, getPluginStringData, IN, const std::string &, s, 
    392                   Properties::NON_VIRTUAL, 
    393                   __std_string__getPluginStringData__C5_std_string_R1, 
    394                   "Get a string from the PluginStrData. ", 
    395                   ""); 
    396         I_Method1(const std::string, getPluginStringData, IN, const std::string &, s, 
    397                   Properties::NON_VIRTUAL, 
    398                   __C5_std_string__getPluginStringData__C5_std_string_R1, 
    399                   "Get a value from the PluginData. ", 
    400                   ""); 
    401         I_Method1(void, removePluginStringData, IN, const std::string &, s, 
    402                   Properties::NON_VIRTUAL, 
    403                   __void__removePluginStringData__C5_std_string_R1, 
    404                   "Remove a value from the PluginData. ", 
    405                   ""); 
    406         I_SimpleProperty(osgDB::AuthenticationMap *, AuthenticationMap,  
    407                          0,  
    408                          __void__setAuthenticationMap__AuthenticationMap_P1); 
    409         I_SimpleProperty(osgDB::ReaderWriter::Options::BuildKdTreesHint, BuildKdTreesHint,  
    410                          __BuildKdTreesHint__getBuildKdTreesHint,  
    411                          __void__setBuildKdTreesHint__BuildKdTreesHint); 
    412         I_SimpleProperty(const std::string &, DatabasePath,  
    413                          0,  
    414                          __void__setDatabasePath__C5_std_string_R1); 
    415         I_SimpleProperty(osgDB::FilePathList &, DatabasePathList,  
    416                          __FilePathList_R1__getDatabasePathList,  
    417                          0); 
    418         I_SimpleProperty(osgDB::ReaderWriter::Options::CacheHintOptions, ObjectCacheHint,  
    419                          __CacheHintOptions__getObjectCacheHint,  
    420                          __void__setObjectCacheHint__CacheHintOptions); 
    421         I_SimpleProperty(const std::string &, OptionString,  
    422                          __C5_std_string_R1__getOptionString,  
    423                          __void__setOptionString__C5_std_string_R1); 
    424         I_IndexedProperty(void *, PluginData,  
    425                           __void_P1__getPluginData__C5_std_string_R1,  
    426                           __void__setPluginData__C5_std_string_R1__void_P1,  
    427                           0); 
    428         I_IndexedProperty(std::string, PluginStringData,  
    429                           __std_string__getPluginStringData__C5_std_string_R1,  
    430                           __void__setPluginStringData__C5_std_string_R1__C5_std_string_R1,  
    431                           0); 
    432 END_REFLECTOR 
    433  
    434255BEGIN_ENUM_REFLECTOR(osgDB::ReaderWriter::ReadResult::ReadStatus) 
    435256        I_DeclaringFile("osgDB/ReaderWriter"); 
     
    671492END_REFLECTOR 
    672493 
    673 TYPE_NAME_ALIAS(std::deque< std::string >, osgDB::FilePathList) 
    674  
    675 STD_VECTOR_REFLECTOR(std::deque< std::string >) 
    676  
  • OpenSceneGraph/trunk/src/osgWrappers/osgDB/Registry.cpp

    r10007 r10171  
    2828#include <osgDB/FileCache> 
    2929#include <osgDB/Input> 
     30#include <osgDB/Options> 
    3031#include <osgDB/Output> 
    3132#include <osgDB/ReaderWriter> 
     
    7980TYPE_NAME_ALIAS(std::vector< osg::ref_ptr< osgDB::ReaderWriter > >, osgDB::Registry::ReaderWriterList) 
    8081 
     82TYPE_NAME_ALIAS(class osgDB::FindFileCallback, osgDB::Registry::FindFileCallback) 
     83 
     84TYPE_NAME_ALIAS(class osgDB::ReadFileCallback, osgDB::Registry::ReadFileCallback) 
     85 
     86TYPE_NAME_ALIAS(class osgDB::WriteFileCallback, osgDB::Registry::WriteFileCallback) 
     87 
    8188BEGIN_OBJECT_REFLECTOR(osgDB::Registry) 
    8289        I_DeclaringFile("osgDB/Registry"); 
     
    226233                  "", 
    227234                  ""); 
     235        I_Method1(void, setFindFileCallback, IN, osgDB::Registry::FindFileCallback *, cb, 
     236                  Properties::NON_VIRTUAL, 
     237                  __void__setFindFileCallback__FindFileCallback_P1, 
     238                  "Set the Registry callback to use in place of the default findFile calls. ", 
     239                  ""); 
     240        I_Method0(osgDB::Registry::FindFileCallback *, getFindFileCallback, 
     241                  Properties::NON_VIRTUAL, 
     242                  __FindFileCallback_P1__getFindFileCallback, 
     243                  "Get the findFile callback. ", 
     244                  ""); 
     245        I_Method0(const osgDB::Registry::FindFileCallback *, getFindFileCallback, 
     246                  Properties::NON_VIRTUAL, 
     247                  __C5_FindFileCallback_P1__getFindFileCallback, 
     248                  "Get the const findFile callback. ", 
     249                  ""); 
     250        I_Method3(std::string, findDataFile, IN, const std::string &, fileName, IN, const osgDB::Options *, options, IN, osgDB::CaseSensitivity, caseSensitivity, 
     251                  Properties::NON_VIRTUAL, 
     252                  __std_string__findDataFile__C5_std_string_R1__C5_Options_P1__CaseSensitivity, 
     253                  "", 
     254                  ""); 
     255        I_Method3(std::string, findDataFileImplementation, IN, const std::string &, fileName, IN, const osgDB::Options *, options, IN, osgDB::CaseSensitivity, caseSensitivity, 
     256                  Properties::NON_VIRTUAL, 
     257                  __std_string__findDataFileImplementation__C5_std_string_R1__C5_Options_P1__CaseSensitivity, 
     258                  "", 
     259                  ""); 
     260        I_Method3(std::string, findLibraryFile, IN, const std::string &, fileName, IN, const osgDB::Options *, options, IN, osgDB::CaseSensitivity, caseSensitivity, 
     261                  Properties::NON_VIRTUAL, 
     262                  __std_string__findLibraryFile__C5_std_string_R1__C5_Options_P1__CaseSensitivity, 
     263                  "", 
     264                  ""); 
     265        I_Method3(std::string, findLibraryFileImplementation, IN, const std::string &, fileName, IN, const osgDB::Options *, options, IN, osgDB::CaseSensitivity, caseSensitivity, 
     266                  Properties::NON_VIRTUAL, 
     267                  __std_string__findLibraryFileImplementation__C5_std_string_R1__C5_Options_P1__CaseSensitivity, 
     268                  "", 
     269                  ""); 
    228270        I_Method1(void, setReadFileCallback, IN, osgDB::Registry::ReadFileCallback *, cb, 
    229271                  Properties::NON_VIRTUAL, 
     
    241283                  "Get the const readFile callback. ", 
    242284                  ""); 
    243         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, 
    244                   Properties::NON_VIRTUAL, 
    245                   __ReaderWriter_ReadResult__openArchive__C5_std_string_R1__ReaderWriter_ArchiveStatus__unsigned_int__C5_ReaderWriter_Options_P1, 
    246                   "", 
    247                   ""); 
    248         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, 
    249                   Properties::NON_VIRTUAL, 
    250                   __ReaderWriter_ReadResult__openArchiveImplementation__C5_std_string_R1__ReaderWriter_ArchiveStatus__unsigned_int__C5_ReaderWriter_Options_P1, 
    251                   "", 
    252                   ""); 
    253         I_MethodWithDefaults3(osgDB::ReaderWriter::ReadResult, readObject, IN, const std::string &, fileName, , IN, const osgDB::ReaderWriter::Options *, options, , IN, bool, buildKdTreeIfRequired, true, 
     285        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, 
     286                  Properties::NON_VIRTUAL, 
     287                  __ReaderWriter_ReadResult__openArchive__C5_std_string_R1__ReaderWriter_ArchiveStatus__unsigned_int__C5_Options_P1, 
     288                  "", 
     289                  ""); 
     290        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, 
     291                  Properties::NON_VIRTUAL, 
     292                  __ReaderWriter_ReadResult__openArchiveImplementation__C5_std_string_R1__ReaderWriter_ArchiveStatus__unsigned_int__C5_Options_P1, 
     293                  "", 
     294                  ""); 
     295        I_MethodWithDefaults3(osgDB::ReaderWriter::ReadResult, readObject, IN, const std::string &, fileName, , IN, const osgDB::Options *, options, , IN, bool, buildKdTreeIfRequired, true, 
    254296                              Properties::NON_VIRTUAL, 
    255                               __ReaderWriter_ReadResult__readObject__C5_std_string_R1__C5_ReaderWriter_Options_P1__bool, 
     297                              __ReaderWriter_ReadResult__readObject__C5_std_string_R1__C5_Options_P1__bool, 
    256298                              "", 
    257299                              ""); 
    258         I_Method2(osgDB::ReaderWriter::ReadResult, readObjectImplementation, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    259                   Properties::NON_VIRTUAL, 
    260                   __ReaderWriter_ReadResult__readObjectImplementation__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    261                   "", 
    262                   ""); 
    263         I_Method2(osgDB::ReaderWriter::ReadResult, readImage, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    264                   Properties::NON_VIRTUAL, 
    265                   __ReaderWriter_ReadResult__readImage__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    266                   "", 
    267                   ""); 
    268         I_Method2(osgDB::ReaderWriter::ReadResult, readImageImplementation, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    269                   Properties::NON_VIRTUAL, 
    270                   __ReaderWriter_ReadResult__readImageImplementation__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    271                   "", 
    272                   ""); 
    273         I_Method2(osgDB::ReaderWriter::ReadResult, readHeightField, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    274                   Properties::NON_VIRTUAL, 
    275                   __ReaderWriter_ReadResult__readHeightField__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    276                   "", 
    277                   ""); 
    278         I_Method2(osgDB::ReaderWriter::ReadResult, readHeightFieldImplementation, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    279                   Properties::NON_VIRTUAL, 
    280                   __ReaderWriter_ReadResult__readHeightFieldImplementation__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    281                   "", 
    282                   ""); 
    283         I_MethodWithDefaults3(osgDB::ReaderWriter::ReadResult, readNode, IN, const std::string &, fileName, , IN, const osgDB::ReaderWriter::Options *, options, , IN, bool, buildKdTreeIfRequired, true, 
     300        I_Method2(osgDB::ReaderWriter::ReadResult, readObjectImplementation, IN, const std::string &, fileName, IN, const osgDB::Options *, options, 
     301                  Properties::NON_VIRTUAL, 
     302                  __ReaderWriter_ReadResult__readObjectImplementation__C5_std_string_R1__C5_Options_P1, 
     303                  "", 
     304                  ""); 
     305        I_Method2(osgDB::ReaderWriter::ReadResult, readImage, IN, const std::string &, fileName, IN, const osgDB::Options *, options, 
     306                  Properties::NON_VIRTUAL, 
     307                  __ReaderWriter_ReadResult__readImage__C5_std_string_R1__C5_Options_P1, 
     308                  "", 
     309                  ""); 
     310        I_Method2(osgDB::ReaderWriter::ReadResult, readImageImplementation, IN, const std::string &, fileName, IN, const osgDB::Options *, options, 
     311                  Properties::NON_VIRTUAL, 
     312                  __ReaderWriter_ReadResult__readImageImplementation__C5_std_string_R1__C5_Options_P1, 
     313                  "", 
     314                  ""); 
     315        I_Method2(osgDB::ReaderWriter::ReadResult, readHeightField, IN, const std::string &, fileName, IN, const osgDB::Options *, options, 
     316                  Properties::NON_VIRTUAL, 
     317                  __ReaderWriter_ReadResult__readHeightField__C5_std_string_R1__C5_Options_P1, 
     318                  "", 
     319                  ""); 
     320        I_Method2(osgDB::ReaderWriter::ReadResult, readHeightFieldImplementation, IN, const std::string &, fileName, IN, const osgDB::Options *, options, 
     321                  Properties::NON_VIRTUAL, 
     322                  __ReaderWriter_ReadResult__readHeightFieldImplementation__C5_std_string_R1__C5_Options_P1, 
     323                  "", 
     324                  ""); 
     325        I_MethodWithDefaults3(osgDB::ReaderWriter::ReadResult, readNode, IN, const std::string &, fileName, , IN, const osgDB::Options *, options, , IN, bool, buildKdTreeIfRequired, true, 
    284326                              Properties::NON_VIRTUAL, 
    285                               __ReaderWriter_ReadResult__readNode__C5_std_string_R1__C5_ReaderWriter_Options_P1__bool, 
     327                              __ReaderWriter_ReadResult__readNode__C5_std_string_R1__C5_Options_P1__bool, 
    286328                              "", 
    287329                              ""); 
    288         I_Method2(osgDB::ReaderWriter::ReadResult, readNodeImplementation, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    289                   Properties::NON_VIRTUAL, 
    290                   __ReaderWriter_ReadResult__readNodeImplementation__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    291                   "", 
    292                   ""); 
    293         I_Method2(osgDB::ReaderWriter::ReadResult, readShader, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    294                   Properties::NON_VIRTUAL, 
    295                   __ReaderWriter_ReadResult__readShader__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    296                   "", 
    297                   ""); 
    298         I_Method2(osgDB::ReaderWriter::ReadResult, readShaderImplementation, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    299                   Properties::NON_VIRTUAL, 
    300                   __ReaderWriter_ReadResult__readShaderImplementation__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
     330        I_Method2(osgDB::ReaderWriter::ReadResult, readNodeImplementation, IN, const std::string &, fileName, IN, const osgDB::Options *, options, 
     331                  Properties::NON_VIRTUAL, 
     332                  __ReaderWriter_ReadResult__readNodeImplementation__C5_std_string_R1__C5_Options_P1, 
     333                  "", 
     334                  ""); 
     335        I_Method2(osgDB::ReaderWriter::ReadResult, readShader, IN, const std::string &, fileName, IN, const osgDB::Options *, options, 
     336                  Properties::NON_VIRTUAL, 
     337                  __ReaderWriter_ReadResult__readShader__C5_std_string_R1__C5_Options_P1, 
     338                  "", 
     339                  ""); 
     340        I_Method2(osgDB::ReaderWriter::ReadResult, readShaderImplementation, IN, const std::string &, fileName, IN, const osgDB::Options *, options, 
     341                  Properties::NON_VIRTUAL, 
     342                  __ReaderWriter_ReadResult__readShaderImplementation__C5_std_string_R1__C5_Options_P1, 
    301343                  "", 
    302344                  ""); 
     
    316358                  "Get the const writeFile callback. ", 
    317359                  ""); 
    318         I_Method3(osgDB::ReaderWriter::WriteResult, writeObject, IN, const osg::Object &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    319                   Properties::NON_VIRTUAL, 
    320                   __ReaderWriter_WriteResult__writeObject__C5_osg_Object_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    321                   "", 
    322                   ""); 
    323         I_Method3(osgDB::ReaderWriter::WriteResult, writeObjectImplementation, IN, const osg::Object &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    324                   Properties::NON_VIRTUAL, 
    325                   __ReaderWriter_WriteResult__writeObjectImplementation__C5_osg_Object_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    326                   "", 
    327                   ""); 
    328         I_Method3(osgDB::ReaderWriter::WriteResult, writeImage, IN, const osg::Image &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    329                   Properties::NON_VIRTUAL, 
    330                   __ReaderWriter_WriteResult__writeImage__C5_osg_Image_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    331                   "", 
    332                   ""); 
    333         I_Method3(osgDB::ReaderWriter::WriteResult, writeImageImplementation, IN, const osg::Image &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    334                   Properties::NON_VIRTUAL, 
    335                   __ReaderWriter_WriteResult__writeImageImplementation__C5_osg_Image_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    336                   "", 
    337                   ""); 
    338         I_Method3(osgDB::ReaderWriter::WriteResult, writeHeightField, IN, const osg::HeightField &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    339                   Properties::NON_VIRTUAL, 
    340                   __ReaderWriter_WriteResult__writeHeightField__C5_osg_HeightField_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    341                   "", 
    342                   ""); 
    343         I_Method3(osgDB::ReaderWriter::WriteResult, writeHeightFieldImplementation, IN, const osg::HeightField &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    344                   Properties::NON_VIRTUAL, 
    345                   __ReaderWriter_WriteResult__writeHeightFieldImplementation__C5_osg_HeightField_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    346                   "", 
    347                   ""); 
    348         I_Method3(osgDB::ReaderWriter::WriteResult, writeNode, IN, const osg::Node &, node, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    349                   Properties::NON_VIRTUAL, 
    350                   __ReaderWriter_WriteResult__writeNode__C5_osg_Node_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    351                   "", 
    352                   ""); 
    353         I_Method3(osgDB::ReaderWriter::WriteResult, writeNodeImplementation, IN, const osg::Node &, node, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    354                   Properties::NON_VIRTUAL, 
    355                   __ReaderWriter_WriteResult__writeNodeImplementation__C5_osg_Node_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    356                   "", 
    357                   ""); 
    358         I_Method3(osgDB::ReaderWriter::WriteResult, writeShader, IN, const osg::Shader &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    359                   Properties::NON_VIRTUAL, 
    360                   __ReaderWriter_WriteResult__writeShader__C5_osg_Shader_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    361                   "", 
    362                   ""); 
    363         I_Method3(osgDB::ReaderWriter::WriteResult, writeShaderImplementation, IN, const osg::Shader &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    364                   Properties::NON_VIRTUAL, 
    365                   __ReaderWriter_WriteResult__writeShaderImplementation__C5_osg_Shader_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    366                   "", 
    367                   ""); 
    368         I_Method2(void, _buildKdTreeIfRequired, IN, osgDB::ReaderWriter::ReadResult &, result, IN, const osgDB::ReaderWriter::Options *, options, 
    369                   Properties::NON_VIRTUAL, 
    370                   __void___buildKdTreeIfRequired__ReaderWriter_ReadResult_R1__C5_ReaderWriter_Options_P1, 
    371                   "", 
    372                   ""); 
    373         I_Method1(void, setBuildKdTreesHint, IN, osgDB::ReaderWriter::Options::BuildKdTreesHint, hint, 
    374                   Properties::NON_VIRTUAL, 
    375                   __void__setBuildKdTreesHint__ReaderWriter_Options_BuildKdTreesHint, 
     360        I_Method3(osgDB::ReaderWriter::WriteResult, writeObject, IN, const osg::Object &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options, 
     361                  Properties::NON_VIRTUAL, 
     362                  __ReaderWriter_WriteResult__writeObject__C5_osg_Object_R1__C5_std_string_R1__C5_Options_P1, 
     363                  "", 
     364                  ""); 
     365        I_Method3(osgDB::ReaderWriter::WriteResult, writeObjectImplementation, IN, const osg::Object &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options, 
     366                  Properties::NON_VIRTUAL, 
     367                  __ReaderWriter_WriteResult__writeObjectImplementation__C5_osg_Object_R1__C5_std_string_R1__C5_Options_P1, 
     368                  "", 
     369                  ""); 
     370        I_Method3(osgDB::ReaderWriter::WriteResult, writeImage, IN, const osg::Image &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options, 
     371                  Properties::NON_VIRTUAL, 
     372                  __ReaderWriter_WriteResult__writeImage__C5_osg_Image_R1__C5_std_string_R1__C5_Options_P1, 
     373                  "", 
     374                  ""); 
     375        I_Method3(osgDB::ReaderWriter::WriteResult, writeImageImplementation, IN, const osg::Image &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options, 
     376                  Properties::NON_VIRTUAL, 
     377                  __ReaderWriter_WriteResult__writeImageImplementation__C5_osg_Image_R1__C5_std_string_R1__C5_Options_P1, 
     378                  "", 
     379                  ""); 
     380        I_Method3(osgDB::ReaderWriter::WriteResult, writeHeightField, IN, const osg::HeightField &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options, 
     381                  Properties::NON_VIRTUAL, 
     382                  __ReaderWriter_WriteResult__writeHeightField__C5_osg_HeightField_R1__C5_std_string_R1__C5_Options_P1, 
     383                  "", 
     384                  ""); 
     385        I_Method3(osgDB::ReaderWriter::WriteResult, writeHeightFieldImplementation, IN, const osg::HeightField &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options, 
     386                  Properties::NON_VIRTUAL, 
     387                  __ReaderWriter_WriteResult__writeHeightFieldImplementation__C5_osg_HeightField_R1__C5_std_string_R1__C5_Options_P1, 
     388                  "", 
     389                  ""); 
     390        I_Method3(osgDB::ReaderWriter::WriteResult, writeNode, IN, const osg::Node &, node, IN, const std::string &, fileName, IN, const osgDB::Options *, options, 
     391                  Properties::NON_VIRTUAL, 
     392                  __ReaderWriter_WriteResult__writeNode__C5_osg_Node_R1__C5_std_string_R1__C5_Options_P1, 
     393                  "", 
     394                  ""); 
     395        I_Method3(osgDB::ReaderWriter::WriteResult, writeNodeImplementation, IN, const osg::Node &, node, IN, const std::string &, fileName, IN, const osgDB::Options *, options, 
     396                  Properties::NON_VIRTUAL, 
     397                  __ReaderWriter_WriteResult__writeNodeImplementation__C5_osg_Node_R1__C5_std_string_R1__C5_Options_P1, 
     398                  "", 
     399                  ""); 
     400        I_Method3(osgDB::ReaderWriter::WriteResult, writeShader, IN, const osg::Shader &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options, 
     401                  Properties::NON_VIRTUAL, 
     402                  __ReaderWriter_WriteResult__writeShader__C5_osg_Shader_R1__C5_std_string_R1__C5_Options_P1, 
     403                  "", 
     404                  ""); 
     405        I_Method3(osgDB::ReaderWriter::WriteResult, writeShaderImplementation, IN, const osg::Shader &, obj, IN, const std::string &, fileName, IN, const osgDB::Options *, options, 
     406                  Properties::NON_VIRTUAL, 
     407                  __ReaderWriter_WriteResult__writeShaderImplementation__C5_osg_Shader_R1__C5_std_string_R1__C5_Options_P1, 
     408                  "", 
     409                  ""); 
     410        I_Method2(void, _buildKdTreeIfRequired, IN, osgDB::ReaderWriter::ReadResult &, result, IN, const osgDB::Options *, options, 
     411                  Properties::NON_VIRTUAL, 
     412                  __void___buildKdTreeIfRequired__ReaderWriter_ReadResult_R1__C5_Options_P1, 
     413                  "", 
     414                  ""); 
     415        I_Method1(void, setBuildKdTreesHint, IN, osgDB::Options::BuildKdTreesHint, hint, 
     416                  Properties::NON_VIRTUAL, 
     417                  __void__setBuildKdTreesHint__Options_BuildKdTreesHint, 
    376418                  "Set whether the KdTrees should be built for geometry in the loader model. ", 
    377419                  ""); 
    378         I_Method0(osgDB::ReaderWriter::Options::BuildKdTreesHint, getBuildKdTreesHint, 
    379                   Properties::NON_VIRTUAL, 
    380                   __ReaderWriter_Options_BuildKdTreesHint__getBuildKdTreesHint, 
     420        I_Method0(osgDB::Options::BuildKdTreesHint, getBuildKdTreesHint, 
     421                  Properties::NON_VIRTUAL, 
     422                  __Options_BuildKdTreesHint__getBuildKdTreesHint, 
    381423                  "Get whether the KdTrees should be built for geometry in the loader model. ", 
    382424                  ""); 
     
    431473                  "", 
    432474                  ""); 
    433         I_Method1(void, setOptions, IN, osgDB::ReaderWriter::Options *, opt, 
    434                   Properties::NON_VIRTUAL, 
    435                   __void__setOptions__ReaderWriter_Options_P1, 
    436                   "", 
    437                   ""); 
    438         I_Method0(osgDB::ReaderWriter::Options *, getOptions, 
    439                   Properties::NON_VIRTUAL, 
    440                   __ReaderWriter_Options_P1__getOptions, 
    441                   "", 
    442                   ""); 
    443         I_Method0(const osgDB::ReaderWriter::Options *, getOptions, 
    444                   Properties::NON_VIRTUAL, 
    445                   __C5_ReaderWriter_Options_P1__getOptions, 
     475        I_Method1(void, setOptions, IN, osgDB::Options *, opt, 
     476                  Properties::NON_VIRTUAL, 
     477                  __void__setOptions__Options_P1, 
     478                  "", 
     479                  ""); 
     480        I_Method0(osgDB::Options *, getOptions, 
     481                  Properties::NON_VIRTUAL, 
     482                  __Options_P1__getOptions, 
     483                  "", 
     484                  ""); 
     485        I_Method0(const osgDB::Options *, getOptions, 
     486                  Properties::NON_VIRTUAL, 
     487                  __C5_Options_P1__getOptions, 
    446488                  "", 
    447489                  ""); 
     
    604646                           "", 
    605647                           ""); 
    606         I_ProtectedMethod2(osgDB::ReaderWriter::ReadResult, readImplementation, IN, const osgDB::Registry::ReadFunctor &, readFunctor, IN, osgDB::ReaderWriter::Options::CacheHintOptions, cacheHint, 
     648        I_ProtectedMethod2(osgDB::ReaderWriter::ReadResult, readImplementation, IN, const osgDB::Registry::ReadFunctor &, readFunctor, IN, osgDB::Options::CacheHintOptions, cacheHint, 
    607649                           Properties::NON_VIRTUAL, 
    608650                           Properties::NON_CONST, 
    609                            __ReaderWriter_ReadResult__readImplementation__C5_ReadFunctor_R1__ReaderWriter_Options_CacheHintOptions, 
     651                           __ReaderWriter_ReadResult__readImplementation__C5_ReadFunctor_R1__Options_CacheHintOptions, 
    610652                           "", 
    611653                           ""); 
     
    613655                         __AuthenticationMap_P1__getAuthenticationMap,  
    614656                         __void__setAuthenticationMap__AuthenticationMap_P1); 
    615         I_SimpleProperty(osgDB::ReaderWriter::Options::BuildKdTreesHint, BuildKdTreesHint,  
    616                          __ReaderWriter_Options_BuildKdTreesHint__getBuildKdTreesHint,  
    617                          __void__setBuildKdTreesHint__ReaderWriter_Options_BuildKdTreesHint); 
     657        I_SimpleProperty(osgDB::Options::BuildKdTreesHint, BuildKdTreesHint,  
     658                         __Options_BuildKdTreesHint__getBuildKdTreesHint,  
     659                         __void__setBuildKdTreesHint__Options_BuildKdTreesHint); 
    618660        I_SimpleProperty(bool, CreateNodeFromImage,  
    619661                         __bool__getCreateNodeFromImage,  
     
    625667                         __FileCache_P1__getFileCache,  
    626668                         __void__setFileCache__FileCache_P1); 
     669        I_SimpleProperty(osgDB::Registry::FindFileCallback *, FindFileCallback,  
     670                         __FindFileCallback_P1__getFindFileCallback,  
     671                         __void__setFindFileCallback__FindFileCallback_P1); 
    627672        I_SimpleProperty(osg::KdTreeBuilder *, KdTreeBuilder,  
    628673                         __osg_KdTreeBuilder_P1__getKdTreeBuilder,  
     
    631676                         __C5_FilePathList_R1__getLibraryFilePathList,  
    632677                         __void__setLibraryFilePathList__C5_FilePathList_R1); 
    633         I_SimpleProperty(osgDB::ReaderWriter::Options *, Options,  
    634                          __ReaderWriter_Options_P1__getOptions,  
    635                          __void__setOptions__ReaderWriter_Options_P1); 
     678        I_SimpleProperty(osgDB::Options *, Options,  
     679                         __Options_P1__getOptions,  
     680                         __void__setOptions__Options_P1); 
    636681        I_SimpleProperty(osgDB::Registry::ReadFileCallback *, ReadFileCallback,  
    637682                         __ReadFileCallback_P1__getReadFileCallback,  
     
    648693END_REFLECTOR 
    649694 
    650 BEGIN_OBJECT_REFLECTOR(osgDB::Registry::ReadFileCallback) 
    651         I_DeclaringFile("osgDB/Registry"); 
    652         I_VirtualBaseType(osg::Referenced); 
    653         I_Constructor0(____ReadFileCallback, 
    654                        "", 
    655                        ""); 
    656         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, 
    657                   Properties::VIRTUAL, 
    658                   __ReaderWriter_ReadResult__openArchive__C5_std_string_R1__ReaderWriter_ArchiveStatus__unsigned_int__C5_ReaderWriter_Options_P1, 
    659                   "", 
    660                   ""); 
    661         I_Method2(osgDB::ReaderWriter::ReadResult, readObject, IN, const std::string &, filename, IN, const osgDB::ReaderWriter::Options *, options, 
    662                   Properties::VIRTUAL, 
    663                   __ReaderWriter_ReadResult__readObject__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    664                   "", 
    665                   ""); 
    666         I_Method2(osgDB::ReaderWriter::ReadResult, readImage, IN, const std::string &, filename, IN, const osgDB::ReaderWriter::Options *, options, 
    667                   Properties::VIRTUAL, 
    668                   __ReaderWriter_ReadResult__readImage__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    669                   "", 
    670                   ""); 
    671         I_Method2(osgDB::ReaderWriter::ReadResult, readHeightField, IN, const std::string &, filename, IN, const osgDB::ReaderWriter::Options *, options, 
    672                   Properties::VIRTUAL, 
    673                   __ReaderWriter_ReadResult__readHeightField__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    674                   "", 
    675                   ""); 
    676         I_Method2(osgDB::ReaderWriter::ReadResult, readNode, IN, const std::string &, filename, IN, const osgDB::ReaderWriter::Options *, options, 
    677                   Properties::VIRTUAL, 
    678                   __ReaderWriter_ReadResult__readNode__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    679                   "", 
    680                   ""); 
    681         I_Method2(osgDB::ReaderWriter::ReadResult, readShader, IN, const std::string &, filename, IN, const osgDB::ReaderWriter::Options *, options, 
    682                   Properties::VIRTUAL, 
    683                   __ReaderWriter_ReadResult__readShader__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    684                   "", 
    685                   ""); 
    686 END_REFLECTOR 
    687  
    688695BEGIN_ABSTRACT_OBJECT_REFLECTOR(osgDB::Registry::ReadFunctor) 
    689696        I_DeclaringFile("osgDB/Registry"); 
    690         I_Constructor2(IN, const std::string &, filename, IN, const osgDB::ReaderWriter::Options *, options, 
    691                        ____ReadFunctor__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
     697        I_Constructor2(IN, const std::string &, filename, IN, const osgDB::Options *, options, 
     698                       ____ReadFunctor__C5_std_string_R1__C5_Options_P1, 
    692699                       "", 
    693700                       ""); 
     
    708715                  ""); 
    709716        I_PublicMemberProperty(std::string, _filename); 
    710 END_REFLECTOR 
    711  
    712 BEGIN_OBJECT_REFLECTOR(osgDB::Registry::WriteFileCallback) 
    713         I_DeclaringFile("osgDB/Registry"); 
    714         I_VirtualBaseType(osg::Referenced); 
    715         I_Constructor0(____WriteFileCallback, 
    716                        "", 
    717                        ""); 
    718         I_Method3(osgDB::ReaderWriter::WriteResult, writeObject, IN, const osg::Object &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    719                   Properties::VIRTUAL, 
    720                   __ReaderWriter_WriteResult__writeObject__C5_osg_Object_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    721                   "", 
    722                   ""); 
    723         I_Method3(osgDB::ReaderWriter::WriteResult, writeImage, IN, const osg::Image &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    724                   Properties::VIRTUAL, 
    725                   __ReaderWriter_WriteResult__writeImage__C5_osg_Image_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    726                   "", 
    727                   ""); 
    728         I_Method3(osgDB::ReaderWriter::WriteResult, writeHeightField, IN, const osg::HeightField &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    729                   Properties::VIRTUAL, 
    730                   __ReaderWriter_WriteResult__writeHeightField__C5_osg_HeightField_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    731                   "", 
    732                   ""); 
    733         I_Method3(osgDB::ReaderWriter::WriteResult, writeNode, IN, const osg::Node &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    734                   Properties::VIRTUAL, 
    735                   __ReaderWriter_WriteResult__writeNode__C5_osg_Node_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    736                   "", 
    737                   ""); 
    738         I_Method3(osgDB::ReaderWriter::WriteResult, writeShader, IN, const osg::Shader &, obj, IN, const std::string &, fileName, IN, const osgDB::ReaderWriter::Options *, options, 
    739                   Properties::VIRTUAL, 
    740                   __ReaderWriter_WriteResult__writeShader__C5_osg_Shader_R1__C5_std_string_R1__C5_ReaderWriter_Options_P1, 
    741                   "", 
    742                   ""); 
    743717END_REFLECTOR 
    744718