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

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

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

View File

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