Addd method implementation in serializers

This commit is contained in:
Robert Osfield
2014-05-21 16:15:02 +00:00
parent d8adc80c2c
commit 0b5b3213fe
6 changed files with 45 additions and 73 deletions

View File

@@ -1703,6 +1703,22 @@ public:
#define REMOVE_SERIALIZER(PROP) \
wrapper->markSerializerAsRemoved( #PROP );
#define ADD_METHOD_OBJECT( METHODNAME, METHODOBJECTCLASS ) wrapper->addMethodObject(METHODNAME, new METHODOBJECTCLASS());
#define ADD_METHOD(METHODNAME) \
{ \
struct MethodCaller : public osgDB::MethodObject \
{ \
virtual bool run(void* objectPtr, osg::Parameters&, osg::Parameters&) const \
{ \
MyClass* obj = reinterpret_cast<MyClass*>(objectPtr); \
obj->METHODNAME(); \
return true; \
} \
}; \
wrapper->addMethodObject(#METHODNAME, new MethodCaller()); \
}
}
#endif