[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Surface.java, 1.219, 1.220 Defaults.
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2008-04-07 11:20:31
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5449/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Defaults.java Space.java Log Message: Materializing Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.219 retrieving revision 1.220 diff -C2 -d -r1.219 -r1.220 *** Surface.java 25 Jan 2008 13:06:02 -0000 1.219 --- Surface.java 7 Apr 2008 11:20:31 -0000 1.220 *************** *** 1332,1336 **** /** ! * Returs the material to be used on the back side * * @return back material --- 1332,1336 ---- /** ! * Returns the material to be used on the back side * * @return back material *************** *** 1340,1344 **** return backMaterial; } else { ! return backDomain.material(); } } --- 1340,1344 ---- return backMaterial; } else { ! return frontDomain.material(); } } *************** *** 1368,1372 **** return frontMaterial; } else { ! return frontDomain.material(); } } --- 1368,1372 ---- return frontMaterial; } else { ! return backDomain.material(); } } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.233 retrieving revision 1.234 diff -C2 -d -r1.233 -r1.234 *** Space.java 23 Jan 2008 14:49:33 -0000 1.233 --- Space.java 7 Apr 2008 11:20:31 -0000 1.234 *************** *** 51,55 **** /** The name */ protected String name; ! /** The Discription */ protected Description description; /** The envelope (a set of surfaces) */ --- 51,55 ---- /** The name */ protected String name; ! /** The description */ protected Description description; /** The envelope (a set of surfaces) */ *************** *** 59,63 **** protected int type; ! /** If the constructionspace is transparent */ protected boolean transparent; --- 59,63 ---- protected int type; ! /** If the space is transparent */ protected boolean transparent; *************** *** 81,84 **** --- 81,87 ---- protected Container empty; + /** The material */ + private Material material; + /** The modellor */ *************** *** 199,207 **** /** * Returns the material for this space * @return material to used for this space */ public Material material() { ! if (isVoid()) { return Defaults.getVoidMaterial(); } else if (isFunctionalSpace()) { --- 202,228 ---- /** + * Sets material + * @param material The new material + */ + public void setMaterial(Material material) { + this.material = material; + } + + /** + * Returns the material + * @return Material + */ + public Material getMaterial() { + return material; + } + + /** * Returns the material for this space * @return material to used for this space */ public Material material() { ! if (material != null) { ! return material; ! } else if (isVoid()) { return Defaults.getVoidMaterial(); } else if (isFunctionalSpace()) { *************** *** 478,491 **** } else if (a.getName().equals("Description")) { setDescription(((String)a.getValue().toString())); ! } else { ! if (!changedType && getClassificationType() != null) { ! if (getClassificationType().getParameter(a.getName()) != null && ! !getClassificationType().getParameter(a.getName()).getValue().equals(a.getValue())) { ! setOwnParameter(a.getName(), a.getValue()); ! } } } } } /** --- 499,517 ---- } else if (a.getName().equals("Description")) { setDescription(((String)a.getValue().toString())); ! } else if (a.getName().equals("Material")) { ! Material material = (Material) ((Reference) a.getValue()).getObject(); ! if (material != material()) { ! setMaterial(material); ! } ! } else if (!changedType && getClassificationType() != null) { ! if (getClassificationType().getParameter(a.getName()) != null && ! !getClassificationType().getParameter(a.getName()).getValue().equals(a.getValue())) { ! setOwnParameter(a.getName(), a.getValue()); } } } } + + /** *************** *** 495,498 **** --- 521,526 ---- public List<Attribute> getAttributes() { ArrayList<Attribute> res = new ArrayList<Attribute>(); + List<Material> materials = new LinkedList(Project.getInstance().getMaterials()); + res.add(new Attribute("Name", getName())); if (getOwner() == Project.getInstance().world()) { *************** *** 540,543 **** --- 568,572 ---- } } + res.add(new Attribute("Material", new Reference(material(), materials))); res.add(new Attribute("Euler", Double.valueOf(eulerCharacteristic()))); res.add(new Attribute("Description", getDescription())); Index: Defaults.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Defaults.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Defaults.java 17 Dec 2007 14:20:37 -0000 1.3 --- Defaults.java 7 Apr 2008 11:20:31 -0000 1.4 *************** *** 14,22 **** private static Material constructionMaterial ! = new Material("Construction", new float[] {0.90f, 0.90f, 0.90f}); private static Material voidMaterial = new Material("Void", new float[] {255f / 280, 228f / 280, 225f / 280}); private static Material functionalMaterial ! = new Material("Functional", new float[] {0.96f, 0.87f, 0.70f}); --- 14,22 ---- private static Material constructionMaterial ! = new Material("Construction", new float[] {0.96f, 0.87f, 0.70f}); private static Material voidMaterial = new Material("Void", new float[] {255f / 280, 228f / 280, 225f / 280}); private static Material functionalMaterial ! = new Material("Functional", new float[] {0.90f, 0.90f, 0.90f}); |