bprocessor-commit Mailing List for B-processor (Page 114)
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: Nordholt <nor...@us...> - 2006-07-31 11:29:58
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12672 Modified Files: ArcTool.java Log Message: dragging and length field in arctool Index: ArcTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ArcTool.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ArcTool.java 29 Mar 2006 13:18:29 -0000 1.9 --- ArcTool.java 31 Jul 2006 11:29:56 -0000 1.10 *************** *** 28,31 **** --- 28,37 ---- private Intersection end; + /** Wherther or not the arc tool is being dragged */ + private boolean dragging; + + /** Radius of the current arc */ + private double radius = 0; + /** * Update feedback *************** *** 103,107 **** if (inter != null) { Vertex center = inter.getFrom(); ! double radius = 0; double tetra1 = 0; double tetra2 = 0; --- 109,113 ---- if (inter != null) { Vertex center = inter.getFrom(); ! radius = 0; double tetra1 = 0; double tetra2 = 0; *************** *** 134,138 **** edges.add(edge); current = next; ! } } if (debug) { --- 140,144 ---- edges.add(edge); current = next; ! } } if (debug) { *************** *** 202,205 **** --- 208,215 ---- */ protected void dragged(MouseEvent e) { + if (!dragging) { + dragging = true; + } + moved(e); } *************** *** 209,214 **** --- 219,247 ---- */ protected void released(MouseEvent e) { + if (dragging) { + pressed(e); + dragging = false; + } } + + /** + * Update the length field + */ + protected void updateLength() { + if (end == null) { + super.updateLength(); + } else { + glv.setLength(radius); + } + } + + /** + * Clean up + */ + public void cleanUp() { + super.cleanUp(); + end = null; + } } |
From: rimestad <rim...@us...> - 2006-07-31 11:29:42
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12640/src/net/sourceforge/bprocessor/model Modified Files: Space.java Project.java Log Message: Added setting of activecoordinatesystem to the clear method of Project and fixed a misspell and boolean check in space Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** Space.java 27 Jul 2006 10:27:37 -0000 1.42 --- Space.java 31 Jul 2006 11:29:40 -0000 1.43 *************** *** 82,87 **** private long nextSurfaceId; ! /** The co0nstructors */ ! private HashMap constructors; /** The next constructor id */ private long nextConstructorId; --- 82,87 ---- private long nextSurfaceId; ! /** The constructors */ ! private Map constructors; /** The next constructor id */ private long nextConstructorId; *************** *** 330,334 **** */ public Collection getConstructors() { ! if (container) { return constructors.values(); } else { --- 330,334 ---- */ public Collection getConstructors() { ! if (this.isContainer()) { return constructors.values(); } else { *************** *** 338,341 **** --- 338,348 ---- /** + * Set the set of connstructors in the map to the given map + * @param constructors the constructors + */ + public void setConstructors(Map constructors) { + this.constructors = constructors; + } + /** * Add a vertex * @param vertex The vertex Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** Project.java 26 Jul 2006 14:45:55 -0000 1.67 --- Project.java 31 Jul 2006 11:29:40 -0000 1.68 *************** *** 183,186 **** --- 183,190 ---- world.clear(); this.setActiveSpace(null); + CoordinateSystem cs = new CoordinateSystem(new Vertex(1, 0, 0), + new Vertex(0, 1, 0), new Vertex(0, 0, 1), new Vertex(0, 0, 0)); + world.add(cs); + this.setActiveCoordinateSystem(cs); changed(this); } |
From: Nordholt <nor...@us...> - 2006-07-31 11:29:12
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12585 Modified Files: Pencil.java Log Message: dragging in pencil Index: Pencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Pencil.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Pencil.java 25 Jul 2006 13:12:34 -0000 1.9 --- Pencil.java 31 Jul 2006 11:29:08 -0000 1.10 *************** *** 25,28 **** --- 25,31 ---- public class Pencil extends AbstractPencil { + /** Wherter or not the pencil is being dragged */ + private boolean dragging; + /** * Constructor for Pencil *************** *** 32,35 **** --- 35,39 ---- public Pencil(GLView glv, Cursor cursor) { super(glv, cursor); + dragging = false; } *************** *** 108,112 **** */ protected void dragged(MouseEvent e) { ! } --- 112,119 ---- */ protected void dragged(MouseEvent e) { ! if (!dragging) { ! dragging = true; ! } ! moved(e); } *************** *** 115,119 **** */ protected void released(MouseEvent e) { ! } } --- 122,137 ---- */ protected void released(MouseEvent e) { ! if (dragging) { ! pressed(e); ! dragging = false; ! } ! } ! ! /** ! * Clean up ! */ ! public void cleanUp() { ! super.cleanUp(); ! dragging = false; } } |
From: rimestad <rim...@us...> - 2006-07-31 11:25:59
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11096/src/net/sourceforge/bprocessor/gl/tool Modified Files: ConstructorTool.java Log Message: Added xml schema for constructors and added interlizing and externalizing of constructors to persistens.java, Added checkpoint call to ConstructorTool and added empty constructor to Line Point and Coordinatesystem Index: ConstructorTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ConstructorTool.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ConstructorTool.java 20 Jul 2006 12:58:04 -0000 1.7 --- ConstructorTool.java 31 Jul 2006 11:25:57 -0000 1.8 *************** *** 55,58 **** --- 55,59 ---- Point point = new Point(vertex.copy()); Project.getInstance().getActiveSpace().add(point); + Project.getInstance().checkpoint(); Project.getInstance().changed(Project.getInstance()); } *************** *** 66,69 **** --- 67,71 ---- Line line = new Line(p1, p2.minus(p1)); Project.getInstance().getActiveSpace().add(line); + Project.getInstance().checkpoint(); Project.getInstance().changed(Project.getInstance()); } *************** *** 82,85 **** --- 84,88 ---- cs.onlyPlane(true); Project.getInstance().getActiveSpace().add(cs); + Project.getInstance().checkpoint(); Project.getInstance().changed(Project.getInstance()); } |
From: rimestad <rim...@us...> - 2006-07-31 11:25:55
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11071/src/net/sourceforge/bprocessor/model Modified Files: Line.java Point.java Persistence.java CoordinateSystem.java Constructor.java Log Message: Added xml schema for constructors and added interlizing and externalizing of constructors to persistens.java, Added checkpoint call to ConstructorTool and added empty constructor to Line Point and Coordinatesystem Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Persistence.java 15 May 2006 10:31:45 -0000 1.3 --- Persistence.java 31 Jul 2006 11:25:51 -0000 1.4 *************** *** 9,21 **** --- 9,28 ---- import net.sourceforge.bprocessor.model.xml.Bmodel; + import net.sourceforge.bprocessor.model.xml.ConstructorType; + import net.sourceforge.bprocessor.model.xml.CoordinateSystemType; import net.sourceforge.bprocessor.model.xml.EdgeType; import net.sourceforge.bprocessor.model.xml.EntityType; + import net.sourceforge.bprocessor.model.xml.LineType; import net.sourceforge.bprocessor.model.xml.MaterialType; + import net.sourceforge.bprocessor.model.xml.PointType; import net.sourceforge.bprocessor.model.xml.SpaceType; import net.sourceforge.bprocessor.model.xml.SurfaceType; import net.sourceforge.bprocessor.model.xml.VertexType; import net.sourceforge.bprocessor.model.xml.impl.BmodelImpl; + import net.sourceforge.bprocessor.model.xml.impl.CoordinateSystemTypeImpl; import net.sourceforge.bprocessor.model.xml.impl.EdgeImpl; + import net.sourceforge.bprocessor.model.xml.impl.LineTypeImpl; import net.sourceforge.bprocessor.model.xml.impl.MaterialImpl; + import net.sourceforge.bprocessor.model.xml.impl.PointTypeImpl; import net.sourceforge.bprocessor.model.xml.impl.SpaceImpl; import net.sourceforge.bprocessor.model.xml.impl.SurfaceImpl; *************** *** 79,82 **** --- 86,91 ---- } Project.getInstance().setWorld(world); + Project.getInstance().setActiveCoordinateSystem( + (CoordinateSystem) get(document.getCs(), mapper)); Project.getInstance().setActiveSpace((Space) get(document.getActive(), mapper)); } *************** *** 174,180 **** --- 183,237 ---- } } + { + Iterator iter = xml.getConstructor().iterator(); + while (iter.hasNext()) { + ConstructorType current = (ConstructorType) iter.next(); + space.add(internalizeConstructor(current, mapper, xmls)); + } + } return space; } + + /** + * + * @param xml The ConstructorType + * @param mapper The mapper + * @param xmls The xmls + * @return The Constructor + */ + private static Constructor internalizeConstructor(ConstructorType xml, + Map mapper, Collection xmls) { + Constructor res; + if (xml instanceof PointType) { + res = new Point(); + } else if (xml instanceof LineType) { + Line l = new Line(); + l.setDirection(internalizeVertex(((LineType)xml).getDirection(), + new HashMap(), new LinkedList())); + res = l; + } else if (xml instanceof CoordinateSystemType) { + CoordinateSystem cs = new CoordinateSystem(); + CoordinateSystemType cst = (CoordinateSystemType)xml; + cs.onlyPlane(cst.isOnlyplane()); + List ijn = cst.getIjn(); + 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()); + cs.setIJN(i, j, n); + res = cs; + } else { + log.error(xml + " were not a known constructor"); + return null; + } + res.setActive(xml.isActive()); + res.setEditable(xml.isEditable()); + res.setId(new Long(xml.getProgid())); + mapper.put(new Long(xml.getId()), res); + res.setOrigin(internalizeVertex(xml.getOrigin(), new HashMap(), new LinkedList())); + xmls.add(xml); + return res; + } + /** * *************** *** 217,221 **** private static Vertex internalizeVertex(VertexType xml, Map mapper, Collection xmls) { Vertex vertex = new Vertex(); ! vertex.setId(new Long(xml.getProgid())); mapper.put(new Long(xml.getId()), vertex); xmls.add(xml); --- 274,280 ---- private static Vertex internalizeVertex(VertexType xml, Map mapper, Collection xmls) { Vertex vertex = new Vertex(); ! if (xml.getProgid() != 0) { ! vertex.setId(new Long(xml.getProgid())); ! } mapper.put(new Long(xml.getId()), vertex); xmls.add(xml); *************** *** 386,389 **** --- 445,449 ---- } } + document.setCs(id(mapper, Project.getInstance().getActiveCoordinateSystem())); document.setActive(id(mapper, Project.getInstance().getActiveSpace())); return document; *************** *** 471,474 **** --- 531,578 ---- } } + { + Iterator iter = space.getConstructors().iterator(); + while (iter.hasNext()) { + Constructor current = (Constructor) iter.next(); + xml.getConstructor().add(externalizeConstructor(current, map)); + } + } + return xml; + } + + /** + * Create an xml ConstructorImpl and place it in the map + * @param constructor The constructor + * @param map The map + * @return The ConstructorImpl + */ + private static ConstructorType externalizeConstructor(Constructor constructor, Map map) { + ConstructorType xml; + if (constructor instanceof Point) { + xml = new PointTypeImpl(); + } else if (constructor instanceof Line) { + xml = new LineTypeImpl(); + ((LineType)xml).setDirection(externalizeVertex(((Line)constructor).getDirection(), + new HashMap())); + } else if (constructor instanceof CoordinateSystem) { + CoordinateSystem cs = (CoordinateSystem)constructor; + CoordinateSystemType cst = new CoordinateSystemTypeImpl(); + cst.setOnlyplane(((CoordinateSystem)constructor).onlyPlane()); + List ijn = cst.getIjn(); + ijn.add(0, externalizeVertex(cs.getI(), new HashMap())); + ijn.add(1, externalizeVertex(cs.getJ(), new HashMap())); + ijn.add(2, externalizeVertex(cs.getN(), new HashMap())); + xml = cst; + } else { + log.error(constructor + " were of unknown type"); + return null; + } + xml.setId(counter++); + xml.setProgid(constructor.getId().longValue()); + xml.setActive(constructor.isActive()); + xml.setEditable(constructor.isEditable()); + VertexType orig = externalizeVertex(constructor.getOrigin(), new HashMap()); + xml.setOrigin(orig); + map.put(constructor, xml); return xml; } *************** *** 513,517 **** VertexType xml = new VertexImpl(); xml.setId(counter++); ! xml.setProgid(vertex.getId().longValue()); map.put(vertex, xml); xml.setX(vertex.getX()); --- 617,623 ---- VertexType xml = new VertexImpl(); xml.setId(counter++); ! if (vertex.getId() != null) { ! xml.setProgid(vertex.getId().longValue()); ! } map.put(vertex, xml); xml.setX(vertex.getX()); *************** *** 588,593 **** } else if (object instanceof Vertex) { externalizeReferences((Vertex) object, (VertexType) xml, map); ! } else if (object instanceof Material) { externalizeMaterial((Material) object, (MaterialType) xml, map); } } --- 694,701 ---- } else if (object instanceof Vertex) { externalizeReferences((Vertex) object, (VertexType) xml, map); ! } else if (object instanceof Material) { externalizeMaterial((Material) object, (MaterialType) xml, map); + } else if (object instanceof Constructor) { + externalizeReferences((Constructor) object, (ConstructorType) xml, map); } } *************** *** 646,649 **** --- 754,766 ---- * @param map The map */ + private static void externalizeReferences(Constructor object, ConstructorType xml, Map map) { + } + + /** + * Externalize references + * @param object The object + * @param xml The xml entity + * @param map The map + */ private static void externalizeMaterial(Material object, MaterialType xml, Map map) { } Index: Point.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Point.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Point.java 27 Jul 2006 08:05:21 -0000 1.6 --- Point.java 31 Jul 2006 11:25:51 -0000 1.7 *************** *** 25,28 **** --- 25,36 ---- /** + * A persistence constructor + * Constructor + */ + public Point() { + super(); + } + + /** * Collects the set of vertices in this geometric * @return the set of vertices Index: Constructor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Constructor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Constructor.java 27 Jul 2006 10:27:02 -0000 1.6 --- Constructor.java 31 Jul 2006 11:25:51 -0000 1.7 *************** *** 22,40 **** /** Specify wether the constructor is changable */ private boolean editable; - /** - * True if the constructor is active - * @return Returns the active. - */ - public boolean isActive() { - return active; - } /** ! * @param active The active to set. */ ! public void setActive(boolean active) { ! this.active = active; } ! /** * The constructor method --- 22,32 ---- /** Specify wether the constructor is changable */ private boolean editable; /** ! * Do not use, for persistence use only */ ! public Constructor() { } ! /** * The constructor method *************** *** 60,63 **** --- 52,70 ---- /** + * True if the constructor is active + * @return Returns the active. + */ + public boolean isActive() { + return active; + } + + /** + * @param active The active to set. + */ + public void setActive(boolean active) { + this.active = active; + } + + /** * Getter for the origin * @return The origin Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** CoordinateSystem.java 27 Jul 2006 08:05:21 -0000 1.19 --- CoordinateSystem.java 31 Jul 2006 11:25:51 -0000 1.20 *************** *** 39,42 **** --- 39,49 ---- /** + * Empty constructor for persistence only + */ + public CoordinateSystem() { + super(); + } + + /** * Constructor secure that they all are orthogonal to each other and normalized * @param i The i vector *************** *** 381,383 **** --- 388,418 ---- return "CS-" + getId(); } + + /** + * Set the I and J vectors + * @param i the I vector + * @param j the J vector + */ + public void setIJ(Vertex i, Vertex j) { + this.i = i; + this.j = j; + this.i.normalize(); + this.j.normalize(); + this.n = this.i.cross(this.j); + } + + /** + * Set the I, J and N vectors + * @param i the I vector + * @param j the J vector + * @param n the N vector + */ + public void setIJN(Vertex i, Vertex j, Vertex n) { + this.i = i; + this.j = j; + this.n = n; + this.i.normalize(); + this.j.normalize(); + this.n.normalize(); + } } Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Line.java 27 Jul 2006 10:27:02 -0000 1.16 --- Line.java 31 Jul 2006 11:25:51 -0000 1.17 *************** *** 20,23 **** --- 20,30 ---- /** + * Empty constructor for persistence only + */ + public Line() { + super(); + } + + /** * Constuctor of Line with only the origin and a standard direction of (1,0,0) * @param origin The origin |
From: rimestad <rim...@us...> - 2006-07-31 11:25:55
|
Update of /cvsroot/bprocessor/model/src/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11071/src/etc Modified Files: bprocessor.xsd Log Message: Added xml schema for constructors and added interlizing and externalizing of constructors to persistens.java, Added checkpoint call to ConstructorTool and added empty constructor to Line Point and Coordinatesystem Index: bprocessor.xsd =================================================================== RCS file: /cvsroot/bprocessor/model/src/etc/bprocessor.xsd,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** bprocessor.xsd 15 May 2006 10:29:56 -0000 1.12 --- bprocessor.xsd 31 Jul 2006 11:25:51 -0000 1.13 *************** *** 10,18 **** <xsd:complexType name="EntityType"> <xsd:sequence> ! <xsd:element name="id" type="xsd:long"/> ! <xsd:element name="progid" type="xsd:long"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="SpaceType"> <xsd:complexContent> --- 10,30 ---- <xsd:complexType name="EntityType"> <xsd:sequence> ! <xsd:element name="id" type="xsd:long" maxOccurs="1" minOccurs="1"/> ! <xsd:element name="progid" type="xsd:long" maxOccurs="1" minOccurs="0"/> </xsd:sequence> </xsd:complexType> + <xsd:complexType name="ConstructorType"> + <xsd:complexContent> + <xsd:extension base="EntityType"> + <xsd:sequence> + <xsd:element ref="origin" maxOccurs="1" minOccurs="1"/> + <xsd:element name="active" type="xsd:boolean" maxOccurs="1" minOccurs="0"/> + <xsd:element name="editable" type="xsd:boolean" maxOccurs="1" minOccurs="0"/> + </xsd:sequence> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + <xsd:complexType name="SpaceType"> <xsd:complexContent> *************** *** 29,33 **** <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:extension> --- 41,46 ---- <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 ref="constructor" maxOccurs="unbounded" minOccurs="0"/> </xsd:sequence> </xsd:extension> *************** *** 85,92 **** --- 98,134 ---- <xsd:element name="B" type="xsd:float" maxOccurs="1" minOccurs="0"/> </xsd:sequence> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="LineType"> + <xsd:complexContent> + <xsd:extension base="ConstructorType"> + <xsd:sequence> + <xsd:element ref="direction" maxOccurs="1" minOccurs="1"/> + </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> + <xsd:complexType name="PointType"> + <xsd:complexContent> + <xsd:extension base="ConstructorType"> + <xsd:sequence> + </xsd:sequence> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="CoordinateSystemType"> + <xsd:complexContent> + <xsd:extension base="ConstructorType"> + <xsd:sequence> + <xsd:element name="onlyplane" type="xsd:boolean" maxOccurs="1" minOccurs="0"/> + <xsd:element ref="ijn" maxOccurs="3" minOccurs="3"/> + </xsd:sequence> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> <!-- Element definitions --> *************** *** 96,99 **** --- 138,145 ---- <xsd:element name="vertex" type="VertexType"/> <xsd:element name="material" type="MaterialType"/> + <xsd:element name="constructor" type="ConstructorType"/> + <xsd:element name="origin" type="VertexType"/> + <xsd:element name="direction" type="VertexType"/> + <xsd:element name="ijn" type="VertexType"/> <!-- Main element --> *************** *** 102,105 **** --- 148,152 ---- <xsd:sequence> <xsd:element name="active" type="xsd:long" maxOccurs="1" minOccurs="0"/> + <xsd:element name="cs" type="xsd:long" maxOccurs="1" minOccurs="0"/> <xsd:element ref="space" maxOccurs="unbounded" minOccurs="0"/> <xsd:element ref="surface" maxOccurs="unbounded" minOccurs="0"/> |
From: rimestad <rim...@us...> - 2006-07-27 22:34:09
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19641/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: The active coordinatesystem can't be removed from the project Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** Space.java 24 Jul 2006 11:13:57 -0000 1.41 --- Space.java 27 Jul 2006 10:27:37 -0000 1.42 *************** *** 320,324 **** */ public void delete(Constructor c) { ! if (c.getId() != null) { remove(c); } --- 320,324 ---- */ public void delete(Constructor c) { ! if (c.getId() != null && c != Project.getInstance().getActiveCoordinateSystem()) { remove(c); } |
From: rimestad <rim...@us...> - 2006-07-27 22:33:28
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23501/src/net/sourceforge/bprocessor/model Modified Files: Line.java Point.java CoordinateSystem.java Log Message: Added getName and filled out the attributes for coordinatesystem Index: Point.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Point.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Point.java 23 Jul 2006 09:17:36 -0000 1.5 --- Point.java 27 Jul 2006 08:05:21 -0000 1.6 *************** *** 76,78 **** --- 76,83 ---- return "Point"; } + + /** @see net.sourceforge.bprocessor.model.Geometric#getName() */ + public String getName() { + return "P-" + getId(); + } } Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** CoordinateSystem.java 24 Jul 2006 12:06:09 -0000 1.18 --- CoordinateSystem.java 27 Jul 2006 08:05:21 -0000 1.19 *************** *** 252,261 **** public void setAttributes(List attributes) { Vertex orig = new Vertex(0, 0, 0); - orig.setX(((Double)(((Attribute)attributes.get(1)).getValue())).doubleValue()); orig.setY(((Double)(((Attribute)attributes.get(2)).getValue())).doubleValue()); orig.setZ(((Double)(((Attribute)attributes.get(3)).getValue())).doubleValue()); setOrigin(orig); ! setActive(((Boolean)(((Attribute)attributes.get(4)).getValue())).booleanValue()); } --- 252,287 ---- public void setAttributes(List attributes) { Vertex orig = new Vertex(0, 0, 0); orig.setX(((Double)(((Attribute)attributes.get(1)).getValue())).doubleValue()); orig.setY(((Double)(((Attribute)attributes.get(2)).getValue())).doubleValue()); orig.setZ(((Double)(((Attribute)attributes.get(3)).getValue())).doubleValue()); setOrigin(orig); ! Vertex i = new Vertex(0, 0, 0); ! i.setX(((Double)(((Attribute)attributes.get(5)).getValue())).doubleValue()); ! i.setY(((Double)(((Attribute)attributes.get(6)).getValue())).doubleValue()); ! i.setZ(((Double)(((Attribute)attributes.get(7)).getValue())).doubleValue()); ! if (i.length() > 0) { ! this.i = i; ! } ! Vertex j = new Vertex(0, 0, 0); ! j.setX(((Double)(((Attribute)attributes.get(9)).getValue())).doubleValue()); ! j.setY(((Double)(((Attribute)attributes.get(10)).getValue())).doubleValue()); ! j.setZ(((Double)(((Attribute)attributes.get(11)).getValue())).doubleValue()); ! if (j.length() > 0) { ! this.j = j; ! } ! if (onlyPlane) { ! setActive(((Boolean)(((Attribute)attributes.get(12)).getValue())).booleanValue()); ! onlyPlane(((Boolean)(((Attribute)attributes.get(13)).getValue())).booleanValue()); ! } else { ! Vertex n = new Vertex(0, 0, 0); ! n.setX(((Double)(((Attribute)attributes.get(13)).getValue())).doubleValue()); ! n.setY(((Double)(((Attribute)attributes.get(14)).getValue())).doubleValue()); ! n.setZ(((Double)(((Attribute)attributes.get(15)).getValue())).doubleValue()); ! if (n.length() > 0) { ! this.n = n; ! } ! setActive(((Boolean)(((Attribute)attributes.get(16)).getValue())).booleanValue()); ! onlyPlane(((Boolean)(((Attribute)attributes.get(17)).getValue())).booleanValue()); ! } } *************** *** 265,272 **** public List getAttributes() { ArrayList res = new ArrayList(); ! res.add(new Attribute("name", "Origin", false)); ! res.add(new Attribute("X", new Double(getOrigin().getX()))); ! res.add(new Attribute("Y", new Double(getOrigin().getY()))); ! res.add(new Attribute("Z", new Double(getOrigin().getZ()))); if (isActive()) { res.add(new Attribute("Active", Boolean.TRUE)); --- 291,312 ---- public List getAttributes() { ArrayList res = new ArrayList(); ! res.add(new Attribute("Origin", "", false)); ! res.add(new Attribute("x", new Double(getOrigin().getX()))); ! res.add(new Attribute("y", new Double(getOrigin().getY()))); ! res.add(new Attribute("z", new Double(getOrigin().getZ()))); ! res.add(new Attribute("I", "", false)); ! res.add(new Attribute("x", new Double(getI().getX()))); ! res.add(new Attribute("y", new Double(getI().getY()))); ! res.add(new Attribute("z", new Double(getI().getZ()))); ! res.add(new Attribute("J", "", false)); ! res.add(new Attribute("x", new Double(getJ().getX()))); ! res.add(new Attribute("y", new Double(getJ().getY()))); ! res.add(new Attribute("z", new Double(getJ().getZ()))); ! if (!onlyPlane()) { ! res.add(new Attribute("K (Normal)", "", false)); ! res.add(new Attribute("x", new Double(getN().getX()))); ! res.add(new Attribute("y", new Double(getN().getY()))); ! res.add(new Attribute("z", new Double(getN().getZ()))); ! } if (isActive()) { res.add(new Attribute("Active", Boolean.TRUE)); *************** *** 274,277 **** --- 314,322 ---- res.add(new Attribute("Active", Boolean.FALSE)); } + if (onlyPlane()) { + res.add(new Attribute("Only plane", Boolean.TRUE)); + } else { + res.add(new Attribute("Only plane", Boolean.FALSE)); + } return res; } *************** *** 331,333 **** --- 376,383 ---- return surface; } + + /** @see net.sourceforge.bprocessor.model.Geometric#getName() */ + public String getName() { + return "CS-" + getId(); + } } Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Line.java 23 Jul 2006 09:17:36 -0000 1.14 --- Line.java 27 Jul 2006 08:05:21 -0000 1.15 *************** *** 251,253 **** --- 251,258 ---- } } + + /** @see net.sourceforge.bprocessor.model.Geometric#getName() */ + public String getName() { + return "L-" + getId(); + } } |
From: rimestad <rim...@us...> - 2006-07-27 20:50:54
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19256/src/net/sourceforge/bprocessor/model Modified Files: Line.java Constructor.java Log Message: Added editable boolean to constructor which remove the drawing of handles and arrows, to be used when constructors are to resemble computed directions and placements. It is still moveable though. Index: Constructor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Constructor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Constructor.java 20 Jul 2006 13:00:40 -0000 1.5 --- Constructor.java 27 Jul 2006 10:27:02 -0000 1.6 *************** *** 20,23 **** --- 20,25 ---- private boolean active; + /** Specify wether the constructor is changable */ + private boolean editable; /** * True if the constructor is active *************** *** 42,45 **** --- 44,60 ---- this.origin = origin; this.active = false; + this.editable = true; + } + + /** + * The constructor method + * @param origin The origin of the constructor + * @param active Is the constructor active + * @param editable Is it editable + */ + public Constructor(Vertex origin, boolean active, boolean editable) { + this.origin = origin; + this.active = active; + this.editable = editable; } *************** *** 75,77 **** --- 90,115 ---- public abstract void delete(); + /** + * @return Returns the editable. + */ + public boolean isEditable() { + return editable; + } + + /** + * @param editable The editable to set. + */ + public void setEditable(boolean editable) { + this.editable = editable; + } + + /** + * Move the constructor + * @param x the movement in x + * @param y the movement in y + * @param z the movement in z + */ + public void move(double x, double y, double z) { + getOrigin().add(new Vertex(x, y, z)); + } } Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Line.java 27 Jul 2006 08:05:21 -0000 1.15 --- Line.java 27 Jul 2006 10:27:02 -0000 1.16 *************** *** 50,53 **** --- 50,66 ---- /** + * Constructor of the Line with orgin and three angles + * @param origin The origin + * @param dir The vector of direction + * @param active If the constructor is active + * @param editable If the constructor is editable + */ + public Line(Vertex origin, Vertex dir, boolean active, boolean editable) { + super(origin, active, editable); + dir.normalize(); + this.dir = dir; + } + + /** * Get a direction vector for the line * @return A non stored vertex that points in the direction of the line and are of length 1 *************** *** 110,113 **** --- 123,127 ---- } setActive(((Boolean)(((Attribute)attributes.get(10)).getValue())).booleanValue()); + setEditable(((Boolean)(((Attribute)attributes.get(11)).getValue())).booleanValue()); } *************** *** 132,135 **** --- 146,154 ---- res.add(new Attribute("Active", Boolean.FALSE)); } + if (isEditable()) { + res.add(new Attribute("Editable", Boolean.TRUE)); + } else { + res.add(new Attribute("Editable", Boolean.FALSE)); + } return res; } *************** *** 196,200 **** Vertex to = origin.add(direction); Edge constructor = new Guide(from, to); - constructor.setConstructor(true); return constructor; } --- 215,218 ---- |
From: rimestad <rim...@us...> - 2006-07-27 11:20:39
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8850/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Changed a bit on the drawing.... -The path are drawn with depthtest turned off -The non editable constructors are not drawn with with handles when in selsection mode -All constructors are drawn in the drawGeneralConstructors even the active coordinate system and its grid, to achieve depth test and visible coordinatesystem when in front of objects. - added test if constrctor is selected or target (CAN BE TOO SLOW) but othervise the selection is not clear, especially not the guidelines Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.123 retrieving revision 1.124 diff -C2 -d -r1.123 -r1.124 *** View.java 26 Jul 2006 14:41:12 -0000 1.123 --- View.java 27 Jul 2006 11:20:20 -0000 1.124 *************** *** 531,535 **** // grid and coords are always completely lit ! gl.glLineWidth(1.0f); CoordinateSystem cs = Project.getInstance().getActiveCoordinateSystem(); grid(cs); --- 531,535 ---- // grid and coords are always completely lit ! /*gl.glLineWidth(1.0f); CoordinateSystem cs = Project.getInstance().getActiveCoordinateSystem(); grid(cs); *************** *** 539,543 **** drawCoordinateSystem(cs, ((new Vertex(camera.getCamera())).minus(cs.center())).length() * scale, true); ! Iterator clipit = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); while (clipit.hasNext()) { --- 539,543 ---- drawCoordinateSystem(cs, ((new Vertex(camera.getCamera())).minus(cs.center())).length() * scale, true); ! */ Iterator clipit = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); while (clipit.hasNext()) { *************** *** 599,602 **** --- 599,603 ---- //Drawing the space path gl.glMatrixMode(GL.GL_PROJECTION); + gl.glDisable(GL.GL_DEPTH_TEST); gl.glPushMatrix(); gl.glLoadIdentity(); *************** *** 699,703 **** gl.glLineWidth(0.5f); gl.glColor4fv(gridColor); ! gl.glDisable(GL.GL_DEPTH_TEST); gl.glBegin(GL.GL_LINES); --- 700,704 ---- gl.glLineWidth(0.5f); gl.glColor4fv(gridColor); ! //gl.glDisable(GL.GL_DEPTH_TEST); gl.glBegin(GL.GL_LINES); *************** *** 1052,1057 **** dist = (c.getOrigin().minus(v)).length() * scale; } ! drawGeneralConstructor(c, dist, true); } } else { break; --- 1053,1061 ---- dist = (c.getOrigin().minus(v)).length() * scale; } ! if (target != c && !highligts.contains(c)) { ! drawGeneralConstructor(c, dist, true); ! } } + grid(cs); } else { break; *************** *** 1078,1082 **** } Line l = (Line)constructor; ! drawConstructorVector(l.getOrigin(), l.getDirection(), dist); if (l.isActive()) { drawConstructorLine(l.getOrigin(), l.getDirection(), dist); --- 1082,1088 ---- } Line l = (Line)constructor; ! if (l.isEditable()) { ! drawConstructorVector(l.getOrigin(), l.getDirection(), dist); ! } if (l.isActive()) { drawConstructorLine(l.getOrigin(), l.getDirection(), dist); *************** *** 1084,1091 **** } else if (constructor instanceof CoordinateSystem) { CoordinateSystem system = (CoordinateSystem)constructor; ! CoordinateSystem cs = Project.getInstance().getActiveCoordinateSystem(); ! if (cs != system) { ! drawCoordinateSystem(system, dist, colorize); ! } } } --- 1090,1094 ---- } else if (constructor instanceof CoordinateSystem) { CoordinateSystem system = (CoordinateSystem)constructor; ! drawCoordinateSystem(system, dist, colorize); } } *************** *** 1103,1107 **** gl.glColor3fv(X_AXIS_COLOR); } ! drawConstructorVector(cs.getOrigin(), i, dist); if (cs.isActive()) { drawConstructorLine(cs.getOrigin(), i, dist); --- 1106,1112 ---- gl.glColor3fv(X_AXIS_COLOR); } ! if (cs.isEditable()) { ! drawConstructorVector(cs.getOrigin(), i, dist); ! } if (cs.isActive()) { drawConstructorLine(cs.getOrigin(), i, dist); *************** *** 1110,1114 **** gl.glColor3fv(Y_AXIS_COLOR); } ! drawConstructorVector(cs.getOrigin(), j, dist); if (cs.isActive()) { drawConstructorLine(cs.getOrigin(), j, dist); --- 1115,1121 ---- gl.glColor3fv(Y_AXIS_COLOR); } ! if (cs.isEditable()) { ! drawConstructorVector(cs.getOrigin(), j, dist); ! } if (cs.isActive()) { drawConstructorLine(cs.getOrigin(), j, dist); *************** *** 1119,1123 **** gl.glColor3fv(Z_AXIS_COLOR); } ! drawConstructorVector(cs.getOrigin(), n, dist); if (cs.isActive()) { drawConstructorLine(cs.getOrigin(), n, dist); --- 1126,1132 ---- gl.glColor3fv(Z_AXIS_COLOR); } ! if (cs.isEditable()) { ! drawConstructorVector(cs.getOrigin(), n, dist); ! } if (cs.isActive()) { drawConstructorLine(cs.getOrigin(), n, dist); *************** *** 1784,1797 **** } if (selectIntersections) { ! pushName(gl, current.getOrigin()); ! drawVertexHit(current.getOrigin()); ! popName(gl); if (current instanceof Line) { Line line = (Line) current; Edge guide = line.edge(View.gridSize() * 2); ! Vertex tip = line.tip(dist / 16 + dist / 20); ! pushName(gl, tip); ! drawVertexHit(tip); ! popName(gl); if (current.isActive()) { pushName(gl, guide); --- 1793,1810 ---- } if (selectIntersections) { ! if (current.isEditable()) { ! pushName(gl, current.getOrigin()); ! drawVertexHit(current.getOrigin()); ! popName(gl); ! } if (current instanceof Line) { Line line = (Line) current; Edge guide = line.edge(View.gridSize() * 2); ! if (current.isEditable()) { ! Vertex tip = line.tip(dist / 16 + dist / 20); ! pushName(gl, tip); ! drawVertexHit(tip); ! popName(gl); ! } if (current.isActive()) { pushName(gl, guide); |
From: Nordholt <nor...@us...> - 2006-07-26 15:45:25
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21939/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: default cameras are now kept in a list to keep their order Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** Project.java 24 Jul 2006 13:41:18 -0000 1.66 --- Project.java 26 Jul 2006 14:45:55 -0000 1.67 *************** *** 45,49 **** /** The default un-changeable cameras */ ! private HashMap defaultCams = new HashMap(); /** The domain id */ --- 45,49 ---- /** The default un-changeable cameras */ ! private LinkedList defaultCams = new LinkedList(); /** The domain id */ *************** *** 194,210 **** cam0.setName("Main view"); cameras.put(cam0.getId(), cam0); ! defaultCams.put(cam0.getId(), 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.put(cam2.getId(), 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.put(cam3.getId(), 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.put(cam4.getId(), cam4); currentCamera = new Camera(cam0, "Current"); } --- 194,210 ---- 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); currentCamera = new Camera(cam0, "Current"); } *************** *** 597,602 **** * @return The cameras */ ! public Collection getDefaultCameras() { ! return new HashSet(defaultCams.values()); } --- 597,602 ---- * @return The cameras */ ! public LinkedList getDefaultCameras() { ! return defaultCams; } |
From: Nordholt <nor...@us...> - 2006-07-26 15:41:34
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20228/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java Log Message: added a path to the currently active space. Click one of the spacenames in the path, and it becomes the active space. Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** AbstractTool.java 21 Jul 2006 15:14:57 -0000 1.88 --- AbstractTool.java 26 Jul 2006 14:41:12 -0000 1.89 *************** *** 376,379 **** --- 376,380 ---- previousPos[0] = pressPos[0]; previousPos[1] = pressPos[1]; + Object o = glv.getView().getObjectAtPoint(e.getX(), e.getY()); if (e.getButton() == MouseEvent.BUTTON2) { glv.setCursor(dragCursor); *************** *** 382,385 **** --- 383,388 ---- if (cameraMode) { orbit.pressed(e); + } else if (o instanceof Space) { + Project.getInstance().setActiveSpace((Space)o); } else { pressed(e); |
From: Nordholt <nor...@us...> - 2006-07-26 14:41:26
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20228/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: added a path to the currently active space. Click one of the spacenames in the path, and it becomes the active space. Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.122 retrieving revision 1.123 diff -C2 -d -r1.122 -r1.123 *** View.java 24 Jul 2006 13:42:34 -0000 1.122 --- View.java 26 Jul 2006 14:41:12 -0000 1.123 *************** *** 437,442 **** bg.add(but); but.setToolTipText("Wireframe"); ! but.setMnemonic(KeyEvent.VK_F7); ! } --- 437,441 ---- bg.add(but); but.setToolTipText("Wireframe"); ! but.setMnemonic(KeyEvent.VK_F7); } *************** *** 459,463 **** gl = gld.getGL(); glu = gld.getGLU(); ! int[] maxplanes = new int[1]; gl.glGetIntegerv(GL.GL_MAX_CLIP_PLANES, maxplanes); --- 458,462 ---- gl = gld.getGL(); glu = gld.getGLU(); ! int[] maxplanes = new int[1]; gl.glGetIntegerv(GL.GL_MAX_CLIP_PLANES, maxplanes); *************** *** 596,601 **** gl.glMatrixMode(GL.GL_MODELVIEW); gl.glPopMatrix(); - } gl.glPopMatrix(); if (hitdetection) { --- 595,619 ---- gl.glMatrixMode(GL.GL_MODELVIEW); gl.glPopMatrix(); } + + //Drawing the space path + gl.glMatrixMode(GL.GL_PROJECTION); + gl.glPushMatrix(); + gl.glLoadIdentity(); + if (hitdetection) { + int[] viewport = new int[] {0, 0, (int)width, (int)height}; + glu.gluPickMatrix(x, viewport[3] - y, 5, 5, viewport); + } + glu.gluOrtho2D(0, width, 0, height); + gl.glMatrixMode(GL.GL_MODELVIEW); + gl.glPushMatrix(); + gl.glLoadIdentity(); + drawSpacePath(hitdetection); + gl.glMatrixMode(GL.GL_PROJECTION); + gl.glPopMatrix(); + gl.glMatrixMode(GL.GL_MODELVIEW); + gl.glPopMatrix(); + + gl.glPopMatrix(); if (hitdetection) { *************** *** 827,831 **** gl.glDisable(GL.GL_DEPTH_TEST); - { Iterator it = onTopEntities.iterator(); --- 845,848 ---- *************** *** 834,838 **** } } ! } --- 851,902 ---- } } ! } ! ! /** ! * Draw the space path ! * @param selection wherther or not we are drawing for selection ! */ ! private void drawSpacePath(boolean selection) { ! Space active = Project.getInstance().getActiveSpace(); ! Space world = Project.getInstance().world(); ! LinkedList path = new LinkedList(); ! path.add(active); ! while (active != world) { ! active = active.getOwner(); ! path.addFirst(active); ! } ! String name = ""; ! Iterator it = path.iterator(); ! if (it.hasNext()) { ! Space sp = (Space)it.next(); ! name = sp.getName(); ! int sepLength = glut.glutBitmapLength(GLUT.BITMAP_HELVETICA_10, " >> ");; ! int length = 0; ! int nameLength = glut.glutBitmapLength(GLUT.BITMAP_HELVETICA_10, name); ! if (selection) { ! drawClickBox(5 + length, height - 15, 0.5, ! nameLength, 10, sp); ! } ! length = nameLength; ! while (it.hasNext()) { ! sp = (Space)it.next(); ! name = name + " >> " + sp.getName(); ! length += sepLength; ! nameLength = glut.glutBitmapLength(GLUT.BITMAP_HELVETICA_10, sp.getName()); ! if (selection) { ! drawClickBox(5 + length, height - 15, 0.5, ! nameLength, 10, sp); ! } ! length += nameLength; ! } ! } ! if (!selection) { ! gl.glColor3d(1.0, 0.0, 0.0); ! gl.glPushMatrix(); ! gl.glTranslated(5, height - 15, 0.5); ! gl.glRasterPos2i(0, 0); ! glut.glutBitmapString(gl, GLUT.BITMAP_HELVETICA_10, name); ! gl.glPopMatrix(); ! } } *************** *** 1465,1470 **** } - - if (clickable) { //Name must be "front" --- 1529,1532 ---- *************** *** 1486,1490 **** } //draw the front domain name - if (frontDomain == null) { gl.glColor3d(0.2 + fcb, 0.2 + fcb, 0.2 + fcb); --- 1548,1551 ---- *************** *** 1494,1500 **** gl.glColor3d(0.8 + fcb, 0.2 + fcb, 0.4 + fcb); } - drawString(frontTextAnchor.getX(), frontTextAnchor.getY(), frontName); - double bcb = 0; if (backLabelSelect) { --- 1555,1559 ---- *************** *** 1540,1544 **** */ private void drawClickBox(double x, double y, double z, ! int width, int height, String name) { pushName(gl, name); gl.glBegin(GL.GL_POLYGON); --- 1599,1603 ---- */ private void drawClickBox(double x, double y, double z, ! int width, int height, Object name) { pushName(gl, name); gl.glBegin(GL.GL_POLYGON); |
From: Nordholt <nor...@us...> - 2006-07-25 13:16:19
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25845/src/net/sourceforge/bprocessor/gui Modified Files: CameraView.java Log Message: you will allways be editing a copy of the chosen camera Index: CameraView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/CameraView.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CameraView.java 16 Jun 2006 09:48:05 -0000 1.4 --- CameraView.java 25 Jul 2006 13:16:13 -0000 1.5 *************** *** 66,71 **** Project p = Project.getInstance(); if (which == add) { ! Camera c = new Camera(p.getCurrentCamera(), "copy " + p.getCurrentCamera().getName()); p.add(c); p.setCurrentCamera(c); } else if (which == remove) { --- 66,72 ---- Project p = Project.getInstance(); if (which == add) { ! Camera c = new Camera(p.getCurrentCamera(), ""); p.add(c); + c.setName("Cam " + c.getId()); p.setCurrentCamera(c); } else if (which == remove) { |
From: Nordholt <nor...@us...> - 2006-07-25 13:15:03
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25058/src/net/sourceforge/bprocessor/gui/treeview Modified Files: CameraTreeView.java Log Message: default cameras are allways drawn in top of the tree in the same order Index: CameraTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/CameraTreeView.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CameraTreeView.java 6 Jul 2006 10:41:27 -0000 1.5 --- CameraTreeView.java 25 Jul 2006 13:14:55 -0000 1.6 *************** *** 50,54 **** root.removeAllChildren(); Collection cameras = Project.getInstance().getCameras(); ! Iterator iter = cameras.iterator(); while (iter.hasNext()) { Camera current = (Camera) iter.next(); --- 50,55 ---- root.removeAllChildren(); Collection cameras = Project.getInstance().getCameras(); ! Collection defaultCams = Project.getInstance().getDefaultCameras(); ! Iterator iter = defaultCams.iterator(); while (iter.hasNext()) { Camera current = (Camera) iter.next(); *************** *** 60,63 **** --- 61,76 ---- root.add(cn); } + iter = cameras.iterator(); + while (iter.hasNext()) { + Camera current = (Camera) iter.next(); + if (!defaultCams.contains(current)) { + GenericTreeView.CameraNode cn = new GenericTreeView.CameraNode(current); + Iterator clipIt = current.getClipplanes().iterator(); + while (clipIt.hasNext()) { + cn.add(new EntityNode((Entity)clipIt.next())); + } + root.add(cn); + } + } model.nodeStructureChanged(root); openPaths(paths); *************** *** 177,186 **** if (target instanceof Camera && target != selected) { selected = (Camera)target; ! if (Project.getInstance().getDefaultCameras().contains(target)) { ! Project.getInstance().setCurrentCamera(new Camera(selected, ! "default copy")); ! } else { ! Project.getInstance().setCurrentCamera(selected); ! } } } --- 190,195 ---- if (target instanceof Camera && target != selected) { selected = (Camera)target; ! Project.getInstance().setCurrentCamera(new Camera(selected, ! "Current Camera")); } } |
From: Nordholt <nor...@us...> - 2006-07-25 13:12:40
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24198/src/net/sourceforge/bprocessor/gl/tool Modified Files: Pencil.java Log Message: pencil stops drawing on existing edges and vertices Index: Pencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Pencil.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Pencil.java 21 Jul 2006 12:48:12 -0000 1.8 --- Pencil.java 25 Jul 2006 13:12:34 -0000 1.9 *************** *** 11,17 **** --- 11,20 ---- import java.awt.event.MouseEvent; import java.util.LinkedList; + import java.util.Collection; import java.util.List; import net.sourceforge.bprocessor.gl.GLView; + import net.sourceforge.bprocessor.gl.model.Intersection; + import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Edge; *************** *** 54,60 **** current = findIntersection(e); if (current != null) { - updateFeedback(); updateConstructors(); ! } } --- 57,63 ---- current = findIntersection(e); if (current != null) { updateConstructors(); ! updateFeedback(); ! } } *************** *** 73,78 **** if (start == null) { start = current; ! } else { ! if (start.vertex().equalEps(current.vertex())) { cleanUp(); --- 76,80 ---- if (start == null) { start = current; ! } else { if (start.vertex().equalEps(current.vertex())) { cleanUp(); *************** *** 85,89 **** start = current; incident = null; ! if (insertEdges(edges)) { cleanUp(); return; --- 87,97 ---- start = current; incident = null; ! Collection vColl = Project.getInstance().getVertices(); ! Collection eColl = Project.getInstance().getEdges(); ! boolean exsGeometry = ((current.type() == Intersection.VERTEX && ! vColl.contains(current.object())) || ! (current.type() == Intersection.EDGE && ! eColl.contains(current.object()))); ! if (insertEdges(edges) || exsGeometry) { cleanUp(); return; *************** *** 100,103 **** --- 108,112 ---- */ protected void dragged(MouseEvent e) { + } |
From: rimestad <rim...@us...> - 2006-07-24 13:42:40
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2288/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Now the main coordinatesystem keeps size even when it is moved Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** View.java 23 Jul 2006 09:17:44 -0000 1.121 --- View.java 24 Jul 2006 13:42:34 -0000 1.122 *************** *** 533,542 **** // grid and coords are always completely lit gl.glLineWidth(1.0f); ! grid(Project.getInstance().getActiveCoordinateSystem()); Camera camera = Project.getInstance().getCurrentCamera(); double scale = (camera.getFocalwidth() / 65) * (500 / height); ! drawCoordinateSystem(Project.getInstance().getActiveCoordinateSystem(), ! camera.dist() * scale, true); Iterator clipit = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); --- 533,543 ---- // grid and coords are always completely lit gl.glLineWidth(1.0f); ! CoordinateSystem cs = Project.getInstance().getActiveCoordinateSystem(); ! grid(cs); Camera camera = Project.getInstance().getCurrentCamera(); double scale = (camera.getFocalwidth() / 65) * (500 / height); ! drawCoordinateSystem(cs, ! ((new Vertex(camera.getCamera())).minus(cs.center())).length() * scale, true); Iterator clipit = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); *************** *** 1119,1124 **** gl.glPushMatrix(); gl.glTranslated(to.getX(), to.getY(), to.getZ()); ! gl.glRotated(Math.toDegrees(Geometry.degreesAboutZ(d)), 0, 0, 1); ! gl.glRotated(-Math.toDegrees(Geometry.degreesAboutY(d)), 0, 1, 0); gl.glRotated(90, 0, 1, 0); glu.gluCylinder(quad, (dist / 90), 0, (dist / 20), 10, 10); --- 1120,1125 ---- gl.glPushMatrix(); gl.glTranslated(to.getX(), to.getY(), to.getZ()); ! gl.glRotated(Math.toDegrees(Geometry.degreesAboutZ(direction)), 0, 0, 1); ! gl.glRotated(-Math.toDegrees(Geometry.degreesAboutY(direction)), 0, 1, 0); gl.glRotated(90, 0, 1, 0); glu.gluCylinder(quad, (dist / 90), 0, (dist / 20), 10, 10); |
From: rimestad <rim...@us...> - 2006-07-24 13:41:21
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1822/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Added deletion of constructors Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** Project.java 23 Jul 2006 09:17:36 -0000 1.65 --- Project.java 24 Jul 2006 13:41:18 -0000 1.66 *************** *** 226,229 **** --- 226,231 ---- } else if (next instanceof Space) { remove((Space)next); + } else if (next instanceof Constructor) { + ((Constructor)next).delete(); } } |
From: rimestad <rim...@us...> - 2006-07-24 13:41:21
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1797/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: Added deletion of constructors Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** SpaceTool.java 19 Jun 2006 13:15:12 -0000 1.22 --- SpaceTool.java 24 Jul 2006 13:41:14 -0000 1.23 *************** *** 28,31 **** --- 28,32 ---- import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.model.ClippingPlane; + import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.LayerModellor; *************** *** 525,528 **** --- 526,531 ---- } else if (selected instanceof ClippingPlane) { Project.getInstance().getCurrentCamera().removeClipplane((ClippingPlane)selected); + } else if (selected instanceof Constructor) { + ((Constructor)selected).delete(); } } |
From: rimestad <rim...@us...> - 2006-07-24 13:18:11
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24780/src/net/sourceforge/bprocessor/model Modified Files: Geometry.java Log Message: Fixed rotationAbout methods Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Geometry.java 19 Jul 2006 12:04:13 -0000 1.22 --- Geometry.java 24 Jul 2006 13:18:06 -0000 1.23 *************** *** 718,729 **** */ public static double degreesAboutZ(Vertex dir) { ! Vertex tmp; ! if (dir.getX() != 0.0) { ! tmp = new Vertex(dir.getX(), dir.getY(), 0); ! } else { ! tmp = new Vertex(0, dir.getY(), dir.getZ()); ! } tmp.normalize(); ! if (dir.getY() < 0) { return -Math.acos(tmp.getX()); } else { --- 718,727 ---- */ public static double degreesAboutZ(Vertex dir) { ! Vertex tmp = new Vertex(dir.getX(), dir.getY(), 0); tmp.normalize(); ! if (tmp.getX() == 0.0 && tmp.getY() == 0.0) { ! return 0; ! } ! if (dir.getY() < 0.0) { return -Math.acos(tmp.getX()); } else { *************** *** 738,747 **** */ public static double degreesAboutY(Vertex dir) { ! Vertex tmp; ! if (dir.getX() != 0.0) { ! tmp = new Vertex(dir.getX(), 0, dir.getZ()); ! } else { ! tmp = new Vertex(0, dir.getY(), dir.getZ()); ! } tmp.normalize(); return Math.asin(tmp.getZ()); --- 736,740 ---- */ public static double degreesAboutY(Vertex dir) { ! Vertex tmp = dir.copy(); tmp.normalize(); return Math.asin(tmp.getZ()); |
From: rimestad <rim...@us...> - 2006-07-24 13:18:10
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24780/src/net/sourceforge/bprocessor/model/test Modified Files: LineTest.java Log Message: Fixed rotationAbout methods Index: LineTest.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test/LineTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LineTest.java 12 Jul 2006 13:25:02 -0000 1.3 --- LineTest.java 24 Jul 2006 13:18:06 -0000 1.4 *************** *** 56,63 **** line.setDirection(new Vertex(0, 0, 1)); assertEquals(Math.toRadians(90.0), line.degreesAboutY(), 0.0001); ! assertEquals(Math.toRadians(90.0), line.degreesAboutZ(), 0.0001); line.setDirection(new Vertex(1, 1, 1)); ! assertEquals(Math.toRadians(45.0), line.degreesAboutY(), 0.0001); assertEquals(Math.toRadians(45.0), line.degreesAboutZ(), 0.0001); --- 56,63 ---- line.setDirection(new Vertex(0, 0, 1)); assertEquals(Math.toRadians(90.0), line.degreesAboutY(), 0.0001); ! assertEquals(Math.toRadians(0.0), line.degreesAboutZ(), 0.0001); line.setDirection(new Vertex(1, 1, 1)); ! assertEquals(Math.asin(line.getDirection().getZ()), line.degreesAboutY(), 0.0001); assertEquals(Math.toRadians(45.0), line.degreesAboutZ(), 0.0001); *************** *** 67,71 **** line.setDirection(new Vertex(-1, 1, 0)); ! assertEquals(Math.toRadians(0.0), line.degreesAboutY(), 0.0001); assertEquals(Math.toRadians(135.0), line.degreesAboutZ(), 0.0001); --- 67,71 ---- line.setDirection(new Vertex(-1, 1, 0)); ! assertEquals(Math.toRadians(00.0), line.degreesAboutY(), 0.0001); assertEquals(Math.toRadians(135.0), line.degreesAboutZ(), 0.0001); |
From: Nordholt <nor...@us...> - 2006-07-24 12:06:13
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27435 Modified Files: CoordinateSystem.java Log Message: fixing coordinatesystem constructor Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** CoordinateSystem.java 23 Jul 2006 09:17:36 -0000 1.17 --- CoordinateSystem.java 24 Jul 2006 12:06:09 -0000 1.18 *************** *** 51,56 **** n.normalize(); this.i = i; ! this.j = n.cross(this.i); ! this.n = this.i.cross(this.j); onlyPlane = false; } --- 51,56 ---- n.normalize(); this.i = i; ! this.j = j; ! this.n = n; onlyPlane = false; } |
From: Nordholt <nor...@us...> - 2006-07-24 11:17:49
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8063/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: added thread to periodicly check which spaces are closed and which are open. We might want a nice way to output this. Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** GUI.java 26 Jun 2006 11:37:53 -0000 1.34 --- GUI.java 24 Jul 2006 11:17:43 -0000 1.35 *************** *** 28,31 **** --- 28,34 ---- import net.sourceforge.bprocessor.gui.treeview.SurfaceTreeView; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Space; + + import java.util.Iterator; import java.awt.BorderLayout; *************** *** 88,91 **** --- 91,96 ---- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); instance = this; + Thread sc = new SpaceChecker(); + sc.start(); } *************** *** 418,420 **** --- 423,460 ---- Project.getInstance().checkpoint(); } + + /** + * Checks if spaces are closed. + */ + private class SpaceChecker extends Thread { + /** + * The constructor + */ + SpaceChecker() { + super(); + } + + /** + * The run + */ + public void run() { + while (true) { + log.info("============check starting==========="); + Iterator it = Project.getInstance().getSpaces().iterator(); + while (it.hasNext()) { + Space sp = (Space)it.next(); + if (sp.isClosed()) { + log.info("Space " + sp + " is closed"); + } else { + log.info("Space " + sp + " is open"); + } + } + try { + sleep(10000); + } catch (Exception e) { + log.info("Space checker thread threw a: " + e); + } + } + } + } } |
From: Nordholt <nor...@us...> - 2006-07-24 11:14:01
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6484/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: method for determining whether spaces are closed or not add Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Space.java 17 Jul 2006 08:37:00 -0000 1.40 --- Space.java 24 Jul 2006 11:13:57 -0000 1.41 *************** *** 1387,1389 **** --- 1387,1590 ---- } + /** + * Finds out if this space is closed or not. + * @return true or false. + */ + public boolean isClosed() { + Iterator surfaces = envelope.iterator(); + Surface startSurface = null; + if (surfaces.hasNext()) { + startSurface = (Surface)surfaces.next(); + Set coloured = new HashSet(); + if (colour(startSurface, coloured)) { + return coloured.containsAll(envelope); + } + } + return false; + } + + /** + * Colours a surface and then calls it self recursively to colour its neighbours. + * returns true if the colouring is succesfull, false otherwise + * @param surface the surface to colour + * @param coloured the set of coloured surfaces. + * @return the outcome of the colouring + */ + private boolean colour(Surface surface, Set coloured) { + coloured.add(surface); + boolean closed = true; + Iterator it = surface.getEdges().iterator(); + while (closed && it.hasNext()) { + Edge e = (Edge)it.next(); + Surface neighbour = neighbourOnEdge(surface, e); + if (neighbour != null) { + if (!coloured.contains(neighbour)) { + closed = colour(neighbour, coloured); + } + } else { + closed = false; + } + } + return closed; + } + + /** + * Determines if a surface can be coloured. + * @param s a surface + * @param angle the angle of the surface with the previous surface + * @param i - + * @param j - + * @return wherter or not it can be coloured. + */ + private boolean colourable(Surface s, double angle, Vertex i, Vertex j) { + boolean colourable = false; + if (s != null) { + Vertex spaceVector = s.normal(); + if (s.getFrontDomain() == this) { + spaceVector.scale(1 / spaceVector.length()); + } else if (s.getBackDomain() == this) { + spaceVector.scale(-1 / spaceVector.length()); + } else { + return false; + } + if (angle > Math.PI && spaceVector.dot(i) > 0) { + colourable = true; + } + if (angle < Math.PI && spaceVector.dot(i) < 0) { + colourable = true; + } + if (Math.abs(angle - Math.PI) < 0.00001 && spaceVector.dot(j) > 0) { + colourable = true; + } + if (Math.abs(angle) < 0.00001 && spaceVector.dot(j) < 0) { + colourable = true; + } + } + return colourable; + + } + + /** + * Finds the next surface on an edge + * @param startSurface the surface to find neighbours for. + * @param sharedEdge the shared edge + * @return the neighbour surface. + */ + private Surface neighbourOnEdge(Surface startSurface, Edge sharedEdge) { + //Building a coordinate system: + Vertex n = sharedEdge.getDirection(); + n.scale(1 / n.length()); + + Vertex j = startSurface.normal(); + if (startSurface.getFrontDomain() == this) { + j.scale(1 / j.length()); + } else { + j.scale(-1 / j.length()); + } + + LinkedList edges = new LinkedList(startSurface.getEdges()); + Vertex sharedVertex = sharedEdge.getFrom(); + Vertex adjacentVertex = findNextVertex(sharedEdge, sharedVertex, edges); + + + Plane p = new Plane(n.getX(), n.getY(), n.getZ(), + -(n.getX() * sharedVertex.getX() + + n.getY() * sharedVertex.getY() + + n.getZ() * sharedVertex.getZ())); + Vertex i = (p.project(sharedVertex)).minus(p.project(adjacentVertex)); + i.scale(1 / i.length()); + CoordinateSystem cs = new CoordinateSystem(i, j , n, sharedVertex); + + //Finding the surface with the minimal angle to the startSurface: + Iterator it = sharedEdge.getSurfaces().iterator(); + Surface neighbour = null; + double minAngle = (Math.PI * 2 + 1); + double angle = minAngle; + while (it.hasNext()) { + Surface s = (Surface)it.next(); + if (s != startSurface) { + LinkedList l = new LinkedList(s.getEdges()); + Vertex notShared = findNextVertex(sharedEdge, sharedVertex, l); + angle = findAngle(sharedVertex, notShared, cs); + Vertex normal = s.normal(); + if (angle < minAngle && colourable(s, angle, i, j)) { + minAngle = angle; + neighbour = s; + } + } + } + return neighbour; + } + + /** + * finds the angle between the x-axis of the coordinate system and + * a neighbour-surface to the sharedEdge. + * @param shared - + * @param notShared - + * @param coordinateSystem - + * @return the angle. + */ + private double findAngle(Vertex shared, Vertex notShared, + CoordinateSystem coordinateSystem) { + Vertex projShared = coordinateSystem.projection(shared); + Vertex projNotShared = coordinateSystem.projection(notShared); + Vertex projEdgeDir = projNotShared.minus(projShared); + projEdgeDir.scale(1 / projEdgeDir.length()); + Vertex xAxis = coordinateSystem.getI().copy(); + double angle = Math.acos(xAxis.dot(projEdgeDir)); + if (coordinateSystem.translate(projNotShared).getY() >= 0) { + angle = Math.PI - angle; + } else { + angle = Math.PI + angle; + } + return angle; + } + + /** + * Given a list of edges, L, one edge in the list, e, and one of this edge's + * vertices, v, finds the next edge in L which also contains v. If the edge found, e', + * is parrallel to e the first edge e'' in the direction of rotation from e to e' + * that is not parrallel to e is found. The end point of e'' that is not on a line + * parrallel to e is then returned. If no such vertex exists null is returned. + * @param edge the edge + * @param shared the shared vertex + * @param edges the list of edges + * @return the first non parrallel edge + */ + private Vertex findNextVertex(Edge edge, Vertex shared, LinkedList edges) { + int nextIndex = (edges.indexOf(edge) + 1) % edges.size(); + int lastIndex = ((edges.indexOf(edge) - 1) + edges.size()) % edges.size(); + Edge nextEdge = (Edge)edges.get(nextIndex); + Edge lastEdge = (Edge)edges.get(lastIndex); + int index; + int direction; + Edge nonParrallel; + Vertex notShared; + if (nextEdge.contains(shared)) { + nonParrallel = nextEdge; + notShared = nonParrallel.otherVertex(shared); + index = nextIndex; + direction = 1; + } else { + nonParrallel = lastEdge; + notShared = nonParrallel.otherVertex(shared); + index = lastIndex; + direction = -1; + } + boolean found = false; + while (!found && nonParrallel != edge) { + if (nonParrallel.getDirection().cross(edge.getDirection()).length() > 0.00001) { + found = true; + } else { + index = ((index + direction) + edges.size()) % edges.size(); + nonParrallel = (Edge)edges.get(index); + notShared = nonParrallel.otherVertex(notShared); + } + } + if (nonParrallel == edge) { + return null; + } else { + return notShared; + } + } } |
From: Michael L. <he...@us...> - 2006-07-23 09:17:55
|
Update of /cvsroot/bprocessor/build In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16675 Modified Files: build.xml Log Message: Possible to draw in active plane Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/build/build.xml,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** build.xml 28 Apr 2006 11:29:16 -0000 1.17 --- build.xml 23 Jul 2006 09:17:52 -0000 1.18 *************** *** 3,7 **** <target name="init"> <property name="project" value="bprocessor"/> ! <property name="version" value="M5-development"/> <property name="script.dir" value="${basedir}/bin"/> --- 3,7 ---- <target name="init"> <property name="project" value="bprocessor"/> ! <property name="version" value="M6"/> <property name="script.dir" value="${basedir}/bin"/> |