java3d
  1. java3d
  2. JAVA3D-563

Background cloneNode() fails with Background geometry

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: current
    • Fix Version/s: 1.5.2
    • Component/s: j3d-core
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      563

      Description

      Background cloneNode() fails when Background geometry BranchGroup is present.
      The Geometry BranchGroup should be cloned as well, but it is only referenced.

      EXCEPTION AS FOOLOWS:

      javax.media.j3d.IllegalSharingException: Background: Background geometry
      BranchGroup cannot be referenced by multiple Background node.

      Fix is to add a call to cloneNode() to duplicateAttributes() in Background.java.

        Activity

        Hide
        mcneillk added a comment -

        Issue is fixed, tested, and ready for integration. It involves adding a simple
        nested call to cloneTree().

        Please let me know if I can commit it myself.

        Index: Background.java
        ===================================================================
        RCS file: /cvs/j3d-core/src/classes/share/javax/media/j3d/Background.java,v
        retrieving revision 1.6
        diff -u -r1.6 Background.java
        — Background.java 9 Feb 2007 17:17:51 -0000 1.6
        +++ Background.java 30 Jan 2008 18:03:56 -0000
        @@ -716,7 +716,8 @@
        attr.getColor(c);
        rt.initColor(c);
        rt.initApplicationBounds(attr.getApplicationBounds());

        • rt.initGeometry(attr.getGeometry());
          + // issue 563: added call to cloneTree()
          + rt.initGeometry((BranchGroup) attr.getGeometry().cloneTree(true));
          rt.initImage((ImageComponent2D) getNodeComponent(
          attr.getImage(),
          forceDuplicate,
        Show
        mcneillk added a comment - Issue is fixed, tested, and ready for integration. It involves adding a simple nested call to cloneTree(). Please let me know if I can commit it myself. Index: Background.java =================================================================== RCS file: /cvs/j3d-core/src/classes/share/javax/media/j3d/Background.java,v retrieving revision 1.6 diff -u -r1.6 Background.java — Background.java 9 Feb 2007 17:17:51 -0000 1.6 +++ Background.java 30 Jan 2008 18:03:56 -0000 @@ -716,7 +716,8 @@ attr.getColor(c); rt.initColor(c); rt.initApplicationBounds(attr.getApplicationBounds()); rt.initGeometry(attr.getGeometry()); + // issue 563: added call to cloneTree() + rt.initGeometry((BranchGroup) attr.getGeometry().cloneTree(true)); rt.initImage((ImageComponent2D) getNodeComponent( attr.getImage(), forceDuplicate,
        Hide
        mcneillk added a comment -

        Sorry, forgot to test for null; new fix as follows...

        Index: Background.java
        ===================================================================
        RCS file: /cvs/j3d-core/src/classes/share/javax/media/j3d/Background.java,v
        retrieving revision 1.6
        diff -u -r1.6 Background.java
        — Background.java 9 Feb 2007 17:17:51 -0000 1.6
        +++ Background.java 30 Jan 2008 21:29:05 -0000
        @@ -716,7 +716,8 @@
        attr.getColor(c);
        rt.initColor(c);
        rt.initApplicationBounds(attr.getApplicationBounds());

        • rt.initGeometry(attr.getGeometry());
          + // issue # 563: add call to cloneTree()
          + rt.initGeometry((BranchGroup) (attr.getGeometry() == null ? null :
          attr.getGeometry().cloneTree(true)));
          rt.initImage((ImageComponent2D) getNodeComponent(
          attr.getImage(),
          forceDuplicate,
        Show
        mcneillk added a comment - Sorry, forgot to test for null; new fix as follows... Index: Background.java =================================================================== RCS file: /cvs/j3d-core/src/classes/share/javax/media/j3d/Background.java,v retrieving revision 1.6 diff -u -r1.6 Background.java — Background.java 9 Feb 2007 17:17:51 -0000 1.6 +++ Background.java 30 Jan 2008 21:29:05 -0000 @@ -716,7 +716,8 @@ attr.getColor(c); rt.initColor(c); rt.initApplicationBounds(attr.getApplicationBounds()); rt.initGeometry(attr.getGeometry()); + // issue # 563: add call to cloneTree() + rt.initGeometry((BranchGroup) (attr.getGeometry() == null ? null : attr.getGeometry().cloneTree(true))); rt.initImage((ImageComponent2D) getNodeComponent( attr.getImage(), forceDuplicate,
        Hide
        jada added a comment -

        Thanks for the suggested fix. I have integrated it into the 1.5.2 source tree,
        please verify that it fixes this issue.

        Show
        jada added a comment - Thanks for the suggested fix. I have integrated it into the 1.5.2 source tree, please verify that it fixes this issue.
        Hide
        kcr added a comment -

        Set target milestone to 1.5.2

        Show
        kcr added a comment - Set target milestone to 1.5.2
        Hide
        jada added a comment -

        Fixed in 1.5.2.

        Show
        jada added a comment - Fixed in 1.5.2.

          People

          • Assignee:
            mcneillk
            Reporter:
            mcneillk
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: