bprocessor-commit Mailing List for B-processor (Page 116)
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: rimestad <rim...@us...> - 2006-07-20 13:00:44
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23100/src/net/sourceforge/bprocessor/model Modified Files: CoordinateSystem.java Constructor.java Log Message: added boolean to constructors isActive that tells if the extended version of the constructor should be shown... and added onlyPlane to coordinatesystem that should be true if the coordinatesystem should only be shown as a plane Index: Constructor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Constructor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Constructor.java 4 Jul 2006 11:53:43 -0000 1.4 --- Constructor.java 20 Jul 2006 13:00:40 -0000 1.5 *************** *** 17,20 **** --- 17,38 ---- private Vertex origin; + /** Tells if the constructor is extended for hit or not */ + private boolean active; + + /** + * 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 *************** *** 23,26 **** --- 41,45 ---- public Constructor(Vertex origin) { this.origin = origin; + this.active = false; } *************** *** 34,37 **** --- 53,64 ---- /** + * Setter for origin + * @param origin the new origin + */ + public void setOrigin(Vertex origin) { + this.origin = origin; + } + + /** * @see net.sourceforge.bprocessor.model.Geometric#collect() */ Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** CoordinateSystem.java 13 Jul 2006 13:30:14 -0000 1.13 --- CoordinateSystem.java 20 Jul 2006 13:00:40 -0000 1.14 *************** *** 33,36 **** --- 33,39 ---- /** The n unit vector (z-direction) */ protected Vertex n; + + /** True if the coordinate system should be treated as a plane */ + private boolean onlyPlane; /** *************** *** 43,49 **** --- 46,56 ---- public CoordinateSystem(Vertex i, Vertex j, Vertex n, Vertex origin) { super(origin); + i.normalize(); + j.normalize(); + n.normalize(); this.i = i; this.j = j; this.n = n; + onlyPlane = false; } *************** *** 260,263 **** --- 267,285 ---- return "Constructor-Coordinatesystem"; } + + /** + * Check of onlyPlane boolean + * @return True if coordinatesystem only should be drawn as a plane + */ + public boolean onlyPlane() { + return onlyPlane; + } + /** + * Setter for onlyPlane + * @param what The value for onlyPlane + */ + public void onlyPlane(boolean what) { + onlyPlane = what; + } } |
|
From: rimestad <rim...@us...> - 2006-07-20 12:58:55
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22263/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: removed drawing of constructor plane and chaged the drawing of coordinatesystem Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.116 retrieving revision 1.117 diff -C2 -d -r1.116 -r1.117 *** View.java 19 Jul 2006 14:31:05 -0000 1.116 --- View.java 20 Jul 2006 12:58:52 -0000 1.117 *************** *** 965,982 **** drawConstructorPoint(l.getOrigin(), dist); drawConstructorVector(l.getOrigin(), l.getDirection(), dist); - } else if (o instanceof Plane) { - Plane p = (Plane)o; - drawConstructorPoint(p.getOrigin(), dist); - drawConstructorVector(p.getOrigin(), p.getI(), dist); - drawConstructorVector(p.getOrigin(), p.getJ(), dist); } else if (o instanceof CoordinateSystem) { CoordinateSystem cs = (CoordinateSystem)o; - drawConstructorPoint(cs.getOrigin(), dist); Vertex i = cs.getI(); Vertex j = cs.getJ(); ! Vertex n = cs.getN(); drawConstructorVector(cs.getOrigin(), i, dist); drawConstructorVector(cs.getOrigin(), j, dist); ! drawConstructorVector(cs.getOrigin(), n, dist); } } --- 965,981 ---- drawConstructorPoint(l.getOrigin(), dist); drawConstructorVector(l.getOrigin(), l.getDirection(), dist); } else if (o instanceof CoordinateSystem) { CoordinateSystem cs = (CoordinateSystem)o; Vertex i = cs.getI(); Vertex j = cs.getJ(); ! gl.glColor3fv(X_AXIS_COLOR); drawConstructorVector(cs.getOrigin(), i, dist); + gl.glColor3fv(Y_AXIS_COLOR); drawConstructorVector(cs.getOrigin(), j, dist); ! if (!cs.onlyPlane()) { ! Vertex n = cs.getN(); ! gl.glColor3fv(Z_AXIS_COLOR); ! drawConstructorVector(cs.getOrigin(), n, dist); ! } } } |
|
From: rimestad <rim...@us...> - 2006-07-20 12:58:11
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22166/src/net/sourceforge/bprocessor/model Modified Files: ClippingPlane.java Log Message: changes caused by changes in plane Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClippingPlane.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ClippingPlane.java 4 Jul 2006 09:36:54 -0000 1.3 --- ClippingPlane.java 20 Jul 2006 12:58:08 -0000 1.4 *************** *** 26,33 **** /** The placement of the clippingplane */ ! private Plane plane; ! ! /** The coordinate sytem of the clipping plane */ ! private CoordinateSystem system; /** The corners */ --- 26,30 ---- /** The placement of the clippingplane */ ! private CoordinateSystem cs; /** The corners */ *************** *** 37,40 **** --- 34,40 ---- private ArrayList silluet; + /** The plane of the clipingplane */ + private Plane plane; + /** * The constructor *************** *** 42,46 **** */ public ClippingPlane(CoordinateSystem system) { ! this.system = system; update(); } --- 42,47 ---- */ public ClippingPlane(CoordinateSystem system) { ! this.cs = system; ! plane = cs.plane(); update(); } *************** *** 51,71 **** */ public Plane getPlane() { ! return plane; ! } ! ! /** ! * Getter for the origin ! * @return The origin ! */ ! public Vertex origin() { ! Vertex origin = origin = system.getOrigin(); ! // FIXME Interning the origin to give it an ID.. ! // It needs an ID to be in a hashtable, but this ! // means that the origin point will be drawn an ! // clickable etc. ! if (origin.getId() == null) { ! //Project.getInstance().intern(origin); } ! return origin; } --- 52,59 ---- */ public Plane getPlane() { ! if (plane == null) { ! plane = cs.plane(); } ! return plane; } *************** *** 75,87 **** */ public Vertex center() { ! return origin(); } /** * Update this clipping from the defining coordinatesystem attribute - * */ public void update() { ! plane = system.plane(); findCorners(); } --- 63,74 ---- */ public Vertex center() { ! return cs.getOrigin(); } /** * Update this clipping from the defining coordinatesystem attribute */ public void update() { ! plane = null; findCorners(); } *************** *** 103,119 **** return number; } /** * Find intersections with all edges and return the vertices * @return The set of all intersection vertices */ public Collection findIntersections() { Collection edges = Project.getInstance().getEdges(); ! silluet = new ArrayList(); Collection res = new ArrayList(); Iterator it = edges.iterator(); while (it.hasNext()) { Edge e = (Edge)it.next(); ! Vertex v = plane.intersection(e); if (v != null) { res.add(v); --- 90,168 ---- return number; } + + /** + * Getter for corners + * @return The corners + */ + public Collection getCorners() { + if (corners == null) { + update(); + } + return corners; + } + + /** + * collects the vertices for this clipplane + * @return the set of vertices + */ + public Set collect() { + Set result = new HashSet(); + result.add(center()); + return result; + } + + /** + * FIXME: empty implementation to make compile + * (pfff make sure stuff compiles before you check in please) + */ + 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; + } + + /** + * Makes a string representation of the clippingplane + * @return The string representing til object + */ + public String toString() { + double[] p = getPlane().getDoublev(); + return "[" + p[0] + ", " + p[1] + ", " + p[2] + ", " + p[3] + "]"; + } + + /** + * Gettter for the intersected geometry + * @return The intersection edges + */ + public Collection getLines() { + return silluet; + } + + /** * Find intersections with all edges and return the vertices + * (Have sideeffects) * @return The set of all intersection vertices */ public Collection findIntersections() { Collection edges = Project.getInstance().getEdges(); ! ArrayList silluet = new ArrayList(); Collection res = new ArrayList(); Iterator it = edges.iterator(); while (it.hasNext()) { Edge e = (Edge)it.next(); ! Vertex v = getPlane().intersection(e); if (v != null) { res.add(v); *************** *** 129,133 **** while (iter.hasNext()) { Edge e = (Edge)iter.next(); ! Vertex v = plane.intersection(e); if (v != null) { if (first == null) { --- 178,182 ---- while (iter.hasNext()) { Edge e = (Edge)iter.next(); ! Vertex v = getPlane().intersection(e); if (v != null) { if (first == null) { *************** *** 143,155 **** } } return res; } ! /** ! * Find the 4 corners among intersections */ - public void findCorners() { ! Collection c = findIntersections(); if (c.isEmpty()) { if (!corners.isEmpty()) { --- 192,208 ---- } } + if (silluet.size() > 0) { + this.silluet = silluet; + } return res; } ! /** ! * Find the 4 corners among intersections ! * (Have side effects) */ public void findCorners() { ! Collection c = this.findIntersections(); ! CoordinateSystem system = getPlane().coordinateSystem(); if (c.isEmpty()) { if (!corners.isEmpty()) { *************** *** 205,263 **** } } - - /** - * Getter for corners - * @return The corners - */ - public Collection getCorners() { - return corners; - } - - /** - * collects the vertices for this clipplane - * @return the set of vertices - */ - public Set collect() { - Set result = new HashSet(); - result.add(origin()); - return result; - } - - /** - * FIXME: empty implementation to make compile - * (pfff make sure stuff compiles before you check in please) - */ - 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; - } - - /** - * Makes a string representation of the clippingplane - * @return The string representing til object - */ - public String toString() { - double[] p = plane.getDoublev(); - return "[" + p[0] + ", " + p[1] + ", " + p[2] + ", " + p[3] + "]"; - } - - /** - * Gettter for the intersected geometry - * @return The intersection edges - */ - public Collection getLines() { - return silluet; - } } --- 258,260 ---- |
|
From: rimestad <rim...@us...> - 2006-07-20 12:58:10
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22166/src/net/sourceforge/bprocessor/model/test Removed Files: PlaneTest.java Log Message: changes caused by changes in plane --- PlaneTest.java DELETED --- |
|
From: rimestad <rim...@us...> - 2006-07-20 12:58:06
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21907/src/net/sourceforge/bprocessor/gl/tool Modified Files: ConstructorTool.java Log Message: changes caused by changes in plane Index: ConstructorTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ConstructorTool.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ConstructorTool.java 19 Jul 2006 11:40:14 -0000 1.6 --- ConstructorTool.java 20 Jul 2006 12:58:04 -0000 1.7 *************** *** 17,21 **** import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Line; ! import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Point; import net.sourceforge.bprocessor.model.Project; --- 17,21 ---- import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Line; ! import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Point; import net.sourceforge.bprocessor.model.Project; *************** *** 76,81 **** */ protected void insertPlane(Vertex p1, Vertex p2, Vertex p3) { ! Plane plane = new Plane(p2.minus(p1), p3.minus(p1), p1); ! Project.getInstance().getActiveSpace().add(plane); Project.getInstance().changed(Project.getInstance()); } --- 76,85 ---- */ protected void insertPlane(Vertex p1, Vertex p2, Vertex p3) { ! Vertex i = p2.minus(p1); ! Vertex j = p3.minus(p1); ! Vertex k = i.cross(j); ! CoordinateSystem cs = new CoordinateSystem(i, j, k, p1); ! cs.onlyPlane(true); ! Project.getInstance().getActiveSpace().add(cs); Project.getInstance().changed(Project.getInstance()); } |
|
From: rimestad <rim...@us...> - 2006-07-20 12:56:29
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21424/src/net/sourceforge/bprocessor/model Modified Files: Plane.java Log Message: Plane is not a constructor anymore, is represented by a coordinatesystem now Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Plane.java 12 Jul 2006 14:34:18 -0000 1.22 --- Plane.java 20 Jul 2006 12:56:25 -0000 1.23 *************** *** 9,14 **** import java.util.Collection; import java.util.Iterator; - import java.util.List; - import java.util.Set; import org.apache.log4j.Logger; --- 9,12 ---- *************** *** 22,26 **** * ax + by + cz - (ah + bi + cj) = 0 */ ! public class Plane extends Constructor { /** The logger */ private static Logger log = Logger.getLogger(Plane.class); --- 20,24 ---- * ax + by + cz - (ah + bi + cj) = 0 */ ! public class Plane { /** The logger */ private static Logger log = Logger.getLogger(Plane.class); *************** *** 56,60 **** */ public Plane(double a, double b, double c, double d) { - super(new Vertex(-d / a, 0, 0)); this.a = a; this.b = b; --- 54,57 ---- *************** *** 64,83 **** /** - * Constructor - * @param a the first vector in the plane - * @param b the second vector in the plane - * @param origin a point in the plane - */ - public Plane(Vertex a, Vertex b, Vertex origin) { - super(origin); - Vertex normal = b.cross(a); - normal.normalize(); - this.a = normal.getX(); - this.b = normal.getY(); - this.c = normal.getZ(); - this.d = -this.a * (origin.getX()) - this.b * (origin.getY()) - this.c * (origin.getZ()); - } - - /** * Return a doublearray {a,b,c,d} * @return The array --- 61,64 ---- *************** *** 341,419 **** log.info(info); } - - /** - * @see net.sourceforge.bprocessor.model.Geometric#collect() - */ - public Set collect() { - - // TODO Auto-generated method stub - return null; - } - - /** - * @see net.sourceforge.bprocessor.model.Entity#center() - */ - public Vertex center() { - // TODO Auto-generated method stub - return null; - } - - /** - * @see net.sourceforge.bprocessor.model.Entity#delete() - */ - public void delete() { - getOwner().delete(this); - } - - /** - * @see net.sourceforge.bprocessor.model.Parametric#setAttributes() - */ - public void setAttributes(List attributes) { - // TODO Auto-generated method stub - } - - /** - * @see net.sourceforge.bprocessor.model.Parametric#getAttributes() - */ - public List getAttributes() { - // TODO Auto-generated method stub - return null; - } - - /** - * @see net.sourceforge.bprocessor.model.Parametric#getGeneralName() - */ - public String getGeneralName() { - return "Constructor-Plane"; - } - - /** - * Return one vector in the plane - * @return a vector in the plane - */ - public Vertex getI() { - Vertex res; - if (a != 0.0) { - res = new Vertex(-d / a, 0 , 0); - } else if (b != 0.0) { - res = new Vertex(0, -d / b , 0); - } else { - res = new Vertex(0, 0 , -d / c); - } - res = res.minus(getOrigin()); - res.normalize(); - return res; - } - - /** - * A vector perpindicular to the one returned in getI that is in the plane - * @return a vector in the plane perpindicular to the one returned in getI - */ - public Vertex getJ() { - Vertex v = getI(); - Vertex res = v.cross(normal()); - res.normalize(); - return res; - - } } --- 322,324 ---- |
|
From: Michael L. <he...@us...> - 2006-07-20 11:33:18
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20894/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: Small improvement to shift-locking mechanism in AbstractPencil Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** AbstractPencil.java 20 Jul 2006 11:08:39 -0000 1.45 --- AbstractPencil.java 20 Jul 2006 11:33:16 -0000 1.46 *************** *** 117,122 **** planeNormal.getZ() * start.vertex().getZ())); if (!constrain) { ! locked = start.vertex().minus(current.vertex()); ! locked.normalize(); } } --- 117,126 ---- planeNormal.getZ() * start.vertex().getZ())); if (!constrain) { ! if (current.type() == Intersection.EDGE) { ! locked = start.vertex().minus(current.vertex()); ! locked.normalize(); ! } else { ! locked = null; ! } } } *************** *** 129,133 **** (Intersection) glv.getView().getObjectAtPoint(e.getX(), e.getY(), unwanted, true, plane); ! if (constrain) { intersection = lockedIntersection(intersection); } --- 133,137 ---- (Intersection) glv.getView().getObjectAtPoint(e.getX(), e.getY(), unwanted, true, plane); ! if (constrain && locked != null) { intersection = lockedIntersection(intersection); } |
|
From: Michael L. <he...@us...> - 2006-07-20 11:08:50
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11135/src/net/sourceforge/bprocessor/model Modified Files: Vertex.java Log Message: Fixed bug in AbstractPencil with shift-locking direction Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Vertex.java 13 Jul 2006 13:28:24 -0000 1.38 --- Vertex.java 20 Jul 2006 11:08:44 -0000 1.39 *************** *** 433,437 **** public void normalize() { if (getX() != 0.0 || getY() != 0.0 || getZ() != 0.0) { ! this.scale(1 / this.length()); } } --- 433,437 ---- public void normalize() { if (getX() != 0.0 || getY() != 0.0 || getZ() != 0.0) { ! scale(1 / length()); } } |
|
From: Michael L. <he...@us...> - 2006-07-20 11:08:44
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11126/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java AbstractPencil.java Log Message: Fixed bug in AbstractPencil with shift-locking direction Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** AbstractPencil.java 20 Jul 2006 08:41:59 -0000 1.44 --- AbstractPencil.java 20 Jul 2006 11:08:39 -0000 1.45 *************** *** 106,109 **** --- 106,111 ---- */ protected Intersection findIntersection(MouseEvent e) { + boolean constrain = lock || e.isShiftDown(); + if (start != null) { Vertex planeNormal = plane.normal(); *************** *** 114,118 **** --- 116,126 ---- planeNormal.getY() * start.vertex().getY() + planeNormal.getZ() * start.vertex().getZ())); + if (!constrain) { + locked = start.vertex().minus(current.vertex()); + locked.normalize(); + } } + + Collection unwanted = new HashSet(); unwanted.addAll(elements); *************** *** 121,125 **** (Intersection) glv.getView().getObjectAtPoint(e.getX(), e.getY(), unwanted, true, plane); ! if (lock) { intersection = lockedIntersection(intersection); } --- 129,133 ---- (Intersection) glv.getView().getObjectAtPoint(e.getX(), e.getY(), unwanted, true, plane); ! if (constrain) { intersection = lockedIntersection(intersection); } *************** *** 134,142 **** private Intersection lockedIntersection(Intersection intersection) { if (start != null) { ! Vertex lockedcopy = locked.copy(); Vertex unlocked = intersection.vertex().minus(start.vertex()); ! lockedcopy.scale(locked.dot(unlocked) / locked.length()); ! lockedcopy = lockedcopy.add(start.vertex()); ! return new Intersection(lockedcopy, intersection.type(), intersection.object()); } else { return intersection; --- 142,150 ---- private Intersection lockedIntersection(Intersection intersection) { if (start != null) { ! Vertex direction = locked.copy(); Vertex unlocked = intersection.vertex().minus(start.vertex()); ! direction.scale(locked.dot(unlocked)); ! Vertex vertex = start.vertex().add(direction); ! return new Intersection(vertex, intersection.type(), intersection.object()); } else { return intersection; *************** *** 728,743 **** number = ""; } ! if (e.getKeyCode() == KeyEvent.VK_SHIFT) { ! if (start != null && current != null) { ! locked = start.vertex().minus(current.vertex()); ! locked.scale(1 / locked.length()); ! lock = true; ! } ! } else if (e.getKeyCode() == KeyEvent.VK_CAPS_LOCK) { ! if (start != null && current != null) { ! locked = start.vertex().minus(current.vertex()); ! locked.scale(1 / locked.length()); ! } ! lock = !lock; } else if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { cleanUp(); --- 736,741 ---- number = ""; } ! if (e.getKeyCode() == KeyEvent.VK_CAPS_LOCK) { ! lock = true; } else if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { cleanUp(); *************** *** 804,808 **** public void keyReleased(KeyEvent e) { super.keyReleased(e); ! if (e.getKeyCode() == KeyEvent.VK_SHIFT) { lock = false; } --- 802,806 ---- public void keyReleased(KeyEvent e) { super.keyReleased(e); ! if (e.getKeyCode() == KeyEvent.VK_CAPS_LOCK) { lock = false; } *************** *** 819,822 **** --- 817,821 ---- hooverEdge = null; lock = false; + locked = null; constructors(new LinkedList()); feedback(new LinkedList()); Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** AbstractTool.java 9 Jul 2006 16:22:19 -0000 1.85 --- AbstractTool.java 20 Jul 2006 11:08:39 -0000 1.86 *************** *** 209,212 **** --- 209,213 ---- */ public void keyPressed(KeyEvent e) { + Camera c = Project.getInstance().getCurrentCamera(); Vertex up = new Vertex(c.getRoll()[0], c.getRoll()[1], c.getRoll()[2]); *************** *** 245,288 **** } ! if ((e.getModifiersEx() & KeyEvent.SHIFT_DOWN_MASK) == KeyEvent.SHIFT_DOWN_MASK) { ! // IF SHIFT IS PRESSED AS MODIFIER ! if (e.getKeyCode() == KeyEvent.VK_W) { ! glv.changeTool(Tool.WALK_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_F) { ! glv.changeTool(Tool.FLY_TOOL); ! } ! } else { ! if (e.getModifiers() == 0) { ! if (e.getKeyCode() == KeyEvent.VK_UP) { ! c.translate(new double[] {up.getX(), up.getY(), up.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_DOWN) { ! c.translate(new double[] {-up.getX(), -up.getY(), -up.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_LEFT) { ! c.translate(new double[] {sidewards.getX(), sidewards.getY(), sidewards.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_RIGHT) { ! c.translate(new double[] {-sidewards.getX(), -sidewards.getY(), -sidewards.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_Z) { ! c.zoomout(); ! } else if (e.getKeyCode() == KeyEvent.VK_X) { ! c.zoomin(); ! } else if (e.getKeyCode() == KeyEvent.VK_Q) { ! glv.changeTool(Tool.SELECT_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_W) { ! glv.changeTool(Tool.PENCIL_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_M) { ! glv.changeTool(Tool.MOVE_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_R) { ! glv.changeTool(Tool.CAMERA_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_E) { ! glv.changeTool(Tool.EXTRUSION_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_F5) { ! glv.getView().changeDrawMode(View.WIREFRAME_MODE); ! } else if (e.getKeyCode() == KeyEvent.VK_F6) { ! glv.getView().changeDrawMode(View.SOLID_MODE); ! } else if (e.getKeyCode() == KeyEvent.VK_F7) { ! glv.getView().changeDrawMode(View.LIGHTING_MODE); ! } else { ! key(e); ! } } } --- 246,280 ---- } ! if (e.getModifiers() == 0) { ! if (e.getKeyCode() == KeyEvent.VK_UP) { ! c.translate(new double[] {up.getX(), up.getY(), up.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_DOWN) { ! c.translate(new double[] {-up.getX(), -up.getY(), -up.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_LEFT) { ! c.translate(new double[] {sidewards.getX(), sidewards.getY(), sidewards.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_RIGHT) { ! c.translate(new double[] {-sidewards.getX(), -sidewards.getY(), -sidewards.getZ()}); ! } else if (e.getKeyCode() == KeyEvent.VK_Z) { ! c.zoomout(); ! } else if (e.getKeyCode() == KeyEvent.VK_X) { ! c.zoomin(); ! } else if (e.getKeyCode() == KeyEvent.VK_Q) { ! glv.changeTool(Tool.SELECT_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_W) { ! glv.changeTool(Tool.PENCIL_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_M) { ! glv.changeTool(Tool.MOVE_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_R) { ! glv.changeTool(Tool.CAMERA_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_E) { ! glv.changeTool(Tool.EXTRUSION_TOOL); ! } else if (e.getKeyCode() == KeyEvent.VK_F5) { ! glv.getView().changeDrawMode(View.WIREFRAME_MODE); ! } else if (e.getKeyCode() == KeyEvent.VK_F6) { ! glv.getView().changeDrawMode(View.SOLID_MODE); ! } else if (e.getKeyCode() == KeyEvent.VK_F7) { ! glv.getView().changeDrawMode(View.LIGHTING_MODE); ! } else { ! key(e); } } |
|
From: Michael L. <he...@us...> - 2006-07-20 08:42:03
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14748/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: Fixed orthogonal constructor Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** AbstractPencil.java 19 Jul 2006 14:31:05 -0000 1.43 --- AbstractPencil.java 20 Jul 2006 08:41:59 -0000 1.44 *************** *** 447,450 **** --- 447,454 ---- origin.setZ(start.vertex().getZ()); } + + origin.setX(0); + origin.setY(0); + origin.setZ(0); Vertex direction = parrallel.getDirection(); direction = system.translate(direction); *************** *** 455,465 **** direction = system.unTranslate(direction); direction.scale(50 / direction.length()); Edge orthogonal = null; ! if (start != null) { ! orthogonal = new Edge(start.vertex().minus(direction), start.vertex().add(direction)); ! } else { ! if (incident != null) { ! orthogonal = new Edge(incident.vertex().minus(direction), ! incident.vertex().add(direction)); } } --- 459,472 ---- direction = system.unTranslate(direction); direction.scale(50 / direction.length()); + Edge orthogonal = null; ! if (Math.abs(direction.getZ()) < 0.0000001) { ! if (start != null) { ! orthogonal = new Edge(start.vertex().minus(direction), start.vertex().add(direction)); ! } else { ! if (incident != null) { ! orthogonal = new Edge(incident.vertex().minus(direction), ! incident.vertex().add(direction)); ! } } } |
|
From: Michael L. <he...@us...> - 2006-07-19 14:31:14
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6462/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Fixed bug with orthogonal constructors Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.115 retrieving revision 1.116 diff -C2 -d -r1.115 -r1.116 *** View.java 19 Jul 2006 08:42:12 -0000 1.115 --- View.java 19 Jul 2006 14:31:05 -0000 1.116 *************** *** 800,803 **** --- 800,804 ---- if (target != null) { gl.glColor3fv(targetColor); + gl.glLineWidth(1.5f); drawObject(target); } |
|
From: Michael L. <he...@us...> - 2006-07-19 14:31:09
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6462/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: Fixed bug with orthogonal constructors Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** AbstractPencil.java 19 Jul 2006 13:42:19 -0000 1.42 --- AbstractPencil.java 19 Jul 2006 14:31:05 -0000 1.43 *************** *** 441,445 **** CoordinateSystem system = plane.coordinateSystem(); ! Vertex direction = parrallel.getDirection(); direction = system.translate(direction); --- 441,450 ---- CoordinateSystem system = plane.coordinateSystem(); ! Vertex origin = system.getOrigin(); ! if (start != null) { ! origin.setX(start.vertex().getX()); ! origin.setY(start.vertex().getY()); ! origin.setZ(start.vertex().getZ()); ! } Vertex direction = parrallel.getDirection(); direction = system.translate(direction); |
|
From: Michael L. <he...@us...> - 2006-07-19 13:42:22
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19445/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: Fixed bug in creating orthogonal constructor Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** AbstractPencil.java 19 Jul 2006 12:04:17 -0000 1.41 --- AbstractPencil.java 19 Jul 2006 13:42:19 -0000 1.42 *************** *** 430,433 **** --- 430,435 ---- constructors.add(parrallel); } + + Plane plane; *************** *** 439,442 **** --- 441,445 ---- CoordinateSystem system = plane.coordinateSystem(); + Vertex direction = parrallel.getDirection(); direction = system.translate(direction); *************** *** 445,449 **** direction.setX(-y); direction.setY(x); ! system.unTranslate(direction); direction.scale(50 / direction.length()); Edge orthogonal = null; --- 448,452 ---- direction.setX(-y); direction.setY(x); ! direction = system.unTranslate(direction); direction.scale(50 / direction.length()); Edge orthogonal = null; |
|
From: Michael L. <he...@us...> - 2006-07-19 12:04:20
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7555/src/net/sourceforge/bprocessor/gl/tool Modified Files: Pencil.java AbstractPencil.java Log Message: Improved finish/continue logic in Pencil Index: Pencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Pencil.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Pencil.java 5 May 2006 12:14:01 -0000 1.6 --- Pencil.java 19 Jul 2006 12:04:17 -0000 1.7 *************** *** 14,18 **** import net.sourceforge.bprocessor.gl.GLView; - import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.model.Edge; --- 14,17 ---- *************** *** 74,90 **** start = current; } else { - Edge edge = new Edge(start.vertex(), current.vertex()); - List edges = new LinkedList(); - edges.add(edge); - insertEdges(edges); - hooverEdge = edge; ! if (current.type() == Intersection.VERTEX ! || current.type() == Intersection.EDGE_MIDPOINT) { ! start = null; ! incident = null; } else { start = current; incident = null; } } --- 73,91 ---- start = current; } else { ! if (start.vertex().equalEps(current.vertex())) { ! cleanUp(); ! return; } else { + Edge edge = new Edge(start.vertex(), current.vertex()); + List edges = new LinkedList(); + edges.add(edge); + hooverEdge = edge; start = current; incident = null; + if (insertEdges(edges)) { + cleanUp(); + return; + } } } Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** AbstractPencil.java 19 Jul 2006 11:32:19 -0000 1.40 --- AbstractPencil.java 19 Jul 2006 12:04:17 -0000 1.41 *************** *** 198,205 **** Vertex from = insertVertex(edge.getFrom(), split); Vertex to = insertVertex(edge.getTo(), split); - if (from == to) { - log.error("Cannot insert edge: " + edge + " to and from vertices are the same"); - return null; - } edge.setFrom(from); edge.setTo(to); --- 198,201 ---- *************** *** 228,233 **** * Insert a number edges into the model * @param edges List of edges */ ! public void insertEdges(List edges) { if (!edges.isEmpty()) { Vertex from = ((Edge) edges.get(0)).getFrom(); --- 224,231 ---- * Insert a number edges into the model * @param edges List of edges + * @return Boolean indicating whether the edges are closed */ ! public boolean insertEdges(List edges) { ! boolean closed = false; if (!edges.isEmpty()) { Vertex from = ((Edge) edges.get(0)).getFrom(); *************** *** 240,252 **** Edge current = (Edge) iter.next(); Edge edge = insertEdge(current, false); ! if (edge != null) { ! actual.add(edge); ! } else { ! return; ! } } Surface surface = new Surface(actual); mesh().insert(surface); holeAnalysis(surface); } else { List actual = new LinkedList(); --- 238,247 ---- Edge current = (Edge) iter.next(); Edge edge = insertEdge(current, false); ! actual.add(edge); } Surface surface = new Surface(actual); mesh().insert(surface); holeAnalysis(surface); + closed = true; } else { List actual = new LinkedList(); *************** *** 255,269 **** Edge current = (Edge) iter.next(); Edge edge = insertEdge(current, true); ! if (edge != null) { ! actual.add(edge); ! } else { ! return; ! } } ! Geometry.insert(actual); } } Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } --- 250,261 ---- Edge current = (Edge) iter.next(); Edge edge = insertEdge(current, true); ! actual.add(edge); } ! closed = Geometry.insert(actual); } } Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); + return closed; } |
|
From: Michael L. <he...@us...> - 2006-07-19 12:04:16
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7526/src/net/sourceforge/bprocessor/model Modified Files: Geometry.java Log Message: Improved finish/continue logic in Pencil Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Geometry.java 12 Jul 2006 14:30:36 -0000 1.21 --- Geometry.java 19 Jul 2006 12:04:13 -0000 1.22 *************** *** 176,181 **** * surfaces etc. * @param edges The list of edges */ ! public static void insert(List edges) { Edge first = (Edge) edges.get(0); --- 176,182 ---- * surfaces etc. * @param edges The list of edges + * @return Whether a new surface was added */ ! public static boolean insert(List edges) { Edge first = (Edge) edges.get(0); *************** *** 184,187 **** --- 185,189 ---- Vertex to = last.getTo(); Surface exterior = null; + boolean closed = false; { Set fromSurfaces = from.getSurfaces(); *************** *** 238,246 **** siblings = node.insert(siblings); node.sort(); ! findSurfaces(node, lastEdgeNode, edges, exterior); } } } ! } --- 240,248 ---- siblings = node.insert(siblings); node.sort(); ! closed = findSurfaces(node, lastEdgeNode, edges, exterior); } } } ! return closed; } *************** *** 252,257 **** * @param edges The edges * @param exterior The exterior */ ! private static void findSurfaces(VertexNode vertex, EdgeNode last, List edges, Surface exterior) { int count = 0; List surfaces = new LinkedList(); --- 254,261 ---- * @param edges The edges * @param exterior The exterior + * @return Whether a surface was found */ ! private static boolean findSurfaces(VertexNode vertex, EdgeNode last, ! List edges, Surface exterior) { int count = 0; List surfaces = new LinkedList(); *************** *** 298,301 **** --- 302,306 ---- } } + return !surfaces.isEmpty(); } |
|
From: Michael L. <he...@us...> - 2006-07-19 11:40:16
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30340/src/net/sourceforge/bprocessor/gl/tool Modified Files: ConstructorTool.java Log Message: Avoid constructors sharing the same origin vertex Index: ConstructorTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ConstructorTool.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ConstructorTool.java 19 Jul 2006 11:25:28 -0000 1.5 --- ConstructorTool.java 19 Jul 2006 11:40:14 -0000 1.6 *************** *** 137,141 **** } else { if (p1.vertex().equalEps(current.vertex())) { ! insertPoint(current.vertex()); cleanUp(); return; --- 137,141 ---- } else { if (p1.vertex().equalEps(current.vertex())) { ! insertPoint(current.vertex().copy()); cleanUp(); return; *************** *** 144,152 **** } else { if (p2.vertex().equalEps(current.vertex())) { ! insertLine(p1.vertex(), p2.vertex()); cleanUp(); return; } else { ! insertPlane(p1.vertex(), p2.vertex(), current.vertex()); cleanUp(); return; --- 144,152 ---- } else { if (p2.vertex().equalEps(current.vertex())) { ! insertLine(p1.vertex().copy(), p2.vertex().copy()); cleanUp(); return; } else { ! insertPlane(p1.vertex().copy(), p2.vertex().copy(), current.vertex().copy()); cleanUp(); return; |
|
From: Michael L. <he...@us...> - 2006-07-19 11:32:23
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27258/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: Removed unused code (aligners) from AbstractPencil Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** AbstractPencil.java 19 Jul 2006 11:25:28 -0000 1.39 --- AbstractPencil.java 19 Jul 2006 11:32:19 -0000 1.40 *************** *** 75,82 **** protected Vertex locked; ! /** Wherther or not unaligned constructors are showing */ ! protected boolean showing; ! ! /** Wherther or not the tool is locked */ protected boolean lock; --- 75,79 ---- protected Vertex locked; ! /** Whether or not the tool is locked */ protected boolean lock; *************** *** 100,104 **** timer.setRepeats(false); lock = false; - showing = true; plane = new Plane (0, 0, 1, 0); } --- 97,100 ---- *************** *** 406,416 **** protected void updateConstructors() { List constructors = computeConstructors(); - if (!showing) { - aligners(constructors); - constructors = new LinkedList(); - if (current.object() instanceof Edge) { - constructors.add(current.object()); - } - } constructors(constructors); number = ""; --- 402,405 ---- *************** *** 516,550 **** /** - * Show aligners - */ - protected void showAligners() { - Iterator iter = aligners.iterator(); - while (iter.hasNext()) { - Edge current = (Edge) iter.next(); - glv.getView().addTempEdge(current); - } - } - - /** - * Hide aligners - */ - protected void hideAligners() { - Iterator iter = aligners.iterator(); - while (iter.hasNext()) { - Edge current = (Edge) iter.next(); - glv.getView().removeTempEdge(current); - } - } - - /** - * Supply the aligner elements - * @param feed Collection of edges - */ - protected void aligners(Collection feed) { - aligners.clear(); - aligners.addAll(feed); - } - - /** * Get the plane out of the XY XZ and YZ planes that is best aligned * with screen. --- 505,508 ---- |
|
From: Michael L. <he...@us...> - 2006-07-19 11:25:32
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24550/src/net/sourceforge/bprocessor/gl/tool Modified Files: ConstructorTool.java AbstractPencil.java Log Message: Fixed alignment issues in ConstructorTool Index: ConstructorTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ConstructorTool.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ConstructorTool.java 19 Jul 2006 09:00:19 -0000 1.4 --- ConstructorTool.java 19 Jul 2006 11:25:28 -0000 1.5 *************** *** 84,88 **** * Update Constructors */ ! protected void updateConstructors() { List constructors = new LinkedList(); List points = new LinkedList(); --- 84,88 ---- * Update Constructors */ ! protected void updateFeedback() { List constructors = new LinkedList(); List points = new LinkedList(); *************** *** 104,109 **** excluded.addAll(constructors); points(points); ! constructors(constructors); ! excluded(excluded); } --- 104,110 ---- excluded.addAll(constructors); points(points); ! feedback(constructors); ! makeTarget(current); ! updateConstructors(); } *************** *** 114,123 **** current = findIntersection(e); if (current != null) { ! makeTarget(current); ! updateConstructors(); } } /** * @param e MouseEvent */ --- 115,132 ---- current = findIntersection(e); if (current != null) { ! updateFeedback(); } } /** + * + */ + public void cleanUp() { + super.cleanUp(); + p1 = null; + p2 = null; + } + + /** * @param e MouseEvent */ *************** *** 125,133 **** if (p1 == null) { p1 = current; } else { if (p1.vertex().equalEps(current.vertex())) { insertPoint(current.vertex()); ! p1 = null; ! p2 = null; } else if (p2 == null) { p2 = current; --- 134,143 ---- if (p1 == null) { p1 = current; + start = p1; } else { if (p1.vertex().equalEps(current.vertex())) { insertPoint(current.vertex()); ! cleanUp(); ! return; } else if (p2 == null) { p2 = current; *************** *** 135,148 **** if (p2.vertex().equalEps(current.vertex())) { insertLine(p1.vertex(), p2.vertex()); ! p1 = null; ! p2 = null; } else { insertPlane(p1.vertex(), p2.vertex(), current.vertex()); ! p1 = null; ! p2 = null; } } } ! updateConstructors(); } --- 145,158 ---- if (p2.vertex().equalEps(current.vertex())) { insertLine(p1.vertex(), p2.vertex()); ! cleanUp(); ! return; } else { insertPlane(p1.vertex(), p2.vertex(), current.vertex()); ! cleanUp(); ! return; } } } ! updateFeedback(); } Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** AbstractPencil.java 17 Jul 2006 09:08:42 -0000 1.38 --- AbstractPencil.java 19 Jul 2006 11:25:28 -0000 1.39 *************** *** 400,407 **** } /** ! * Update constructors based on start, current and incident. */ protected void updateConstructors() { List constructors = new LinkedList(); if (start != null) { --- 400,426 ---- } + /** ! * Update constructors */ protected void updateConstructors() { + List constructors = computeConstructors(); + if (!showing) { + aligners(constructors); + constructors = new LinkedList(); + if (current.object() instanceof Edge) { + constructors.add(current.object()); + } + } + constructors(constructors); + number = ""; + updateLength(); + } + + /** + * Update constructors based on start, current and incident. + * @return Constructors + */ + protected List computeConstructors() { List constructors = new LinkedList(); if (start != null) { *************** *** 465,479 **** } } ! ! if (!showing) { ! aligners(constructors); ! constructors = new LinkedList(); ! if (current.object() instanceof Edge) { ! constructors.add(current.object()); ! } ! } ! constructors(constructors); ! number = ""; ! updateLength(); } --- 484,488 ---- } } ! return constructors; } |
|
From: Michael L. <he...@us...> - 2006-07-19 09:00:22
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31770/src/net/sourceforge/bprocessor/gl/tool Modified Files: ConstructorTool.java Log Message: Reworked logic og constructor-tool Index: ConstructorTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ConstructorTool.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ConstructorTool.java 17 Jul 2006 12:38:16 -0000 1.3 --- ConstructorTool.java 19 Jul 2006 09:00:19 -0000 1.4 *************** *** 127,140 **** } else { if (p1.vertex().equalEps(current.vertex())) { ! if (p2 == null) { ! insertPoint(current.vertex()); ! } else { ! insertLine(p1.vertex(), p2.vertex()); ! } p1 = null; p2 = null; } else { ! if (p2 == null) { ! p2 = current; } else { insertPlane(p1.vertex(), p2.vertex(), current.vertex()); --- 127,140 ---- } else { if (p1.vertex().equalEps(current.vertex())) { ! insertPoint(current.vertex()); p1 = null; p2 = null; + } else if (p2 == null) { + p2 = current; } else { ! if (p2.vertex().equalEps(current.vertex())) { ! insertLine(p1.vertex(), p2.vertex()); ! p1 = null; ! p2 = null; } else { insertPlane(p1.vertex(), p2.vertex(), current.vertex()); |
|
From: Michael L. <he...@us...> - 2006-07-19 08:42:14
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24326/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Line can now be used for snapping Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.114 retrieving revision 1.115 diff -C2 -d -r1.114 -r1.115 *** View.java 18 Jul 2006 21:50:49 -0000 1.114 --- View.java 19 Jul 2006 08:42:12 -0000 1.115 *************** *** 1027,1044 **** gl.glPopMatrix(); gl.glDisable(GL.GL_LIGHTING); ! ! { ! Vertex dir = direction.copy(); ! dir.scale(View.gridSize() * 2); ! Vertex a = from.minus(dir); ! Vertex b = from.add(dir); ! gl.glLineWidth(0.5f); ! gl.glEnable(GL.GL_LINE_STIPPLE); ! gl.glBegin(GL.GL_LINE_STRIP); ! gl.glVertex3d(a.getX(), a.getY(), a.getZ()); ! gl.glVertex3d(b.getX(), b.getY(), b.getZ()); ! gl.glEnd(); ! gl.glDisable(GL.GL_LINE_STIPPLE); ! } } --- 1027,1062 ---- gl.glPopMatrix(); gl.glDisable(GL.GL_LIGHTING); ! drawConstructorLine(from, direction, dist); ! } ! ! /** ! * Draw constructor line ! * @param from Origin ! * @param direction Direction vector ! * @param dist Dist ! */ ! private void drawConstructorLine(Vertex from, Vertex direction, double dist) { ! gl.glLineWidth(0.5f); ! gl.glEnable(GL.GL_LINE_STIPPLE); ! gl.glBegin(GL.GL_LINE_STRIP); ! drawConstructorLineGeometry(from, direction, dist); ! gl.glDisable(GL.GL_LINE_STIPPLE); ! } ! ! /** ! * Draw constructor line ! * @param from Origin ! * @param direction Direction vector ! * @param dist Dist ! */ ! private void drawConstructorLineGeometry(Vertex from, Vertex direction, double dist) { ! Vertex dir = direction.copy(); ! dir.scale(View.gridSize() * 2); ! Vertex a = from.minus(dir); ! Vertex b = from.add(dir); ! gl.glBegin(GL.GL_LINE_STRIP); ! gl.glVertex3d(a.getX(), a.getY(), a.getZ()); ! gl.glVertex3d(b.getX(), b.getY(), b.getZ()); ! gl.glEnd(); } *************** *** 1609,1614 **** if (current instanceof Line) { Line line = (Line) current; if (camera.getType() == Camera.PERSPECTIVE) { ! dist = (line.getOrigin().minus(v)).length() * scale; } Vertex tip = line.tip(dist / 16 + dist / 20); --- 1627,1641 ---- if (current instanceof Line) { Line line = (Line) current; + + Vertex origin = line.getOrigin(); + Vertex direction = line.getDirection(); + direction.scale(View.gridSize() * 2); + Vertex from = origin.minus(direction); + Vertex to = origin.add(direction); + Edge constructor = new Edge(from, to); + constructor.setConstructor(true); + if (camera.getType() == Camera.PERSPECTIVE) { ! dist = (origin.minus(v)).length() * scale; } Vertex tip = line.tip(dist / 16 + dist / 20); *************** *** 1616,1619 **** --- 1643,1649 ---- drawVertexHit(tip); popName(gl); + pushName(gl, constructor); + drawEdge(constructor); + popName(gl); } } |
|
From: Michael L. <he...@us...> - 2006-07-18 21:50:51
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2528/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Accurately computes to the placement of the tip of a vector for hit-detection to be able to rotate a vector by moving the tip Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.113 retrieving revision 1.114 diff -C2 -d -r1.113 -r1.114 *** View.java 18 Jul 2006 14:04:41 -0000 1.113 --- View.java 18 Jul 2006 21:50:49 -0000 1.114 *************** *** 943,956 **** Collection cons = active.getConstructors(); Iterator iter = cons.iterator(); ! Camera current = Project.getInstance().getCurrentCamera(); ! Vertex v = new Vertex(current.getCamera()); ! double scale = scale = current.getFocalwidth() / 65; ! double dist = v.minus(new Vertex(current.getCenter())).length() * scale; while (iter.hasNext()) { Object o = iter.next(); Constructor c = (Constructor)o; ! if (current.getType() == Camera.PERSPECTIVE) { dist = (c.getOrigin().minus(v)).length() * scale; } if (o instanceof Point) { drawConstructorPoint(((Point)o).getOrigin(), dist); --- 943,961 ---- Collection cons = active.getConstructors(); Iterator iter = cons.iterator(); ! ! ! Camera camera = Project.getInstance().getCurrentCamera(); ! Vertex v = new Vertex(camera.getCamera()); ! double scale = (camera.getFocalwidth() / 65) * (500 / height); ! double dist = v.minus(new Vertex(camera.getCenter())).length() * scale; ! while (iter.hasNext()) { Object o = iter.next(); Constructor c = (Constructor)o; ! ! if (camera.getType() == Camera.PERSPECTIVE) { dist = (c.getOrigin().minus(v)).length() * scale; } + if (o instanceof Point) { drawConstructorPoint(((Point)o).getOrigin(), dist); *************** *** 1003,1009 **** private void drawConstructorVector(Vertex from, Vertex direction, double dist) { gl.glLineWidth(2); - double scale = 500 / height; Vertex d = direction.copy(); ! d.scale(scale * dist / 16); Vertex to = from.add(d); gl.glBegin(GL.GL_LINES); --- 1008,1013 ---- private void drawConstructorVector(Vertex from, Vertex direction, double dist) { gl.glLineWidth(2); Vertex d = direction.copy(); ! d.scale(dist / 16); Vertex to = from.add(d); gl.glBegin(GL.GL_LINES); *************** *** 1020,1024 **** gl.glRotated(-Math.toDegrees(Geometry.degreesAboutY(d)), 0, 1, 0); gl.glRotated(90, 0, 1, 0); ! glu.gluCylinder(quad, (dist / 90) * scale, 0, (dist / 20) * scale, 10, 10); gl.glPopMatrix(); gl.glDisable(GL.GL_LIGHTING); --- 1024,1028 ---- 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); gl.glPopMatrix(); gl.glDisable(GL.GL_LIGHTING); *************** *** 1591,1594 **** --- 1595,1604 ---- if (selectMode == CONSTRUCTORS || selectMode == ALL) { { + Camera camera = Project.getInstance().getCurrentCamera(); + Vertex v = new Vertex(camera.getCamera()); + double scale = (camera.getFocalwidth() / 65) * (500 / height); + double dist = v.minus(new Vertex(camera.getCenter())).length() * scale; + + Iterator iter = space.getConstructors().iterator(); while (iter.hasNext()) { *************** *** 1599,1603 **** if (current instanceof Line) { Line line = (Line) current; ! Vertex tip = line.tip(); pushName(gl, tip); drawVertexHit(tip); --- 1609,1616 ---- if (current instanceof Line) { Line line = (Line) current; ! if (camera.getType() == Camera.PERSPECTIVE) { ! dist = (line.getOrigin().minus(v)).length() * scale; ! } ! Vertex tip = line.tip(dist / 16 + dist / 20); pushName(gl, tip); drawVertexHit(tip); |
|
From: Michael L. <he...@us...> - 2006-07-18 21:50:46
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2519/src/net/sourceforge/bprocessor/model Modified Files: Line.java Log Message: Accurately computes to the placement of the tip of a vector for hit-detection to be able to rotate a vector by moving the tip Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Line.java 18 Jul 2006 14:04:37 -0000 1.10 --- Line.java 18 Jul 2006 21:50:41 -0000 1.11 *************** *** 134,140 **** */ public Vertex tip() { ! double x = getOrigin().getX() + dir.getX(); ! double y = getOrigin().getY() + dir.getY(); ! double z = getOrigin().getZ() + dir.getZ(); return new Tip(x, y, z); } --- 134,149 ---- */ public Vertex tip() { ! return tip(1.0); ! } ! ! /** ! * Tip ! * @param distance Distance from origin ! * @return A vertex representing the tip ! */ ! public Vertex tip(double distance) { ! double x = getOrigin().getX() + dir.getX() * distance; ! double y = getOrigin().getY() + dir.getY() * distance; ! double z = getOrigin().getZ() + dir.getZ() * distance; return new Tip(x, y, z); } |
|
From: Michael L. <he...@us...> - 2006-07-18 14:04:48
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14156/src/net/sourceforge/bprocessor/model Modified Files: Line.java Geometric.java Project.java Log Message: Implemented strategy to rotate a vector by moving the tip Index: Geometric.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometric.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Geometric.java 16 Jun 2006 09:42:57 -0000 1.6 --- Geometric.java 18 Jul 2006 14:04:37 -0000 1.7 *************** *** 54,57 **** public abstract Set collect(); ! } --- 54,62 ---- public abstract Set collect(); ! /** ! * Update after move ! */ ! public void update() { ! ! } } Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Line.java 13 Jul 2006 13:30:14 -0000 1.9 --- Line.java 18 Jul 2006 14:04:37 -0000 1.10 *************** *** 128,130 **** --- 128,164 ---- return Geometry.degreesAboutZ(dir); } + + /** + * Tip + * @return A vertex representing the tip + */ + public Vertex tip() { + double x = getOrigin().getX() + dir.getX(); + double y = getOrigin().getY() + dir.getY(); + double z = getOrigin().getZ() + dir.getZ(); + return new Tip(x, y, z); + } + + /** + * Vertex representing the tip of the vector defining this line + */ + private class Tip extends Vertex { + /** */ + private static final long serialVersionUID = 1L; + /** + * Constructor for Tip + * @param x X + * @param y Y + * @param z Z + */ + public Tip(double x, double y, double z) { + super(x, y, z); + } + /** + * Update the direction based on the placement of the tip + */ + public void update() { + setDirection(minus(getOrigin())); + } + } } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** Project.java 7 Jul 2006 14:07:33 -0000 1.61 --- Project.java 18 Jul 2006 14:04:37 -0000 1.62 *************** *** 285,288 **** --- 285,289 ---- while (iter.hasNext()) { Vertex current = (Vertex) iter.next(); + current.update(); edges.addAll(current.getEdges()); } |
|
From: Michael L. <he...@us...> - 2006-07-18 14:04:46
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14167/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Implemented strategy to rotate a vector by moving the tip Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.112 retrieving revision 1.113 diff -C2 -d -r1.112 -r1.113 *** View.java 18 Jul 2006 12:43:13 -0000 1.112 --- View.java 18 Jul 2006 14:04:41 -0000 1.113 *************** *** 21,24 **** --- 21,25 ---- import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Point; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; *************** *** 952,957 **** dist = (c.getOrigin().minus(v)).length() * scale; } ! if (o instanceof net.sourceforge.bprocessor.model.Point) { ! drawConstructorPoint(((net.sourceforge.bprocessor.model.Point)o).getOrigin(), dist); } else if (o instanceof Line) { Line l = (Line)o; --- 953,958 ---- dist = (c.getOrigin().minus(v)).length() * scale; } ! if (o instanceof Point) { ! drawConstructorPoint(((Point)o).getOrigin(), dist); } else if (o instanceof Line) { Line l = (Line)o; *************** *** 1035,1042 **** gl.glEnd(); gl.glDisable(GL.GL_LINE_STIPPLE); ! } ! } ! /** * --- 1036,1042 ---- gl.glEnd(); gl.glDisable(GL.GL_LINE_STIPPLE); ! } } ! /** * *************** *** 1597,1602 **** drawVertexHit(current.getOrigin()); popName(gl); } - } } --- 1597,1608 ---- drawVertexHit(current.getOrigin()); popName(gl); + if (current instanceof Line) { + Line line = (Line) current; + Vertex tip = line.tip(); + pushName(gl, tip); + drawVertexHit(tip); + popName(gl); + } } } } |
|
From: Michael L. <he...@us...> - 2006-07-18 12:43:15
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15893/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Renamed View.Point to TesselatorPoint Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** View.java 18 Jul 2006 11:18:58 -0000 1.111 --- View.java 18 Jul 2006 12:43:13 -0000 1.112 *************** *** 1208,1215 **** Vertex current = (Vertex) iter.next(); double[] coords = new double[] {current.getX(), current.getY(), current.getZ()}; ! glu.gluTessVertex(tess, coords, new Point(coords[0], coords[1], coords[2])); } double[] coords = new double[] {first.getX(), first.getY(), first.getZ()}; ! glu.gluTessVertex(tess, coords, new Point(coords[0], coords[1], coords[2])); glu.gluTessEndContour(tess); } --- 1208,1215 ---- Vertex current = (Vertex) iter.next(); double[] coords = new double[] {current.getX(), current.getY(), current.getZ()}; ! glu.gluTessVertex(tess, coords, new TesselatorPoint(coords[0], coords[1], coords[2])); } double[] coords = new double[] {first.getX(), first.getY(), first.getZ()}; ! glu.gluTessVertex(tess, coords, new TesselatorPoint(coords[0], coords[1], coords[2])); glu.gluTessEndContour(tess); } *************** *** 1598,1601 **** --- 1598,1602 ---- popName(gl); } + } } *************** *** 2225,2229 **** * representation of a 3D point. */ ! private class Point { /** the x coordinate*/ private double x; --- 2226,2230 ---- * representation of a 3D point. */ ! private class TesselatorPoint { /** the x coordinate*/ private double x; *************** *** 2234,2243 **** /** ! * Constructor for a point * @param x the x coordinate. * @param y the y coordinate. * @param z the z coordinate. */ ! public Point(double x, double y, double z) { this.x = x; this.y = y; --- 2235,2244 ---- /** ! * Constructor for a tesselator-point * @param x the x coordinate. * @param y the y coordinate. * @param z the z coordinate. */ ! public TesselatorPoint(double x, double y, double z) { this.x = x; this.y = y; *************** *** 2300,2305 **** */ public void vertex(Object vertex) { ! if (vertex instanceof Point) { ! Point p = (Point)vertex; gl.glVertex3d(p.x, p.y, p.z); } else { --- 2301,2306 ---- */ public void vertex(Object vertex) { ! if (vertex instanceof TesselatorPoint) { ! TesselatorPoint p = (TesselatorPoint)vertex; gl.glVertex3d(p.x, p.y, p.z); } else { |