Package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d

Examples of com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.SceneGraphObjectState


/* 130 */       matrix = this.control.readMatrix4d(in);
/* 131 */       Transform3D trans = new Transform3D(matrix);
/* 132 */       tg.setTransform(trans);
/*     */     }
/*     */
/* 135 */     SceneGraphObjectState tmp = this.control.readObject(in);
/*     */
/* 137 */     if ((tmp instanceof PlatformGeometryState))
/* 138 */       this.platformGeom = ((PlatformGeometryState)tmp);
/*     */     else {
/* 140 */       this.platformGeom = null;
View Full Code Here


/*     */   public SceneGraphObjectState createState(SymbolTableData symbol)
/*     */   {
/* 196 */     SceneGraphObject obj = symbol.getJ3dNode();
/* 197 */     if (obj == null) return this.nullObject;
/*     */ String name = obj.getClass().getName();
/*     */     SceneGraphObjectState ret;
/*     */     try
/*     */     {
/* 203 */       Class state = Class.forName("com.sun.j3d.utils.scenegraph.io.state." + name + "State", true, this.classLoader);
/* 204 */       ret = constructStateObj(symbol, state, obj.getClass());
/*     */     } catch (ClassNotFoundException e) {
/* 206 */       ret = checkSuperClasses(symbol);
/* 207 */       if (!(obj instanceof SceneGraphIO))
/* 208 */         System.out.println("Could not find com.sun.j3d.utils.scenegraph.io.state." + name + "State, using superclass " + ret.getClass().getName());
/* 209 */       if (ret == null) {
/* 210 */         throw new SGIORuntimeException("No State class for " + obj.getClass().getName());
/*     */       }
/*     */     }
/*     */
View Full Code Here

/* 216 */     return ret;
/*     */   }
/*     */
/*     */   private SceneGraphObjectState constructStateObj(SymbolTableData symbol, Class state, Class objClass)
/*     */   {
/* 222 */     SceneGraphObjectState ret = null;
/*     */     try
/*     */     {
/* 225 */       Constructor construct = state.getConstructor(new Class[] { SymbolTableData.class, Controller.class });
/*     */
/* 229 */       ret = (SceneGraphObjectState)construct.newInstance(new Object[] { symbol, this });
View Full Code Here

/*     */   }
/*     */
/*     */   public SceneGraphObjectState readObject(DataInput in) throws IOException {
/* 298 */     int classID = in.readInt();
/*     */
/* 300 */     SceneGraphObjectState state = null;
/*     */
/* 302 */     if (classID == -1)
/* 303 */       return this.nullObject;
/* 304 */     if (classID == 0) {
/* 305 */       String stateClassName = in.readUTF();
/*     */       try
/*     */       {
/* 308 */         Class cl = Class.forName(stateClassName, true, this.classLoader);
/*     */
/* 310 */         Constructor construct = cl.getConstructor(new Class[] { SymbolTableData.class, Controller.class });
/*     */
/* 316 */         state = (SceneGraphObjectState)construct.newInstance(new Object[] { null, this });
/*     */       }
/*     */       catch (ClassNotFoundException e)
/*     */       {
/* 321 */         throw new IOException("Error Loading State Class " + stateClassName + "  " + e.getMessage());
/*     */       } catch (NoSuchMethodException ex) {
/* 323 */         throw new IOException("1 Broken State class for " + stateClassName + "  " + ex.getMessage());
/*     */       }
/*     */       catch (InvocationTargetException exc) {
/* 326 */         exc.printStackTrace();
/* 327 */         throw new IOException("2 Broken State class for " + stateClassName);
/*     */       }
/*     */       catch (IllegalAccessException exce) {
/* 330 */         throw new IOException("3 Broken State class for " + stateClassName);
/*     */       }
/*     */       catch (InstantiationException excep) {
/* 333 */         throw new IOException("4 Broken State class for " + stateClassName);
/*     */       }
/*     */     }
/*     */     else {
/* 337 */       state = createCoreState(classID);
/*     */     }
/*     */
/* 340 */     state.readObject(in);
/*     */
/* 342 */     return state;
/*     */   }
View Full Code Here

/*     */
/*     */   protected void readNodeComponents(DataInput in)
/*     */     throws IOException
/*     */   {
/* 389 */     int count = in.readInt();
/*     */     SceneGraphObjectState nodeComponent;
/* 391 */     for (int i = 0; i < count; i++)
/*     */     {
/* 394 */       int nodeID = in.readInt();
/* 395 */       long nextNC = in.readLong();
/*     */
View Full Code Here

/*     */   }
/*     */
/*     */   public void writeSharedGroup(DataOutput out, SharedGroup sharedGroup, SymbolTableData symbol)
/*     */     throws IOException
/*     */   {
/* 405 */     SceneGraphObjectState state = createState(sharedGroup, symbol);
/* 406 */     this.symbolTable.startUnsavedNodeComponentFrame();
/* 407 */     writeObject(out, state);
/* 408 */     writeNodeComponents(out);
/* 409 */     this.symbolTable.endUnsavedNodeComponentFrame();
/*     */   }
View Full Code Here

/*     */   }
/*     */
/*     */   public int readSharedGroup(DataInput in)
/*     */     throws IOException
/*     */   {
/* 416 */     SceneGraphObjectState state = readObject(in);
/* 417 */     readNodeComponents(in);
/*     */
/* 419 */     return state.getNodeID();
/*     */   }
View Full Code Here

/*     */     }
/* 511 */     Class j3dClass = getNodeClassFromID(classID - 1);
/* 512 */     String j3dClassName = j3dClass.getName();
/* 513 */     String stateClassName = "com.sun.j3d.utils.scenegraph.io.state." + j3dClassName + "State";
/*     */
/* 515 */     SceneGraphObjectState stateObj = null;
/*     */     try {
/* 517 */       Class stateClass = Class.forName(stateClassName, true, ClassLoader.getSystemClassLoader());
/* 518 */       Constructor stateConstructor = stateClass.getConstructor(new Class[] { SymbolTableData.class, Controller.class });
/* 519 */       stateObj = (SceneGraphObjectState)stateConstructor.newInstance(new Object[] { null, this });
/*     */     } catch (Exception e) {
View Full Code Here

/* 126 */         symbol.branchGraphID = -1;
/*     */       }
/*     */
/* 129 */       this.symbolTable.setBranchGraphRoot(symbol, 0L);
/* 130 */       this.symbolTable.startUnsavedNodeComponentFrame();
/* 131 */       SceneGraphObjectState state = createState(bg, symbol);
/* 132 */       writeObject(this.outputStream, state);
/* 133 */       writeNodeComponents(this.outputStream);
/* 134 */       this.symbolTable.endUnsavedNodeComponentFrame();
/*     */
/* 136 */       if (this.symbolTable.branchGraphHasDependencies(symbol.branchGraphID)) {
View Full Code Here

/*     */     }
/*     */   }
/*     */
/*     */   public BranchGroup readBranchGraph(HashMap namedObjects) throws IOException {
/*     */     try {
/* 148 */       SceneGraphObjectState state = readObject(this.inputStream);
/* 149 */       readNodeComponents(this.inputStream);
/* 150 */       this.symbolTable.readTable(this.inputStream, true);
/*     */
/* 152 */       this.symbolTable.setBranchGraphRoot(state.getSymbol(), 0L);
/*     */
/* 154 */       state.buildGraph();
/*     */
/* 156 */       if (namedObjects != null) {
/* 157 */         this.symbolTable.getNamedObjectMap(namedObjects);
/*     */       }
/* 159 */       return (BranchGroup)state.getNode();
/*     */     } catch (SGIORuntimeException e) {
/* 161 */       throw new IOException(e.getMessage());
/*     */     }
/*     */   }
View Full Code Here

TOP

Related Classes of com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.SceneGraphObjectState

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.