Show
Ignore:
Timestamp:
05/11/09 13:39:12 (5 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.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • 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,