Added set/get to the ImageSerializer and removed some redudent comments

This commit is contained in:
Robert Osfield
2013-10-10 20:43:03 +00:00
parent cd86995d7d
commit eb7c2ae3f7
2 changed files with 3 additions and 2 deletions

View File

@@ -582,6 +582,9 @@ public:
ImageSerializer( const char* name, P* def, Getter gf, Setter sf )
: ParentType(name, def), _getter(gf), _setter(sf) {}
virtual bool set(osg::Object& obj, void* value) { C& object = OBJECT_CAST<C&>(obj); (object.*_setter)( *(reinterpret_cast<P**>(value)) ); return true; }
virtual bool get(const osg::Object& obj, void* value) { const C& object = OBJECT_CAST<const C&>(obj);*(reinterpret_cast<const P**>(value )) = (object.*_getter)(); return true; }
virtual bool read( InputStream& is, osg::Object& obj )
{
C& object = OBJECT_CAST<C&>(obj);

View File

@@ -366,7 +366,6 @@ bool PropertyInterface::copyPropertyDataToObject(osg::Object* object, const std:
bool PropertyInterface::copyPropertyObjectFromObject(const osg::Object* object, const std::string& propertyName, void* valuePtr, unsigned int valueSize, osgDB::BaseSerializer::Type valueType)
{
OSG_NOTICE<<"PropertyInterface::copyPropertyObjectFromObject() Not Supported yet."<<std::endl;
osgDB::BaseSerializer::Type sourceType;
osgDB::BaseSerializer* serializer = getSerializer(object, propertyName, sourceType);
if (serializer)
@@ -391,7 +390,6 @@ bool PropertyInterface::copyPropertyObjectFromObject(const osg::Object* object,
bool PropertyInterface::copyPropertyObjectToObject(osg::Object* object, const std::string& propertyName, const void* valuePtr, unsigned int valueSize, osgDB::BaseSerializer::Type valueType)
{
OSG_NOTICE<<"PropertyInterface::copyPropertyObjectToObject() Not Supported yet."<<std::endl;
osgDB::BaseSerializer::Type destinationType;
osgDB::BaseSerializer* serializer = getSerializer(object, propertyName, destinationType);
if (serializer)