>> I was wondering if it would be feasible to add a Referenced* member variable >> to osg::Node in the OSG base that could be used for arbitrary information >> tagging?
> Would : > osg::Object::setUserData(Referenced*) be what you are looking for? > osg::Node subclasses from osg::Object so has the same user data too. Is "user data" safe for general use? When I grep through the source for "setUserData", I get hits besides the actual definitions of the UserData functions. For example (osg V1.2): osgPlugins/flt/FltFile.cpp: model->setUserData( loc.get() ); osgPlugins/OpenFlight/PrimaryRecords.cpp: _header->setUserData( loc ); osgPlugins/OpenFlight/PrimaryRecords.cpp: _external->setUserData(new ParentPools... osgPlugins/OpenFlight/ReaderWriterFLT.cpp: _options->setUserData( node.getUserData() ); OpenSceneGraph/src/osgSim/Impostor.cpp: cv->setUserData(impostorSpriteManager); OpenSceneGraph/src/osgSim/LightPointNode.cpp: rg->setUserData(drawable); (more) Quite admittedly, I haven't opened each of these files and tracked down the usage (it may not even be the same "user data" field as in the nodes). However, when I originally wanted to use "user data", I got scared off by this light search thinking "oh, looks like OSG uses this field so it's not necessarily available for my use". Is there a chance that user data may get stomped on by some of the OSG functions? Thanks, Bill _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
