From 59f6e0cdcfdf8dc81a74b6874fc5b599cc55941e Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 15 Jul 2008 10:45:07 +0000 Subject: [PATCH] Updated wrappers --- src/osgWrappers/osgDB/Archive.cpp | 2 +- src/osgWrappers/osgDB/ReaderWriter.cpp | 37 ++++++++++++++++- src/osgWrappers/osgDB/Registry.cpp | 57 ++++++++++++++++++++++++++ 3 files changed, 94 insertions(+), 2 deletions(-) diff --git a/src/osgWrappers/osgDB/Archive.cpp b/src/osgWrappers/osgDB/Archive.cpp index 8be8db438..566e8072e 100644 --- a/src/osgWrappers/osgDB/Archive.cpp +++ b/src/osgWrappers/osgDB/Archive.cpp @@ -46,7 +46,7 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osgDB::Archive) I_Method1(bool, acceptsExtension, IN, const std::string &, x, Properties::VIRTUAL, __bool__acceptsExtension__C5_std_string_R1, - "", + "return true if ReaderWriter accepts specified file extension. ", ""); I_Method0(void, close, Properties::PURE_VIRTUAL, diff --git a/src/osgWrappers/osgDB/ReaderWriter.cpp b/src/osgWrappers/osgDB/ReaderWriter.cpp index b75c29515..a72c1afbe 100644 --- a/src/osgWrappers/osgDB/ReaderWriter.cpp +++ b/src/osgWrappers/osgDB/ReaderWriter.cpp @@ -27,6 +27,8 @@ #undef OUT #endif +TYPE_NAME_ALIAS(std::map< std::string COMMA std::string >, osgDB::ReaderWriter::FormatDescriptionMap) + BEGIN_ENUM_REFLECTOR(osgDB::ReaderWriter::ArchiveStatus) I_DeclaringFile("osgDB/ReaderWriter"); I_EnumLabel(osgDB::ReaderWriter::READ); @@ -69,10 +71,25 @@ BEGIN_OBJECT_REFLECTOR(osgDB::ReaderWriter) __C5_char_P1__className, "return the name of the object's class type. ", "Must be defined by derived classes. "); + I_Method0(const osgDB::ReaderWriter::FormatDescriptionMap &, supportedProtocols, + Properties::VIRTUAL, + __C5_FormatDescriptionMap_R1__supportedProtocols, + "return which protocols are supported by ReaderWriter. ", + ""); + I_Method0(const osgDB::ReaderWriter::FormatDescriptionMap &, supportedExtensions, + Properties::VIRTUAL, + __C5_FormatDescriptionMap_R1__supportedExtensions, + "return which list of file extensions supported by ReaderWriter. ", + ""); + I_Method0(const osgDB::ReaderWriter::FormatDescriptionMap &, supportedOptions, + Properties::VIRTUAL, + __C5_FormatDescriptionMap_R1__supportedOptions, + "return which list of file extensions supported by ReaderWriter. ", + ""); I_Method1(bool, acceptsExtension, IN, const std::string &, x, Properties::VIRTUAL, __bool__acceptsExtension__C5_std_string_R1, - "", + "return true if ReaderWriter accepts specified file extension. ", ""); I_MethodWithDefaults4(osgDB::ReaderWriter::ReadResult, openArchive, IN, const std::string &, x, , IN, osgDB::ReaderWriter::ArchiveStatus, x, , IN, unsigned, int, 4096, IN, const osgDB::ReaderWriter::Options *, x, NULL, Properties::VIRTUAL, @@ -184,6 +201,24 @@ BEGIN_OBJECT_REFLECTOR(osgDB::ReaderWriter) __WriteResult__writeShader__C5_osg_Shader_R1__std_ostream_R1__C5_Options_P1, "", ""); + I_ProtectedMethod2(void, supportsProtocol, IN, const std::string &, fmt, IN, const std::string &, description, + Properties::NON_VIRTUAL, + Properties::NON_CONST, + __void__supportsProtocol__C5_std_string_R1__C5_std_string_R1, + "", + ""); + I_ProtectedMethod2(void, supportsExtension, IN, const std::string &, fmt, IN, const std::string &, description, + Properties::NON_VIRTUAL, + Properties::NON_CONST, + __void__supportsExtension__C5_std_string_R1__C5_std_string_R1, + "", + ""); + I_ProtectedMethod2(void, supportsOption, IN, const std::string &, fmt, IN, const std::string &, description, + Properties::NON_VIRTUAL, + Properties::NON_CONST, + __void__supportsOption__C5_std_string_R1__C5_std_string_R1, + "", + ""); END_REFLECTOR BEGIN_ENUM_REFLECTOR(osgDB::ReaderWriter::Options::CacheHintOptions) diff --git a/src/osgWrappers/osgDB/Registry.cpp b/src/osgWrappers/osgDB/Registry.cpp index d516068c1..c386a21e1 100644 --- a/src/osgWrappers/osgDB/Registry.cpp +++ b/src/osgWrappers/osgDB/Registry.cpp @@ -68,6 +68,8 @@ BEGIN_VALUE_REFLECTOR(osgDB::RegisterDotOsgWrapperProxy) ""); END_REFLECTOR +TYPE_NAME_ALIAS(std::vector< osg::ref_ptr< osgDB::ReaderWriter > >, osgDB::Registry::ReaderWriterList) + BEGIN_OBJECT_REFLECTOR(osgDB::Registry) I_DeclaringFile("osgDB/Registry"); I_BaseType(osg::Referenced); @@ -141,6 +143,16 @@ BEGIN_OBJECT_REFLECTOR(osgDB::Registry) __ReaderWriter_P1__getReaderWriterForExtension__C5_std_string_R1, "get a reader writer which handles specified extension. ", ""); + I_Method0(osgDB::Registry::ReaderWriterList &, getReaderWriterList, + Properties::NON_VIRTUAL, + __ReaderWriterList_R1__getReaderWriterList, + "get list of all registered ReaderWriters. ", + ""); + I_Method0(const osgDB::Registry::ReaderWriterList &, getReaderWriterList, + Properties::NON_VIRTUAL, + __C5_ReaderWriterList_R1__getReaderWriterList, + "get const list of all registered ReaderWriters. ", + ""); I_Method2(osg::Object *, readObjectOfType, IN, const osg::Object &, compObj, IN, osgDB::Input &, fr, Properties::NON_VIRTUAL, __osg_Object_P1__readObjectOfType__C5_osg_Object_R1__Input_R1, @@ -578,6 +590,9 @@ BEGIN_OBJECT_REFLECTOR(osgDB::Registry) I_SimpleProperty(osgDB::Registry::ReadFileCallback *, ReadFileCallback, __ReadFileCallback_P1__getReadFileCallback, __void__setReadFileCallback__ReadFileCallback_P1); + I_SimpleProperty(osgDB::Registry::ReaderWriterList &, ReaderWriterList, + __ReaderWriterList_R1__getReaderWriterList, + 0); I_SimpleProperty(osgDB::SharedStateManager *, SharedStateManager, __SharedStateManager_P1__getSharedStateManager, __void__setSharedStateManager__SharedStateManager_P1); @@ -681,3 +696,45 @@ BEGIN_OBJECT_REFLECTOR(osgDB::Registry::WriteFileCallback) ""); END_REFLECTOR +BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osgDB::ReaderWriter >) + I_DeclaringFile("osg/ref_ptr"); + I_Constructor0(____ref_ptr, + "", + ""); + I_Constructor1(IN, osgDB::ReaderWriter *, ptr, + Properties::NON_EXPLICIT, + ____ref_ptr__T_P1, + "", + ""); + I_Constructor1(IN, const osg::ref_ptr< osgDB::ReaderWriter > &, rp, + Properties::NON_EXPLICIT, + ____ref_ptr__C5_ref_ptr_R1, + "", + ""); + I_Method0(osgDB::ReaderWriter *, get, + Properties::NON_VIRTUAL, + __T_P1__get, + "", + ""); + I_Method0(bool, valid, + Properties::NON_VIRTUAL, + __bool__valid, + "", + ""); + I_Method0(osgDB::ReaderWriter *, release, + Properties::NON_VIRTUAL, + __T_P1__release, + "", + ""); + I_Method1(void, swap, IN, osg::ref_ptr< osgDB::ReaderWriter > &, rp, + Properties::NON_VIRTUAL, + __void__swap__ref_ptr_R1, + "", + ""); + I_SimpleProperty(osgDB::ReaderWriter *, , + __T_P1__get, + 0); +END_REFLECTOR + +STD_VECTOR_REFLECTOR(std::vector< osg::ref_ptr< osgDB::ReaderWriter > >) +