bprocessor-commit Mailing List for B-processor (Page 92)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael L. <he...@us...> - 2006-11-06 11:01:06
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26739/src/net/sourceforge/bprocessor/model Modified Files: Space.java Persistence.java Entity.java Log Message: Fixed a few style errors Refactored persistence-code Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Persistence.java 24 Oct 2006 20:40:48 -0000 1.16 --- Persistence.java 6 Nov 2006 11:00:54 -0000 1.17 *************** *** 100,104 **** Collection xmls = new LinkedList(); ! Space world = internalizeSpace((SpaceType) document.getSpace().iterator().next(), mapper, xmls); { --- 100,105 ---- Collection xmls = new LinkedList(); ! Space world = internalizeSpace(null, ! (SpaceType) document.getSpace().iterator().next(), mapper, xmls); { *************** *** 143,147 **** /** ! * * @param xml The SpaceType * @param mapper The mapper --- 144,148 ---- /** ! * @param owner Space * @param xml The SpaceType * @param mapper The mapper *************** *** 149,155 **** * @return The Space */ ! private static Space internalizeSpace(SpaceType xml, Map mapper, Collection xmls) { String name = xml.getName(); - Collection elements = new LinkedList(); int type = xml.getType(); int level = xml.getLevel(); --- 150,156 ---- * @return The Space */ ! private static Space internalizeSpace(Space owner, SpaceType xml, ! Map mapper, Collection xmls) { String name = xml.getName(); int type = xml.getType(); int level = xml.getLevel(); *************** *** 169,212 **** xmls.add(xml); { Iterator iter = xml.getSpace().iterator(); while (iter.hasNext()) { SpaceType current = (SpaceType) iter.next(); ! elements.add(internalizeSpace(current, mapper, xmls)); } } - Space e = null; if (empty != 0) { ! e = (Space) mapper.get(new Long(empty)); ! space.setEmpty(e); ! } ! { ! Iterator iter = elements.iterator(); ! while (iter.hasNext()) { ! Space current = (Space) iter.next(); ! if (current != e) { ! space.add(current); ! } ! } } ! { Iterator iter = xml.getSurface().iterator(); while (iter.hasNext()) { SurfaceType current = (SurfaceType) iter.next(); ! space.add(internalizeSurface(current, mapper, xmls)); } } { Iterator iter = xml.getEdge().iterator(); while (iter.hasNext()) { EdgeType current = (EdgeType) iter.next(); ! space.add(internalizeEdge(current, mapper, xmls)); } } { Iterator iter = xml.getVertex().iterator(); while (iter.hasNext()) { VertexType current = (VertexType) iter.next(); ! space.add(internalizeVertex(current, mapper, xmls)); } } { --- 170,214 ---- xmls.add(xml); { + HashMap elements = new HashMap(); Iterator iter = xml.getSpace().iterator(); while (iter.hasNext()) { SpaceType current = (SpaceType) iter.next(); ! Space element = internalizeSpace(space, current, mapper, xmls); ! elements.put(element.getId(), element); } + space.setElements(elements); } if (empty != 0) { ! space.setEmpty((Space) mapper.get(new Long(empty))); } ! { ! HashMap surfaces = new HashMap(); Iterator iter = xml.getSurface().iterator(); while (iter.hasNext()) { SurfaceType current = (SurfaceType) iter.next(); ! Surface surface = internalizeSurface(space, current, mapper, xmls); ! surfaces.put(surface.getId(), surface); } + space.setSurfaces(surfaces); } { + HashMap edges = new HashMap(); Iterator iter = xml.getEdge().iterator(); while (iter.hasNext()) { EdgeType current = (EdgeType) iter.next(); ! Edge edge = internalizeEdge(space, current, mapper, xmls); ! edges.put(edge.getId(), edge); } + space.setEdges(edges); } { + HashMap vertices = new HashMap(); Iterator iter = xml.getVertex().iterator(); while (iter.hasNext()) { VertexType current = (VertexType) iter.next(); ! Vertex vertex = internalizeVertex(space, current, mapper, xmls); ! vertices.put(vertex.getId(), vertex); } + space.setVertices(vertices); } { *************** *** 250,253 **** --- 252,256 ---- } } + space.setOwner(owner); return space; } *************** *** 349,353 **** res.setId(new Long(xml.getProgid())); mapper.put(new Long(xml.getId()), res); ! res.setOrigin(internalizeVertex(xml.getVertex(), new HashMap(), new LinkedList())); xmls.add(xml); return res; --- 352,356 ---- res.setId(new Long(xml.getProgid())); mapper.put(new Long(xml.getId()), res); ! res.setOrigin(internalizeVertex(null, xml.getVertex(), new HashMap(), new LinkedList())); xmls.add(xml); return res; *************** *** 364,368 **** Map mapper, Collection xmls) { Line res = new Line(); ! res.setDirection(internalizeVertex( (VertexType)((LineType)xml).getDirection().getVertex().get(0), new HashMap(), new LinkedList())); --- 367,371 ---- Map mapper, Collection xmls) { Line res = new Line(); ! res.setDirection(internalizeVertex(null, (VertexType)((LineType)xml).getDirection().getVertex().get(0), new HashMap(), new LinkedList())); *************** *** 371,375 **** res.setId(new Long(xml.getProgid())); mapper.put(new Long(xml.getId()), res); ! res.setOrigin(internalizeVertex(xml.getVertex(), new HashMap(), new LinkedList())); xmls.add(xml); return res; --- 374,378 ---- res.setId(new Long(xml.getProgid())); mapper.put(new Long(xml.getId()), res); ! res.setOrigin(internalizeVertex(null, xml.getVertex(), new HashMap(), new LinkedList())); xmls.add(xml); return res; *************** *** 389,395 **** res.onlyPlane(cst.isOnlyplane()); List ijn = cst.getIjn().getVertex(); ! Vertex i = internalizeVertex((VertexType)ijn.get(0), new HashMap(), new LinkedList()); ! Vertex j = internalizeVertex((VertexType)ijn.get(1), new HashMap(), new LinkedList()); ! Vertex n = internalizeVertex((VertexType)ijn.get(2), new HashMap(), new LinkedList()); res.setIJN(i, j, n); res.setActive(xml.isActive()); --- 392,398 ---- res.onlyPlane(cst.isOnlyplane()); List ijn = cst.getIjn().getVertex(); ! Vertex i = internalizeVertex(null, (VertexType)ijn.get(0), new HashMap(), new LinkedList()); ! Vertex j = internalizeVertex(null, (VertexType)ijn.get(1), new HashMap(), new LinkedList()); ! Vertex n = internalizeVertex(null, (VertexType)ijn.get(2), new HashMap(), new LinkedList()); res.setIJN(i, j, n); res.setActive(xml.isActive()); *************** *** 397,401 **** res.setId(new Long(xml.getProgid())); mapper.put(new Long(xml.getId()), res); ! res.setOrigin(internalizeVertex(xml.getVertex(), new HashMap(), new LinkedList())); xmls.add(xml); return res; --- 400,404 ---- res.setId(new Long(xml.getProgid())); mapper.put(new Long(xml.getId()), res); ! res.setOrigin(internalizeVertex(null, xml.getVertex(), new HashMap(), new LinkedList())); xmls.add(xml); return res; *************** *** 404,407 **** --- 407,411 ---- /** * + * @param owner Space * @param xml The SurfaceType * @param mapper The mapper *************** *** 409,422 **** * @return The Surface */ ! private static Surface internalizeSurface(SurfaceType xml, Map mapper, Collection xmls) { Surface surface = new Surface(); surface.setId(new Long(xml.getProgid())); mapper.put(new Long(xml.getId()), surface); xmls.add(xml); return surface; } /** ! * * @param xml The EdgeType * @param mapper The mapper --- 413,428 ---- * @return The Surface */ ! private static Surface internalizeSurface(Space owner, SurfaceType xml, ! Map mapper, Collection xmls) { Surface surface = new Surface(); surface.setId(new Long(xml.getProgid())); mapper.put(new Long(xml.getId()), surface); xmls.add(xml); + surface.setOwner(owner); return surface; } /** ! * @param owner Space * @param xml The EdgeType * @param mapper The mapper *************** *** 424,428 **** * @return The Edge */ ! private static Edge internalizeEdge(EdgeType xml, Map mapper, Collection xmls) { Edge edge = new Edge(); edge.setId(new Long(xml.getProgid())); --- 430,434 ---- * @return The Edge */ ! private static Edge internalizeEdge(Space owner, EdgeType xml, Map mapper, Collection xmls) { Edge edge = new Edge(); edge.setId(new Long(xml.getProgid())); *************** *** 430,438 **** xmls.add(xml); edge.setStrippled(xml.isConstructor()); return edge; } /** ! * * @param xml The VertexType * @param mapper The mapper --- 436,445 ---- xmls.add(xml); edge.setStrippled(xml.isConstructor()); + edge.setOwner(owner); return edge; } /** ! * @param owner Space * @param xml The VertexType * @param mapper The mapper *************** *** 440,444 **** * @return The Vertex */ ! private static Vertex internalizeVertex(VertexType xml, Map mapper, Collection xmls) { Vertex vertex = new Vertex(); if (xml.getProgid() != 0) { --- 447,452 ---- * @return The Vertex */ ! private static Vertex internalizeVertex(Space owner, VertexType xml, ! Map mapper, Collection xmls) { Vertex vertex = new Vertex(); if (xml.getProgid() != 0) { *************** *** 450,453 **** --- 458,462 ---- vertex.setY(xml.getY()); vertex.setZ(xml.getZ()); + vertex.setOwner(owner); return vertex; } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** Space.java 2 Nov 2006 14:45:38 -0000 1.92 --- Space.java 6 Nov 2006 11:00:54 -0000 1.93 *************** *** 361,371 **** */ public void setEmpty(Space element) { - if (empty != null) { - remove(empty); - } empty = element; - if (empty != null) { - add(empty); - } } --- 361,365 ---- *************** *** 1163,1166 **** --- 1157,1196 ---- this.envelope = surfaces; } + + /** + * Set the vertices + * @param vertices HashMap + */ + public void setVertices(HashMap vertices) { + this.vertices = vertices; + nextVertexId = Entity.maxId(vertices.values()) + 1; + } + + /** + * Set the edges + * @param edges HashMap + */ + public void setEdges(HashMap edges) { + this.edges = edges; + nextEdgeId = Entity.maxId(edges.values()) + 1; + } + + /** + * Set the surfaces + * @param surfaces HashMap + */ + public void setSurfaces(HashMap surfaces) { + this.surfaces = surfaces; + nextSurfaceId = Entity.maxId(surfaces.values()) + 1; + } + + /** + * Set the elements + * @param elements HashMap + */ + public void setElements(HashMap elements) { + this.elements = elements; + nextElementId = Entity.maxId(elements.values()); + } /** *************** *** 1170,1174 **** public void addSurface(Surface surface) { envelope.add(surface); - //changed(); } --- 1200,1203 ---- *************** *** 1179,1183 **** public void removeSurface(Surface surface) { envelope.remove(surface); - //changed(); } --- 1208,1211 ---- Index: Entity.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Entity.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Entity.java 9 Aug 2006 15:14:58 -0000 1.9 --- Entity.java 6 Nov 2006 11:00:54 -0000 1.10 *************** *** 8,11 **** --- 8,13 ---- import java.io.Serializable; + import java.util.Collection; + import java.util.Iterator; /** *************** *** 15,18 **** --- 17,39 ---- /** The id */ protected Long id; + + /** + * Find the maximum id of entities in the collection + * @param entities Collection of entities + * @return max id + */ + public static long maxId(Collection entities) { + long value = 0; + Iterator iter = entities.iterator(); + while (iter.hasNext()) { + Entity current = (Entity) iter.next(); + if (current.getId() != null) { + if (current.getId().longValue() > value) { + value = current.getId().longValue(); + } + } + } + return value; + } /** |
From: Nordholt <nor...@us...> - 2006-11-04 16:54:56
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5372/src/net/sourceforge/bprocessor/gui/attrview Modified Files: BooleanAttribute.java StringAttribute.java GenericPanel.java Log Message: Fixed the "cant click on more than one item" bug in the attribute panel Index: StringAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/StringAttribute.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** StringAttribute.java 24 Apr 2006 08:45:10 -0000 1.11 --- StringAttribute.java 4 Nov 2006 16:54:53 -0000 1.12 *************** *** 25,33 **** --- 25,42 ---- import net.sourceforge.bprocessor.model.Attribute; + import org.apache.log4j.Logger; + /** * The StringAttributeView */ public class StringAttribute extends GenericAttribute implements KeyListener, MouseListener { + /** + * serial version UID + */ + private static final long serialVersionUID = 602299046329792847L; + /** The logger */ + private static Logger log = Logger.getLogger(StringAttribute.class); + /** The listeners */ private List listeners; *************** *** 43,50 **** /** The editor, when this EditableAttribute is being edited */ ! private JTextField editor; ! ! ! /** --- 52,56 ---- /** The editor, when this EditableAttribute is being edited */ ! private JTextField editor; /** Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** GenericPanel.java 30 Oct 2006 00:00:02 -0000 1.23 --- GenericPanel.java 4 Nov 2006 16:54:53 -0000 1.24 *************** *** 11,16 **** --- 11,19 ---- import java.awt.event.MouseEvent; import java.awt.event.MouseListener; + import java.util.ArrayList; + import java.util.HashMap; import java.util.Iterator; import java.util.List; + import java.util.Map; import javax.swing.BorderFactory; *************** *** 47,50 **** --- 50,56 ---- private List attributes; + /** The list of generic attributes */ + private List genAttributes = new ArrayList(); + /** The box of content */ private Box content; *************** *** 87,94 **** /** * local method for generating the content ! * @param what The list of attrinutes * @param where The place to put all the generated content; */ private void generateContent(List what, JComponent where) { Iterator iter = what.iterator(); while (iter.hasNext()) { --- 93,101 ---- /** * local method for generating the content ! * @param what The list of attributes * @param where The place to put all the generated content; */ private void generateContent(List what, JComponent where) { + genAttributes.clear(); Iterator iter = what.iterator(); while (iter.hasNext()) { *************** *** 108,111 **** --- 115,119 ---- } }); + genAttributes.add(sa); where.add(new AttributeRow(sa)); } else if (a.getValue() instanceof List) { *************** *** 121,125 **** if (iterElems.next() instanceof Attribute) { generateContent(elems, more); ! } where.add(more); } else if (a.getValue() instanceof Description) { --- 129,133 ---- if (iterElems.next() instanceof Attribute) { generateContent(elems, more); ! } where.add(more); } else if (a.getValue() instanceof Description) { *************** *** 137,140 **** --- 145,149 ---- } }); + genAttributes.add(da); where.add(new AttributeRow(da)); } else if (a.getValue() instanceof Parametric) { *************** *** 152,155 **** --- 161,165 ---- } }); + genAttributes.add(la); where.add(new AttributeRow(la)); } else if (a.getValue() instanceof Material) { *************** *** 167,170 **** --- 177,181 ---- } }); + genAttributes.add(ma); where.add(new AttributeRow(ma)); } else if (a.getValue() instanceof Boolean) { *************** *** 182,185 **** --- 193,197 ---- } }); + genAttributes.add(ba); where.add(new AttributeRow(ba)); } else if (a.getValue() instanceof Classification) { *************** *** 197,200 **** --- 209,213 ---- } }); + genAttributes.add(catext);; where.add(new AttributeRow(catext)); if (a.getClassification() != null) { *************** *** 213,216 **** --- 226,230 ---- } }); + genAttributes.add(caid); where.add(new AttributeRow(caid)); } *************** *** 224,232 **** /** * Start editing the specified AttributeView ! * @param ga The genericAttribute to edit */ ! public void startEditing(GenericAttribute ga) { stopEditing(); ! current = ga; if (current != null) { current.startEditing(); --- 238,246 ---- /** * Start editing the specified AttributeView ! * @param i index of the attribute to edit */ ! public void startEditing(int i) { stopEditing(); ! current = (GenericAttribute)genAttributes.get(i); if (current != null) { current.startEditing(); *************** *** 299,303 **** */ public void mouseClicked(MouseEvent event) { ! startEditing(ga); } --- 313,317 ---- */ public void mouseClicked(MouseEvent event) { ! startEditing(genAttributes.indexOf(ga)); } *************** *** 325,329 **** /** ! * Getter for the parametric * @return the parametric */ --- 339,343 ---- /** ! * getter for the parametric * @return the parametric */ *************** *** 337,346 **** public void update() { complexUpdate(); ! /*if (simpleUpdate) { ! simpleUpdate(); ! simpleUpdate = false; ! } else { ! complexUpdate(); ! }*/ } --- 351,360 ---- public void update() { complexUpdate(); ! // if (simpleUpdate) { ! // simpleUpdate(); ! // simpleUpdate = false; ! // } else { ! // //complexUpdate(); ! // } } *************** *** 361,364 **** * */ ! public void simpleUpdate() { } } --- 375,379 ---- * */ ! public void simpleUpdate() { ! } } Index: BooleanAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/BooleanAttribute.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BooleanAttribute.java 17 Jul 2006 08:32:00 -0000 1.1 --- BooleanAttribute.java 4 Nov 2006 16:54:53 -0000 1.2 *************** *** 42,49 **** /** The valueLabel */ ! private JCheckBox valueLabel; ! ! ! /** --- 42,46 ---- /** The valueLabel */ ! private JCheckBox valueLabel; /** *************** *** 151,156 **** valueChanged(); } ! } ! /** --- 148,152 ---- valueChanged(); } ! } /** |
From: Nordholt <nor...@us...> - 2006-11-04 12:27:35
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17197/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: enabled the spacechecker again, to check for open spaces Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** GUI.java 14 Oct 2006 08:06:27 -0000 1.47 --- GUI.java 4 Nov 2006 12:27:31 -0000 1.48 *************** *** 98,103 **** setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); instance = this; ! //Thread sc = new SpaceChecker(); ! //sc.start(); } --- 98,103 ---- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); instance = this; ! Thread sc = new SpaceChecker(); ! sc.start(); } *************** *** 452,456 **** */ public boolean isClosed(Space sp) { ! return closedSpaces.contains(sp); } --- 452,457 ---- */ public boolean isClosed(Space sp) { ! boolean closed = closedSpaces.contains(sp); ! return closed; } *************** *** 472,476 **** while (true) { try { - Iterator it = Project.getInstance().getSpaces().iterator(); while (it.hasNext()) { --- 473,476 ---- |
From: Nordholt <nor...@us...> - 2006-11-04 12:26:41
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16509/src/net/sourceforge/bprocessor/facade/modellor Modified Files: FacadeModellor.java Log Message: now uses facade-modellor instead of window modellor for the windows Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** FacadeModellor.java 17 Oct 2006 09:11:11 -0000 1.25 --- FacadeModellor.java 4 Nov 2006 12:26:31 -0000 1.26 *************** *** 73,90 **** /** Thickness of the frame */ ! private double frameThickness = 0; /** Facade depth */ private double depth = 0; - /** The frame space */ - private Space frame; - - /** Set of surfaces that forms the holes for windows*/ - private Set windows = new HashSet(); - - /** The surfaces of the frame */ - private Set frameSurfaces = new HashSet(); - /** edge marking leftmost boundry of the facade */ private Line leftBound; --- 73,81 ---- /** Thickness of the frame */ ! private double frameWidth = 0; /** Facade depth */ private double depth = 0; /** edge marking leftmost boundry of the facade */ private Line leftBound; *************** *** 99,108 **** private Line bottomBound; - /** Set of window elements */ - private Set windowElements = new HashSet(); - - /** Set of window modellors */ - private Set windowModellors = new HashSet(); - /** Type of facade */ private int type; --- 90,93 ---- *************** *** 124,141 **** } /** The constructor for the modellor * @param s the space this modellor models for. */ ! public FacadeModellor(Space s) { ! type = SINGLE_BAR; Project.getInstance().addObserver(this); this.space = s; this.name = "Facade Modellor"; ! Iterator it = space.getEnvelope().iterator(); ! if (it.hasNext()) { ! front = (Surface)it.next(); ! } } ! /** * Create a new instance of the modellor, based on a space --- 109,148 ---- } + /** + * Constructor with no front surface. + * @param s the space + */ + public FacadeModellor(Space s) { + this(s, null); + } + /** The constructor for the modellor * @param s the space this modellor models for. */ ! public FacadeModellor(Space s, Surface front) { ! if (front == null) { ! front = null; ! if (!s.getEnvelope().isEmpty()) { ! front = (Surface)s.getEnvelope().iterator().next(); ! } ! } Project.getInstance().addObserver(this); this.space = s; + //Setting default values this.name = "Facade Modellor"; ! type = SINGLE_BAR; ! this.front = front; ! vertPosts = 1; ! horPosts = 1; ! vertPostWidth = 0.1; ! horPostWidth = 0.1; ! frameWidth = 0.1; ! depth = 0.2; ! createPostConstructors(); ! createFacade(); } ! ! ! /** * Create a new instance of the modellor, based on a space *************** *** 153,156 **** --- 160,164 ---- public void update(Object entity) { if (entity == front) { + createPostConstructors(); createFacade(); } *************** *** 165,172 **** private void createFacade() { removeFacade(); if (type == SINGLE_BAR) { createFrame(); } - createPostConstructors(); createWindows(); } --- 173,199 ---- private void createFacade() { removeFacade(); + if (!vertCons.isEmpty() || !horCons.isEmpty()) { + Iterator it = vertCons.iterator(); + while (it.hasNext()) { + space.add((Line)it.next()); + } + it = horCons.iterator(); + while (it.hasNext()) { + space.add((Line)it.next()); + } + for (int i = 0; i < vertSegs.length - 1; i++) { + for (int j = 0; j < vertSegs[0].length - 1; j++) { + if (0 < i) { + space.add(vertSegs[i][j]); + } + if (0 < j) { + space.add(horSegs[i][j]); + } + } + } + } if (type == SINGLE_BAR) { createFrame(); } createWindows(); } *************** *** 196,200 **** public void setAttributes(List attributes) { Iterator it = attributes.iterator(); ! boolean changed = false; while (it.hasNext()) { Attribute a = (Attribute)it.next(); --- 223,228 ---- public void setAttributes(List attributes) { Iterator it = attributes.iterator(); ! boolean changeFacade = false; ! boolean changeCons = false; while (it.hasNext()) { Attribute a = (Attribute)it.next(); *************** *** 208,212 **** if (front != s) { front = s; ! changed = true; } } --- 236,241 ---- if (front != s) { front = s; ! changeFacade = true; ! changeCons = true; } } *************** *** 215,219 **** int n = ((Double)a.getValue()).intValue(); if (n != vertPosts) { ! changed = true; vertPosts = n; } --- 244,249 ---- int n = ((Double)a.getValue()).intValue(); if (n != vertPosts) { ! changeFacade = true; ! changeCons = true; vertPosts = n; } *************** *** 221,225 **** int n = ((Double)a.getValue()).intValue(); if (n != horPosts) { ! changed = true; horPosts = n; } --- 251,256 ---- int n = ((Double)a.getValue()).intValue(); if (n != horPosts) { ! changeFacade = true; ! changeCons = true; horPosts = n; } *************** *** 227,240 **** double d = ((Double)a.getValue()).doubleValue(); setVertPostWidth(d); ! changed = true; } else if (a.getName().equals("H-postwidth")) { double d = ((Double)a.getValue()).doubleValue(); setHorPostWidth(d); ! changed = true; } else if (a.getName().equals("Frame thickness")) { double n = ((Double)a.getValue()).doubleValue(); ! if (n != frameThickness) { ! frameThickness = n; ! changed = true; } } else if (a.getName().equals("Depth")) { --- 258,271 ---- double d = ((Double)a.getValue()).doubleValue(); setVertPostWidth(d); ! changeFacade = true; } else if (a.getName().equals("H-postwidth")) { double d = ((Double)a.getValue()).doubleValue(); setHorPostWidth(d); ! changeFacade = true; } else if (a.getName().equals("Frame thickness")) { double n = ((Double)a.getValue()).doubleValue(); ! if (n != frameWidth) { ! frameWidth = n; ! changeFacade = true; } } else if (a.getName().equals("Depth")) { *************** *** 242,246 **** if (n != depth) { depth = n; ! changed = true; } } else if (a.getName().equals("Single posted")) { --- 273,277 ---- if (n != depth) { depth = n; ! changeFacade = true; } } else if (a.getName().equals("Single posted")) { *************** *** 248,263 **** if (b && type != SINGLE_BAR) { type = SINGLE_BAR; ! changed = true; } if (!b && type == SINGLE_BAR) { type = DOUBLE_BAR; ! vertPostWidth = 0; ! horPostWidth = 0; ! frameThickness = 0; ! changed = true; } } } ! if (changed) { createFacade(); Project.getInstance().changed(this); --- 279,296 ---- if (b && type != SINGLE_BAR) { type = SINGLE_BAR; ! changeFacade = true; ! changeCons = true; } if (!b && type == SINGLE_BAR) { type = DOUBLE_BAR; ! changeFacade = true; ! changeCons = true; } } } ! if (changeCons || (horCons.isEmpty() && vertCons.isEmpty())) { ! createPostConstructors(); ! } ! if (changeFacade) { createFacade(); Project.getInstance().changed(this); *************** *** 279,287 **** attributes.add(new Attribute("V-postwidth", new Double(vertPostWidth), bars)); attributes.add(new Attribute("H-postwidth", new Double(horPostWidth), bars)); ! attributes.add(new Attribute("Frame thickness", new Double(frameThickness), bars)); ! } else { ! attributes.add(new Attribute("V-postwidth", new Double(0), bars)); ! attributes.add(new Attribute("H-postwidth", new Double(0), bars)); ! attributes.add(new Attribute("Frame thickness", new Double(0), bars)); } attributes.add(new Attribute("Depth", new Double(depth))); --- 312,316 ---- attributes.add(new Attribute("V-postwidth", new Double(vertPostWidth), bars)); attributes.add(new Attribute("H-postwidth", new Double(horPostWidth), bars)); ! attributes.add(new Attribute("Frame thickness", new Double(frameWidth), bars)); } attributes.add(new Attribute("Depth", new Double(depth))); *************** *** 302,306 **** return "Facade Modellor"; } ! /** Delete */ public void delete() { space.setModellor(null); --- 331,335 ---- return "Facade Modellor"; } ! /** Delete */ public void delete() { space.setModellor(null); *************** *** 312,320 **** if (front != null && depth > 0) { ! removeFacade(); ! frame = new Space("Frame", Space.CONSTRUCTION, Space.ELEMENT_LEVEL, true); space.add(frame); Surface eFront = front.copy(space); - frameSurfaces.add(eFront); if (front.getBackDomain() == space) { eFront.setBackDomain(frame); --- 341,347 ---- if (front != null && depth > 0) { ! Space frame = new Space("Frame", Space.CONSTRUCTION, Space.ELEMENT_LEVEL, true); space.add(frame); Surface eFront = front.copy(space); if (front.getBackDomain() == space) { eFront.setBackDomain(frame); *************** *** 323,328 **** } Set sides = new HashSet(); ! frameSurfaces.add(extrudeIntoSpace(eFront, depth, sides)); ! frameSurfaces.addAll(sides); Iterator sidesIt = sides.iterator(); while (sidesIt.hasNext()) { --- 350,354 ---- } Set sides = new HashSet(); ! extrudeIntoSpace(eFront, depth, sides); Iterator sidesIt = sides.iterator(); while (sidesIt.hasNext()) { *************** *** 335,351 **** */ private void removeFacade() { - Iterator it = frameSurfaces.iterator(); - while (it.hasNext()) { - ((Surface)it.next()).delete(); - } - frameSurfaces = new HashSet(); - if (frame != null) { - frame.clear(); - frame.delete(); - } - frame = null; - removeWindows(); - removeConstructors(); - removeSegmentLines(); space.clear(); } --- 361,364 ---- *************** *** 374,386 **** } } Vertex cross = null; if (horEdge != null && vertEdge != null) { ! ! if (horEdge.contains(vertEdge.getFrom())) { ! cross = vertEdge.getFrom(); ! } else { ! cross = vertEdge.getTo(); ! } } if (cross != null) { horSegs = new Line[vertPosts][horPosts]; --- 387,396 ---- } } + //If horizontal and vertical edge were found continue Vertex cross = null; if (horEdge != null && vertEdge != null) { ! cross = Edge.commonVertex(horEdge, vertEdge); } + //if cross was found continue if (cross != null) { horSegs = new Line[vertPosts][horPosts]; *************** *** 388,404 **** Vertex horDir = horEdge.otherVertex(cross).minus(cross); Vertex vertDir = vertEdge.otherVertex(cross).minus(cross); ! double intervalV = ((horEdge.getLength() - frameThickness * 2) - ! vertPostWidth * vertPosts) / (vertPosts + 1); ! double intervalH = ((vertEdge.getLength() - frameThickness * 2) - ! horPostWidth * horPosts) / (horPosts + 1); Vertex offset; //vertical constructors { ! offset = horDir.copy(); ! double lengthV = intervalV + frameThickness + (vertPostWidth / 2); for (int i = 0; i < vertPosts; i++) { offset.scale(lengthV / offset.length()); Constructor l = new Line(cross.add(offset), vertDir.copy(), horEdge, true, true); ! lengthV += (intervalV + vertPostWidth); space.add(l); vertCons.add(l); --- 398,421 ---- Vertex horDir = horEdge.otherVertex(cross).minus(cross); Vertex vertDir = vertEdge.otherVertex(cross).minus(cross); ! double intervalV = horEdge.getLength() / (vertPosts + 1); ! double intervalH = vertEdge.getLength() / (horPosts + 1); ! double lengthV = intervalV; ! double lengthH = intervalH; ! if (type == SINGLE_BAR) { ! intervalV = intervalV - ((frameWidth * 2) + vertPosts * vertPostWidth)/ (vertPosts + 1); ! intervalH = intervalH - ((frameWidth * 2) + horPosts * horPostWidth)/ (horPosts + 1); ! intervalV += vertPostWidth; ! intervalH += horPostWidth; ! lengthV = intervalV - (vertPostWidth / 2) + frameWidth; ! lengthH = intervalH - (horPostWidth / 2) + frameWidth; ! } Vertex offset; //vertical constructors { ! offset = horDir.copy(); for (int i = 0; i < vertPosts; i++) { offset.scale(lengthV / offset.length()); Constructor l = new Line(cross.add(offset), vertDir.copy(), horEdge, true, true); ! lengthV += intervalV; space.add(l); vertCons.add(l); *************** *** 407,416 **** //horizontal constructors { ! offset = vertDir.copy(); ! double lengthH = intervalH + frameThickness + (horPostWidth / 2); for (int i = 0; i < horPosts; i++) { offset.scale(lengthH / offset.length()); Line l = new Line(cross.add(offset), horDir.copy(), vertEdge, true, true); ! lengthH += (intervalH + horPostWidth); horCons.add(l); space.add(l); --- 424,432 ---- //horizontal constructors { ! offset = vertDir.copy(); for (int i = 0; i < horPosts; i++) { offset.scale(lengthH / offset.length()); Line l = new Line(cross.add(offset), horDir.copy(), vertEdge, true, true); ! lengthH += (intervalH); horCons.add(l); space.add(l); *************** *** 419,433 **** //boundries { ! Vertex topOffset = vertDir.copy(); ! topOffset.scale(frameThickness / topOffset.length()); topBound = new Line(cross.add(topOffset), horDir); - Vertex bottomOffset = vertDir.copy(); - bottomOffset.scale((vertEdge.getLength() - frameThickness) / bottomOffset.length()); - bottomBound = new Line(cross.add(bottomOffset), horDir); - Vertex leftOffset = horDir.copy(); - leftOffset.scale(frameThickness / leftOffset.length()); leftBound = new Line(cross.add(leftOffset), vertDir); ! Vertex rightOffset = horDir.copy(); ! rightOffset.scale((horEdge.getLength() - frameThickness) / rightOffset.length()); rightBound = new Line(cross.add(rightOffset), vertDir); } --- 435,449 ---- //boundries { ! double frame = 0; ! if (type == SINGLE_BAR) { ! frame = frameWidth; ! } ! Vertex topOffset = vertDir.copy(frame / vertDir.length()); ! Vertex leftOffset = horDir.copy(frame / horDir.length()); ! Vertex bottomOffset = vertDir.copy((vertEdge.getLength() - frame) / vertDir.length()); ! Vertex rightOffset = horDir.copy((horEdge.getLength() - frame) / horDir.length()); topBound = new Line(cross.add(topOffset), horDir); leftBound = new Line(cross.add(leftOffset), vertDir); ! bottomBound = new Line(cross.add(bottomOffset), horDir); rightBound = new Line(cross.add(rightOffset), vertDir); } *************** *** 466,477 **** horSegs[i][j] = hSeg; vertSegs[i][j] = vSeg; - /* - if (j > 0 && i < vertPosts + 1 && j < horPosts + 1 && - i % 2 == 0) { - drawSeg.put(hSeg, Boolean.FALSE); - } else { - drawSeg.put(hSeg, Boolean.TRUE); - } - */ drawSeg.put(hSeg, Boolean.TRUE); drawSeg.put(vSeg, Boolean.TRUE); --- 482,485 ---- *************** *** 517,526 **** private void createWindows() { if (front != null && depth > 0) { ! Space oldActive = Project.getInstance().getActiveSpace(); ! Project.getInstance().setActiveSpace(space); ! Vertex vDir = vertSegs[0][0].getDirection(); ! vDir = vDir.copy((vertPostWidth / 2) / vDir.length()); ! Vertex hDir = horSegs[0][0].getDirection(); ! hDir = hDir.copy((horPostWidth / 2) / hDir.length()); List slist = new LinkedList(); Map connectMap = new HashMap(); --- 525,536 ---- private void createWindows() { if (front != null && depth > 0) { ! Vertex vDir = new Vertex(0, 0, 0); ! Vertex hDir = new Vertex(0, 0, 0); ! if (type == SINGLE_BAR) { ! vDir = vertSegs[0][0].getDirection(); ! vDir = vDir.copy((vertPostWidth / 2) / vDir.length()); ! hDir = horSegs[0][0].getDirection(); ! hDir = hDir.copy((horPostWidth / 2) / hDir.length()); ! } List slist = new LinkedList(); Map connectMap = new HashMap(); *************** *** 538,546 **** int stepJ = 0; Vertex start = h.intersection(v); ! start = start.add(vDir).add(hDir); ! Vertex last = start; //= Geometry.insertVertex(start, false); space.add(start); Vertex next = vertSegs[i + di][j].intersection(h); ! next = next.add(vDir); //make edges till we are back at the start-vertex while (di != 0 || dj != 0) { --- 548,564 ---- int stepJ = 0; Vertex start = h.intersection(v); ! if (j != 0) { ! start = start.add(vDir); ! } ! if (i != 0) { ! start = start.add(hDir); ! } space.add(start); + + Vertex last = start; Vertex next = vertSegs[i + di][j].intersection(h); ! if (j != 0) { ! next = next.add(vDir); ! } //make edges till we are back at the start-vertex while (di != 0 || dj != 0) { *************** *** 557,565 **** stepI = 0; dirChanged = true; ! } else if (((Boolean)drawSeg.get(horSegs[i + di][j + dj])).booleanValue()) { ! //step right ! stepJ = 0; ! stepI = 1; ! } connectMap.put(e, horSegs[i + di - 1][j + dj]); } else if (stepJ == 1) { --- 575,579 ---- stepI = 0; dirChanged = true; ! } connectMap.put(e, horSegs[i + di - 1][j + dj]); } else if (stepJ == 1) { *************** *** 570,578 **** stepI = -1; dirChanged = true; ! } else if (((Boolean)drawSeg.get(vertSegs[i + di][j + dj])).booleanValue()) { ! //step down ! stepJ = 1; ! stepI = 0; ! } connectMap.put(e, vertSegs[i + di][j + dj - 1]); } else if (stepI == -1) { --- 584,588 ---- stepI = -1; dirChanged = true; ! } connectMap.put(e, vertSegs[i + di][j + dj - 1]); } else if (stepI == -1) { *************** *** 583,591 **** stepI = 0; dirChanged = true; ! } else if (((Boolean)drawSeg.get(horSegs[i + di - 1][j + dj])).booleanValue()) { ! //step left ! stepJ = 0; ! stepI = -1; ! } connectMap.put(e, horSegs[i + di][j + dj]); } else if (stepJ == -1) { --- 593,597 ---- stepI = 0; dirChanged = true; ! } connectMap.put(e, horSegs[i + di][j + dj]); } else if (stepJ == -1) { *************** *** 601,607 **** } if (dirChanged) { ! next.move((hDir.copy(-stepJ)).add(vDir.copy(stepI)).getX(), ! (hDir.copy(-stepJ)).add(vDir.copy(stepI)).getY(), ! (hDir.copy(-stepJ)).add(vDir.copy(stepI)).getZ()); } last = next; --- 607,620 ---- } if (dirChanged) { ! if (j + dj > 0 && j + dj < horPosts + 1) { ! next.move(vDir.copy(stepI).getX(), ! vDir.copy(stepI).getY(), ! vDir.copy(stepI).getZ()); ! } ! if (i + di > 0 && i + di < vertPosts + 1) { ! next.move(hDir.copy(-stepJ).getX(), ! hDir.copy(-stepJ).getY(), ! hDir.copy(-stepJ).getZ()); ! } } last = next; *************** *** 609,613 **** dj += stepJ; next = vertSegs[i + di][j + dj].intersection(horSegs[i + di][j + dj]); ! next = next.add(hDir.copy(-stepJ)).add(vDir.copy(stepI)); } Edge e = new Edge(last, start); --- 622,631 ---- dj += stepJ; next = vertSegs[i + di][j + dj].intersection(horSegs[i + di][j + dj]); ! if (j + dj > 0 && j + dj < horPosts + 1) { ! next = next.add(vDir.copy(stepI)); ! } ! if (i + di > 0 && i + di < vertPosts + 1) { ! next = next.add(hDir.copy(-stepJ)); ! } } Edge e = new Edge(last, start); *************** *** 623,627 **** } extrudeWindows(slist, connectMap); - Project.getInstance().setActiveSpace(oldActive); } } --- 641,644 ---- *************** *** 639,658 **** Surface s = (Surface)it.next(); Set sides = new HashSet(); ! if (type == SINGLE_BAR) { ! Geometry.holeAnalysis(extrudeIntoSpace(s, depth, sides)); ! } else if (type == DOUBLE_BAR) { ! Space w = new Space("Window", Space.CONSTRUCTION, Space.ELEMENT_LEVEL, true); ! double u = s.normal().dot(front.normal()); ! if ((u > 0 && front.getBackDomain() == space) || ! u < 0 && front.getFrontDomain() == space) { ! s.setBackDomain(w); ! } else { ! s.setFrontDomain(w); ! } ! space.add(w); ! Modellor wm = new WindowModellor(w, s); w.setModellor(wm); ! sides.addAll(w.getEnvelope()); ! sides.remove(s); } Iterator sideIt = sides.iterator(); --- 656,680 ---- Surface s = (Surface)it.next(); Set sides = new HashSet(); ! Space w = new Space("Window", Space.CONSTRUCTION, Space.ELEMENT_LEVEL, true); ! double u = s.normal().dot(front.normal()); ! if ((u > 0 && front.getBackDomain() == space) || ! u < 0 && front.getFrontDomain() == space) { ! s.setBackDomain(w); ! } else { ! s.setFrontDomain(w); ! } ! w.setTransparent(true); ! space.add(w); ! Geometry.holeAnalysis(extrudeIntoSpace(s, depth, sides)); ! if (type == DOUBLE_BAR) { ! FacadeModellor wm = new FacadeModellor(w, s); w.setModellor(wm); ! //wm.setFront(s); ! wm.setFrameWidth(0.1); ! wm.setDepth(0.2); ! wm.setHorPosts(0); ! wm.setVertPosts(0); ! wm.createPostConstructors(); ! wm.createFacade(); } Iterator sideIt = sides.iterator(); *************** *** 669,694 **** } } ! /** ! * Removes the windows of the facade. ! */ ! private void removeWindows() { ! Iterator it = windows.iterator(); ! while (it.hasNext()) { ! ((Surface)it.next()).delete(); ! } ! it = windowModellors.iterator(); ! while (it.hasNext()) { ! ((Modellor)it.next()).delete(); ! } ! it = windowElements.iterator(); ! while (it.hasNext()) { ! Space sp = (Space)it.next(); ! sp.clear(); ! sp.delete(); ! } ! windowModellors = new HashSet(); ! windowElements = new HashSet(); ! windows = new HashSet(); ! } /** * Makes sure to extrude the a surface to the right side --- 691,695 ---- } } ! /** * Makes sure to extrude the a surface to the right side *************** *** 723,729 **** if (this.vertPostWidth != vertPostWidth) { this.vertPostWidth = vertPostWidth; - //removeWindows(); - //createWindows(); - createFacade(); } } --- 724,727 ---- *************** *** 742,750 **** if (this.horPostWidth != horPostWidth) { this.horPostWidth = horPostWidth; - //removeWindows(); - //createWindows(); - createFacade(); } ! } /** @see net.sourceforge.bprocessor.model.modellor.Modellor#setContent(Map) */ --- 740,761 ---- if (this.horPostWidth != horPostWidth) { this.horPostWidth = horPostWidth; } ! } ! ! /** ! * Set the width of the frame ! * @param frameWidth the new frame width ! */ ! public void setFrameWidth(double frameWidth) { ! this.frameWidth = frameWidth; ! } ! ! /** ! * Set the depth ! * @param depth the new horizontal postwidth ! */ ! public void setDepth(double depth) { ! this.depth = depth; ! } /** @see net.sourceforge.bprocessor.model.modellor.Modellor#setContent(Map) */ *************** *** 755,761 **** topBound = (Line)m.get("topBound"); depth = ((Double)m.get("depth")).doubleValue(); - frame = (Space)m.get("frame"); front = (Surface)m.get("front"); ! frameThickness = ((Double)m.get("frameThickness")).doubleValue(); horPosts = ((Integer)m.get("horPosts")).intValue(); horPostWidth = ((Double)m.get("horPostWidth")).doubleValue(); --- 766,771 ---- topBound = (Line)m.get("topBound"); depth = ((Double)m.get("depth")).doubleValue(); front = (Surface)m.get("front"); ! frameWidth = ((Double)m.get("frameThickness")).doubleValue(); horPosts = ((Integer)m.get("horPosts")).intValue(); horPostWidth = ((Double)m.get("horPostWidth")).doubleValue(); *************** *** 775,781 **** m.put("topBound", topBound); m.put("depth", new Double(depth)); - m.put("frame", frame); m.put("front", front); ! m.put("frameThickness", new Double(frameThickness)); m.put("horPosts", new Integer(horPosts)); m.put("horPostWidth", new Double(horPostWidth)); --- 785,790 ---- m.put("topBound", topBound); m.put("depth", new Double(depth)); m.put("front", front); ! m.put("frameThickness", new Double(frameWidth)); m.put("horPosts", new Integer(horPosts)); m.put("horPostWidth", new Double(horPostWidth)); *************** *** 787,789 **** --- 796,820 ---- return m; } + + /** + * Set the front surface + * @param front new front surface + */ + public void setFront(Surface front) { + this.front = front; + } + /** + * Set the number of vertical posts + * @param vertPosts number of posts + */ + public void setVertPosts(int vertPosts) { + this.vertPosts = vertPosts; + } + /** + * Set the number of horizontal posts + * @param horPosts number of posts + */ + public void setHorPosts(int horPosts) { + this.horPosts = horPosts; + } } |
From: Michael L. <he...@us...> - 2006-11-02 14:45:49
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26634/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Vertex.java Surface.java Space.java Log Message: New copy operations on surface/edge/vertex Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.119 retrieving revision 1.120 diff -C2 -d -r1.119 -r1.120 *** Surface.java 30 Oct 2006 10:43:32 -0000 1.119 --- Surface.java 2 Nov 2006 14:45:38 -0000 1.120 *************** *** 437,470 **** */ public Surface copy(Space mesh) { - Surface surface = new Surface(); - HashMap map = new HashMap(); ! List edges = new ArrayList(); ! Iterator iter = getEdges().iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! Edge newEdge = new Edge(); ! Vertex from = current.getFrom(); ! Vertex newFrom = (Vertex) map.get(from); ! if (newFrom == null) { ! newFrom = from.copy(); ! map.put(from, newFrom); ! mesh.add(newFrom); ! } ! newEdge.setFrom(newFrom); ! Vertex to = current.getTo(); ! Vertex newTo = (Vertex) map.get(to); ! if (newTo == null) { ! newTo = to.copy(); ! map.put(to, newTo); ! mesh.add(newTo); } ! newEdge.setTo(newTo); ! mesh.add(newEdge); ! edges.add(newEdge); } ! surface.setEdges(edges); ! mesh.add(surface); ! return surface; } --- 437,469 ---- */ public Surface copy(Space mesh) { HashMap map = new HashMap(); ! Surface surface = copy(map); ! Collection surfaces = new LinkedList(); ! surfaces.add(surface); ! mesh.addAll(surfaces); ! return surface; ! } ! ! /** ! * Return a copy of this surface and insert the copy ! * in the map. ! * If the map already contains a copy, just return ! * the existing copy ! * @param map Maps objects to their copy ! * @return A copy ! */ ! public Surface copy(Map map) { ! Surface copy = (Surface) map.get(this); ! if (copy == null) { ! copy = new Surface(); ! List edges = new ArrayList(); ! Iterator iter = getEdges().iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! edges.add(current.copy(map)); } ! copy.setEdges(edges); } ! return copy; } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** Space.java 30 Oct 2006 06:49:24 -0000 1.91 --- Space.java 2 Nov 2006 14:45:38 -0000 1.92 *************** *** 2221,2225 **** /** ! * Add extrusion to this space * @param extrusion Collection of surfaces */ --- 2221,2225 ---- /** ! * Add extrusion to this space and protect all elements * @param extrusion Collection of surfaces */ *************** *** 2252,2255 **** --- 2252,2284 ---- } } + + /** + * Add extrusion to this space + * @param extrusion Collection of surfaces + */ + public void addAll(Collection extrusion) { + Iterator surfaces = extrusion.iterator(); + while (surfaces.hasNext()) { + Surface surface = (Surface) surfaces.next(); + Iterator edges = surface.getEdges().iterator(); + while (edges.hasNext()) { + Edge edge = (Edge) edges.next(); + Vertex from = edge.getFrom(); + if (from.getOwner() == null) { + this.add(from); + } + Vertex to = edge.getTo(); + if (to.getOwner() == null) { + this.add(to); + } + if (edge.getOwner() == null) { + this.add(edge); + } + } + if (surface.getOwner() == null) { + this.add(surface); + } + } + } /** Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** Vertex.java 30 Oct 2006 15:01:31 -0000 1.49 --- Vertex.java 2 Nov 2006 14:45:38 -0000 1.50 *************** *** 12,15 **** --- 12,16 ---- import java.util.Iterator; import java.util.List; + import java.util.Map; import java.util.Set; *************** *** 215,222 **** */ public Vertex copy() { ! Vertex vertex = new Vertex(); ! vertex.setX(getX()); ! vertex.setY(getY()); ! vertex.setZ(getZ()); return vertex; } --- 216,220 ---- */ public Vertex copy() { ! Vertex vertex = new Vertex(x, y, z); return vertex; } *************** *** 232,235 **** --- 230,250 ---- return v; } + + /** + * Return a copy of the vertex and insert the copy + * in the map. + * If the map already contains a copy, just return + * the existing copy + * @param map Maps objects to their copy + * @return A copy + */ + public Vertex copy(Map map) { + Vertex copy = (Vertex) map.get(this); + if (copy == null) { + copy = new Vertex(x, y, z); + map.put(this, copy); + } + return copy; + } /** Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** Edge.java 19 Oct 2006 09:56:21 -0000 1.63 --- Edge.java 2 Nov 2006 14:45:38 -0000 1.64 *************** *** 267,270 **** --- 267,288 ---- return edge; } + + /** + * Return a copy of this edge and insert the copy + * in the map. + * If the map already contains a copy, just return + * the existing copy + * @param map Maps objects to their copy + * @return A copy + */ + public Edge copy(Map map) { + Edge copy = (Edge) map.get(this); + if (copy == null) { + copy = new Edge(from.copy(map), to.copy(map)); + map.put(this, copy); + } + return copy; + } + /** * Move the Edge a distance (dx, dy, dz) |
From: rimestad <rim...@us...> - 2006-11-01 14:32:56
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13375/src/net/sourceforge/bprocessor/gui Modified Files: CameraView.java Log Message: Changed the default views to only contain current Index: CameraView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/CameraView.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CameraView.java 29 Sep 2006 15:07:29 -0000 1.7 --- CameraView.java 1 Nov 2006 14:32:48 -0000 1.8 *************** *** 69,79 **** Camera c = new Camera(p.getCurrentCamera(), ""); p.add(c); ! c.setName("Cam " + c.getId()); ! p.setCurrentCamera(c); } else if (which == remove) { TreePath tp = ctv.getSelectionPath(); if (tp != null) { Object node = tp.getLastPathComponent(); ! if (node instanceof CameraNode) { p.remove((Camera)((CameraNode)node).getUserObject()); } --- 69,78 ---- Camera c = new Camera(p.getCurrentCamera(), ""); p.add(c); ! c.setName("View " + c.getId()); } else if (which == remove) { TreePath tp = ctv.getSelectionPath(); if (tp != null) { Object node = tp.getLastPathComponent(); ! if (node instanceof CameraNode && node != p.getCurrentCamera()) { p.remove((Camera)((CameraNode)node).getUserObject()); } |
From: rimestad <rim...@us...> - 2006-11-01 14:32:55
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13375/src/net/sourceforge/bprocessor/gui/treeview Modified Files: CameraTreeView.java Log Message: Changed the default views to only contain current Index: CameraTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/CameraTreeView.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CameraTreeView.java 30 Oct 2006 10:37:58 -0000 1.9 --- CameraTreeView.java 1 Nov 2006 14:32:48 -0000 1.10 *************** *** 140,145 **** Object target = node.getUserObject(); if (target instanceof Camera) { ! Camera c = new Camera((Camera)target, "Current Camera"); ! Project.getInstance().setCurrentCamera(c); } } --- 140,148 ---- Object target = node.getUserObject(); if (target instanceof Camera) { ! if (Project.getInstance().getCurrentCamera() != target) { ! Camera c = new Camera((Camera)target, "(Current)"); ! Project.getInstance().setCurrentCamera(c); ! } ! Project.getInstance().changed(Project.getInstance()); } } |
From: rimestad <rim...@us...> - 2006-11-01 14:32:53
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13364/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Changed the default views to only contain current Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** Project.java 30 Oct 2006 14:19:37 -0000 1.89 --- Project.java 1 Nov 2006 14:32:45 -0000 1.90 *************** *** 51,57 **** /** The cameras */ private HashMap cameras = new HashMap(); - - /** The default un-changeable cameras */ - private LinkedList defaultCams = new LinkedList(); /** The domain id */ --- 51,54 ---- *************** *** 117,121 **** undoStack = new Stack(); redoStack = new Stack(); ! addCams(); observers = new LinkedList(); world = new Space("Project", Space.FUNCTIONAL, Space.PROJECT_LEVEL, true); --- 114,121 ---- undoStack = new Stack(); redoStack = new Stack(); ! currentCamera = new Camera("(Current)", ! new double[]{6, 3, 2}, ! new double[]{7, -12, 16}, ! new double[]{0, 0, 1}, Camera.PERSPECTIVE); observers = new LinkedList(); world = new Space("Project", Space.FUNCTIONAL, Space.PROJECT_LEVEL, true); *************** *** 218,222 **** this.setActiveCoordinateSystem(cs); this.cameras.clear(); - addCams(); this.cameraId = 0; cs.setActive(true); --- 218,221 ---- *************** *** 225,254 **** /** - * Add the default cameras to cameras - */ - private void addCams() { - Camera cam0 = Camera.create(Camera.VIEW_3D); // The starting cam (copy of 3d cam) - cam0.setId(new Long(cameraId++)); - cam0.setName("Main view"); - cameras.put(cam0.getId(), cam0); - defaultCams.add(cam0); - Camera cam2 = Camera.create(Camera.VIEW_XY); // Reset to 2D position XY with ortho - cam2.setId(new Long(cameraId++)); - cameras.put(cam2.getId(), cam2); - defaultCams.add(cam2); - Camera cam3 = Camera.create(Camera.VIEW_XZ); // Reset to 2D position XZ with ortho - cam3.setId(new Long(cameraId++)); - cameras.put(cam3.getId(), cam3); - defaultCams.add(cam3); - Camera cam4 = Camera.create(Camera.VIEW_YZ); // Reset to 2D position YZ with ortho - cam4.setId(new Long(cameraId++)); - cameras.put(cam4.getId(), cam4); - defaultCams.add(cam4); - if (currentCamera == null) { - currentCamera = new Camera(cam0, "Current"); - } - } - - /** * remove all elements in the collection from the project * @param c the collection of elements --- 224,227 ---- *************** *** 459,470 **** return new HashSet(cameras.values()); } - - /** - * Get all default cameras - * @return The cameras - */ - public LinkedList getDefaultCameras() { - return defaultCams; - } /** --- 432,435 ---- |
From: rimestad <rim...@us...> - 2006-10-31 14:23:03
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16066/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: changed viewentiremodel to zoomon which takes a colelction and a aspect. changed the implementation to reflect that. Now the focus on method choose the closest edge in the surface in respect to angle... Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** PopupMenu.java 31 Oct 2006 13:24:20 -0000 1.14 --- PopupMenu.java 31 Oct 2006 14:22:54 -0000 1.15 *************** *** 73,77 **** Vertex n = (s.normal()); Camera current = Project.getInstance().getCurrentCamera(); ! Vertex c = s.center(); double[] center = current.getCenter(); double[] cam = current.getCamera(); --- 73,77 ---- Vertex n = (s.normal()); Camera current = Project.getInstance().getCurrentCamera(); ! Vertex cen = s.center(); double[] center = current.getCenter(); double[] cam = current.getCamera(); *************** *** 79,88 **** Vertex r = new Vertex(dir); n = r.projectOnto(n); ! Vertex roll = ((Edge)(s.getEdges().get(0))).getDirection(); ! roll.normalize(); ! current.setRoll(new double[]{roll.getX(), roll.getY(), roll.getZ()}); ! current.setCenter(new double[]{c.getX(), c.getY(), c.getZ()}); ! current.setCamera(new double[]{c.getX() + n.getX(), c.getY() + n.getY(), c.getZ() + n.getZ()}); ! Project.getInstance().getCurrentCamera().viewEntireModel(1); } }; --- 79,103 ---- Vertex r = new Vertex(dir); n = r.projectOnto(n); ! Iterator iter = s.getEdges().iterator(); ! Vertex roll = new Vertex(current.getRoll()); ! Vertex newroll = null; ! double angle = 2 * 3.14; ! while (iter.hasNext()) { ! Edge e = (Edge)iter.next(); ! Vertex d = e.getDirection(); ! double tmp = d.angle(roll); ! if (tmp < angle) { ! angle = tmp; ! newroll = d; ! } ! } ! newroll.normalize(); ! current.setRoll(new double[]{newroll.getX(), newroll.getY(), newroll.getZ()}); ! current.setCenter(new double[]{cen.getX(), cen.getY(), cen.getZ()}); ! current.setCamera(new double[]{cen.getX() + n.getX(), ! cen.getY() + n.getY(), cen.getZ() + n.getZ()}); ! Collection c = new LinkedList(); ! c.add(s); ! Project.getInstance().getCurrentCamera().zoomOn(c, 1.0); } }; |
From: rimestad <rim...@us...> - 2006-10-31 14:22:53
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16054/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Log Message: changed viewentiremodel to zoomon which takes a colelction and a aspect. changed the implementation to reflect that. Now the focus on method choose the closest edge in the surface in respect to angle... Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Camera.java 29 Sep 2006 15:07:32 -0000 1.24 --- Camera.java 31 Oct 2006 14:22:51 -0000 1.25 *************** *** 403,416 **** * Moves the camera to a position where the entire model is visible. * @param aspect the acspect ratio of the view. */ ! public void viewEntireModel(double aspect) { ! Set allVertices; ! ! if (Selection.primary().isEmpty()) { ! Space space = Project.getInstance().getActiveSpace(); ! allVertices = space.collect(); ! } else { ! allVertices = Selection.primary().collect(); ! } if (!allVertices.isEmpty()) { --- 403,410 ---- * Moves the camera to a position where the entire model is visible. * @param aspect the acspect ratio of the view. + * @param c the Collection of object to zoom on to. */ ! public void zoomOn(Collection c, double aspect) { ! Set allVertices = Geometry.collect(c); if (!allVertices.isEmpty()) { |
From: rimestad <rim...@us...> - 2006-10-31 14:22:51
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16042/src/net/sourceforge/bprocessor/gl/tool Modified Files: ToolFactory.java Log Message: changed viewentiremodel to zoomon which takes a colelction and a aspect. changed the implementation to reflect that. Now the focus on method choose the closest edge in the surface in respect to angle... Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** ToolFactory.java 22 Oct 2006 14:32:55 -0000 1.62 --- ToolFactory.java 31 Oct 2006 14:22:46 -0000 1.63 *************** *** 12,17 **** --- 12,19 ---- import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Selection; import java.net.URL; + import java.util.Collection; import java.util.HashMap; import java.util.Map; *************** *** 222,226 **** public void actionPerformed(ActionEvent agr0) { double aspect = glv.getView().getAspect(); ! Project.getInstance().getCurrentCamera().viewEntireModel(aspect); this.glv.repaint(); } --- 224,232 ---- public void actionPerformed(ActionEvent agr0) { double aspect = glv.getView().getAspect(); ! Collection c = Selection.primary(); ! if (c.isEmpty()) { ! c.add(Project.getInstance().getActiveSpace()); ! } ! Project.getInstance().getCurrentCamera().zoomOn(Selection.primary(), aspect); this.glv.repaint(); } |
From: rimestad <rim...@us...> - 2006-10-31 13:30:39
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25339/src/net/sourceforge/bprocessor/gl/tool Modified Files: OrbitStrategy.java Log Message: To change the roll the turn direction cannot be taken into account because it is the turn that are changed Index: OrbitStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OrbitStrategy.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OrbitStrategy.java 7 Sep 2006 11:38:41 -0000 1.2 --- OrbitStrategy.java 31 Oct 2006 13:30:30 -0000 1.3 *************** *** 82,86 **** if (e.isShiftDown()) { // roll camera ! Camera.rollCamera(c, turn * (-angleY - angleX) / 2); } else if (e.isAltDown()) { // rotate camera about itself --- 82,86 ---- if (e.isShiftDown()) { // roll camera ! Camera.rollCamera(c, (angleY + angleX) / 2); } else if (e.isAltDown()) { // rotate camera about itself |
From: rimestad <rim...@us...> - 2006-10-31 13:24:28
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22865/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: changed see above below to focus on, and roll are now aligned with the first edge in the surface Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** PopupMenu.java 31 Oct 2006 10:29:59 -0000 1.13 --- PopupMenu.java 31 Oct 2006 13:24:20 -0000 1.14 *************** *** 68,72 **** if (c.size() == 1) { Surface s = (Surface)c.iterator().next(); ! AbstractAction fromAbove = new EntityMenuAction(s, "See from above") { public void actionPerformed(ActionEvent arg0) { Surface s = (Surface)entity; --- 68,72 ---- if (c.size() == 1) { Surface s = (Surface)c.iterator().next(); ! AbstractAction focus = new EntityMenuAction(s, "Focus on") { public void actionPerformed(ActionEvent arg0) { Surface s = (Surface)entity; *************** *** 78,102 **** double[] dir = new double[]{cam[0] - center[0], cam[1] - center[1], cam[2] - center[2]}; Vertex r = new Vertex(dir); ! Vertex right = r.cross(n); ! if (right.length() > 0.1) { ! double angle = r.angle(n); ! System.out.println(angle); ! Geometry.rotate(angle, right.getX(), right.getY(), right.getZ(), ! current.getRoll(), new double[]{0, 0, 0}); ! current.setCenter(new double[]{c.getX(), c.getY(), c.getZ()}); ! current.setCamera(new double[]{c.getX() + n.getX(), c.getY() + n.getY(), ! c.getZ() + n.getZ()}); ! Project.getInstance().getCurrentCamera().viewEntireModel(1); ! } ! } ! }; ! jm.add(fromAbove); ! AbstractAction fromBelow = new EntityMenuAction(s, "See from below") { ! public void actionPerformed(ActionEvent arg0) { ! Vertex n = ((Surface)entity).normal(); ! } }; ! jm.add(fromBelow); } if (c.size() == 2) { --- 78,91 ---- double[] dir = new double[]{cam[0] - center[0], cam[1] - center[1], cam[2] - center[2]}; Vertex r = new Vertex(dir); ! n = r.projectOnto(n); ! Vertex roll = ((Edge)(s.getEdges().get(0))).getDirection(); ! roll.normalize(); ! current.setRoll(new double[]{roll.getX(), roll.getY(), roll.getZ()}); ! current.setCenter(new double[]{c.getX(), c.getY(), c.getZ()}); ! current.setCamera(new double[]{c.getX() + n.getX(), c.getY() + n.getY(), c.getZ() + n.getZ()}); ! Project.getInstance().getCurrentCamera().viewEntireModel(1); } }; ! jm.add(focus); } if (c.size() == 2) { |
From: Michael L. <he...@us...> - 2006-10-31 10:30:08
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17021/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: All connected Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PopupMenu.java 31 Oct 2006 07:44:04 -0000 1.12 --- PopupMenu.java 31 Oct 2006 10:29:59 -0000 1.13 *************** *** 29,32 **** --- 29,33 ---- import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Camera; + import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Geometry; *************** *** 365,369 **** */ public static JPopupMenu getEntiesMenu(Collection entities) { ! JPopupMenu pm = new JPopupMenu(); AbstractAction delete = new EntitiesMenuAction(entities, "Delete") { public void actionPerformed(ActionEvent arg0) { --- 366,370 ---- */ public static JPopupMenu getEntiesMenu(Collection entities) { ! JPopupMenu menu = new JPopupMenu(); AbstractAction delete = new EntitiesMenuAction(entities, "Delete") { public void actionPerformed(ActionEvent arg0) { *************** *** 385,391 **** } }; ! pm.add(delete); ! ! return pm; } } --- 386,411 ---- } }; ! menu.add(delete); ! AbstractAction allConnected = new EntitiesMenuAction(entities, "All Connected") { ! public void actionPerformed(ActionEvent arg0) { ! int size = 0; ! Collection vertices = Geometry.collect(entities); ! Collection edges = new LinkedList(); ! while (vertices.size() > size) { ! size = vertices.size(); ! edges = Vertex.edges(vertices); ! vertices = Geometry.collect(edges); ! } ! Collection surfaces = Edge.surfaces(edges); ! Collection geometrics = new HashSet(); ! geometrics.addAll(surfaces); ! geometrics.addAll(edges); ! geometrics.addAll(vertices); ! Selection.primary().clear(); ! Selection.primary().addAll(geometrics); ! } ! }; ! menu.add(allConnected); ! return menu; } } |
From: Michael L. <he...@us...> - 2006-10-31 10:30:08
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17008/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: All connected Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** SpaceTool.java 30 Oct 2006 11:39:37 -0000 1.62 --- SpaceTool.java 31 Oct 2006 10:29:56 -0000 1.63 *************** *** 156,185 **** protected JPopupMenu makeSelectionMenu() { if (Selection.primary().isEmpty()) { ! if (target instanceof String) { ! String type = (String) target; ! JPopupMenu menu = new JPopupMenu(); ! JMenuItem layerItem = new JMenuItem("Layer"); ! Surface surface = null; ! Space space = null; ! ! Iterator iter = Selection.primary().iterator(); ! while (iter.hasNext()) { ! Object current = iter.next(); ! if (current instanceof Surface) { ! surface = (Surface) current; ! } ! } ! if (surface != null) { ! if (type.equals("front")) { ! space = surface.getFrontDomain(); ! } ! if (type.equals("back")) { ! space = surface.getBackDomain(); ! } ! } ! layerItem.addActionListener(new LayerAction(space, surface)); ! menu.add(layerItem); ! return menu; ! } else if (target instanceof Space) { return PopupMenu.getSpaceMenu((Space)target); } else if (target instanceof Surface) { --- 156,160 ---- protected JPopupMenu makeSelectionMenu() { if (Selection.primary().isEmpty()) { ! if (target instanceof Space) { return PopupMenu.getSpaceMenu((Space)target); } else if (target instanceof Surface) { *************** *** 204,212 **** } } ! String name = type.getName(); ! log.info(name); ! if (name.substring(name.length() - 5).equals("Space")) { return PopupMenu.getSpaceMenu(Selection.primary()); ! } else if (name.substring(name.length() - 7).equals("Surface")) { return PopupMenu.getSurfaceMenu(Selection.primary()); } else { --- 179,185 ---- } } ! if (type == Space.class) { return PopupMenu.getSpaceMenu(Selection.primary()); ! } else if (type == Surface.class) { return PopupMenu.getSurfaceMenu(Selection.primary()); } else { |
From: Michael L. <he...@us...> - 2006-10-31 07:44:12
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15159/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: Fixed styleerror Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PopupMenu.java 30 Oct 2006 15:01:35 -0000 1.11 --- PopupMenu.java 31 Oct 2006 07:44:04 -0000 1.12 *************** *** 81,87 **** double angle = r.angle(n); System.out.println(angle); ! Geometry.rotate(angle, right.getX(), right.getY(), right.getZ(), current.getRoll(), new double[]{0, 0, 0}); current.setCenter(new double[]{c.getX(), c.getY(), c.getZ()}); ! current.setCamera(new double[]{c.getX() + n.getX(), c.getY() + n.getY(), c.getZ() + n.getZ()}); Project.getInstance().getCurrentCamera().viewEntireModel(1); } --- 81,89 ---- double angle = r.angle(n); System.out.println(angle); ! Geometry.rotate(angle, right.getX(), right.getY(), right.getZ(), ! current.getRoll(), new double[]{0, 0, 0}); current.setCenter(new double[]{c.getX(), c.getY(), c.getZ()}); ! current.setCamera(new double[]{c.getX() + n.getX(), c.getY() + n.getY(), ! c.getZ() + n.getZ()}); Project.getInstance().getCurrentCamera().viewEntireModel(1); } |
From: rimestad <rim...@us...> - 2006-10-30 15:01:40
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3240/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: implemented see from above for surfaces. There have emerged some serious problems with the rotation tool, maybe it is due to wierd roll vectors??? Added Angle(Vertex) on vertex Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PopupMenu.java 30 Oct 2006 10:30:11 -0000 1.10 --- PopupMenu.java 30 Oct 2006 15:01:35 -0000 1.11 *************** *** 28,31 **** --- 28,32 ---- import net.sourceforge.bprocessor.gui.attrview.AttributeView; import net.sourceforge.bprocessor.model.Attribute; + import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Geometry; *************** *** 68,73 **** AbstractAction fromAbove = new EntityMenuAction(s, "See from above") { public void actionPerformed(ActionEvent arg0) { ! Vertex n = ((Surface)entity).normal(); ! Project.getInstance().checkpoint(); } }; --- 69,89 ---- AbstractAction fromAbove = new EntityMenuAction(s, "See from above") { public void actionPerformed(ActionEvent arg0) { ! Surface s = (Surface)entity; ! Vertex n = (s.normal()); ! Camera current = Project.getInstance().getCurrentCamera(); ! Vertex c = s.center(); ! double[] center = current.getCenter(); ! double[] cam = current.getCamera(); ! double[] dir = new double[]{cam[0] - center[0], cam[1] - center[1], cam[2] - center[2]}; ! Vertex r = new Vertex(dir); ! Vertex right = r.cross(n); ! if (right.length() > 0.1) { ! double angle = r.angle(n); ! System.out.println(angle); ! Geometry.rotate(angle, right.getX(), right.getY(), right.getZ(), current.getRoll(), new double[]{0, 0, 0}); ! current.setCenter(new double[]{c.getX(), c.getY(), c.getZ()}); ! current.setCamera(new double[]{c.getX() + n.getX(), c.getY() + n.getY(), c.getZ() + n.getZ()}); ! Project.getInstance().getCurrentCamera().viewEntireModel(1); ! } } }; *************** *** 76,80 **** public void actionPerformed(ActionEvent arg0) { Vertex n = ((Surface)entity).normal(); ! Project.getInstance().checkpoint(); } }; --- 92,96 ---- public void actionPerformed(ActionEvent arg0) { Vertex n = ((Surface)entity).normal(); ! } }; |
From: rimestad <rim...@us...> - 2006-10-30 15:01:33
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3232/src/net/sourceforge/bprocessor/model Modified Files: Vertex.java Log Message: implemented see from above for surfaces. There have emerged some serious problems with the rotation tool, maybe it is due to wierd roll vectors??? Added Angle(Vertex) on vertex Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** Vertex.java 19 Oct 2006 09:56:21 -0000 1.48 --- Vertex.java 30 Oct 2006 15:01:31 -0000 1.49 *************** *** 295,298 **** --- 295,307 ---- /** + * Compute the angle between two vertex (as if they were vectors) + * @param v The second vertex + * @return the angle between + */ + public double angle(Vertex v) { + return Math.acos(this.dot(v) / (this.length() * v.length())); + } + + /** * compute the lengt of the vertex * @return the length of the vertex |
From: rimestad <rim...@us...> - 2006-10-30 14:19:39
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20455/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: no resetting the currentCamera Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** Project.java 30 Oct 2006 10:40:31 -0000 1.88 --- Project.java 30 Oct 2006 14:19:37 -0000 1.89 *************** *** 245,249 **** cameras.put(cam4.getId(), cam4); defaultCams.add(cam4); ! currentCamera = new Camera(cam0, "Current"); } --- 245,251 ---- cameras.put(cam4.getId(), cam4); defaultCams.add(cam4); ! if (currentCamera == null) { ! currentCamera = new Camera(cam0, "Current"); ! } } |
From: rimestad <rim...@us...> - 2006-10-30 11:39:41
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19319/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: getSimpleName only available in 1.5 and isPopuptrigger aparently doesn't always work on windows Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** SpaceTool.java 30 Oct 2006 10:34:27 -0000 1.61 --- SpaceTool.java 30 Oct 2006 11:39:37 -0000 1.62 *************** *** 87,95 **** glv.setLengthValue(""); typing = false; - findTarget(e); boolean done = false; ! if (e.isPopupTrigger()) { glv.popup(makeSelectionMenu(), e.getX(), e.getY()); done = true; --- 87,95 ---- glv.setLengthValue(""); typing = false; findTarget(e); boolean done = false; ! if (e.getButton() == MouseEvent.BUTTON3 || ! (e.isControlDown() && e.getButton() == MouseEvent.BUTTON3)) { glv.popup(makeSelectionMenu(), e.getX(), e.getY()); done = true; *************** *** 204,210 **** } } ! if (type.getSimpleName().equals("Space")) { return PopupMenu.getSpaceMenu(Selection.primary()); ! } else if (type.getSimpleName().equals("Surface")) { return PopupMenu.getSurfaceMenu(Selection.primary()); } else { --- 204,212 ---- } } ! String name = type.getName(); ! log.info(name); ! if (name.substring(name.length() - 5).equals("Space")) { return PopupMenu.getSpaceMenu(Selection.primary()); ! } else if (name.substring(name.length() - 7).equals("Surface")) { return PopupMenu.getSurfaceMenu(Selection.primary()); } else { |
From: rimestad <rim...@us...> - 2006-10-30 10:58:41
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/constraints In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2556/src/net/sourceforge/bprocessor/model/constraints Modified Files: OffsetConstraint.java Log Message: added a static method to Offset to make a new offset Index: OffsetConstraint.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/constraints/OffsetConstraint.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** OffsetConstraint.java 4 Jul 2006 09:36:55 -0000 1.5 --- OffsetConstraint.java 30 Oct 2006 10:58:36 -0000 1.6 *************** *** 11,14 **** --- 11,15 ---- import java.io.Reader; import java.io.StringReader; + import java.util.Collection; import java.util.HashMap; import java.util.HashSet; *************** *** 54,57 **** --- 55,82 ---- /** + * Add offset constraint to objects + * @param objects The objects + */ + public static void addOffsetConstraint(Collection objects) { + if (objects.size() == 2) { + Iterator iter = objects.iterator(); + Object arg1 = iter.next(); + Object arg2 = iter.next(); + Surface master = null; + Surface slave = null; + if (arg1 instanceof Surface) { + master = (Surface) arg1; + } + if (arg2 instanceof Surface) { + slave = (Surface) arg2; + } + if (master != null && slave != null) { + OffsetConstraint constraint = new OffsetConstraint(master, slave); + Project.getInstance().add(constraint); + } + } + } + + /** * @return offset */ |
From: rimestad <rim...@us...> - 2006-10-30 10:43:35
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28781/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Some surfaces cant genrerate a coordinatesystem, dont know why just made a cheeck for it Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.118 retrieving revision 1.119 diff -C2 -d -r1.118 -r1.119 *** Surface.java 30 Oct 2006 06:49:24 -0000 1.118 --- Surface.java 30 Oct 2006 10:43:32 -0000 1.119 *************** *** 1435,1438 **** --- 1435,1442 ---- public boolean surrounds(Vertex v, double planePrecision) { CoordinateSystem cs = this.coordinateSystem(); + if (cs == null) { + log.warn("Surface " + this + " could not present a coordinatesystem"); + return false; + } Vertex lv = cs.translate(v); /* |
From: rimestad <rim...@us...> - 2006-10-30 10:42:21
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28353/src/net/sourceforge/bprocessor/model Modified Files: ClippingPlane.java Geometry.java CoordinateSystem.java Log Message: Made some modifications to ClippingPlane, made them parametric to watch them in the object view, and added new methods to it, so that it can represent a slice. Still need lots of work Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClippingPlane.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ClippingPlane.java 5 Oct 2006 11:27:04 -0000 1.11 --- ClippingPlane.java 30 Oct 2006 10:42:17 -0000 1.12 *************** *** 10,13 **** --- 10,14 ---- import java.util.Iterator; import java.util.ArrayList; + import java.util.List; import java.util.Set; import java.util.HashSet; *************** *** 18,22 **** * The Clippingplane */ ! public class ClippingPlane extends Geometric { /** * --- 19,23 ---- * The Clippingplane */ ! public class ClippingPlane extends Geometric implements Parametric { /** * *************** *** 45,48 **** --- 46,55 ---- private boolean isActive; + /** The depth of the cut, if 0 the cut is infinit */ + private double clipdepth = 0; + + /** The joined clippingplane */ + private ClippingPlane friend; + /** * The constructor *************** *** 128,145 **** */ public void delete() { ! Iterator it = Project.getInstance().getCameras().iterator(); ! while (it.hasNext()) { ! Camera cam = (Camera)it.next(); ! Iterator clipIt = cam.getClipplanes().iterator(); ! while (clipIt.hasNext()) { ! ClippingPlane clip = (ClippingPlane)clipIt.next(); ! if (clip == this) { ! cam.removeClipplane(this); ! Project.getInstance().changed(cam); ! break; ! } ! } } - return; } --- 135,143 ---- */ public void delete() { ! Camera c = Project.getInstance().getCurrentCamera(); ! c.removeClipplane(this); ! if (friend != null) { ! c.removeClipplane(friend); } } *************** *** 169,173 **** */ public Collection findIntersections() { ! Collection edges = Project.getInstance().getActiveSpace().getEdges(); ArrayList silluet = new ArrayList(); Collection res = new ArrayList(); --- 167,172 ---- */ public Collection findIntersections() { ! Space space = Project.getInstance().getActiveSpace(); ! Collection edges = Geometry.getActiveEdges(space); ArrayList silluet = new ArrayList(); Collection res = new ArrayList(); *************** *** 190,194 **** } } ! Collection surfaces = Project.getInstance().getActiveSpace().getSurfaces(); it = surfaces.iterator(); while (it.hasNext()) { --- 189,193 ---- } } ! Collection surfaces = Geometry.getActiveSurfaces(space); it = surfaces.iterator(); while (it.hasNext()) { *************** *** 292,295 **** --- 291,297 ---- public void setActive(boolean isActive) { this.isActive = isActive; + if (friend != null) { + friend.isActive = isActive; + } } *************** *** 297,300 **** --- 299,305 ---- public void move(double x, double y, double z) { center().move(x, y, z); + if (friend != null) { + friend.center().move(x, y, z); + } } *************** *** 303,305 **** --- 308,392 ---- return new Vertex(x, y, z).projectOnto(plane.normal()); } + + /** + * @see net.sourceforge.bprocessor.model.Parametric#getAttributes() + */ + public List getAttributes() { + if (friend != null && clipdepth == 0) { + return friend.getAttributes(); + } + ArrayList res = new ArrayList(); + if (isActive()) { + res.add(new Attribute("isActive", Boolean.TRUE)); + } else { + res.add(new Attribute("isActive", Boolean.FALSE)); + } + res.add(new Attribute("Clip depth", new Double(clipdepth))); + res.add(new Attribute("Friend", friend, false)); + return res; + } + + /** + * @see net.sourceforge.bprocessor.model.Parametric#getGeneralName() + */ + public String getGeneralName() { + String s = "Clippingplane"; + return s; + } + + /** + * @see net.sourceforge.bprocessor.model.Parametric#setAttributes(List) + */ + public void setAttributes(List attributes) { + if (friend != null && clipdepth == 0) { + friend.setAttributes(attributes); + } + Iterator iter = attributes.iterator(); + while (iter.hasNext()) { + Attribute a = (Attribute)iter.next(); + if (a.getName().equals("isActive")) { + setActive(((Boolean)a.getValue()).booleanValue()); + } else if (a.getName().equals("Clip depth")) { + setClipdepth(((Double)a.getValue()).doubleValue()); + } else { + log.warn("Don't know attribute " + a.getName()); + } + } + } + + /** + * Return the clipdepth + * @return the clipdepth + */ + public double getClipdepth() { + return clipdepth; + } + + /** + * Setter for the clipdepth + * @param clipdepth the new clipdepth + */ + public void setClipdepth(double clipdepth) { + this.clipdepth = Math.abs(clipdepth); + if (clipdepth != 0) { + if (friend != null) { + Project.getInstance().getCurrentCamera().removeClipplane(friend); + } + //make a new friend + CoordinateSystem newcs = cs.copy(); + newcs.flip(); + Vertex move = newcs.n.copy(); + move.scale(-clipdepth); + newcs.move(move.getX(), move.getY(), move.getZ()); + ClippingPlane cp = new ClippingPlane(newcs); + Project.getInstance().getCurrentCamera().addClipplane(cp); + cp.friend = this; + this.friend = cp; + } else { + if (friend != null) { + Project.getInstance().getCurrentCamera().removeClipplane(friend); + } + friend = null; + } + } } Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Geometry.java 19 Oct 2006 15:28:51 -0000 1.34 --- Geometry.java 30 Oct 2006 10:42:17 -0000 1.35 *************** *** 28,31 **** --- 28,92 ---- /** + * Find all edges in given space and all its subspaces that are active parts, + * that is all edges in spaces that have no subspaces. + * @param s The space to start from + * @return The collection of edges + */ + public static Collection getActiveEdges(Space s) { + if (s.getElements().isEmpty()) { + Collection c = s.getEdges(); + if (c.isEmpty()) { + Collection e = new ArrayList(); + Iterator iter = s.getEnvelope().iterator(); + while (iter.hasNext()) { + e.addAll(((Surface)iter.next()).getEdges()); + } + return e; + } + return c; + } else { + ArrayList edges = new ArrayList(); + Iterator iter = s.getElements().iterator(); + while (iter.hasNext()) { + Space cur = (Space)iter.next(); + Collection c = getActiveEdges(cur); + edges.addAll(c); + } + return edges; + } + } + + /** + * Find all surfaces in given space and all its subspaces that are active parts, + * that is all surfaces in spaces that have no subspaces. + * @param s The space to start from + * @return The collection of surfaces + */ + public static Collection getActiveSurfaces(Space s) { + if (s.getElements().isEmpty()) { + Collection c = s.getSurfaces(); + if (c.isEmpty()) { + return s.getEnvelope(); + } else { + return c; + } + } else { + ArrayList surfaces = new ArrayList(); + Iterator iter = s.getElements().iterator(); + while (iter.hasNext()) { + try { + Space cur = (Space)iter.next(); + surfaces.addAll(getActiveSurfaces(cur)); + } catch (ClassCastException e) { + log.info("Elements in " + s + " were not only spaces"); + e.printStackTrace(); + break; + } + } + return surfaces; + } + } + + /** * Calculate the normal that points outwards * @param vertices The vertices describing a planar polygon Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** CoordinateSystem.java 17 Oct 2006 12:20:00 -0000 1.29 --- CoordinateSystem.java 30 Oct 2006 10:42:17 -0000 1.30 *************** *** 586,588 **** --- 586,608 ---- } } + + /** + * make a copy of the coordinatsystem + * @return the copy + */ + public CoordinateSystem copy() { + CoordinateSystem n = new CoordinateSystem(); + n.setAttributes(this.getAttributes()); + return n; + } + + /** + * flip the coordinatesystem on its head; + */ + public void flip() { + Vertex tmp = i; + i = j; + j = tmp; + n.scale(-1); + } } |
From: rimestad <rim...@us...> - 2006-10-30 10:41:01
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27591/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: when a project is cleared the cams are reset as well Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** Project.java 27 Oct 2006 10:25:14 -0000 1.87 --- Project.java 30 Oct 2006 10:40:31 -0000 1.88 *************** *** 217,220 **** --- 217,223 ---- world.add(cs); this.setActiveCoordinateSystem(cs); + this.cameras.clear(); + addCams(); + this.cameraId = 0; cs.setActive(true); changed(this); |
From: rimestad <rim...@us...> - 2006-10-30 10:39:03
|
Update of /cvsroot/bprocessor/model/src/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26779/src/etc Modified Files: bprocessor.xsd Log Message: added the scema of camera and clipplanes, but havn't finished the Persistence of them yet Index: bprocessor.xsd =================================================================== RCS file: /cvsroot/bprocessor/model/src/etc/bprocessor.xsd,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** bprocessor.xsd 16 Oct 2006 08:44:29 -0000 1.22 --- bprocessor.xsd 30 Oct 2006 10:38:59 -0000 1.23 *************** *** 31,34 **** --- 31,69 ---- </xsd:complexContent> </xsd:complexType> + + <xsd:complexType name="TripletType"> + <xsd:attribute name="x" type="xsd:int" use="required"/> + <xsd:attribute name="y" type="xsd:int" use="required"/> + <xsd:attribute name="z" type="xsd:int" use="required"/> + </xsd:complexType> + + <xsd:complexType name="ClipplaneType"> + <xsd:complexContent> + <xsd:extension base="EntityType"> + <xsd:sequence> + <xsd:element name="coordinateSystem" type="CoordinateSystemType" maxOccurs="1" minOccurs="1"/> + </xsd:sequence> + <xsd:attribute name="Active" type="xsd:boolean" use="required"/> + <xsd:attribute name="friend" type="xsd:long"/> + <xsd:attribute name="number" type="xsd:int" use="required"/> + <xsd:attribute name="clipdepth" type="xsd:double" use="required"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="CameraType"> + <xsd:complexContent> + <xsd:extension base="EntityType"> + <xsd:sequence> + <xsd:element name="camera" type="TripletType" maxOccurs="1" minOccurs="1"/> + <xsd:element name="center" type="TripletType" maxOccurs="1" minOccurs="1"/> + <xsd:element name="roll" type="TripletType" maxOccurs="1" minOccurs="1"/> + <xsd:element name="focalwidth" type="xsd:double" maxOccurs="1" minOccurs="1"/> + <xsd:element name="type" type="xsd:int" maxOccurs="1" minOccurs="1"/> + <xsd:element name="clipplanes" type="ClipplaneType" maxOccurs="unbounded" minOccurs="0"/> + </xsd:sequence> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> <xsd:complexType name="SpaceType"> *************** *** 291,295 **** <xsd:element ref="edge" maxOccurs="unbounded" minOccurs="0"/> <xsd:element ref="vertex" maxOccurs="unbounded" minOccurs="0"/> ! <xsd:element ref="material" maxOccurs="unbounded" minOccurs="0"/> </xsd:sequence> </xsd:complexType> --- 326,331 ---- <xsd:element ref="edge" maxOccurs="unbounded" minOccurs="0"/> <xsd:element ref="vertex" maxOccurs="unbounded" minOccurs="0"/> ! <xsd:element ref="material" maxOccurs="unbounded" minOccurs="0"/> ! <xsd:element name="camera" type="CameraType" maxOccurs="unbounded" minOccurs="0"/> </xsd:sequence> </xsd:complexType> |