[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool Protractor.java,1.2,1.3 ArcTool.java,1
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Michael L. <he...@us...> - 2006-03-29 13:18:40
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26505/src/net/sourceforge/bprocessor/gl/tool Modified Files: Protractor.java ArcTool.java AbstractPencil.java Log Message: Improvemenents of construction line functionality in pencil Index: ArcTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ArcTool.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ArcTool.java 26 Mar 2006 21:40:32 -0000 1.8 --- ArcTool.java 29 Mar 2006 13:18:29 -0000 1.9 *************** *** 122,126 **** { ! int n = 6; double angle = tetra1; double step = (tetra2 - tetra1) / n; --- 122,126 ---- { ! int n = 12; double angle = tetra1; double step = (tetra2 - tetra1) / n; *************** *** 173,176 **** --- 173,177 ---- if (current != null) { updateFeedback(); + updateConstructors(); } } *************** *** 193,196 **** --- 194,198 ---- } updateFeedback(); + updateConstructors(); } } Index: Protractor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Protractor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Protractor.java 26 Mar 2006 21:40:32 -0000 1.2 --- Protractor.java 29 Mar 2006 13:18:29 -0000 1.3 *************** *** 80,83 **** --- 80,84 ---- if (current != null) { updateFeedback(); + updateConstructors(); } } *************** *** 103,106 **** --- 104,108 ---- } updateFeedback(); + updateConstructors(); } Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** AbstractPencil.java 29 Mar 2006 08:23:11 -0000 1.14 --- AbstractPencil.java 29 Mar 2006 13:18:29 -0000 1.15 *************** *** 19,23 **** import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.model.Intersection; - import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; --- 19,22 ---- *************** *** 51,55 **** protected String number; - /** * Constructor --- 50,53 ---- *************** *** 241,285 **** /** ! * Update constructors based on origin. */ protected void updateConstructors() { ! if (start == null) { ! if (incident != null) { ! constructors(xyz(incident.vertex())); ! } else { ! constructors(new LinkedList()); ! } ! } else { ! List constructors = new LinkedList(); ! ! if (incident != null && current != null) { ! Edge e1 = new Edge(incident.vertex(), current.vertex()); ! Edge e2 = new Edge(current.vertex(), start.vertex()); ! CoordinateSystem system = CoordinateSystem.create(e1, e2); ! if (system != null) { ! ! Vertex a = system.translate(start.vertex()); ! Vertex b = system.translate(current.vertex()); ! Vertex p = system.translate(incident.vertex()); ! ! Vertex u = b.minus(a); ! u.scale(1 / u.length()); ! Vertex ap = p.minus(a); ! double t = u.dot(ap); ! u.scale(t); ! Vertex q = a.add(u); ! q = system.unTranslate(q); ! Edge edge = new Edge(incident.vertex(), q); ! edge.setConstructor(true); ! constructors.add(edge); ! constructors(constructors); ! } ! constructors.addAll(xyz(incident.vertex())); ! } ! constructors.addAll(xyz(start.vertex())); - constructors(constructors); - number = ""; } } --- 239,254 ---- /** ! * Update constructors based on start, current and incident. */ protected void updateConstructors() { ! List constructors = new LinkedList(); ! if (start != null) { constructors.addAll(xyz(start.vertex())); } + if (incident != null) { + constructors.addAll(xyz(incident.vertex())); + } + constructors(constructors); + number = ""; } |