Changeset 10174

Show
Ignore:
Timestamp:
05/11/09 13:39:12 (4 years ago)
Author:
robert
Message:

Moved Registry::ReadFileCallback? + WriteFileCallback?, and osgDB::ReaderWriter::Options into their own separate Options file and into the osgDB namespace.

Introduced a new callback osgDB::FindFileCallback? that overrides the default behavior of findDataFile/findLibraryFile.

Introduced support for assigning ReaderWriter::Options directory to PagedLOD.

Introduced new osgDB::FileLocationCallback? for assistancing the DatabasePager? to know when a file is hosted on a local or remote file system.

Location:
OpenSceneGraph/trunk
Files:
16 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/CMakeLists.txt

    r10165 r10174  
    3131SET(OPENSCENEGRAPH_MAJOR_VERSION 2) 
    3232SET(OPENSCENEGRAPH_MINOR_VERSION 9) 
    33 SET(OPENSCENEGRAPH_PATCH_VERSION 4) 
    34 SET(OPENSCENEGRAPH_SOVERSION 59) 
     33SET(OPENSCENEGRAPH_PATCH_VERSION 5) 
     34SET(OPENSCENEGRAPH_SOVERSION 60) 
    3535 
    3636# set to 0 when not a release candidate, non zero means that any generated  
  • OpenSceneGraph/trunk/include/osg/NodeVisitor

    r9464 r10174  
    275275        { 
    276276        public: 
    277          
     277 
    278278            DatabaseRequestHandler(): 
    279279                Referenced(true) {} 
    280          
    281             virtual void requestNodeFile(const std::string& fileName,osg::Group* group, float priority, const FrameStamp* framestamp, osg::ref_ptr<osg::Referenced>& databaseRequest) = 0; 
    282              
     280 
     281            virtual void requestNodeFile(const std::string& fileName,osg::Group* group, float priority, const FrameStamp* framestamp, osg::ref_ptr<osg::Referenced>& databaseRequest, const osg::Referenced* options=0) = 0; 
     282 
    283283        protected: 
    284284            virtual ~DatabaseRequestHandler() {} 
    285285        }; 
    286          
     286 
    287287        /** Set the handler for database requests.*/ 
    288288        void setDatabaseRequestHandler(DatabaseRequestHandler* handler) { _databaseRequestHandler = handler; } 
    289          
     289 
    290290        /** Get the handler for database requests.*/ 
    291291        DatabaseRequestHandler* getDatabaseRequestHandler() { return _databaseRequestHandler.get(); } 
  • OpenSceneGraph/trunk/include/osg/PagedLOD

    r8994 r10174  
    4343 
    4444        virtual bool removeChildren(unsigned int pos,unsigned int numChildrenToRemove=1); 
    45          
     45 
     46 
     47        /** Set the optional database osgDB::Options object to use when loaded children.*/ 
     48        void setDatabaseOptions(osg::Referenced* options) { _databaseOptions = options; } 
     49 
     50        /** Get the optional database osgDB::Options object used when loaded children.*/ 
     51        osg::Referenced* getDatabaseOptions() { return _databaseOptions.get(); } 
     52 
     53        /** Get the optional database osgDB::Options object used when loaded children.*/ 
     54        const osg::Referenced* getDatabaseOptions() const { return _databaseOptions.get(); } 
    4655 
    4756 
     
    134143        void expandPerRangeDataTo(unsigned int pos); 
    135144 
     145        ref_ptr<Referenced> _databaseOptions; 
    136146        std::string         _databasePath; 
    137147 
  • OpenSceneGraph/trunk/include/osgDB/DatabasePager

    r10171 r10174  
    6666        virtual void requestNodeFile(const std::string& fileName,osg::Group* group, 
    6767                                     float priority, const osg::FrameStamp* framestamp, 
    68                                      osg::ref_ptr<osg::Referenced>& databaseRequest); 
    69  
    70         virtual void requestNodeFile(const std::string& fileName,osg::Group* group, 
    71                                      float priority, const osg::FrameStamp* framestamp, 
    7268                                     osg::ref_ptr<osg::Referenced>& databaseRequest, 
    73                                      Options* loadOptions); 
     69                                     const osg::Referenced* options); 
    7470 
    7571        /** Set the priority of the database pager thread(s).*/ 
  • OpenSceneGraph/trunk/include/osgDB/FileCache

    r10171 r10174  
    2929        const std::string& getFileCachePath() const { return _fileCachePath; } 
    3030 
     31        virtual bool isFileAppropriateForFileCache(const std::string& originalFileName) const; 
     32 
    3133        virtual std::string createCacheFileName(const std::string& originalFileName) const; 
    3234 
  • OpenSceneGraph/trunk/include/osgDB/Options

    r10172 r10174  
    1717#include <osgDB/AuthenticationMap> 
    1818#include <osgDB/ReaderWriter> 
     19#include <osgDB/FileCache> 
    1920 
    2021#include <deque> 
     
    8788}; 
    8889 
     90class OSGDB_EXPORT FileLocationCallback : public virtual osg::Referenced 
     91{ 
     92    public: 
     93 
     94        enum Location 
     95        { 
     96            LOCAL_FILE, 
     97            REMOTE_FILE 
     98        }; 
     99 
     100        virtual Location fileLocation(const std::string& filename, const Options* options) = 0; 
     101 
     102        virtual bool useFileCache() const = 0; 
     103 
     104    protected: 
     105        virtual ~FileLocationCallback() {} 
     106}; 
     107 
     108 
    89109/** Options base class used for passing options into plugins to control their operation.*/ 
    90 class Options : public osg::Object 
     110class OSGDB_EXPORT Options : public osg::Object 
    91111{ 
    92112    public: 
     
    234254 
    235255 
    236         /** Set the Registry callback to use in place of the default writeFile calls.*/ 
     256        /** Set the callback to use in place of the default writeFile calls.*/ 
    237257        void setWriteFileCallback( WriteFileCallback* cb) { _writeFileCallback = cb; } 
    238258 
    239259        /** Get the const writeFile callback.*/ 
    240260        WriteFileCallback* getWriteFileCallback() const { return _writeFileCallback.get(); } 
     261 
     262 
     263        /** Set the callback to use inform the DatabasePager whether a file is located on local or remote file system..*/ 
     264        void setFileLocationCallback( FileLocationCallback* cb) { _fileLocationCallback = cb; } 
     265 
     266        /** Get the callback to use inform the DatabasePager whether a file is located on local or remote file system..*/ 
     267        FileLocationCallback* getFileLocationCallback() const { return _fileLocationCallback.get(); } 
     268 
     269 
     270        /** Set the FileCache that is used to manage local storage of files downloaded from the internet.*/ 
     271        void setFileCache(FileCache* fileCache) { _fileCache = fileCache; } 
     272 
     273        /** Get the FileCache that is used to manage local storage of files downloaded from the internet.*/ 
     274        FileCache* getFileCache() const { return _fileCache.get(); } 
    241275 
    242276 
     
    259293        osg::ref_ptr<ReadFileCallback>      _readFileCallback; 
    260294        osg::ref_ptr<WriteFileCallback>     _writeFileCallback; 
     295        osg::ref_ptr<FileLocationCallback>  _fileLocationCallback; 
     296 
     297        osg::ref_ptr<FileCache>             _fileCache; 
    261298}; 
    262299 
  • OpenSceneGraph/trunk/include/osgDB/Registry

    r10171 r10174  
    165165        typedef class osgDB::ReadFileCallback ReadFileCallback; 
    166166        typedef class osgDB::WriteFileCallback WriteFileCallback; 
     167        typedef class osgDB::FileLocationCallback FileLocationCallback; 
    167168 
    168169        /** Set the Registry callback to use in place of the default findFile calls.*/ 
     
    327328        } 
    328329 
     330        /** Set the callback to use inform the DatabasePager whether a file is located on local or remote file system..*/ 
     331        void setFileLocationCallback( FileLocationCallback* cb) { _fileLocationCallback = cb; } 
     332 
     333        /** Get the callback to use inform the DatabasePager whether a file is located on local or remote file system..*/ 
     334        FileLocationCallback* getFileLocationCallback() const { return _fileLocationCallback.get(); } 
     335 
     336 
    329337 
    330338        /** Set whether the KdTrees should be built for geometry in the loader model. */ 
     
    339347        /** Get the KdTreeBuilder visitor that is used to build KdTree on loaded models.*/ 
    340348        osg::KdTreeBuilder* getKdTreeBuilder() { return _kdTreeBuilder.get(); } 
     349 
    341350 
    342351        /** Set the FileCache that is used to manage local storage of files downloaded from the internet.*/ 
     
    489498            therefore ensuring only one copy is ever constructed*/ 
    490499        Registry(); 
    491          
     500 
    492501        /** get the attached library with specified name.*/ 
    493502        DynamicLibraryList::iterator getLibraryItr(const std::string& fileName); 
     
    558567        osg::ref_ptr<ReadFileCallback>      _readFileCallback; 
    559568        osg::ref_ptr<WriteFileCallback>     _writeFileCallback; 
     569        osg::ref_ptr<FileLocationCallback>  _fileLocationCallback; 
    560570 
    561571        DotOsgWrapperMap   _objectWrapperMap; 
  • OpenSceneGraph/trunk/src/osg/PagedLOD.cpp

    r9387 r10174  
    5959PagedLOD::PagedLOD(const PagedLOD& plod,const CopyOp& copyop): 
    6060    LOD(plod,copyop), 
     61    _databaseOptions(plod._databaseOptions), 
    6162    _databasePath(plod._databasePath), 
    6263    _frameNumberOfLastTraversal(plod._frameNumberOfLastTraversal), 
     
    214215                    if (_databasePath.empty()) 
    215216                    { 
    216                         nv.getDatabaseRequestHandler()->requestNodeFile(_perRangeDataList[numChildren]._filename,this,priority,nv.getFrameStamp(), _perRangeDataList[numChildren]._databaseRequest); 
     217                        nv.getDatabaseRequestHandler()->requestNodeFile(_perRangeDataList[numChildren]._filename,this,priority,nv.getFrameStamp(), _perRangeDataList[numChildren]._databaseRequest, _databaseOptions.get()); 
    217218                    } 
    218219                    else 
    219220                    { 
    220221                        // prepend the databasePath to the child's filename. 
    221                         nv.getDatabaseRequestHandler()->requestNodeFile(_databasePath+_perRangeDataList[numChildren]._filename,this,priority,nv.getFrameStamp(), _perRangeDataList[numChildren]._databaseRequest); 
    222                     } 
    223                 } 
    224  
     222                        nv.getDatabaseRequestHandler()->requestNodeFile(_databasePath+_perRangeDataList[numChildren]._filename,this,priority,nv.getFrameStamp(), _perRangeDataList[numChildren]._databaseRequest, _databaseOptions.get()); 
     223                    } 
     224                } 
    225225 
    226226            } 
  • OpenSceneGraph/trunk/src/osgDB/DatabasePager.cpp

    r10171 r10174  
    446446            break; 
    447447    } 
    448      
    449     //Getting CURL Environment Variables (If found rewrite OSG Options) 
    450     osg::ref_ptr<FileCache> fileCache = osgDB::Registry::instance()->getFileCache(); 
     448 
    451449 
    452450    do 
     
    482480 
    483481        bool readFromFileCache = false; 
    484                  
     482 
     483        osg::ref_ptr<FileCache> fileCache = osgDB::Registry::instance()->getFileCache(); 
     484        osg::ref_ptr<FileLocationCallback> fileLocationCallback = osgDB::Registry::instance()->getFileLocationCallback(); 
     485 
    485486        if (databaseRequest.valid()) 
    486487        { 
     488            if (databaseRequest->_loadOptions.valid()) 
     489            { 
     490                if (databaseRequest->_loadOptions->getFileCache()) fileCache = databaseRequest->_loadOptions->getFileCache(); 
     491                if (databaseRequest->_loadOptions->getFileLocationCallback()) fileLocationCallback = databaseRequest->_loadOptions->getFileLocationCallback(); 
     492            } 
     493 
     494            // disable the FileCache if the fileLocationCallback tells us that it isn't required for this request. 
     495            if (fileLocationCallback.valid() && !fileLocationCallback->useFileCache()) fileCache = 0; 
     496 
     497 
    487498            // check if databaseRequest is still relevant 
    488499            if ((_pager->_frameNumber-databaseRequest->_frameNumberLastRequest)<=1) 
     
    493504                { 
    494505                    case(HANDLE_ALL_REQUESTS): 
     506                    { 
    495507                        // do nothing as this thread can handle the load 
    496                         if (osgDB::containsServerAddress(databaseRequest->_fileName)) 
     508                        if (fileCache.valid() && fileCache->isFileAppropriateForFileCache(databaseRequest->_fileName)) 
    497509                        { 
    498                             if (fileCache.valid() && fileCache->existsInCache(databaseRequest->_fileName)) 
     510                            if (fileCache->existsInCache(databaseRequest->_fileName)) 
    499511                            { 
    500512                                readFromFileCache = true; 
     
    502514                        } 
    503515                        break; 
    504                          
     516                    } 
    505517                    case(HANDLE_NON_HTTP): 
     518                    { 
    506519                        // check the cache first 
    507                         if (osgDB::containsServerAddress(databaseRequest->_fileName)) 
     520                        bool isHighLatencyFileRequest = false; 
     521 
     522                        if (fileLocationCallback.valid()) 
     523                        { 
     524                            isHighLatencyFileRequest = fileLocationCallback->fileLocation(databaseRequest->_fileName, databaseRequest->_loadOptions.get()) == FileLocationCallback::REMOTE_FILE; 
     525                        } 
     526                        else  if (fileCache.valid() && fileCache->isFileAppropriateForFileCache(databaseRequest->_fileName)) 
     527                        { 
     528                            isHighLatencyFileRequest = true; 
     529                        } 
     530 
     531                        if (isHighLatencyFileRequest) 
    508532                        { 
    509533                            if (fileCache.valid() && fileCache->existsInCache(databaseRequest->_fileName)) 
     
    519543                        } 
    520544                        break; 
    521                          
     545                    } 
    522546                    case(HANDLE_ONLY_HTTP): 
    523                         // make sure the request is a http request 
    524                         if (!osgDB::containsServerAddress(databaseRequest->_fileName)) 
    525                         { 
    526                             osg::notify(osg::NOTICE)<<_name<<": Help we have request we shouldn't have "<<databaseRequest->_fileName<<std::endl; 
    527                             databaseRequest = 0; 
    528                         } 
     547                    { 
     548                        // accept all requests, as we'll assume only high latency requests will have got here. 
    529549                        break; 
     550                    } 
    530551                } 
    531552            } 
     
    555576 
    556577            if (databaseRequest->_loadedModel.valid() && 
    557                 osgDB::containsServerAddress(databaseRequest->_fileName) && 
    558578                fileCache.valid() && 
     579                fileCache->isFileAppropriateForFileCache(databaseRequest->_fileName) && 
    559580                !readFromFileCache) 
    560581            { 
     
    12311252void DatabasePager::requestNodeFile(const std::string& fileName,osg::Group* group, 
    12321253                                    float priority, const osg::FrameStamp* framestamp, 
    1233                                     osg::ref_ptr<osg::Referenced>& databaseRequest) 
    1234 { 
    1235     requestNodeFile(fileName,group,priority,framestamp,databaseRequest,Registry::instance()->getOptions()); 
    1236 } 
    1237  
    1238 void DatabasePager::requestNodeFile(const std::string& fileName,osg::Group* group, 
    1239                                     float priority, const osg::FrameStamp* framestamp, 
    12401254                                    osg::ref_ptr<osg::Referenced>& databaseRequestRef, 
    1241                                     Options* loadOptions) 
    1242 { 
     1255                                    const osg::Referenced* options) 
     1256{ 
     1257    osgDB::Options* loadOptions = dynamic_cast<osgDB::Options*>(const_cast<osg::Referenced*>(options)); 
     1258    if (!loadOptions) 
     1259    { 
     1260       loadOptions = Registry::instance()->getOptions(); 
     1261 
     1262        osg::notify(osg::NOTICE)<<"Using options from Registry "<<std::endl; 
     1263    } 
     1264    else 
     1265    { 
     1266        osg::notify(osg::NOTICE)<<"options from requestNodeFile "<<std::endl; 
     1267    } 
     1268 
     1269 
    12431270    if (!_acceptNewRequests) return; 
    12441271     
  • OpenSceneGraph/trunk/src/osgDB/FileCache.cpp

    r10171 r10174  
    2929{ 
    3030    osg::notify(osg::INFO)<<"Destructed FileCache "<<std::endl; 
     31} 
     32 
     33bool FileCache::isFileAppropriateForFileCache(const std::string& originalFileName) const 
     34{ 
     35    return osgDB::containsServerAddress(originalFileName); 
    3136} 
    3237 
  • OpenSceneGraph/trunk/src/osgDB/Options.cpp

    r10172 r10174  
    109109    _findFileCallback(options._findFileCallback), 
    110110    _readFileCallback(options._readFileCallback), 
    111     _writeFileCallback(options._writeFileCallback) {} 
     111    _writeFileCallback(options._writeFileCallback), 
     112    _fileLocationCallback(options._fileLocationCallback), 
     113    _fileCache(options._fileCache) {} 
  • OpenSceneGraph/trunk/src/osgWrappers/osg/NodeVisitor.cpp

    r9461 r10174  
    420420                       "", 
    421421                       ""); 
    422         I_Method5(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, 
    423                   Properties::PURE_VIRTUAL, 
    424                   __void__requestNodeFile__C5_std_string_R1__osg_Group_P1__float__C5_FrameStamp_P1__osg_ref_ptrT1_osg_Referenced__R1, 
    425                   "", 
    426                   ""); 
     422        I_MethodWithDefaults6(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, const osg::Referenced *, options, 0, 
     423                              Properties::PURE_VIRTUAL, 
     424                              __void__requestNodeFile__C5_std_string_R1__osg_Group_P1__float__C5_FrameStamp_P1__osg_ref_ptrT1_osg_Referenced__R1__C5_osg_Referenced_P1, 
     425                              "", 
     426                              ""); 
    427427END_REFLECTOR 
    428428 
  • OpenSceneGraph/trunk/src/osgWrappers/osg/PagedLOD.cpp

    r9775 r10174  
    9494                              "Remove children from Group. ", 
    9595                              "Note, must be override by subclasses of Group which add per child attributes. "); 
     96        I_Method1(void, setDatabaseOptions, IN, osg::Referenced *, options, 
     97                  Properties::NON_VIRTUAL, 
     98                  __void__setDatabaseOptions__osg_Referenced_P1, 
     99                  "Set the optional database osgDB::Options object to use when loaded children. ", 
     100                  ""); 
     101        I_Method0(osg::Referenced *, getDatabaseOptions, 
     102                  Properties::NON_VIRTUAL, 
     103                  __osg_Referenced_P1__getDatabaseOptions, 
     104                  "Get the optional database osgDB::Options object used when loaded children. ", 
     105                  ""); 
     106        I_Method0(const osg::Referenced *, getDatabaseOptions, 
     107                  Properties::NON_VIRTUAL, 
     108                  __C5_osg_Referenced_P1__getDatabaseOptions, 
     109                  "Get the optional database osgDB::Options object used when loaded children. ", 
     110                  ""); 
    96111        I_Method1(void, setDatabasePath, IN, const std::string &, path, 
    97112                  Properties::NON_VIRTUAL, 
     
    225240                           "", 
    226241                           ""); 
     242        I_SimpleProperty(osg::Referenced *, DatabaseOptions,  
     243                         __osg_Referenced_P1__getDatabaseOptions,  
     244                         __void__setDatabaseOptions__osg_Referenced_P1); 
    227245        I_SimpleProperty(const std::string &, DatabasePath,  
    228246                         __C5_std_string_R1__getDatabasePath,  
  • OpenSceneGraph/trunk/src/osgWrappers/osgDB/DatabasePager.cpp

    r10171 r10174  
    2020#include <osg/State> 
    2121#include <osgDB/DatabasePager> 
    22 #include <osgDB/Options> 
    2322 
    2423// Must undefine IN and OUT macros defined in Windows headers 
     
    7069                  "Create a shallow copy on the DatabasePager. ", 
    7170                  ""); 
    72         I_Method5(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, 
    73                   Properties::VIRTUAL, 
    74                   __void__requestNodeFile__C5_std_string_R1__osg_Group_P1__float__C5_osg_FrameStamp_P1__osg_ref_ptrT1_osg_Referenced__R1, 
     71        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, const osg::Referenced *, options, 
     72                  Properties::VIRTUAL, 
     73                  __void__requestNodeFile__C5_std_string_R1__osg_Group_P1__float__C5_osg_FrameStamp_P1__osg_ref_ptrT1_osg_Referenced__R1__C5_osg_Referenced_P1, 
    7574                  "Add a request to load a node file to end the the database request list. ", 
    76                   ""); 
    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, 
    80                   "", 
    8175                  ""); 
    8276        I_Method1(int, setSchedulePriority, IN, OpenThreads::Thread::ThreadPriority, priority, 
  • OpenSceneGraph/trunk/src/osgWrappers/osgDB/Options.cpp

    r10171 r10174  
    1818#include <osg/Shape> 
    1919#include <osgDB/AuthenticationMap> 
     20#include <osgDB/FileCache> 
    2021#include <osgDB/Options> 
    2122#include <osgDB/ReaderWriter> 
     
    2829#undef OUT 
    2930#endif 
     31 
     32BEGIN_ENUM_REFLECTOR(osgDB::FileLocationCallback::Location) 
     33        I_DeclaringFile("osgDB/Options"); 
     34        I_EnumLabel(osgDB::FileLocationCallback::LOCAL_FILE); 
     35        I_EnumLabel(osgDB::FileLocationCallback::REMOTE_FILE); 
     36END_REFLECTOR 
     37 
     38BEGIN_ABSTRACT_OBJECT_REFLECTOR(osgDB::FileLocationCallback) 
     39        I_DeclaringFile("osgDB/Options"); 
     40        I_VirtualBaseType(osg::Referenced); 
     41        I_Constructor0(____FileLocationCallback, 
     42                       "", 
     43                       ""); 
     44        I_Method2(osgDB::FileLocationCallback::Location, fileLocation, IN, const std::string &, filename, IN, const osgDB::Options *, options, 
     45                  Properties::PURE_VIRTUAL, 
     46                  __Location__fileLocation__C5_std_string_R1__C5_Options_P1, 
     47                  "", 
     48                  ""); 
     49        I_Method0(bool, useFileCache, 
     50                  Properties::PURE_VIRTUAL, 
     51                  __bool__useFileCache, 
     52                  "", 
     53                  ""); 
     54END_REFLECTOR 
    3055 
    3156BEGIN_OBJECT_REFLECTOR(osgDB::FindFileCallback) 
     
    224249                  Properties::NON_VIRTUAL, 
    225250                  __void__setWriteFileCallback__WriteFileCallback_P1, 
    226                   "Set the Registry callback to use in place of the default writeFile calls. ", 
     251                  "Set the callback to use in place of the default writeFile calls. ", 
    227252                  ""); 
    228253        I_Method0(osgDB::WriteFileCallback *, getWriteFileCallback, 
     
    230255                  __WriteFileCallback_P1__getWriteFileCallback, 
    231256                  "Get the const writeFile callback. ", 
     257                  ""); 
     258        I_Method1(void, setFileLocationCallback, IN, osgDB::FileLocationCallback *, cb, 
     259                  Properties::NON_VIRTUAL, 
     260                  __void__setFileLocationCallback__FileLocationCallback_P1, 
     261                  "Set the callback to use inform the DatabasePager whether a file is located on local or remote file system. ", 
     262                  ""); 
     263        I_Method0(osgDB::FileLocationCallback *, getFileLocationCallback, 
     264                  Properties::NON_VIRTUAL, 
     265                  __FileLocationCallback_P1__getFileLocationCallback, 
     266                  "Get the callback to use inform the DatabasePager whether a file is located on local or remote file system. ", 
     267                  ""); 
     268        I_Method1(void, setFileCache, IN, osgDB::FileCache *, fileCache, 
     269                  Properties::NON_VIRTUAL, 
     270                  __void__setFileCache__FileCache_P1, 
     271                  "Set the FileCache that is used to manage local storage of files downloaded from the internet. ", 
     272                  ""); 
     273        I_Method0(osgDB::FileCache *, getFileCache, 
     274                  Properties::NON_VIRTUAL, 
     275                  __FileCache_P1__getFileCache, 
     276                  "Get the FileCache that is used to manage local storage of files downloaded from the internet. ", 
    232277                  ""); 
    233278        I_SimpleProperty(osgDB::AuthenticationMap *, AuthenticationMap,  
     
    243288                         __FilePathList_R1__getDatabasePathList,  
    244289                         0); 
     290        I_SimpleProperty(osgDB::FileCache *, FileCache,  
     291                         __FileCache_P1__getFileCache,  
     292                         __void__setFileCache__FileCache_P1); 
     293        I_SimpleProperty(osgDB::FileLocationCallback *, FileLocationCallback,  
     294                         __FileLocationCallback_P1__getFileLocationCallback,  
     295                         __void__setFileLocationCallback__FileLocationCallback_P1); 
    245296        I_SimpleProperty(osgDB::FindFileCallback *, FindFileCallback,  
    246297                         __FindFileCallback_P1__getFindFileCallback,  
  • OpenSceneGraph/trunk/src/osgWrappers/osgDB/Registry.cpp

    r10171 r10174  
    8686TYPE_NAME_ALIAS(class osgDB::WriteFileCallback, osgDB::Registry::WriteFileCallback) 
    8787 
     88TYPE_NAME_ALIAS(class osgDB::FileLocationCallback, osgDB::Registry::FileLocationCallback) 
     89 
    8890BEGIN_OBJECT_REFLECTOR(osgDB::Registry) 
    8991        I_DeclaringFile("osgDB/Registry"); 
     
    412414                  __void___buildKdTreeIfRequired__ReaderWriter_ReadResult_R1__C5_Options_P1, 
    413415                  "", 
     416                  ""); 
     417        I_Method1(void, setFileLocationCallback, IN, osgDB::Registry::FileLocationCallback *, cb, 
     418                  Properties::NON_VIRTUAL, 
     419                  __void__setFileLocationCallback__FileLocationCallback_P1, 
     420                  "Set the callback to use inform the DatabasePager whether a file is located on local or remote file system. ", 
     421                  ""); 
     422        I_Method0(osgDB::Registry::FileLocationCallback *, getFileLocationCallback, 
     423                  Properties::NON_VIRTUAL, 
     424                  __FileLocationCallback_P1__getFileLocationCallback, 
     425                  "Get the callback to use inform the DatabasePager whether a file is located on local or remote file system. ", 
    414426                  ""); 
    415427        I_Method1(void, setBuildKdTreesHint, IN, osgDB::Options::BuildKdTreesHint, hint, 
     
    667679                         __FileCache_P1__getFileCache,  
    668680                         __void__setFileCache__FileCache_P1); 
     681        I_SimpleProperty(osgDB::Registry::FileLocationCallback *, FileLocationCallback,  
     682                         __FileLocationCallback_P1__getFileLocationCallback,  
     683                         __void__setFileLocationCallback__FileLocationCallback_P1); 
    669684        I_SimpleProperty(osgDB::Registry::FindFileCallback *, FindFileCallback,  
    670685                         __FindFileCallback_P1__getFindFileCallback,