Package javax.media.j3d

Examples of javax.media.j3d.SharedGroup


      }
      return clonedShape;
    } else if (node instanceof Link) {
      Link clonedLink = (Link)node.cloneNode(true);
      // Force duplication of shared groups too
      SharedGroup sharedGroup = clonedLink.getSharedGroup();
      if (sharedGroup != null) {
        SharedGroup clonedSharedGroup = clonedSharedGroups.get(sharedGroup);
        if (clonedSharedGroup == null) {
          clonedSharedGroup = (SharedGroup)cloneNode(sharedGroup, clonedSharedGroups);
          clonedSharedGroups.put(sharedGroup, clonedSharedGroup);         
        }
        clonedLink.setSharedGroup(clonedSharedGroup);
View Full Code Here


        Shape3D sh;
        sapp = new Appearance();
        sapp.setMaterial(side);
        sh = new Shape3D(shaft, sapp);
        sh.setPickable(false);
        shafts[0] = new SharedGroup();
        shafts[0].addChild(sh);

        sapp = new Appearance();
        sapp.setMaterial(sideWater);
        sh = new Shape3D(shaft, sapp);
        shafts[1] = new SharedGroup();
        shafts[1].addChild(sh);
       
        return shafts;
    }
View Full Code Here

    Sphere bSphere = new Sphere(0.1f,bSphereApp);


    //Assign the sphere to a SharedGroup to use it multiple
    //times in the scene.
    SharedGroup sgSphere = new SharedGroup();
    sgSphere.addChild(bSphere);



    //Generate a two-dimensional array of rows*columns spheres.
    //rowStep and columnStep define the distance between the spheres.
View Full Code Here

    Sphere bSphere = new Sphere(0.1f,bSphereApp);


    //Assign the sphere to a SharedGroup to use it multiple
    //times in the scene.
    SharedGroup sgSphere = new SharedGroup();
    sgSphere.addChild(bSphere);



    //Generate a two-dimensional array of rows*columns spheres.
    //rowStep and columnStep define the distance between the spheres.
View Full Code Here

/* 186 */       String tempFileName = this.fileName;
/* 187 */       int fileNum = 0;
/* 188 */       while (new File(tempFileName).exists()) {
/* 189 */         if (storedRefList.get(tempFileName) != null)
/*     */         {
/* 192 */           SharedGroup storedGroup = (SharedGroup)storedRefList.get(tempFileName);
/*     */
/* 194 */           Link newLink = new Link(storedGroup);
/* 195 */           s.addChild(newLink);
/*     */         }
/*     */         else
/*     */         {
/* 199 */           J3dLwoParser objParser = new J3dLwoParser(tempFileName, debugVals);
/*     */
/* 201 */           objParser.createJava3dGeometry();
/* 202 */           TransformGroup t = new TransformGroup();
/* 203 */           SharedGroup newSharedGroup = new SharedGroup();
/* 204 */           storedRefList.put(tempFileName, newSharedGroup);
/* 205 */           newSharedGroup.addChild(t);
/* 206 */           Link newLink = new Link(newSharedGroup);
/* 207 */           s.addChild(newLink);
/* 208 */           if (objParser.getJava3dShapeList() != null) {
/* 209 */             Enumeration e = objParser.getJava3dShapeList().elements();
/*     */
/* 211 */             while (e.hasMoreElements()) {
/* 212 */               t.addChild((Shape3D)e.nextElement());
/*     */             }
/*     */           }
/*     */         }
/* 216 */         fileNum++;
/* 217 */         String fileNumString = String.valueOf(fileNum);
/* 218 */         if (fileNum < 10)
/* 219 */           fileNumString = "00" + fileNumString;
/* 220 */         else if (fileNum < 100)
/* 221 */           fileNumString = "0" + fileNumString;
/* 222 */         tempFileName = fileNameBase + fileNumString + ".lwo";
/*     */       }
/* 224 */       this.behaviors = null;
/* 225 */       if (loadBehaviors != 0) {
/* 226 */         createSwitchBehavior(s);
/*     */       }
/* 228 */       this.geometryGroup = s;
/*     */     }
/*     */     else {
/* 231 */       this.geometryGroup = new Group();
/* 232 */       if (storedRefList.get(this.fileName) != null)
/*     */       {
/* 234 */         SharedGroup storedGroup = (SharedGroup)storedRefList.get(this.fileName);
/*     */
/* 236 */         Link newLink = new Link(storedGroup);
/* 237 */         this.geometryGroup.addChild(newLink);
/*     */       }
/*     */       else
/*     */       {
/* 241 */         J3dLwoParser objParser = new J3dLwoParser(this.fileName, debugVals);
/*     */
/* 243 */         objParser.createJava3dGeometry();
/* 244 */         TransformGroup t = new TransformGroup();
/* 245 */         if (objParser.getJava3dShapeList() != null) {
/* 246 */           Enumeration e = objParser.getJava3dShapeList().elements();
/* 247 */           while (e.hasMoreElements()) {
/* 248 */             t.addChild((Shape3D)e.nextElement());
/*     */           }
/*     */         }
/* 251 */         SharedGroup newSharedGroup = new SharedGroup();
/* 252 */         newSharedGroup.addChild(t);
/* 253 */         Link newLink = new Link(newSharedGroup);
/* 254 */         this.geometryGroup.addChild(newLink);
/* 255 */         storedRefList.put(this.fileName, newSharedGroup);
/*     */       }
/*     */     }
View Full Code Here

/*    */   {
/* 50 */     super(symbol, control);
/*    */   }
/*    */
/*    */   protected SceneGraphObject createNode() {
/* 54 */     return new SharedGroup();
/*    */   }
View Full Code Here

/*    */
/*    */   public LinkState(SymbolTableData symbol, Controller control)
/*    */   {
/* 57 */     super(symbol, control);
/* 58 */     if (this.node != null) {
/* 59 */       SharedGroup sg = ((Link)this.node).getSharedGroup();
/* 60 */       this.sharedGroup = control.getSymbolTable().addReference(sg);
/* 61 */       this.sharedGroupSymbol = control.getSymbolTable().getSymbol(this.sharedGroup);
/*    */     }
/*    */   }
View Full Code Here

/*    */   public void writeObject(DataOutput out) throws IOException {
/* 66 */     super.writeObject(out);
/*    */
/* 68 */     if (this.sharedGroupSymbol.nodeState == null) {
/* 69 */       out.writeInt(-1);
/* 70 */       SharedGroup sg = ((Link)this.node).getSharedGroup();
/* 71 */       this.control.writeSharedGroup(out, sg, this.sharedGroupSymbol);
/*    */     } else {
/* 73 */       out.writeInt(this.sharedGroupSymbol.nodeID);
/*    */     }
/*    */   }
View Full Code Here

TOP

Related Classes of javax.media.j3d.SharedGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.