rem: traverse(scene, osgFunctionFunctor1(dontEnterTrans), osgFunctionFunctor2(leave         ));
add: traverse(scene, osgTypedFunctionFunctor1CPtrRef<Action::ResultE, NodePtr        >(dontEnterTrans), osgTypedFunctionFunctor2CPtrRef<Action::ResultE, NodePtr, Action::ResultE>(leave         ));
context: int main(int argc, char **argv){    // OSG init    osgInit(argc,argv);    // GLUT init    int winid = setupGLUT(&argc, argv);    // the connection between GLUT and OpenSG    GLUTWindowPtr gwin= GLUTWindow::create();    gwin->setId(winid);    gwin->init();    // create the scene        // create a pretty simple graph: a Group with two Transforms as children,    // each of which carries a single Geometry.        // The scene group        NodePtr  scene = Node::create();    GroupPtr g     = Group::create();        beginEditCP(scene, Node::CoreFieldMask | Node::ChildrenFieldMask);    scene->setCore(g);        // The cylinder and its transformation    NodePtr cyl = makeCylinder( 1.4, .3, 8, true, true, true );            cyltrans = Transform::create();    NodePtr cyltransnode = Node::create();    beginEditCP(cyltransnode, Node::CoreFieldMask | Node::ChildrenFieldMask);    {        cyltransnode->setCore (cyltrans);        cyltransnode->addChild(cyl     );    }    endEditCP  (cyltransnode, Node::CoreFieldMask | Node::ChildrenFieldMask);        // add it to the scene    scene->addChild(cyltransnode);        // The torus and its transformation    NodePtr torus = makeTorus( .2, 1, 8, 12 );            tortrans = Transform::create();    NodePtr tortransnode = Node::create();    beginEditCP(tortransnode, Node::CoreFieldMask | Node::ChildrenFieldMask);    {        tortransnode->setCore (tortrans);        tortransnode->addChild(torus   );    }    endEditCP  (tortransnode, Node::CoreFieldMask | Node::ChildrenFieldMask);        // add it to the scene    scene->addChild(tortransnode);    // ok, scene done    endEditCP(scene, Node::CoreFieldMask | Node::ChildrenFieldMask);                 // now traverse the scene        /*        There are four variants of the traverse() function.                It can either be called for a single node or for a vector nodes. And        they can either call a function just when entering the node, or in        addition when leaving the node. The signatures of the functions are:                enter functions:             Action::ResultE enter(NodePtr& node);                    leave functions:             Action::ResultE leave(NodePtr& node, Action::ResultE res);               The functions that are called are wrapped in functors. A functor is an        object that contains a function or method, which can be called through        the functor. OpenSG supports two kinds of user functors: the function        and method functors.                A function functor is created using osgFunctionFunctorX(function),        where X is the number of parameters of the function.                 A method functor is a wrapped call to a method of a specific instance        of a class. It is created using osgMethodFunctorXPtr(instance,        method), again X being the number of parameters of the function. It's        harder to explain than to understand what a method functor does, so        just take a look at the examples below.    */         cerr << "Variant 1: just print every encountered node" << endl;    traverse(scene, osgFunctionFunctor1(enter));         cerr << endl          << "Variant 2: just print every encountered node, using a vector"          << " of nodes" << endl;             vector<NodePtr> nodevec;    nodevec.push_back(tortransnode);    nodevec.push_back(cyltransnode);        traverse(nodevec, osgFunctionFunctor1(enter));          cerr << endl          << "Variant 3: just print every encountered node on entering"         << " and leaving" << endl;    traverse(scene, osgFunctionFunctor1(enter), osgFunctionFunctor2(leave));           // now use a travstate object to hold additional data       travstate t;        cerr << endl          << "Variant 4: use an object to hold state for indentation" << endl;    traverse(scene, osgMethodFunctor1Ptr(&t, &travstate::enter),                     osgMethodFunctor2Ptr(&t, &travstate::leave));           cerr << endl          << "Variant 5: don't descend into transforms" << endl;    traverse(scene, osgFunctionFunctor1(dontEnterTrans),                     osgFunctionFunctor2(leave         ));          cerr << endl          << "Variant 6: quit when you find a geometry" << endl;    traverse(scene, osgFunctionFunctor1(quitGeo),                     osgFunctionFunctor2(leave  ));         // create the SimpleSceneManager helper    mgr = new SimpleSceneManager;    // tell the manager what to manage    mgr->setWindow(gwin );    mgr->setRoot  (scene);    // show the whole scene    mgr->showAll();    // GLUT main loop    glutMainLoop();    return 0;}