Thanks Gerrit.
  so traverse function can be called in the same 5-6 ways as done the traverse 
projects in the samples ?
What do I have to do if I want to pass some other parameter to enter or leave ?
and cant I call leave function alone in the traverse, or I can call it with 
enter only always ?

-shailesh


On Thu, 02 Sep 2004 Gerrit Voss wrote :
>
>Hi,
>
>On Thu, 2004-09-02 at 01:48, shailesh kumar wrote:
> >   HI
> > I am using OpenSGFunctors to traverse a scenegraph .
> > my code is like this :
> >
> > Action::ResultE myfunction(NodePtr& node,UInt32 mask)
> > {
> > /*.....................
> > */
> >     return Action::Continue;
> > }
> >
> > void setAllNodesVisible(NodePtr nptr,UInt32 mask){
> >         traverse(nptr,
> >              osgTypedFunctionFunctor2CPtrRef<Action::ResultE,
> >              NodePtr ,UInt32>enterSetVisible));
> >
> > }
> >
> > But I am getting a compilation error :
> > error C2665: 'osg::traverse' : none of the 4 overloads can convert 
> > parameter 2 from type 
> > 'osg::TypedFunctionFunctor2<RetT,CallArgT,ArgsT,SizeTraitsT>'
> >         with
> >         [
> >             RetT=osg::Action::ResultE,
> >             CallArgT=osg::CPtrRefCallArg<osg::NodePtr>,
> >             ArgsT=osg::ArgsCollector<osg::UInt32>,
> >             SizeTraitsT=osg::DefaultFunctorSizeTraits
> >         ]
> >
> > In the tutorials it is written that : a functor is created like this -
> > osgTypedFunctionFunctorXCPtrRef<returnType, Argument1, Argument2, ..., 
> > ArgumentX>(functionName)
> >
> > and I am doing the same thing .
>
>yes and the error is that there is no traverse function to match your
>arguments. Your functor is ok but is has the wrong signature to be
>used with traverse.
>
>The signature used for the one call traverse functions is
>
>Action::ResultE (*)(NodePtr &);
>
>the separate enter / leave versions need
>
>Action::ResultE (*)(NodePtr &                 );  // for enter
>Action::ResultE (*)(NodePtr &, Action::ResultE);  // for leave
>
>but your signature is
>
>Action::ResultE (*)(NodePtr&, UInt32);
>
>hence the error you see.
>
>there is a way to get a state into the traversals. I'll try to setup (or
>find) a simple example for this and send it around.
>
>regards,
>   gerrit
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by BEA Weblogic Workshop
>FREE Java Enterprise J2EE developer tools!
>Get your free copy of BEA WebLogic Workshop 8.1 today.
>http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
>_______________________________________________
>Opensg-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to