Re: scene graph subtree labelling

New Message Reply Date view Thread view Subject view Author view

Brian Furtaw (brian++at++sgi.com)
Mon, 06 Dec 1999 14:32:23 -0500


Robert you can create a pfuTraverser which go thropugh your scenegraph
looking for pfSwitch and pfDCS nodes by type instead of by name. The
best example of that is in
/usr/share/Performer/src/pguide/libpf/C++/bench.C

Read through the pfuTraverser man page and search for the word Traverser
in the bench.C code,

Key points to remember

1. Init your traverser pfuInitTraverser
2. Your traverser callback should return PFTRAV_CONT to keep traversing
the tree.
3. You can use conditionals like `if
(node->isOfType(pfDCS::getClassType()))' to find the types of nodes you
are interested in.
4. Specify wether it is pre or post traversal callback.
5. Call pfuTraverse with the root of your copied tree to get the work
done.
6. By default pfuInitTraverser enables the traversal to all the children
of a pfSwitch node, it is part of the pfuTraverser's mode flag.

Brian

Robert Wolfe wrote:
>
> Hi,
>
> In an effort to develop a nice generic way of duplicating
> example models of different vehicles in a simulation
> and allowing manipulating of articulations and switches
> in those models, I would like to know if there is a way
> to traverse the subtree representing a cloned model in order
> to discover any pfDCS or pfSwitch (without knowing their
> names beforehand) so that user data corresponding to a model ID
> may be assigned to each one.
>
> Thanks,
>
> Robert
> --
> Robert Wolfe, consultant
> Training Technology
> Defence and Civil Institute of Environmental Medicine
> 1133 Sheppard Ave. West,
> P.O. Box 2000,
> Toronto, Ontario
> CANADA
> M3M 3B9
> (416) 635-2065
> robert.wolfe++at++dciem.dnd.ca
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com

-- 
    ----oOOo----    ----oOOo----    ----oOOo----    ----oOOo----

Brian Furtaw (brian++at++sgi.com) Graphics Guru Office:(301)572-3293 Fax: (301)572-3280 12200-G Plum Orchard Drive OpenGL/Performer/OpenInventor/ImageVision Silver Spring, Maryland 20904 Optimizer/React/PCI Device Drivers


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Dec 06 1999 - 11:47:33 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.