[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Camera.java,1.11,1.12
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2006-02-09 13:55:50
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20280/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Log Message: Changed a bit in the attributes of camera Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Camera.java 3 Feb 2006 15:23:47 -0000 1.11 --- Camera.java 9 Feb 2006 13:55:33 -0000 1.12 *************** *** 407,426 **** } else if (a.getName().equals("Type")) { setType(((String)a.getValue()).equals("Orthographic") ? ORTHOGRAPHIC : PERSPECTIVE); ! } else if (a.getName().equals("Camera")) { ! Double x = (Double)((Attribute)iter.next()).getValue(); ! Double y = (Double)((Attribute)iter.next()).getValue(); ! Double z = (Double)((Attribute)iter.next()).getValue(); setCamera(new double[]{x.doubleValue(), y.doubleValue(), z.doubleValue()}); ! } else if (a.getName().equals("Center")) { ! Double x = (Double)((Attribute)iter.next()).getValue(); ! Double y = (Double)((Attribute)iter.next()).getValue(); ! Double z = (Double)((Attribute)iter.next()).getValue(); setCenter(new double[]{x.doubleValue(), y.doubleValue(), z.doubleValue()}); } else if (a.getName().equals("Roll")) { ! Double x = (Double)((Attribute)iter.next()).getValue(); ! Double y = (Double)((Attribute)iter.next()).getValue(); ! Double z = (Double)((Attribute)iter.next()).getValue(); setRoll(new double[]{x.doubleValue(), y.doubleValue(), z.doubleValue()}); ! } else if (a.getName().equals("Focalwidth")) { setFocalwidth(((Double)a.getValue()).doubleValue()); } else { --- 407,429 ---- } else if (a.getName().equals("Type")) { setType(((String)a.getValue()).equals("Orthographic") ? ORTHOGRAPHIC : PERSPECTIVE); ! } else if (a.getName().equals("Eye")) { ! Iterator camit = ((List)a.getValue()).iterator(); ! Double x = (Double)((Attribute)camit.next()).getValue(); ! Double y = (Double)((Attribute)camit.next()).getValue(); ! Double z = (Double)((Attribute)camit.next()).getValue(); setCamera(new double[]{x.doubleValue(), y.doubleValue(), z.doubleValue()}); ! } else if (a.getName().equals("Look-at")) { ! Iterator cenit = ((List)a.getValue()).iterator(); ! Double x = (Double)((Attribute)cenit.next()).getValue(); ! Double y = (Double)((Attribute)cenit.next()).getValue(); ! Double z = (Double)((Attribute)cenit.next()).getValue(); setCenter(new double[]{x.doubleValue(), y.doubleValue(), z.doubleValue()}); } else if (a.getName().equals("Roll")) { ! Iterator rollit = ((List)a.getValue()).iterator(); ! Double x = (Double)((Attribute)rollit.next()).getValue(); ! Double y = (Double)((Attribute)rollit.next()).getValue(); ! Double z = (Double)((Attribute)rollit.next()).getValue(); setRoll(new double[]{x.doubleValue(), y.doubleValue(), z.doubleValue()}); ! } else if (a.getName().equals("FOW")) { setFocalwidth(((Double)a.getValue()).doubleValue()); } else { *************** *** 437,454 **** ArrayList res = new ArrayList(); res.add(new Attribute("Name", getName())); ! res.add(new Attribute("Type", type == ORTHOGRAPHIC ? "Orthographic" : "Perspective")); ! res.add(new Attribute("Camera", null)); ! res.add(new Attribute("X", new Double(getCamera()[0]))); ! res.add(new Attribute("Y", new Double(getCamera()[1]))); ! res.add(new Attribute("Z", new Double(getCamera()[2]))); ! res.add(new Attribute("Center", null)); ! res.add(new Attribute("X", new Double(getCenter()[0]))); ! res.add(new Attribute("Y", new Double(getCenter()[1]))); ! res.add(new Attribute("Z", new Double(getCenter()[2]))); ! res.add(new Attribute("Roll", null)); ! res.add(new Attribute("X", new Double(getRoll()[0]))); ! res.add(new Attribute("Y", new Double(getRoll()[1]))); ! res.add(new Attribute("Z", new Double(getRoll()[2]))); ! res.add(new Attribute("Focalwidth", new Double(getFocalwidth()))); return res; } --- 440,463 ---- ArrayList res = new ArrayList(); res.add(new Attribute("Name", getName())); ! Attribute a = new Attribute("Type", type == ORTHOGRAPHIC ? "Orthographic" : "Perspective"); ! a.setEditable(false); ! res.add(a); ! ! ArrayList cam = new ArrayList(3); ! cam.add(new Attribute("X", new Double(getCamera()[0]))); ! cam.add(new Attribute("Y", new Double(getCamera()[1]))); ! cam.add(new Attribute("Z", new Double(getCamera()[2]))); ! res.add(new Attribute("Eye", cam)); ! ArrayList cen = new ArrayList(3); ! cen.add(new Attribute("X", new Double(getCenter()[0]))); ! cen.add(new Attribute("Y", new Double(getCenter()[1]))); ! cen.add(new Attribute("Z", new Double(getCenter()[2]))); ! res.add(new Attribute("Look-at", cen)); ! ArrayList roll = new ArrayList(3); ! roll.add(new Attribute("X", new Double(getRoll()[0]))); ! roll.add(new Attribute("Y", new Double(getRoll()[1]))); ! roll.add(new Attribute("Z", new Double(getRoll()[2]))); ! res.add(new Attribute("Roll", roll)); ! res.add(new Attribute("FOW", new Double(getFocalwidth()))); return res; } |