From: Braden M. <br...@en...> - 2002-08-30 03:41:58
|
On Thu, 2002-08-29 at 19:19, Jamie Walch wrote: > I have a couple of things I can't see how to do with the current API. > > 1) Iterate over all named nodes in a scene graph. I've had to modify > VrmlNamespace to add a method returning a const reference to the named > nodes. Is there a way of doing this without modifying the source code? Not an especially easy way. You could write a NodeVisitor to traverse the scene graph and collect the named nodes for. But I can imagine that would be a rather frustrating endeavor when it would be so easy to get this information from the Scope. (Scope has replaced VrmlNamespace on the main branch.) I can see incorporating the change you describe into OpenVRML; but I'd like to hear more about why you need it. > 2) Access the named nodes inside a PROTO node. The idea is that if I'm using > a PROTO to instantiate several objects many times, I still want to be able > access the objects named within it, so that, for example, if I have a PROTO > containing a named node Car, which is instantiated twice, once with DEF A... > and once with DEF B... then I can find out that my scene contains objects > called A.Car and B.Car. Perhaps I can use eventOuts to make the nodes > accessible via the PROTO interface, but I'm not sure how that would work. That's what you would need to do. OpenVRML's API doesn't expose the implementation details of a node. A major goal of the new architecture is to treat all nodes basically the same, regardless of whether they're implemented natively or as PROTOs. -- Braden McDaniel e-mail: <br...@en...> <http://endoframe.com> Jabber: <br...@ja...> |