Addd method implementation in serializers
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user