Hi Peter, On Thu, Jun 9, 2011 at 4:02 PM, Peter Amstutz <[email protected]> wrote: > I noticed that DefaultUserDataContainer does not set the parent > _userDataContainer field to "this", nor does it override > getUserDataContainer() / setUserDataContainer(). I suppose this allows > meta-data about meta-data,
I debated setting the UserDataContainer's _userDataContainer to itself but it woudl create a circular reference so ceratinly a no go. Potentially you could override the Object::s/getUserDataContainer methods to return self but would in itself introduce an inconsistency between how objects and containers behave. I also have no objection to UserDataContainer's having their own User data objects nested within them. > but it means that calling getUserValue() / > setUserValue() on a UserDataContainer will not work that way you would > expect, because it will pass through to the underlying chained > _userDataContainer field which is empty instead of setting data fields > on the UserDataContainer itself. I hadn't spotted this issue, and agree it's potentially confusing when a UserData In the cases where you have nested UserDataContainer. The current implementation won't work with UserDataContainer::s/getUserValue(..) without a nested UserDataContainer, it'll just return false. Could one override the s/getUserValue() template in UserDataContainer? I haven't ever tried this type of template usage so can't say whether it might work. Robert. _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

