Hi Sam,

You have complete control over what you do before and after traversal,
there really isn't any need to have a finalize method as it would only
restrict what users can do over what they can already do.

If you wanted an finialize method in your visitor  then just write a
method like:

  MyVisitor : public NodeVisitor {

       void apply(...) // all my apply overrides your need...

       void process(Node* node)
       {
            // do what you want to initialize the visitor prior
            // to traversing the scene graph
            node->accept(node);
             // do what you want after traversal
       }
   };

   MyVisitor myvistor;
   myvisitor->process(node);

The visitor implementation is deliberately designed to allow you to be
flexible, it's up to you how you want to go about implementing the
details for the purpose of your application.

Robert.

On Tue, Jan 25, 2011 at 10:21 AM, Sam Warns <the_vincu...@hotmail.com> wrote:
> Hi Robert,
>
> the second half of my post is about the second option you was talking about.
> The apply only gathers the nodes in question and does nothing else then there 
> is another method that performs the removal from parent.
> But the issue with that is, that if I do not call this method, no removal is 
> done.
> That was, what I was talking about. The visitor finished its work but as long 
> as the user do not call an additional method the removal from parent has not 
> been done yet.
>
> I was hoping for a finish method that is automatically called after the 
> visitors work has been finished. This finish method could then perform the 
> necessary removal operation (or any other).
>
>
> Thank you!
>
> Cheers,
> Sam
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=35944#35944
>
>
>
>
>
> _______________________________________________
> 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