[osg-users] pfObject::getNamedUserDataSlot

Robert Osfield robert.osfield at gmail.com
Thu Sep 10 00:19:16 PDT 2015


Hi Tony,

As Nick says there is the Node::setUserValue(..) template method and
Node::setUserData().  When you use UserValue it creates a UserDataContainer
to hold the values in a vector of osg::Object*, so this UserDataContainer
kinda has "slots".  The UserDataContainer is only created on demand and
when it is used it attached to the Node(or any osg::Object) via the
setUserData().

Another approach you could take it is create your own version of
UserDataContainer that uses a map rather than a vector and attach this as
UserData.

As a general note, the OSG is designed to be extensible and configurable,
while Performer is just configurable.  In Performer you have few options to
do things that aren't originally anticipated by the API, but with the OSG
the door is open to doing completely different things with it.

Robert.

On 10 September 2015 at 06:56, Tony Vasile <minghia at gmail.com> wrote:

> Is there an equivalent function to the Performer
> pfObject::getNamedUserDataSlot? Our code uses it a lot to store object
> data. I'm guessing we could just store the data in a map and uses the slot
> id returned as a key.
>
> ------------------------
> Tony V
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=65084#65084
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150910/b22ecdf2/attachment-0003.htm>


More information about the osg-users mailing list