I just read some archives and I saw that the update callback is a good place
to modify the node children, but not its parent.
But , the osg Handler inherits from nodeCallback ... so it is safe to modify
children in a handle() isn't it ?

Last, when can I modify a node's parent, or the node itsef (I mean
adding/removing children by 'modify') ?

Thanks, any link or precision will be appreciated.

Regards,
   Vincent.


2009/4/22 Vincent Bourdier <vincent.bourd...@gmail.com>

> Hi Robert,
>
> Thanks for the reply.
>
> So if I understand well, modifying the graph in a handler is not safe at
> all... But if I modify in a callback, this will not be more safe because of
> iterators as you said, no ? ... so when and how can I modify my graph safely
> ?
>
> It looks like a beginner question, but I feel a bit lost with that
> "revelation" ...
>
> Thanks.
>
> Regards,
>    Vincent.
>
>
> 2009/4/22 Robert Osfield <robert.osfi...@gmail.com>
>
> On Wed, Apr 22, 2009 at 8:51 AM, Vincent Bourdier
>> <vincent.bourd...@gmail.com> wrote:
>> > So the question is : it is ok to modify geometry/graph in the Handler
>> even ?
>>
>> It all depends upon what modifications you are making.  If you are
>> modify content of parents from within a callback/handler then you'll
>> be invalidating iterators that are held by the function that called
>> your callback, so this is very definitely something you should avoid
>> doing.
>>
>> Beyond that there is much I can add, it's your code, there are many
>> things you can do wrong and frankly is pointless any of us attempting
>> guessing what these many things might be.  It's you code, you have it
>> front of you, you have a debugger and capability to step through the
>> code in the debugger, go do it.
>>
>> Robert.
>> _______________________________________________
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to