Hi Ulrich, I agree putting serialization in the object breaks the reader/writer phylosophy. This is why the idea of Meta/Component/osg::KeyValue is nice. And I think this could be a few lines.
However I disagree with the "name collisions" problem: this should be an user-dependant implementation. Maybe some users won't care at all if names overlap? Core OSG may provide a few convenience features to help track duplicates, but not much more I think. And what do you mean by "the problem with typing the contained data"? Cheers, Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ ----- "Ulrich Hertlein" <[email protected]> a écrit : > Hi Sukender, > > On 29/10/09 3:38 PM, Sukender wrote: > > And once again, don't you think supporting metadata ("Name, value") > directly in the > > osg::Object wouldn't be nice? Or could we code something like: "if > UserData is an > > osg::Object (or another given type), read from/write to file using > > UserData->serialize()/unserialize()" in reader/writers? > > Having the serialize/deserialize as part of the object isn't a good > idea, because it > doesn't allow you to deal with different formats, such as .osg and > .ive? This must be > implemented in the respective plugin but for pure key/value pairs this > could be added to > the .osg and .ive plugins. > > How about having a osg::KeyValue object derived from osg::Referenced > so that it can be > used as user-data? > > That would also allow other plugins to return additional information, > like an image loader > to pass additional information (like description, fps, colourspace, > and such) back to the > application in a standard format. > > On the other hand there is the problem with typing the contained data > and name collisions... > > Cheers, > /ulrich > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

