Lee,
I think it's an excellent suggestion (and I'm hoping Sun reads your
idea). We intend to be creating scenes that will consist of many parts
that will be attached and detached as the user moves around. For our
purposes using lots of Branchgroups will probably work fine but I can
see where it would be REALLY nice to easily attach and detach
TransformGroups.
- John Wright
Starfire Research
"J. Lee Dixon" wrote:
>
> Well, as for keeping only BranchGroup.detach()... that is not the only
> place you can detach. As I mentioned, you can detach a child from its
> parent using Group.removeChild(index). As for optimization, you can
> only do this if the capability bit is set. (Personally, I'm doing my
> detach before the scene is live anyway.) So this whole question is
> really just about ease of use.
>
> How about this, in addition to the existing Group.removeChild(index), we
> have Group.removeChild(Node). Then, the Group parent could search its
> list, find the node, and call .removeChild(index) on its own. Then, one
> step further, Node.removeFromParent() would just call
> parent.removeChild(this). Does this make sense?
>
> It's not that I can't do the Node.getParent(), then
> Node.getChild(index), and do the search myself. I just don't want
> EVERYBODY to half to write the SAME piece of code, assuming of course
> that I'm not the only one that would want it. But you know what happens
> when you ASSume... ;)
>
> And, of course, the function would throw an exception if the capability
> bit was not set.
>
> -Lee
>
> -----Original Message-----
> From: Matthew Flagg [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 01, 2000 9:43 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [JAVA3D] detach() suggestion
>
> Chris and the list,
> Probably by keeping detach() in only BranchGroup it is easier to
> do
> the optimizations when a scenegraph is compiled. That would be my
> guess.
>
> -----Original Message-----
> From: Christopher Collins [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 01, 2000 9:16 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [JAVA3D] detach() suggestion
>
> Rob and everyone else,
>
> On a related note then... why is there only BranchGroup.detach() and not
> a
> general Node.detach()? It makes scenes much larger when you have many
> shapes, each with it's own BranchGroup to allow the shapes to be
> detachable!
> It would be more convenient to be able to have TransformGroup.detach(),
> Shape3D.detach(), etc.
>
> Chris
>
> _____________________________________________________________
> Christopher Collins http://www.ucs.mun.ca/~a62cmc
> Oceanic Consulting Corporation (709) 754-2357 [home]
> Memorial University of Newfoundland (709) 749-4383 [cell]
>
> -----Original Message-----
> From: Rob Nugent [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 01, 2000 10:23 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [JAVA3D] detach() suggestion
>
> J. Lee,
>
> I made this mistake (and asked this question a few months back).
>
> There is a detach() method in BranchGroup that works fine.
>
> Rob
>
> J. Lee Dixon wrote:
>
> > Why is there not a Node.detach() function? In order to detach a Node
> > child from its parent, currently you have to go to the parent, then
> > search the list of its children to find the index of the one you want
> to
> > detach, then call Group.removeChild(index). (Am I missing some better
> > way of doing this?)
> >
> > Would anyone else like to see this function? How about it, Sun?
> >
> > J. Lee Dixon
> > Software Engineer
> > SAIC - Celebration, FL
> > [EMAIL PROTECTED]
> >
> >
> ========================================================================
> ===
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> > of the message "signoff JAVA3D-INTEREST". For general help, send
> email to
> > [EMAIL PROTECTED] and include in the body of the message "help".
>
> --
>
> Rob Nugent
> Development Manager
> PeerLogic
> [EMAIL PROTECTED]
> http://www.peerlogic.com
> Tel: +44 (0) 1489 585503
> Fax: +44 (0) 1489 881363
>
> ========================================================================
> ===
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff JAVA3D-INTEREST". For general help, send email
> to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
> ========================================================================
> ===
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff JAVA3D-INTEREST". For general help, send email
> to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
> ========================================================================
> ===
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff JAVA3D-INTEREST". For general help, send email
> to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JAVA3D-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".