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.
This commit is contained in:
parent
67e0abf149
commit
f939ea731e
@ -30,8 +30,8 @@ PROJECT(OpenSceneGraph)
|
||||
|
||||
SET(OPENSCENEGRAPH_MAJOR_VERSION 2)
|
||||
SET(OPENSCENEGRAPH_MINOR_VERSION 9)
|
||||
SET(OPENSCENEGRAPH_PATCH_VERSION 4)
|
||||
SET(OPENSCENEGRAPH_SOVERSION 59)
|
||||
SET(OPENSCENEGRAPH_PATCH_VERSION 5)
|
||||
SET(OPENSCENEGRAPH_SOVERSION 60)
|
||||
|
||||
# set to 0 when not a release candidate, non zero means that any generated
|
||||
# svn tags will be treated as release candidates of given number
|
||||
|
@ -278,7 +278,7 @@ class OSG_EXPORT NodeVisitor : public virtual Referenced
|
||||
DatabaseRequestHandler():
|
||||
Referenced(true) {}
|
||||
|
||||
virtual void requestNodeFile(const std::string& fileName,osg::Group* group, float priority, const FrameStamp* framestamp, osg::ref_ptr<osg::Referenced>& databaseRequest) = 0;
|
||||
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;
|
||||
|
||||
protected:
|
||||
virtual ~DatabaseRequestHandler() {}
|
||||
|
@ -44,6 +44,15 @@ class OSG_EXPORT PagedLOD : public LOD
|
||||
virtual bool removeChildren(unsigned int pos,unsigned int numChildrenToRemove=1);
|
||||
|
||||
|
||||
/** Set the optional database osgDB::Options object to use when loaded children.*/
|
||||
void setDatabaseOptions(osg::Referenced* options) { _databaseOptions = options; }
|
||||
|
||||
/** Get the optional database osgDB::Options object used when loaded children.*/
|
||||
osg::Referenced* getDatabaseOptions() { return _databaseOptions.get(); }
|
||||
|
||||
/** Get the optional database osgDB::Options object used when loaded children.*/
|
||||
const osg::Referenced* getDatabaseOptions() const { return _databaseOptions.get(); }
|
||||
|
||||
|
||||
/** Set the database path to prepend to children's filenames.*/
|
||||
void setDatabasePath(const std::string& path);
|
||||
@ -133,6 +142,7 @@ class OSG_EXPORT PagedLOD : public LOD
|
||||
|
||||
void expandPerRangeDataTo(unsigned int pos);
|
||||
|
||||
ref_ptr<Referenced> _databaseOptions;
|
||||
std::string _databasePath;
|
||||
|
||||
int _frameNumberOfLastTraversal;
|
||||
|
@ -63,14 +63,10 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
|
||||
|
||||
|
||||
/** Add a request to load a node file to end the the database request list.*/
|
||||
virtual void requestNodeFile(const std::string& fileName,osg::Group* group,
|
||||
float priority, const osg::FrameStamp* framestamp,
|
||||
osg::ref_ptr<osg::Referenced>& databaseRequest);
|
||||
|
||||
virtual void requestNodeFile(const std::string& fileName,osg::Group* group,
|
||||
float priority, const osg::FrameStamp* framestamp,
|
||||
osg::ref_ptr<osg::Referenced>& databaseRequest,
|
||||
Options* loadOptions);
|
||||
const osg::Referenced* options);
|
||||
|
||||
/** Set the priority of the database pager thread(s).*/
|
||||
int setSchedulePriority(OpenThreads::Thread::ThreadPriority priority);
|
||||
|
@ -28,6 +28,8 @@ class OSGDB_EXPORT FileCache : public osg::Referenced
|
||||
|
||||
const std::string& getFileCachePath() const { return _fileCachePath; }
|
||||
|
||||
virtual bool isFileAppropriateForFileCache(const std::string& originalFileName) const;
|
||||
|
||||
virtual std::string createCacheFileName(const std::string& originalFileName) const;
|
||||
|
||||
virtual bool existsInCache(const std::string& originalFileName) const;
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
#include <osgDB/AuthenticationMap>
|
||||
#include <osgDB/ReaderWriter>
|
||||
#include <osgDB/FileCache>
|
||||
|
||||
#include <deque>
|
||||
#include <list>
|
||||
@ -86,8 +87,27 @@ class OSGDB_EXPORT WriteFileCallback : public virtual osg::Referenced
|
||||
virtual ~WriteFileCallback() {}
|
||||
};
|
||||
|
||||
class OSGDB_EXPORT FileLocationCallback : public virtual osg::Referenced
|
||||
{
|
||||
public:
|
||||
|
||||
enum Location
|
||||
{
|
||||
LOCAL_FILE,
|
||||
REMOTE_FILE
|
||||
};
|
||||
|
||||
virtual Location fileLocation(const std::string& filename, const Options* options) = 0;
|
||||
|
||||
virtual bool useFileCache() const = 0;
|
||||
|
||||
protected:
|
||||
virtual ~FileLocationCallback() {}
|
||||
};
|
||||
|
||||
|
||||
/** Options base class used for passing options into plugins to control their operation.*/
|
||||
class Options : public osg::Object
|
||||
class OSGDB_EXPORT Options : public osg::Object
|
||||
{
|
||||
public:
|
||||
|
||||
@ -233,13 +253,27 @@ class Options : public osg::Object
|
||||
ReadFileCallback* getReadFileCallback() const { return _readFileCallback.get(); }
|
||||
|
||||
|
||||
/** Set the Registry callback to use in place of the default writeFile calls.*/
|
||||
/** Set the callback to use in place of the default writeFile calls.*/
|
||||
void setWriteFileCallback( WriteFileCallback* cb) { _writeFileCallback = cb; }
|
||||
|
||||
/** Get the const writeFile callback.*/
|
||||
WriteFileCallback* getWriteFileCallback() const { return _writeFileCallback.get(); }
|
||||
|
||||
|
||||
/** Set the callback to use inform the DatabasePager whether a file is located on local or remote file system..*/
|
||||
void setFileLocationCallback( FileLocationCallback* cb) { _fileLocationCallback = cb; }
|
||||
|
||||
/** Get the callback to use inform the DatabasePager whether a file is located on local or remote file system..*/
|
||||
FileLocationCallback* getFileLocationCallback() const { return _fileLocationCallback.get(); }
|
||||
|
||||
|
||||
/** Set the FileCache that is used to manage local storage of files downloaded from the internet.*/
|
||||
void setFileCache(FileCache* fileCache) { _fileCache = fileCache; }
|
||||
|
||||
/** Get the FileCache that is used to manage local storage of files downloaded from the internet.*/
|
||||
FileCache* getFileCache() const { return _fileCache.get(); }
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~Options() {}
|
||||
@ -258,6 +292,9 @@ class Options : public osg::Object
|
||||
osg::ref_ptr<FindFileCallback> _findFileCallback;
|
||||
osg::ref_ptr<ReadFileCallback> _readFileCallback;
|
||||
osg::ref_ptr<WriteFileCallback> _writeFileCallback;
|
||||
osg::ref_ptr<FileLocationCallback> _fileLocationCallback;
|
||||
|
||||
osg::ref_ptr<FileCache> _fileCache;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -164,6 +164,7 @@ class OSGDB_EXPORT Registry : public osg::Referenced
|
||||
typedef class osgDB::FindFileCallback FindFileCallback;
|
||||
typedef class osgDB::ReadFileCallback ReadFileCallback;
|
||||
typedef class osgDB::WriteFileCallback WriteFileCallback;
|
||||
typedef class osgDB::FileLocationCallback FileLocationCallback;
|
||||
|
||||
/** Set the Registry callback to use in place of the default findFile calls.*/
|
||||
void setFindFileCallback( FindFileCallback* cb) { _findFileCallback = cb; }
|
||||
@ -326,6 +327,13 @@ class OSGDB_EXPORT Registry : public osg::Referenced
|
||||
}
|
||||
}
|
||||
|
||||
/** Set the callback to use inform the DatabasePager whether a file is located on local or remote file system..*/
|
||||
void setFileLocationCallback( FileLocationCallback* cb) { _fileLocationCallback = cb; }
|
||||
|
||||
/** Get the callback to use inform the DatabasePager whether a file is located on local or remote file system..*/
|
||||
FileLocationCallback* getFileLocationCallback() const { return _fileLocationCallback.get(); }
|
||||
|
||||
|
||||
|
||||
/** Set whether the KdTrees should be built for geometry in the loader model. */
|
||||
void setBuildKdTreesHint(Options::BuildKdTreesHint hint) { _buildKdTreesHint = hint; }
|
||||
@ -339,6 +347,7 @@ class OSGDB_EXPORT Registry : public osg::Referenced
|
||||
/** Get the KdTreeBuilder visitor that is used to build KdTree on loaded models.*/
|
||||
osg::KdTreeBuilder* getKdTreeBuilder() { return _kdTreeBuilder.get(); }
|
||||
|
||||
|
||||
/** Set the FileCache that is used to manage local storage of files downloaded from the internet.*/
|
||||
void setFileCache(FileCache* fileCache) { _fileCache = fileCache; }
|
||||
|
||||
@ -557,6 +566,7 @@ class OSGDB_EXPORT Registry : public osg::Referenced
|
||||
osg::ref_ptr<FindFileCallback> _findFileCallback;
|
||||
osg::ref_ptr<ReadFileCallback> _readFileCallback;
|
||||
osg::ref_ptr<WriteFileCallback> _writeFileCallback;
|
||||
osg::ref_ptr<FileLocationCallback> _fileLocationCallback;
|
||||
|
||||
DotOsgWrapperMap _objectWrapperMap;
|
||||
DotOsgWrapperMap _imageWrapperMap;
|
||||
|
@ -58,6 +58,7 @@ PagedLOD::PagedLOD()
|
||||
|
||||
PagedLOD::PagedLOD(const PagedLOD& plod,const CopyOp& copyop):
|
||||
LOD(plod,copyop),
|
||||
_databaseOptions(plod._databaseOptions),
|
||||
_databasePath(plod._databasePath),
|
||||
_frameNumberOfLastTraversal(plod._frameNumberOfLastTraversal),
|
||||
_numChildrenThatCannotBeExpired(plod._numChildrenThatCannotBeExpired),
|
||||
@ -213,16 +214,15 @@ void PagedLOD::traverse(NodeVisitor& nv)
|
||||
|
||||
if (_databasePath.empty())
|
||||
{
|
||||
nv.getDatabaseRequestHandler()->requestNodeFile(_perRangeDataList[numChildren]._filename,this,priority,nv.getFrameStamp(), _perRangeDataList[numChildren]._databaseRequest);
|
||||
nv.getDatabaseRequestHandler()->requestNodeFile(_perRangeDataList[numChildren]._filename,this,priority,nv.getFrameStamp(), _perRangeDataList[numChildren]._databaseRequest, _databaseOptions.get());
|
||||
}
|
||||
else
|
||||
{
|
||||
// prepend the databasePath to the child's filename.
|
||||
nv.getDatabaseRequestHandler()->requestNodeFile(_databasePath+_perRangeDataList[numChildren]._filename,this,priority,nv.getFrameStamp(), _perRangeDataList[numChildren]._databaseRequest);
|
||||
nv.getDatabaseRequestHandler()->requestNodeFile(_databasePath+_perRangeDataList[numChildren]._filename,this,priority,nv.getFrameStamp(), _perRangeDataList[numChildren]._databaseRequest, _databaseOptions.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -446,8 +446,6 @@ void DatabasePager::DatabaseThread::run()
|
||||
break;
|
||||
}
|
||||
|
||||
//Getting CURL Environment Variables (If found rewrite OSG Options)
|
||||
osg::ref_ptr<FileCache> fileCache = osgDB::Registry::instance()->getFileCache();
|
||||
|
||||
do
|
||||
{
|
||||
@ -482,8 +480,21 @@ void DatabasePager::DatabaseThread::run()
|
||||
|
||||
bool readFromFileCache = false;
|
||||
|
||||
osg::ref_ptr<FileCache> fileCache = osgDB::Registry::instance()->getFileCache();
|
||||
osg::ref_ptr<FileLocationCallback> fileLocationCallback = osgDB::Registry::instance()->getFileLocationCallback();
|
||||
|
||||
if (databaseRequest.valid())
|
||||
{
|
||||
if (databaseRequest->_loadOptions.valid())
|
||||
{
|
||||
if (databaseRequest->_loadOptions->getFileCache()) fileCache = databaseRequest->_loadOptions->getFileCache();
|
||||
if (databaseRequest->_loadOptions->getFileLocationCallback()) fileLocationCallback = databaseRequest->_loadOptions->getFileLocationCallback();
|
||||
}
|
||||
|
||||
// disable the FileCache if the fileLocationCallback tells us that it isn't required for this request.
|
||||
if (fileLocationCallback.valid() && !fileLocationCallback->useFileCache()) fileCache = 0;
|
||||
|
||||
|
||||
// check if databaseRequest is still relevant
|
||||
if ((_pager->_frameNumber-databaseRequest->_frameNumberLastRequest)<=1)
|
||||
{
|
||||
@ -492,19 +503,32 @@ void DatabasePager::DatabaseThread::run()
|
||||
switch(_mode)
|
||||
{
|
||||
case(HANDLE_ALL_REQUESTS):
|
||||
{
|
||||
// do nothing as this thread can handle the load
|
||||
if (osgDB::containsServerAddress(databaseRequest->_fileName))
|
||||
if (fileCache.valid() && fileCache->isFileAppropriateForFileCache(databaseRequest->_fileName))
|
||||
{
|
||||
if (fileCache.valid() && fileCache->existsInCache(databaseRequest->_fileName))
|
||||
if (fileCache->existsInCache(databaseRequest->_fileName))
|
||||
{
|
||||
readFromFileCache = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
case(HANDLE_NON_HTTP):
|
||||
{
|
||||
// check the cache first
|
||||
if (osgDB::containsServerAddress(databaseRequest->_fileName))
|
||||
bool isHighLatencyFileRequest = false;
|
||||
|
||||
if (fileLocationCallback.valid())
|
||||
{
|
||||
isHighLatencyFileRequest = fileLocationCallback->fileLocation(databaseRequest->_fileName, databaseRequest->_loadOptions.get()) == FileLocationCallback::REMOTE_FILE;
|
||||
}
|
||||
else if (fileCache.valid() && fileCache->isFileAppropriateForFileCache(databaseRequest->_fileName))
|
||||
{
|
||||
isHighLatencyFileRequest = true;
|
||||
}
|
||||
|
||||
if (isHighLatencyFileRequest)
|
||||
{
|
||||
if (fileCache.valid() && fileCache->existsInCache(databaseRequest->_fileName))
|
||||
{
|
||||
@ -518,15 +542,12 @@ void DatabasePager::DatabaseThread::run()
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
case(HANDLE_ONLY_HTTP):
|
||||
// make sure the request is a http request
|
||||
if (!osgDB::containsServerAddress(databaseRequest->_fileName))
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<_name<<": Help we have request we shouldn't have "<<databaseRequest->_fileName<<std::endl;
|
||||
databaseRequest = 0;
|
||||
}
|
||||
{
|
||||
// accept all requests, as we'll assume only high latency requests will have got here.
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -554,8 +575,8 @@ void DatabasePager::DatabaseThread::run()
|
||||
if (rr.error()) osg::notify(osg::WARN)<<"Error in reading file "<<databaseRequest->_fileName<<" : "<<rr.message() << std::endl;
|
||||
|
||||
if (databaseRequest->_loadedModel.valid() &&
|
||||
osgDB::containsServerAddress(databaseRequest->_fileName) &&
|
||||
fileCache.valid() &&
|
||||
fileCache->isFileAppropriateForFileCache(databaseRequest->_fileName) &&
|
||||
!readFromFileCache)
|
||||
{
|
||||
fileCache->writeNode(*(databaseRequest->_loadedModel), databaseRequest->_fileName, databaseRequest->_loadOptions.get());
|
||||
@ -1228,18 +1249,24 @@ bool DatabasePager::getRequestsInProgress() const
|
||||
}
|
||||
|
||||
|
||||
void DatabasePager::requestNodeFile(const std::string& fileName,osg::Group* group,
|
||||
float priority, const osg::FrameStamp* framestamp,
|
||||
osg::ref_ptr<osg::Referenced>& databaseRequest)
|
||||
{
|
||||
requestNodeFile(fileName,group,priority,framestamp,databaseRequest,Registry::instance()->getOptions());
|
||||
}
|
||||
|
||||
void DatabasePager::requestNodeFile(const std::string& fileName,osg::Group* group,
|
||||
float priority, const osg::FrameStamp* framestamp,
|
||||
osg::ref_ptr<osg::Referenced>& databaseRequestRef,
|
||||
Options* loadOptions)
|
||||
const osg::Referenced* options)
|
||||
{
|
||||
osgDB::Options* loadOptions = dynamic_cast<osgDB::Options*>(const_cast<osg::Referenced*>(options));
|
||||
if (!loadOptions)
|
||||
{
|
||||
loadOptions = Registry::instance()->getOptions();
|
||||
|
||||
osg::notify(osg::NOTICE)<<"Using options from Registry "<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"options from requestNodeFile "<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
if (!_acceptNewRequests) return;
|
||||
|
||||
osg::Timer_t start_tick = osg::Timer::instance()->tick();
|
||||
|
@ -30,6 +30,11 @@ FileCache::~FileCache()
|
||||
osg::notify(osg::INFO)<<"Destructed FileCache "<<std::endl;
|
||||
}
|
||||
|
||||
bool FileCache::isFileAppropriateForFileCache(const std::string& originalFileName) const
|
||||
{
|
||||
return osgDB::containsServerAddress(originalFileName);
|
||||
}
|
||||
|
||||
std::string FileCache::createCacheFileName(const std::string& originalFileName) const
|
||||
{
|
||||
std::string cacheFileName = _fileCachePath + "/" +
|
||||
|
@ -108,4 +108,6 @@ Options::Options(const Options& options,const osg::CopyOp& copyop):
|
||||
_pluginStringData(options._pluginStringData),
|
||||
_findFileCallback(options._findFileCallback),
|
||||
_readFileCallback(options._readFileCallback),
|
||||
_writeFileCallback(options._writeFileCallback) {}
|
||||
_writeFileCallback(options._writeFileCallback),
|
||||
_fileLocationCallback(options._fileLocationCallback),
|
||||
_fileCache(options._fileCache) {}
|
||||
|
@ -419,11 +419,11 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::NodeVisitor::DatabaseRequestHandler)
|
||||
I_Constructor0(____DatabaseRequestHandler,
|
||||
"",
|
||||
"");
|
||||
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,
|
||||
Properties::PURE_VIRTUAL,
|
||||
__void__requestNodeFile__C5_std_string_R1__osg_Group_P1__float__C5_FrameStamp_P1__osg_ref_ptrT1_osg_Referenced__R1,
|
||||
"",
|
||||
"");
|
||||
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,
|
||||
Properties::PURE_VIRTUAL,
|
||||
__void__requestNodeFile__C5_std_string_R1__osg_Group_P1__float__C5_FrameStamp_P1__osg_ref_ptrT1_osg_Referenced__R1__C5_osg_Referenced_P1,
|
||||
"",
|
||||
"");
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::NodeVisitor::ImageRequestHandler)
|
||||
|
@ -93,6 +93,21 @@ BEGIN_OBJECT_REFLECTOR(osg::PagedLOD)
|
||||
__bool__removeChildren__unsigned_int__unsigned_int,
|
||||
"Remove children from Group. ",
|
||||
"Note, must be override by subclasses of Group which add per child attributes. ");
|
||||
I_Method1(void, setDatabaseOptions, IN, osg::Referenced *, options,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setDatabaseOptions__osg_Referenced_P1,
|
||||
"Set the optional database osgDB::Options object to use when loaded children. ",
|
||||
"");
|
||||
I_Method0(osg::Referenced *, getDatabaseOptions,
|
||||
Properties::NON_VIRTUAL,
|
||||
__osg_Referenced_P1__getDatabaseOptions,
|
||||
"Get the optional database osgDB::Options object used when loaded children. ",
|
||||
"");
|
||||
I_Method0(const osg::Referenced *, getDatabaseOptions,
|
||||
Properties::NON_VIRTUAL,
|
||||
__C5_osg_Referenced_P1__getDatabaseOptions,
|
||||
"Get the optional database osgDB::Options object used when loaded children. ",
|
||||
"");
|
||||
I_Method1(void, setDatabasePath, IN, const std::string &, path,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setDatabasePath__C5_std_string_R1,
|
||||
@ -224,6 +239,9 @@ BEGIN_OBJECT_REFLECTOR(osg::PagedLOD)
|
||||
__void__expandPerRangeDataTo__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_SimpleProperty(osg::Referenced *, DatabaseOptions,
|
||||
__osg_Referenced_P1__getDatabaseOptions,
|
||||
__void__setDatabaseOptions__osg_Referenced_P1);
|
||||
I_SimpleProperty(const std::string &, DatabasePath,
|
||||
__C5_std_string_R1__getDatabasePath,
|
||||
__void__setDatabasePath__C5_std_string_R1);
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include <osg/Referenced>
|
||||
#include <osg/State>
|
||||
#include <osgDB/DatabasePager>
|
||||
#include <osgDB/Options>
|
||||
|
||||
// Must undefine IN and OUT macros defined in Windows headers
|
||||
#ifdef IN
|
||||
@ -69,16 +68,11 @@ BEGIN_OBJECT_REFLECTOR(osgDB::DatabasePager)
|
||||
__DatabasePager_P1__clone,
|
||||
"Create a shallow copy on the DatabasePager. ",
|
||||
"");
|
||||
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,
|
||||
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,
|
||||
Properties::VIRTUAL,
|
||||
__void__requestNodeFile__C5_std_string_R1__osg_Group_P1__float__C5_osg_FrameStamp_P1__osg_ref_ptrT1_osg_Referenced__R1,
|
||||
__void__requestNodeFile__C5_std_string_R1__osg_Group_P1__float__C5_osg_FrameStamp_P1__osg_ref_ptrT1_osg_Referenced__R1__C5_osg_Referenced_P1,
|
||||
"Add a request to load a node file to end the the database request list. ",
|
||||
"");
|
||||
I_Method6(void, requestNodeFile, IN, const std::string &, fileName, IN, osg::Group *, group, IN, float, priority, IN, const osg::FrameStamp *, framestamp, IN, osg::ref_ptr< osg::Referenced > &, databaseRequest, IN, osgDB::Options *, loadOptions,
|
||||
Properties::VIRTUAL,
|
||||
__void__requestNodeFile__C5_std_string_R1__osg_Group_P1__float__C5_osg_FrameStamp_P1__osg_ref_ptrT1_osg_Referenced__R1__Options_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(int, setSchedulePriority, IN, OpenThreads::Thread::ThreadPriority, priority,
|
||||
Properties::NON_VIRTUAL,
|
||||
__int__setSchedulePriority__OpenThreads_Thread_ThreadPriority,
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <osg/Shader>
|
||||
#include <osg/Shape>
|
||||
#include <osgDB/AuthenticationMap>
|
||||
#include <osgDB/FileCache>
|
||||
#include <osgDB/Options>
|
||||
#include <osgDB/ReaderWriter>
|
||||
|
||||
@ -28,6 +29,30 @@
|
||||
#undef OUT
|
||||
#endif
|
||||
|
||||
BEGIN_ENUM_REFLECTOR(osgDB::FileLocationCallback::Location)
|
||||
I_DeclaringFile("osgDB/Options");
|
||||
I_EnumLabel(osgDB::FileLocationCallback::LOCAL_FILE);
|
||||
I_EnumLabel(osgDB::FileLocationCallback::REMOTE_FILE);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_ABSTRACT_OBJECT_REFLECTOR(osgDB::FileLocationCallback)
|
||||
I_DeclaringFile("osgDB/Options");
|
||||
I_VirtualBaseType(osg::Referenced);
|
||||
I_Constructor0(____FileLocationCallback,
|
||||
"",
|
||||
"");
|
||||
I_Method2(osgDB::FileLocationCallback::Location, fileLocation, IN, const std::string &, filename, IN, const osgDB::Options *, options,
|
||||
Properties::PURE_VIRTUAL,
|
||||
__Location__fileLocation__C5_std_string_R1__C5_Options_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(bool, useFileCache,
|
||||
Properties::PURE_VIRTUAL,
|
||||
__bool__useFileCache,
|
||||
"",
|
||||
"");
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osgDB::FindFileCallback)
|
||||
I_DeclaringFile("osgDB/Options");
|
||||
I_VirtualBaseType(osg::Referenced);
|
||||
@ -223,13 +248,33 @@ BEGIN_OBJECT_REFLECTOR(osgDB::Options)
|
||||
I_Method1(void, setWriteFileCallback, IN, osgDB::WriteFileCallback *, cb,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setWriteFileCallback__WriteFileCallback_P1,
|
||||
"Set the Registry callback to use in place of the default writeFile calls. ",
|
||||
"Set the callback to use in place of the default writeFile calls. ",
|
||||
"");
|
||||
I_Method0(osgDB::WriteFileCallback *, getWriteFileCallback,
|
||||
Properties::NON_VIRTUAL,
|
||||
__WriteFileCallback_P1__getWriteFileCallback,
|
||||
"Get the const writeFile callback. ",
|
||||
"");
|
||||
I_Method1(void, setFileLocationCallback, IN, osgDB::FileLocationCallback *, cb,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setFileLocationCallback__FileLocationCallback_P1,
|
||||
"Set the callback to use inform the DatabasePager whether a file is located on local or remote file system. ",
|
||||
"");
|
||||
I_Method0(osgDB::FileLocationCallback *, getFileLocationCallback,
|
||||
Properties::NON_VIRTUAL,
|
||||
__FileLocationCallback_P1__getFileLocationCallback,
|
||||
"Get the callback to use inform the DatabasePager whether a file is located on local or remote file system. ",
|
||||
"");
|
||||
I_Method1(void, setFileCache, IN, osgDB::FileCache *, fileCache,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setFileCache__FileCache_P1,
|
||||
"Set the FileCache that is used to manage local storage of files downloaded from the internet. ",
|
||||
"");
|
||||
I_Method0(osgDB::FileCache *, getFileCache,
|
||||
Properties::NON_VIRTUAL,
|
||||
__FileCache_P1__getFileCache,
|
||||
"Get the FileCache that is used to manage local storage of files downloaded from the internet. ",
|
||||
"");
|
||||
I_SimpleProperty(osgDB::AuthenticationMap *, AuthenticationMap,
|
||||
0,
|
||||
__void__setAuthenticationMap__AuthenticationMap_P1);
|
||||
@ -242,6 +287,12 @@ BEGIN_OBJECT_REFLECTOR(osgDB::Options)
|
||||
I_SimpleProperty(osgDB::FilePathList &, DatabasePathList,
|
||||
__FilePathList_R1__getDatabasePathList,
|
||||
0);
|
||||
I_SimpleProperty(osgDB::FileCache *, FileCache,
|
||||
__FileCache_P1__getFileCache,
|
||||
__void__setFileCache__FileCache_P1);
|
||||
I_SimpleProperty(osgDB::FileLocationCallback *, FileLocationCallback,
|
||||
__FileLocationCallback_P1__getFileLocationCallback,
|
||||
__void__setFileLocationCallback__FileLocationCallback_P1);
|
||||
I_SimpleProperty(osgDB::FindFileCallback *, FindFileCallback,
|
||||
__FindFileCallback_P1__getFindFileCallback,
|
||||
__void__setFindFileCallback__FindFileCallback_P1);
|
||||
|
@ -85,6 +85,8 @@ TYPE_NAME_ALIAS(class osgDB::ReadFileCallback, osgDB::Registry::ReadFileCallback
|
||||
|
||||
TYPE_NAME_ALIAS(class osgDB::WriteFileCallback, osgDB::Registry::WriteFileCallback)
|
||||
|
||||
TYPE_NAME_ALIAS(class osgDB::FileLocationCallback, osgDB::Registry::FileLocationCallback)
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osgDB::Registry)
|
||||
I_DeclaringFile("osgDB/Registry");
|
||||
I_BaseType(osg::Referenced);
|
||||
@ -412,6 +414,16 @@ BEGIN_OBJECT_REFLECTOR(osgDB::Registry)
|
||||
__void___buildKdTreeIfRequired__ReaderWriter_ReadResult_R1__C5_Options_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setFileLocationCallback, IN, osgDB::Registry::FileLocationCallback *, cb,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setFileLocationCallback__FileLocationCallback_P1,
|
||||
"Set the callback to use inform the DatabasePager whether a file is located on local or remote file system. ",
|
||||
"");
|
||||
I_Method0(osgDB::Registry::FileLocationCallback *, getFileLocationCallback,
|
||||
Properties::NON_VIRTUAL,
|
||||
__FileLocationCallback_P1__getFileLocationCallback,
|
||||
"Get the callback to use inform the DatabasePager whether a file is located on local or remote file system. ",
|
||||
"");
|
||||
I_Method1(void, setBuildKdTreesHint, IN, osgDB::Options::BuildKdTreesHint, hint,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setBuildKdTreesHint__Options_BuildKdTreesHint,
|
||||
@ -666,6 +678,9 @@ BEGIN_OBJECT_REFLECTOR(osgDB::Registry)
|
||||
I_SimpleProperty(osgDB::FileCache *, FileCache,
|
||||
__FileCache_P1__getFileCache,
|
||||
__void__setFileCache__FileCache_P1);
|
||||
I_SimpleProperty(osgDB::Registry::FileLocationCallback *, FileLocationCallback,
|
||||
__FileLocationCallback_P1__getFileLocationCallback,
|
||||
__void__setFileLocationCallback__FileLocationCallback_P1);
|
||||
I_SimpleProperty(osgDB::Registry::FindFileCallback *, FindFileCallback,
|
||||
__FindFileCallback_P1__getFindFileCallback,
|
||||
__void__setFindFileCallback__FindFileCallback_P1);
|
||||
|
Loading…
Reference in New Issue
Block a user