hi there,
        thanks for your reply. well, yes, I have almost extended all the
classes I need so that every time something has been added/changed (in
Geometry and Appearance, Transform3D, etc.) in the live scene, that will
inform my Event Catcher. But it seems very very tedious. I need to browse
all the classes I need in the docs, just to extend the needed method (ONLY
about 1 or 2 methods in my needed class, i.e. BranchGroup, Shape3D,
TransformGroup, etc.).
        About a Thread watcher idea, since what I'm doing so far is quite
tedious, I thought about this before. I know that it would eat up a lot of
resources. --- but I believe java3D has also a Thread that does something
like this. (I stand to be corrected).
        My main objective is, once I have registered that event in the event
watcher, I'll be able to undo it later. This latter part is simpler to do (I
have already implemented it using javax.swing.undo. -- Given an live-scene
event, then undo it). The bottom line is detecting that event.
        any hints from Sun? or can I request for a class (much like my
EventCatcher) in the future release of java3D? (It's a simple class I
believe).

daniel


-----Original Message-----
From: Kasparian, Raffi J. [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 22, 2001 2:01 AM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] watcher Thread


Have you considered subclassing your scene graph Nodes (the ones you're
interested in) like this? It might require a lot of tedious subclassing but
I don't think there is any other way to get the Java3D system to notify you
of scene graph changes. The other way might be to have a thread constantly
traversing the scenegraph and comparing its current state to the previous
state (stored by the thread during the previous traversal) but this would
require tons of permissions to be set, lots of memory, lots of processing
time and would surely cripple the performance of your application.

class MyEventCatcher{
    public void addChild( Group parent, Node child ){
        System.out.println( "addChild" );
    }
    public void setAppearance( Shape3D shape, Appearance app ){
        System.out.println( "setAppearance" );
    }
}

class SomeClass{
    MyEventCatcher eventCatcher = new MyEventCatcher();

    public TransformGroup sceneTG = new TransformGroup(){
        public void addChild( Node child ){
            super.addChild( child );
            eventCatcher.addChild( this, child );
        }
    };
    public Shape3D shape = new Shape3D(){
        public void setAppearance( Appearance app ){
            super.setAppearance( app );
            eventCatcher.setAppearance( this, app );
        }
    };
}


-----Original Message-----
From: Daniel Balaguer Yagan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 21, 2001 9:24 AM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] watcher Thread


hi there again,
        has anyone of you guys implemented a Thread that watches the state
of the live scene graph? this Thread specifically watches which of the
objects in the live scene have changed their Geometry and Appearance
components, and then performs a certain action.

daniel

===========================================================================
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".

Reply via email to