HI Boris,

I've just created a simple test case

    public BranchGroup[] iotest13() {
        Appearance app1 = new Appearance();

        PolygonAttributes poly = new PolygonAttributes();
        app1.setPolygonAttributes( poly );

        TriangleArray geom1 = new TriangleArray( 3, GeometryArray.COORDINATES);
        geom1.setCoordinates( 0, new double[] { 0, 0, 0,
                                               1,0,0,
                                               1,1,0
        });
        Shape3D s3d1 = new Shape3D( geom1, app1 );
        BranchGroup bg1 = new BranchGroup();
        BranchGroup root1 = new BranchGroup();
        root1.addChild( bg1 );
        bg1.addChild( s3d1 );

        CrossReferenceBG crossRef = new CrossReferenceBG( geom1 );
        BranchGroup bg2 = new BranchGroup();
        BranchGroup root2 = new BranchGroup();
        root2.addChild( bg2 );
        bg2.addChild( crossRef );

        root1.setCapability( BranchGroup.ALLOW_DETACH );
        root2.setCapability( BranchGroup.ALLOW_DETACH );

        return new BranchGroup[] { root1, root2 };
    }


Where CrossReferenceBG is a BranchGroup that maintains an internal reference
to the object passed to it a construction (see attachment).

This test works, from your description I think it's similar to your scene. Can
you spot any major differences from your scene graph ?

Rgds

Paul

----------------------------------------------------------
Paul Byrne                      Email : [EMAIL PROTECTED]
Sun Microsystems                Phone : (650) 786 9926
Visualization Software Group    Fax   : (650) 786 5852
----------------------------------------------------------


>MIME-Version: 1.0
>Date: Mon, 14 May 2001 13:30:04 -0700
>From: Boris Zeldin <[EMAIL PROTECTED]>
>Subject: Re: [JAVA3D] Crash in j3dfly serialization
>Comments: To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>
>Paul,
>
>It is not that easy to isolate the code exhibiting the
>problem. I will try to prepare a workable example in
>the next couple days. The problem in my opinion comes
>from the fact that I reference a NodeComponent that is
>"NOT SHARED" by BranchGroups.
>Let me explain a little.
>
>I have a nested hierarchy of BranchGroup Objects (As
>it is shown in the diagram in my previous post to
>Java3D group).
>That is I have something like that
>
>BranchGroup1
>|
>|
>----BranchGroup2
>     |
>     |
>     ---- BranchBroup3
>
>( and so on)
>
>Now I have a texture(Texture3) which is a part of say
>BranchGroup3. This texture is not "shared" with
>BranchGroup1. Nevertheless I customized BranchGroup1
>in such a way so that it
>helds a reference to all available textures
>including Texture3 (to save time/memory).
>I assume (though I am not certain from following
>j3dfly serialization code) that
>you make tables of only those NodeComponents that are
>available in BranchGroupRetained. In my situation,
>BranchGroup1 does not have any geometry. It is just an
>
>assembler of a bunch of models( which might be also
>nested). So when I am at
>createSceneGraphObjectReferences()
>for BranchGroup1 none of the tables related to
>NodeComponents is even initialized.
>As a result I am getting a crash.
>
>Thank you
>
>Boris
>

***************************************************************
"Copyright (c) 2001 Sun Microsystems, Inc. All Rights Reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

-Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

-Redistribution in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

Neither the name of Sun Microsystems, Inc. or the names of contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.

This software is provided "AS IS," without a warranty of any kind. ALL
EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE
LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS
LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

You acknowledge that Software is not designed,licensed or intended for use in
the design, construction, operation or maintenance of any nuclear facility."

****************************************************************************


CrossReferenceBG.java

Reply via email to