bprocessor-commit Mailing List for B-processor (Page 155)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael L. <he...@us...> - 2005-10-24 10:27:53
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5603/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: Made it easier to hit a vertex (but now it is too easy). Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** GLView.java 21 Oct 2005 08:43:57 -0000 1.18 --- GLView.java 24 Oct 2005 10:27:28 -0000 1.19 *************** *** 61,65 **** glCap.setHardwareAccelerated(true); glc = GLDrawableFactory.getFactory().createGLCanvas(glCap); - //glc = GLDrawableFactory.getFactory().createGLJPanel(glCap); JPanel jp = new JPanel(); jp.setPreferredSize(new Dimension(450, 450)); --- 61,64 ---- *************** *** 69,73 **** JPanel lengthPanel = new JPanel(); lengthPanel.setLayout(new BorderLayout()); ! lengthPanel.add(new JLabel("LENGTH: "), BorderLayout.WEST); lengthField = new LengthField(); lengthPanel.add(lengthField, BorderLayout.CENTER); --- 68,72 ---- JPanel lengthPanel = new JPanel(); lengthPanel.setLayout(new BorderLayout()); ! lengthPanel.add(new JLabel("Length: "), BorderLayout.WEST); lengthField = new LengthField(); lengthPanel.add(lengthField, BorderLayout.CENTER); |
From: Michael L. <he...@us...> - 2005-10-24 10:27:52
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5603/src/net/sourceforge/bprocessor/gl/view Modified Files: AbstractView.java Log Message: Made it easier to hit a vertex (but now it is too easy). Index: AbstractView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/AbstractView.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** AbstractView.java 21 Oct 2005 11:57:09 -0000 1.43 --- AbstractView.java 24 Oct 2005 10:27:28 -0000 1.44 *************** *** 193,201 **** gl = gld.getGL(); glu = gld.getGLU(); ! this.width = gld.getSize().getWidth(); ! this.height = gld.getSize().getHeight(); ! ! this.aspect = this.width / this.height; gl.glClearColor(0.7f, 0.7f, 0.7f, 0.0f); --- 193,205 ---- gl = gld.getGL(); glu = gld.getGLU(); + GLUtesselator tess = glu.gluNewTess(); + glu.gluBeginPolygon(tess); + glu.gluEndPolygon(tess); + glu.gluDeleteTess(tess); + // TODO Initialize tesselation... + AbstractView.width = gld.getSize().getWidth(); + AbstractView.height = gld.getSize().getHeight(); ! AbstractView.aspect = AbstractView.width / AbstractView.height; gl.glClearColor(0.7f, 0.7f, 0.7f, 0.0f); *************** *** 693,697 **** if (o instanceof Vertex) { Vertex v = (Vertex) o; ! gl.glPointSize(5.0f); gl.glBegin(GL.GL_POINTS); gl.glVertex3d(v.getX(), v.getY(), v.getZ()); --- 697,701 ---- if (o instanceof Vertex) { Vertex v = (Vertex) o; ! gl.glPointSize(7.0f); gl.glBegin(GL.GL_POINTS); gl.glVertex3d(v.getX(), v.getY(), v.getZ()); *************** *** 813,817 **** gl.glPushMatrix(); gl.glTranslated(v.getX(), v.getY(), v.getZ()); ! glu.gluSphere(ball, 0.2, 8, 8); gl.glPopMatrix(); } --- 817,821 ---- gl.glPushMatrix(); gl.glTranslated(v.getX(), v.getY(), v.getZ()); ! glu.gluSphere(ball, 0.5, 8, 8); gl.glPopMatrix(); } |
From: Michael L. <he...@us...> - 2005-10-24 10:26:09
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5242/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Geometry.java CoordinateSystem.java Log Message: First working version of Geometry.insert(edges) Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** Surface.java 21 Oct 2005 08:40:11 -0000 1.41 --- Surface.java 24 Oct 2005 10:25:47 -0000 1.42 *************** *** 298,304 **** double tetra = 0.0; - System.out.println("--- start ---"); - System.out.print("size: "); - System.out.println(vertices.length); for (int i = 1; i <= (vertices.length - 2); i++) { double dxi = vertices[i + 1].getX() - vertices[i].getX(); --- 298,301 ---- *************** *** 307,314 **** double dyi1 = vertices[i].getY() - vertices[i - 1].getY(); double tetrai = Math.atan2((dxi * dyi1 - dxi1 * dyi), (dxi * dxi1 + dyi * dyi1)); - System.out.println(tetrai); tetra += tetrai; } - System.out.println("--- end ---"); return tetra; } --- 304,309 ---- *************** *** 716,720 **** Edge e0 = (Edge) edges.get(0); Edge e1 = (Edge) edges.get(1); ! return new CoordinateSystem(e0, e1); } else { return null; --- 711,715 ---- Edge e0 = (Edge) edges.get(0); Edge e1 = (Edge) edges.get(1); ! return CoordinateSystem.create(e0, e1); } else { return null; Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Geometry.java 21 Oct 2005 08:40:11 -0000 1.2 --- Geometry.java 24 Oct 2005 10:25:47 -0000 1.3 *************** *** 36,52 **** siblings.remove(last); Iterator iter = siblings.iterator(); - System.out.println("--- processing ---"); while (!siblings.isEmpty()) { - System.out.println(siblings); Edge current = (Edge) siblings.iterator().next(); ! CoordinateSystem system = new CoordinateSystem(last, current); ! VertexNode node = new VertexNode(to, system); ! EdgeNode lastEdgeNode = node.insert(last); ! siblings = node.insert(siblings); ! node.sort(); ! System.out.println("-- NODE --"); ! System.out.println(node); ! findSurfaces(node, lastEdgeNode, edges); ! System.out.println("----------"); } } --- 36,51 ---- siblings.remove(last); Iterator iter = siblings.iterator(); while (!siblings.isEmpty()) { Edge current = (Edge) siblings.iterator().next(); ! CoordinateSystem system = CoordinateSystem.create(last, current); ! if (system != null) { ! VertexNode node = new VertexNode(to, system); ! EdgeNode lastEdgeNode = node.insert(last); ! siblings = node.insert(siblings); ! node.sort(); ! findSurfaces(node, lastEdgeNode, edges); ! } else { ! siblings.remove(current); ! } } } *************** *** 63,75 **** Surface clockwise = clockwiseSurface(vertex, last, edges); if (clockwise != null) { ! Project.getInstance().intern(clockwise); ! System.out.println("interning " + clockwise); ! List vertices = clockwise.getVertices(); ! Iterator iter = vertices.iterator(); ! while (iter.hasNext()) { ! Vertex current = (Vertex) iter.next(); ! System.out.println(current); } - System.out.println("angle = " + clockwise.angle(vertex.system())); } } --- 62,68 ---- Surface clockwise = clockwiseSurface(vertex, last, edges); if (clockwise != null) { ! if (clockwise.angle(vertex.system()) < 0) { ! Project.getInstance().intern(clockwise); } } } *************** *** 77,89 **** Surface counterclockwise = counterclockwiseSurface(vertex, last, edges); if (counterclockwise != null) { ! Project.getInstance().intern(counterclockwise); ! System.out.println("interning " + counterclockwise); ! List vertices = counterclockwise.getVertices(); ! Iterator iter = vertices.iterator(); ! while (iter.hasNext()) { ! Vertex current = (Vertex) iter.next(); ! System.out.println(current); } - System.out.println("angle = " + counterclockwise.angle(vertex.system())); } } --- 70,76 ---- Surface counterclockwise = counterclockwiseSurface(vertex, last, edges); if (counterclockwise != null) { ! if (counterclockwise.angle(vertex.system()) > 0) { ! Project.getInstance().intern(counterclockwise); } } } *************** *** 99,102 **** --- 86,92 ---- */ private static Surface clockwiseSurface(VertexNode vertex, EdgeNode last, List edges) { + if (last == null) { + throw new Error("last null"); + } ArrayList result = new ArrayList(); result.addAll(edges); *************** *** 297,300 **** --- 287,291 ---- */ public EdgeNode clockwise(Edge edge) { + EdgeNode result = null; Object[] sorted = edgenodes.toArray(); int index = 0; *************** *** 305,312 **** } if (index == 0) { ! return (EdgeNode) sorted[sorted.length - 1]; } else { ! return (EdgeNode) sorted[index - 1]; } } --- 296,307 ---- } if (index == 0) { ! result = (EdgeNode) sorted[sorted.length - 1]; } else { ! result = (EdgeNode) sorted[index - 1]; ! } ! if (result == null) { ! throw new Error("null"); } + return result; } Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CoordinateSystem.java 18 Oct 2005 08:17:07 -0000 1.4 --- CoordinateSystem.java 24 Oct 2005 10:25:47 -0000 1.5 *************** *** 57,63 **** * @param e1 Edge one * @param e2 Edge two */ ! public CoordinateSystem(Edge e1, Edge e2) { ! super(); Vertex v0, v1, v2; if (e2.contains(e1.getFrom())) { --- 57,63 ---- * @param e1 Edge one * @param e2 Edge two + * @return CoordinateSystem */ ! public static CoordinateSystem create(Edge e1, Edge e2) { Vertex v0, v1, v2; if (e2.contains(e1.getFrom())) { *************** *** 69,80 **** } v2 = e2.otherVertex(v1); ! origin = v0; ! i = v1.minus(v0); i.scale(1 / i.length()); Vertex v = v2.minus(v1); ! n = i.cross(v); ! n.scale(1 / n.length()); ! j = i.cross(n); ! j.scale(1 / j.length()); } --- 69,85 ---- } v2 = e2.otherVertex(v1); ! Vertex origin = v0; ! Vertex i = v1.minus(v0); i.scale(1 / i.length()); Vertex v = v2.minus(v1); ! Vertex n = i.cross(v); ! if (n.length() > 0) { ! n.scale(1 / n.length()); ! Vertex j = i.cross(n); ! j.scale(1 / j.length()); ! return new CoordinateSystem(i, j, n, origin); ! } else { ! return null; ! } } |
From: Michael L. <he...@us...> - 2005-10-21 11:57:21
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16091/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java PencilTool.java SelectTool.java Log Message: Changed feedback in PencilTool to hilite target Index: SelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectTool.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** SelectTool.java 11 Oct 2005 12:05:15 -0000 1.31 --- SelectTool.java 21 Oct 2005 11:57:10 -0000 1.32 *************** *** 8,12 **** import net.sourceforge.bprocessor.gl.GLView; - import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.kernel.notification.Notification; --- 8,11 ---- *************** *** 52,58 **** protected int viewType; - /** the object corresponding to the mouse */ - protected Object target; - /** * The constructor --- 51,54 ---- *************** *** 63,77 **** } - /** - * Find the object under the mouse and set target - * @param event The MouseEvent - */ - protected void findTarget(MouseEvent event) { - int x = event.getX(); - int y = event.getY(); - View view = glv.getView(); - target = view.getObjectAtPoint(x, y); - } - /** * Invoked when the mouse cursor has been moved --- 59,62 ---- Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** PencilTool.java 21 Oct 2005 08:43:56 -0000 1.26 --- PencilTool.java 21 Oct 2005 11:57:10 -0000 1.27 *************** *** 33,37 **** * The DebugTool */ ! public class PencilTool extends SelectTool { /** The logger */ private static Logger log = Logger.getLogger(PencilTool.class); --- 33,37 ---- * The DebugTool */ ! public class PencilTool extends AbstractTool { /** The logger */ private static Logger log = Logger.getLogger(PencilTool.class); *************** *** 317,321 **** */ protected void pressed(MouseEvent e) { ! super.pressed(e); boolean legal = findVertex(e); if (legal) { --- 317,322 ---- */ protected void pressed(MouseEvent e) { ! findTarget(e); ! glv.getView().makeTarget(target); boolean legal = findVertex(e); if (legal) { *************** *** 328,332 **** */ protected void moved(MouseEvent e) { ! super.moved(e); findVertex(e); --- 329,334 ---- */ protected void moved(MouseEvent e) { ! findTarget(e); ! glv.getView().makeTarget(target); findVertex(e); *************** *** 358,361 **** --- 360,365 ---- */ protected void released(MouseEvent e) { + findTarget(e); + glv.getView().makeTarget(null); int x = e.getX(); int y = e.getY(); Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** AbstractTool.java 2 Oct 2005 14:48:22 -0000 1.22 --- AbstractTool.java 21 Oct 2005 11:57:10 -0000 1.23 *************** *** 67,70 **** --- 67,73 ---- /** The 3DView */ protected GLView glv = null; + + /** the object corresponding to the mouse */ + protected Object target; static { *************** *** 149,154 **** int y = e.getY(); ! this.dx = x - pressPos[0]; ! this.dy = y - pressPos[1]; dragged(e); --- 152,157 ---- int y = e.getY(); ! AbstractTool.dx = x - pressPos[0]; ! AbstractTool.dy = y - pressPos[1]; dragged(e); *************** *** 211,216 **** timer.removeActionListener(moveAction); ! this.dx = 0; ! this.dy = 0; released(e); --- 214,219 ---- timer.removeActionListener(moveAction); ! AbstractTool.dx = 0; ! AbstractTool.dy = 0; released(e); *************** *** 439,441 **** --- 442,455 ---- */ protected abstract void released(MouseEvent e); + + /** + * Find the object under the mouse and set target + * @param event The MouseEvent + */ + protected void findTarget(MouseEvent event) { + int x = event.getX(); + int y = event.getY(); + View view = glv.getView(); + target = view.getObjectAtPoint(x, y); + } } |
From: Michael L. <he...@us...> - 2005-10-21 11:57:21
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16091/src/net/sourceforge/bprocessor/gl/view Modified Files: AbstractView.java View.java Log Message: Changed feedback in PencilTool to hilite target Index: AbstractView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/AbstractView.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** AbstractView.java 11 Oct 2005 12:05:15 -0000 1.42 --- AbstractView.java 21 Oct 2005 11:57:09 -0000 1.43 *************** *** 86,91 **** protected static double[] alignPoint = null; ! /** The alignment vertex */ protected static Vertex alignVertex = null; /** The GL */ --- 86,95 ---- protected static double[] alignPoint = null; ! /** The alignment vertex */ protected static Vertex alignVertex = null; + + /** The target */ + + protected static Object target = null; /** The GL */ *************** *** 322,325 **** --- 326,330 ---- setSnapVertex(null); setAlignPoint(null); + makeTarget(null); } *************** *** 553,583 **** } // draw selection Iterator selit = selection.iterator(); while (selit.hasNext()) { Object o = selit.next(); ! gl.glColor3fv(SELECTED_COLOR); ! if (o instanceof Vertex) { ! Vertex v = (Vertex) o; ! gl.glPointSize(5.0f); ! gl.glBegin(GL.GL_POINTS); ! gl.glVertex3d(v.getX(), v.getY(), v.getZ()); ! gl.glEnd(); ! gl.glPointSize(1.0f); ! } else if (o instanceof Edge) { ! Edge e = (Edge) o; ! Vertex to = e.getTo(); ! Vertex from = e.getFrom(); ! gl.glBegin(GL.GL_LINES); ! gl.glVertex3d(to.getX(), to.getY(), to.getZ()); ! gl.glVertex3d(from.getX(), from.getY(), from.getZ()); ! gl.glEnd(); ! } else if (o instanceof Surface) { ! gl.glEnable(GL.GL_POLYGON_STIPPLE); ! gl.glPolygonStipple(transparency); ! Surface s = (Surface) o; ! log.info(s.getName() + " angle: " + s.angle()); ! drawSurface(s); ! gl.glDisable(GL.GL_POLYGON_STIPPLE); ! } } --- 558,572 ---- } // draw selection + gl.glColor3fv(SELECTED_COLOR); Iterator selit = selection.iterator(); while (selit.hasNext()) { Object o = selit.next(); ! drawObject(o); ! } ! ! // draw target ! gl.glColor3fv(TARGET_COLOR); ! if (target != null) { ! drawObject(target); } *************** *** 698,701 **** --- 687,718 ---- /** + * Draw an object + * @param o The Object + */ + private void drawObject(Object o) { + if (o instanceof Vertex) { + Vertex v = (Vertex) o; + gl.glPointSize(5.0f); + gl.glBegin(GL.GL_POINTS); + gl.glVertex3d(v.getX(), v.getY(), v.getZ()); + gl.glEnd(); + gl.glPointSize(1.0f); + } else if (o instanceof Edge) { + Edge e = (Edge) o; + Vertex to = e.getTo(); + Vertex from = e.getFrom(); + gl.glBegin(GL.GL_LINES); + gl.glVertex3d(to.getX(), to.getY(), to.getZ()); + gl.glVertex3d(from.getX(), from.getY(), from.getZ()); + gl.glEnd(); + } else if (o instanceof Surface) { + gl.glEnable(GL.GL_POLYGON_STIPPLE); + gl.glPolygonStipple(transparency); + Surface s = (Surface) o; + drawSurface(s); + gl.glDisable(GL.GL_POLYGON_STIPPLE); + } + } + /** * Draw a surface * @param s The surface to draw *************** *** 947,950 **** --- 964,975 ---- return alignPoint; } + + /** + * Setter for target + * @param o The object to be target + */ + public void makeTarget(Object o) { + target = o; + } /** Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** View.java 16 Sep 2005 12:09:07 -0000 1.12 --- View.java 21 Oct 2005 11:57:09 -0000 1.13 *************** *** 53,56 **** --- 53,59 ---- public static final float[] SELECTED_COLOR = new float[] {1.0f, 0.4f, 1.0f}; + /** Used for target objects */ + public static final float[] TARGET_COLOR = new float[] {0.1f, 0.8f, 0.1f}; + /** Can be used for setting wireframe mode */ public static final int WIREFRAME_MODE = 0; *************** *** 148,151 **** --- 151,160 ---- */ public Vertex getAlignVertex(); + + /** + * Setter for target + * @param o The object to be target + */ + public void makeTarget(Object o); /** |
From: Michael L. <he...@us...> - 2005-10-21 11:56:41
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15901/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: Changed Edge.getSurfaces() to use Project instead of SurfaceFacade Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Edge.java 10 Oct 2005 12:13:42 -0000 1.15 --- Edge.java 21 Oct 2005 11:56:27 -0000 1.16 *************** *** 300,304 **** public Set getSurfaces() { Set result = new HashSet(); ! Set surfaces = SurfaceFacade.getInstance().findAll(); Iterator iter = surfaces.iterator(); while (iter.hasNext()) { --- 300,304 ---- public Set getSurfaces() { Set result = new HashSet(); ! Set surfaces = Project.getInstance().getSurfaces(); Iterator iter = surfaces.iterator(); while (iter.hasNext()) { |
From: Michael L. <he...@us...> - 2005-10-21 08:45:48
|
Update of /cvsroot/bprocessor/build/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5916/bin Modified Files: bprocessor.sh Log Message: Improves Look'n Feel (LAF) p mac: - Bruger global menubar - Har et applikations navn Index: bprocessor.sh =================================================================== RCS file: /cvsroot/bprocessor/build/bin/bprocessor.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** bprocessor.sh 14 Jul 2005 09:51:32 -0000 1.2 --- bprocessor.sh 21 Oct 2005 08:45:41 -0000 1.3 *************** *** 9,16 **** OS=$OSTYPE LIBDIR=library/linux ! if [ $OS != "linux" ]; then LIBDIR=library/macosx fi ! $JAVA_HOME/bin/java -Djava.library.path=$LIBDIR -jar kernel.jar --- 9,17 ---- OS=$OSTYPE LIBDIR=library/linux ! PLATFORM_DEFS= if [ $OS != "linux" ]; then LIBDIR=library/macosx + PLATFORM_DEFS='-Dapple.laf.useScreenMenuBar=true -Dcom.apple.mrj.application.apple.menu.about.name=B-Processor' fi ! $JAVA_HOME/bin/java -Djava.library.path=$LIBDIR $PLATFORM_DEFS -jar kernel.jar |
From: Michael L. <he...@us...> - 2005-10-21 08:44:04
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5601/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: GLView shows the GUI window when done initialising PencilTool calls Geometry.insert(edges) to find newly created Surfaces Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** GLView.java 2 Oct 2005 14:48:23 -0000 1.17 --- GLView.java 21 Oct 2005 08:43:57 -0000 1.18 *************** *** 21,25 **** import net.java.games.jogl.GLDrawable; import net.java.games.jogl.GLDrawableFactory; ! import net.java.games.jogl.GLCanvas; import java.awt.Dimension; import java.awt.BorderLayout; --- 21,27 ---- import net.java.games.jogl.GLDrawable; import net.java.games.jogl.GLDrawableFactory; ! import net.java.games.jogl.Version; ! ! import java.awt.Component; import java.awt.Dimension; import java.awt.BorderLayout; *************** *** 28,32 **** import javax.swing.JLabel; import javax.swing.JPopupMenu; ! import org.apache.log4j.Logger; --- 30,34 ---- import javax.swing.JLabel; import javax.swing.JPopupMenu; ! import javax.swing.SwingUtilities; import org.apache.log4j.Logger; *************** *** 39,43 **** /** GL canvas */ ! private GLCanvas glc; /** current event listener */ --- 41,45 ---- /** GL canvas */ ! private GLDrawable glc; /** current event listener */ *************** *** 54,67 **** */ public GLView() { ! log.info("Creating GLView"); GLCapabilities glCap = new GLCapabilities(); glCap.setDoubleBuffered(true); glCap.setHardwareAccelerated(true); glc = GLDrawableFactory.getFactory().createGLCanvas(glCap); ! JPanel jp = new JPanel(); jp.setPreferredSize(new Dimension(450, 450)); jp.setLayout(new BorderLayout()); ! jp.add(glc, BorderLayout.CENTER); JPanel lengthPanel = new JPanel(); --- 56,69 ---- */ public GLView() { ! log.info("Using JOGL version " + Version.getVersion()); GLCapabilities glCap = new GLCapabilities(); glCap.setDoubleBuffered(true); glCap.setHardwareAccelerated(true); glc = GLDrawableFactory.getFactory().createGLCanvas(glCap); ! //glc = GLDrawableFactory.getFactory().createGLJPanel(glCap); JPanel jp = new JPanel(); jp.setPreferredSize(new Dimension(450, 450)); jp.setLayout(new BorderLayout()); ! jp.add((Component) glc, BorderLayout.CENTER); JPanel lengthPanel = new JPanel(); *************** *** 81,86 **** GUI.getInstance().registerPanel(jp, GUI.SPLIT_MIDDLE); - log.info("Done Creating GlView"); glc.setAutoSwapBufferMode(false); } --- 83,95 ---- GUI.getInstance().registerPanel(jp, GUI.SPLIT_MIDDLE); glc.setAutoSwapBufferMode(false); + repaint(); + SwingUtilities.invokeLater ( + new Runnable() { + public void run() { + GUI.getInstance().present(); + } + } + ); } *************** *** 179,183 **** */ public void popup(JPopupMenu pp, int x, int y) { ! pp.show(glc, x, y); } --- 188,192 ---- */ public void popup(JPopupMenu pp, int x, int y) { ! pp.show((Component) glc, x, y); } |
From: Michael L. <he...@us...> - 2005-10-21 08:44:04
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5601/src/net/sourceforge/bprocessor/gl/tool Modified Files: PencilTool.java Log Message: GLView shows the GUI window when done initialising PencilTool calls Geometry.insert(edges) to find newly created Surfaces Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** PencilTool.java 18 Oct 2005 08:18:41 -0000 1.25 --- PencilTool.java 21 Oct 2005 08:43:56 -0000 1.26 *************** *** 166,189 **** if (!edges.isEmpty()) { ! Geometry.insert(edges); ! Surface surface = new Surface("S" + surfaceNum++, edges); ! intern(surface); ! if (exterior != null) { ! exterior.addHole(surface); ! Project.getInstance().update(exterior); ! Project.getInstance().update(surface); ! } ! ! // Do automation with spaces ! Space sp = findSpace(surface); ! if (sp != null) { ! sp.addSurface(surface); ! } ! if (sp instanceof ConstructionSpace) { ! Project.getInstance().update((ConstructionSpace)sp); ! } else if (sp instanceof FunctionalSpace) { ! Project.getInstance().update((FunctionalSpace)sp); ! } else { ! //log.warn("No space was found"); } } --- 166,194 ---- if (!edges.isEmpty()) { ! Vertex from = ((Edge) edges.get(0)).getFrom(); ! Vertex to = ((Edge) edges.get(edges.size() - 1)).getTo(); ! if (from == to) { ! Surface surface = new Surface("S" + surfaceNum++, edges); ! intern(surface); ! if (exterior != null) { ! exterior.addHole(surface); ! Project.getInstance().update(exterior); ! Project.getInstance().update(surface); ! } ! ! // Do automation with spaces ! Space sp = findSpace(surface); ! if (sp != null) { ! sp.addSurface(surface); ! } ! if (sp instanceof ConstructionSpace) { ! Project.getInstance().update((ConstructionSpace)sp); ! } else if (sp instanceof FunctionalSpace) { ! Project.getInstance().update((FunctionalSpace)sp); ! } else { ! //log.warn("No space was found"); ! } ! } else { ! Geometry.insert(edges); } } |
From: Michael L. <he...@us...> - 2005-10-21 08:42:56
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/properties In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5293/src/net/sourceforge/bprocessor/gui/properties Modified Files: Settings.java Log Message: Delays showing the GUI window until the GLView is done with initialisation. Displays a SplashWindow on startup, that are removed when the GUI window is displayed. Index: Settings.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/properties/Settings.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Settings.java 4 Aug 2005 06:06:26 -0000 1.1 --- Settings.java 21 Oct 2005 08:42:47 -0000 1.2 *************** *** 7,12 **** package net.sourceforge.bprocessor.gui.properties; ! import net.sourceforge.bprocessor.model.db.Database; ! import net.sourceforge.bprocessor.model.db.DatabaseFactory; import java.io.FileInputStream; --- 7,12 ---- package net.sourceforge.bprocessor.gui.properties; ! //import net.sourceforge.bprocessor.model.db.Database; ! //import net.sourceforge.bprocessor.model.db.DatabaseFactory; import java.io.FileInputStream; *************** *** 96,101 **** String password = getProperty(CONNECTION_PASSWORD); boolean autodrop = Boolean.valueOf(getProperty(CONNECTION_AUTODROP)).booleanValue(); ! ! DatabaseFactory.getInstance().setDatabase(type, url, user, password, autodrop); } --- 96,102 ---- String password = getProperty(CONNECTION_PASSWORD); boolean autodrop = Boolean.valueOf(getProperty(CONNECTION_AUTODROP)).booleanValue(); ! System.out.println("Applying Properties"); ! //DatabaseFactory.getInstance().setDatabase(type, url, user, password, autodrop); ! System.out.println("Done Applying Properties"); } *************** *** 105,117 **** private void defaultSettings() { clear(); ! Database db = DatabaseFactory.getInstance().getDatabase(); ! ! setProperty(DATABASE_NAME, db.getName()); ! setProperty(DATABASE_TYPE, Integer.toString(db.getType())); ! setProperty(CONNECTION_URL, db.getUrl()); ! setProperty(CONNECTION_USER, db.getUser()); ! setProperty(CONNECTION_PASSWORD, db.getPassword()); ! setProperty(CONNECTION_AUTODROP, Boolean.toString(db.getAutodrop())); } } --- 106,119 ---- private void defaultSettings() { clear(); + //System.out.println("Getting Database Instance"); + //Database db = DatabaseFactory.getInstance().getDatabase(); + //System.out.println("DONE"); ! //setProperty(DATABASE_NAME, db.getName()); ! //setProperty(DATABASE_TYPE, Integer.toString(db.getType())); ! //setProperty(CONNECTION_URL, db.getUrl()); ! //setProperty(CONNECTION_USER, db.getUser()); ! //setProperty(CONNECTION_PASSWORD, db.getPassword()); ! //setProperty(CONNECTION_AUTODROP, Boolean.toString(db.getAutodrop())); } } |
From: Michael L. <he...@us...> - 2005-10-21 08:42:56
|
Update of /cvsroot/bprocessor/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5293 Modified Files: build.xml Log Message: Delays showing the GUI window until the GLView is done with initialisation. Displays a SplashWindow on startup, that are removed when the GUI window is displayed. Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/gui/build.xml,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** build.xml 27 Jun 2005 09:32:23 -0000 1.1.1.1 --- build.xml 21 Oct 2005 08:42:47 -0000 1.2 *************** *** 17,20 **** --- 17,22 ---- <property name="dist.dir" value="${basedir}/dist"/> + <property name="gfx.dir" value="${src.dir}/gfx"/> + <property name="checkstyle-results" value="${build.dir}/checkstyle-results.txt" /> *************** *** 82,85 **** --- 84,91 ---- </target> + <target name="fastcompile" depends="copylib"> + <ant dir="src" target="compile"/> + </target> + <target name="doc" depends="copylib"> <delete dir="${doc.api.dir}"/> *************** *** 87,92 **** </target> ! <target name="jar" depends="compile"> <mkdir dir="${dist.dir}"/> <jar jarfile="${dist.dir}/${name}.jar" basedir="${build.dir}" --- 93,103 ---- </target> ! <target name="jar" depends="prepare"> <mkdir dir="${dist.dir}"/> + <copy todir="${build.dir}"> + <fileset dir="${gfx.dir}"> + <include name="**/*"/> + </fileset> + </copy> <jar jarfile="${dist.dir}/${name}.jar" basedir="${build.dir}" *************** *** 108,114 **** </target> ! <target name="dist" depends="jar"> </target> <target name="release" depends="clean,dist"> <move todir="${basedir}/archive/${name}-${version}"> --- 119,129 ---- </target> ! <target name="dist" depends="compile,jar"> </target> + <target name="fast" depends="fastcompile,jar"> + </target> + + <target name="release" depends="clean,dist"> <move todir="${basedir}/archive/${name}-${version}"> |
From: Michael L. <he...@us...> - 2005-10-21 08:42:56
|
Update of /cvsroot/bprocessor/gui/src/gfx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5293/src/gfx Added Files: sagradafamilia.png sagradasketch.png Log Message: Delays showing the GUI window until the GLView is done with initialisation. Displays a SplashWindow on startup, that are removed when the GUI window is displayed. --- NEW FILE: sagradafamilia.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: sagradasketch.png --- (This appears to be a binary file; contents omitted.) |
From: Michael L. <he...@us...> - 2005-10-21 08:42:56
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5293/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Delays showing the GUI window until the GLView is done with initialisation. Displays a SplashWindow on startup, that are removed when the GUI window is displayed. Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** GUI.java 20 Sep 2005 17:21:45 -0000 1.8 --- GUI.java 21 Oct 2005 08:42:47 -0000 1.9 *************** *** 21,24 **** --- 21,25 ---- import net.sourceforge.bprocessor.gui.attrview.AttributeView; import net.sourceforge.bprocessor.gui.properties.Settings; + import net.sourceforge.bprocessor.gui.splash.SplashWindow; import net.sourceforge.bprocessor.gui.treeview.SpacesTreeView; import net.sourceforge.bprocessor.gui.treeview.SurfacesTreeView; *************** *** 27,30 **** --- 28,32 ---- import java.awt.Component; import java.awt.event.KeyEvent; + import javax.swing.JFrame; import javax.swing.JMenu; *************** *** 34,37 **** --- 36,40 ---- import javax.swing.JSplitPane; import javax.swing.JTabbedPane; + import javax.swing.JWindow; import javax.swing.ToolTipManager; import javax.swing.JPopupMenu; *************** *** 54,57 **** --- 57,64 ---- /** The middle/right split pane */ private JSplitPane splitPaneMiddleRight; + + /** The splash */ + + private JWindow plash; /** SPLIT_LEFT */ *************** *** 316,323 **** --- 323,343 ---- */ public void start() { + plash = new SplashWindow("sagradafamilia.png", null); + Settings settings = Settings.getInstance(); settings.load(); setSize(800, 600); + } + + /** + * Show the GUI + */ + public void present() { + if (plash != null) { + plash.setVisible(false); + plash.dispose(); + plash = null; + } setVisible(true); } |
From: Michael L. <he...@us...> - 2005-10-21 08:42:56
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/splash In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5293/src/net/sourceforge/bprocessor/gui/splash Added Files: package.html SplashWindow.java Log Message: Delays showing the GUI window until the GLView is done with initialisation. Displays a SplashWindow on startup, that are removed when the GUI window is displayed. --- NEW FILE: SplashWindow.java --- //--------------------------------------------------------------------------------- // $Id: SplashWindow.java,v 1.1 2005/10/21 08:42:47 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.splash; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Frame; import java.awt.Toolkit; import java.net.URL; import javax.swing.ImageIcon; import javax.swing.JLabel; import javax.swing.JWindow; /** * The SplashWindow */ public class SplashWindow extends JWindow { /** * Constructor for the SplashWindow * Display a splash window * @param iconname The image to show * @param f The owning frame (null is accepted) */ public SplashWindow(String iconname, Frame f) { super(f); ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource(iconname); JLabel l = new JLabel(new ImageIcon(url)); getContentPane().add(l, BorderLayout.CENTER); pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension labelSize = l.getPreferredSize(); setLocation(screenSize.width / 2 - (labelSize.width / 2), screenSize.height / 2 - (labelSize.height / 2)); setVisible(true); screenSize = null; labelSize = null; } } --- NEW FILE: package.html --- <body> Define the package which creates the Splash Window. </body> |
From: Michael L. <he...@us...> - 2005-10-21 08:42:44
|
Update of /cvsroot/bprocessor/gui/src/gfx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5267/src/gfx Log Message: Directory /cvsroot/bprocessor/gui/src/gfx added to the repository |
From: Michael L. <he...@us...> - 2005-10-21 08:42:44
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/splash In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5267/src/net/sourceforge/bprocessor/gui/splash Log Message: Directory /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/splash added to the repository |
From: Michael L. <he...@us...> - 2005-10-21 08:40:19
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4921/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Geometry.java Log Message: Implemented first version of Geometry.insert(edges), that calculates surfaces Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Surface.java 18 Oct 2005 08:17:07 -0000 1.40 --- Surface.java 21 Oct 2005 08:40:11 -0000 1.41 *************** *** 276,282 **** */ public double angle() { List vertexlist = getVertices(); - CoordinateSystem coordinateSystem = coordinateSystem(); vertexlist = coordinateSystem.translate(vertexlist); --- 276,290 ---- */ public double angle() { + return angle(coordinateSystem()); + } + + /** + * Compute the traversed angle of this Surface + * @param coordinateSystem The CoordinateSystem + * @return The angle + */ + public double angle(CoordinateSystem coordinateSystem) { List vertexlist = getVertices(); vertexlist = coordinateSystem.translate(vertexlist); *************** *** 775,780 **** */ public String toString() { ! return "Surface[id=" + id + ",name=" + name + ",constructor=" + constructor + ! ",edges=" + edges == null ? "0" : edges.size() + "]"; } } --- 783,787 ---- */ public String toString() { ! return "Surface[id=" + id + " " + name + " #" + edges.size() + "]"; } } Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Geometry.java 18 Oct 2005 08:17:07 -0000 1.1 --- Geometry.java 21 Oct 2005 08:40:11 -0000 1.2 *************** *** 30,36 **** Edge first = (Edge) edges.get(0); Edge last = (Edge) edges.get(edges.size() - 1); ! Vertex from = first.getFrom(); ! Set siblings = from.getEdges(); siblings.remove(first); siblings.remove(last); --- 30,36 ---- Edge first = (Edge) edges.get(0); Edge last = (Edge) edges.get(edges.size() - 1); ! Vertex to = last.getTo(); ! Set siblings = to.getEdges(); siblings.remove(first); siblings.remove(last); *************** *** 40,50 **** System.out.println(siblings); Edge current = (Edge) siblings.iterator().next(); ! CoordinateSystem system = new CoordinateSystem(first, current); ! VertexNode node = new VertexNode(from, system); ! node.insert(first); siblings = node.insert(siblings); node.sort(); System.out.println("-- NODE --"); System.out.println(node); System.out.println("----------"); } --- 40,51 ---- System.out.println(siblings); Edge current = (Edge) siblings.iterator().next(); ! CoordinateSystem system = new CoordinateSystem(last, current); ! VertexNode node = new VertexNode(to, system); ! EdgeNode lastEdgeNode = node.insert(last); siblings = node.insert(siblings); node.sort(); System.out.println("-- NODE --"); System.out.println(node); + findSurfaces(node, lastEdgeNode, edges); System.out.println("----------"); } *************** *** 55,64 **** * of the VertexNode * @param vertex The Vertex ! * @param first The first EdgeNode * @param edges The edges */ ! private static void findSurfaces(VertexNode vertex, EdgeNode first, List edges) { ! Surface clockwise = clockwiseSurface(vertex, first, edges); ! Project.getInstance().intern(clockwise); } --- 56,91 ---- * of the VertexNode * @param vertex The Vertex ! * @param last The first EdgeNode * @param edges The edges */ ! private static void findSurfaces(VertexNode vertex, EdgeNode last, List edges) { ! { ! Surface clockwise = clockwiseSurface(vertex, last, edges); ! if (clockwise != null) { ! Project.getInstance().intern(clockwise); ! System.out.println("interning " + clockwise); ! List vertices = clockwise.getVertices(); ! Iterator iter = vertices.iterator(); ! while (iter.hasNext()) { ! Vertex current = (Vertex) iter.next(); ! System.out.println(current); ! } ! System.out.println("angle = " + clockwise.angle(vertex.system())); ! } ! } ! { ! Surface counterclockwise = counterclockwiseSurface(vertex, last, edges); ! if (counterclockwise != null) { ! Project.getInstance().intern(counterclockwise); ! System.out.println("interning " + counterclockwise); ! List vertices = counterclockwise.getVertices(); ! Iterator iter = vertices.iterator(); ! while (iter.hasNext()) { ! Vertex current = (Vertex) iter.next(); ! System.out.println(current); ! } ! System.out.println("angle = " + counterclockwise.angle(vertex.system())); ! } ! } } *************** *** 67,75 **** * the VertexNode * @param vertex The Vertex ! * @param first The first EdgeNode * @param edges The edges * @return The Surface */ ! private static Surface clockwiseSurface(VertexNode vertex, EdgeNode first, List edges) { ArrayList result = new ArrayList(); result.addAll(edges); --- 94,102 ---- * the VertexNode * @param vertex The Vertex ! * @param last The first EdgeNode * @param edges The edges * @return The Surface */ ! private static Surface clockwiseSurface(VertexNode vertex, EdgeNode last, List edges) { ArrayList result = new ArrayList(); result.addAll(edges); *************** *** 78,90 **** Vertex to = ((Edge) edges.get(edges.size() - 1)).getTo(); ! EdgeNode currentEdge = first; VertexNode current = vertex; ! while (current.vertex() != to) { ! currentEdge = current.clockwise(currentEdge); result.add(currentEdge.edge()); current = currentEdge.other(current); } ! return new Surface("", result); } --- 105,149 ---- Vertex to = ((Edge) edges.get(edges.size() - 1)).getTo(); ! EdgeNode currentEdge = last; VertexNode current = vertex; ! while (current.vertex() != from) { ! currentEdge = current.clockwise(currentEdge.edge()); ! if (result.contains(currentEdge.edge())) { ! return null; ! } result.add(currentEdge.edge()); current = currentEdge.other(current); } ! return new Surface("Clockwise Surface", result); ! } ! ! /** ! * Find the counterclockwise surface that edges forms in the coordinate system of ! * the VertexNode ! * @param vertex The Vertex ! * @param last The first EdgeNode ! * @param edges The edges ! * @return The Surface ! */ ! private static Surface counterclockwiseSurface(VertexNode vertex, EdgeNode last, List edges) { ! ArrayList result = new ArrayList(); ! result.addAll(edges); ! ! Vertex from = ((Edge) edges.get(0)).getFrom(); ! Vertex to = ((Edge) edges.get(edges.size() - 1)).getTo(); ! ! EdgeNode currentEdge = last; ! VertexNode current = vertex; ! ! while (current.vertex() != from) { ! currentEdge = current.counterclockwise(currentEdge.edge()); ! if (result.contains(currentEdge.edge())) { ! return null; ! } ! result.add(currentEdge.edge()); ! current = currentEdge.other(current); ! } ! return new Surface("Counterclockwise Surface", result); } *************** *** 123,127 **** while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! if (insert(current) != null) { result.add(current); } --- 182,186 ---- while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! if (insert(current) == null) { result.add(current); } *************** *** 203,210 **** LinkedList result = new LinkedList(); for (int i = 0; i < rights.length; i++) { ! result.addLast(((EdgeNode) rights[i]).edge); } for (int i = 0; i < lefts.length; i++) { ! result.addLast(((EdgeNode) lefts[i]).edge); } edgenodes = result; --- 262,269 ---- LinkedList result = new LinkedList(); for (int i = 0; i < rights.length; i++) { ! result.addLast(((EdgeNode) rights[i])); } for (int i = 0; i < lefts.length; i++) { ! result.addLast(((EdgeNode) lefts[i])); } edgenodes = result; *************** *** 216,224 **** * @return The counterclockwise edgenode */ ! public EdgeNode counterclockwise(EdgeNode edge) { Object[] sorted = edgenodes.toArray(); int index = 0; for (int i = 0; i < sorted.length; i++) { ! if (sorted[i] == edge) { index = i; } --- 275,283 ---- * @return The counterclockwise edgenode */ ! public EdgeNode counterclockwise(Edge edge) { Object[] sorted = edgenodes.toArray(); int index = 0; for (int i = 0; i < sorted.length; i++) { ! if (((EdgeNode) sorted[i]).edge() == edge) { index = i; } *************** *** 234,245 **** /** * Return the edgenode clockwise around the vertex from the edge ! * @param edge The edgenode * @return The clockwise edgenode */ ! public EdgeNode clockwise(EdgeNode edge) { Object[] sorted = edgenodes.toArray(); int index = 0; for (int i = 0; i < sorted.length; i++) { ! if (sorted[i] == edge) { index = i; } --- 293,304 ---- /** * Return the edgenode clockwise around the vertex from the edge ! * @param edge The edgen * @return The clockwise edgenode */ ! public EdgeNode clockwise(Edge edge) { Object[] sorted = edgenodes.toArray(); int index = 0; for (int i = 0; i < sorted.length; i++) { ! if (((EdgeNode) sorted[i]).edge() == edge) { index = i; } *************** *** 310,316 **** VertexNode result = new VertexNode(other, system); Set edges = other.getEdges(); - edges.remove(edge); result.insert(edges); - result.insert(this); result.sort(); return result; --- 369,373 ---- |
From: Michael L. <he...@us...> - 2005-10-18 08:18:49
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1229/src/net/sourceforge/bprocessor/gl/tool Modified Files: PencilTool.java Log Message: Calls Geometry.insert to insert new surfaces in model Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** PencilTool.java 2 Oct 2005 14:48:23 -0000 1.24 --- PencilTool.java 18 Oct 2005 08:18:41 -0000 1.25 *************** *** 25,28 **** --- 25,29 ---- import net.sourceforge.bprocessor.model.ConstructionSpace; import net.sourceforge.bprocessor.model.Space; + import net.sourceforge.bprocessor.model.Geometry; import java.util.Iterator; *************** *** 165,168 **** --- 166,170 ---- if (!edges.isEmpty()) { + Geometry.insert(edges); Surface surface = new Surface("S" + surfaceNum++, edges); intern(surface); |
From: Michael L. <he...@us...> - 2005-10-18 08:17:18
|
Update of /cvsroot/bprocessor/model/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv855/src Modified Files: build.xml Log Message: Fast target added to build.xml Geometry implements surface finding algorithms Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/model/src/build.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** build.xml 28 Sep 2005 14:07:55 -0000 1.3 --- build.xml 18 Oct 2005 08:17:07 -0000 1.4 *************** *** 23,27 **** <target name="dep" depends="init"> <depend srcdir="${src.dir}" ! destdir="${build.dir}" cache="${build.dir}/depcache" closure="yes" --- 23,27 ---- <target name="dep" depends="init"> <depend srcdir="${src.dir}" ! destdir="${build.code.dir}" cache="${build.dir}/depcache" closure="yes" |
From: Michael L. <he...@us...> - 2005-10-18 08:17:18
|
Update of /cvsroot/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv855 Modified Files: build.xml Log Message: Fast target added to build.xml Geometry implements surface finding algorithms Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/model/build.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** build.xml 29 Sep 2005 09:28:33 -0000 1.8 --- build.xml 18 Oct 2005 08:17:07 -0000 1.9 *************** *** 144,147 **** --- 144,154 ---- <ant dir="src" target="compile"/> </target> + + <target name="fastcompile" depends="prepare,copylib,compile-xml"> + <ant dir="src" target="compile"/> + </target> + + <target name="fast" depends="fastcompile,jar"> + </target> <target name="doc" depends="copylib, compile-xml"> *************** *** 150,154 **** </target> ! <target name="jar" depends="compile"> <mkdir dir="${dist.dir}"/> <copy todir="${build.code.dir}"> --- 157,161 ---- </target> ! <target name="jar" depends="init"> <mkdir dir="${dist.dir}"/> <copy todir="${build.code.dir}"> *************** *** 175,179 **** </target> ! <target name="dist" depends="jar"> </target> --- 182,186 ---- </target> ! <target name="dist" depends="compile,jar"> </target> |
From: Michael L. <he...@us...> - 2005-10-18 08:17:18
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv855/src/net/sourceforge/bprocessor/model Modified Files: Surface.java CoordinateSystem.java Added Files: Geometry.java Log Message: Fast target added to build.xml Geometry implements surface finding algorithms Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Surface.java 11 Oct 2005 12:04:51 -0000 1.39 --- Surface.java 18 Oct 2005 08:17:07 -0000 1.40 *************** *** 708,725 **** Edge e0 = (Edge) edges.get(0); Edge e1 = (Edge) edges.get(1); ! Vertex v0, v1, v2; ! v0 = getFirtVertex(); ! v1 = e0.otherVertex(v0); ! v2 = e1.otherVertex(v1); ! ! origin = v0; ! i = v1.minus(v0); ! i.scale(1 / i.length()); ! Vertex v = v2.minus(v1); ! n = i.cross(v); ! n.scale(1 / n.length()); ! j = i.cross(n); ! j.scale(1 / j.length()); ! return new CoordinateSystem(i, j, n, origin); } else { return null; --- 708,712 ---- Edge e0 = (Edge) edges.get(0); Edge e1 = (Edge) edges.get(1); ! return new CoordinateSystem(e0, e1); } else { return null; --- NEW FILE: Geometry.java --- //--------------------------------------------------------------------------------- // $Id: Geometry.java,v 1.1 2005/10/18 08:17:07 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Set; /** * The Geometry class is for various geometric things */ public class Geometry { /** * Insert the list of edges in the model by splitting * surfaces etc. * @param edges The list of edges */ public static void insert(List edges) { Edge first = (Edge) edges.get(0); Edge last = (Edge) edges.get(edges.size() - 1); Vertex from = first.getFrom(); Set siblings = from.getEdges(); siblings.remove(first); siblings.remove(last); Iterator iter = siblings.iterator(); System.out.println("--- processing ---"); while (!siblings.isEmpty()) { System.out.println(siblings); Edge current = (Edge) siblings.iterator().next(); CoordinateSystem system = new CoordinateSystem(first, current); VertexNode node = new VertexNode(from, system); node.insert(first); siblings = node.insert(siblings); node.sort(); System.out.println("-- NODE --"); System.out.println(node); System.out.println("----------"); } } /** * Find surfaces that the new edges forms in the plane the coordinate system * of the VertexNode * @param vertex The Vertex * @param first The first EdgeNode * @param edges The edges */ private static void findSurfaces(VertexNode vertex, EdgeNode first, List edges) { Surface clockwise = clockwiseSurface(vertex, first, edges); Project.getInstance().intern(clockwise); } /** * Find the clockwise surface that edges forms in the coordinate system of * the VertexNode * @param vertex The Vertex * @param first The first EdgeNode * @param edges The edges * @return The Surface */ private static Surface clockwiseSurface(VertexNode vertex, EdgeNode first, List edges) { ArrayList result = new ArrayList(); result.addAll(edges); Vertex from = ((Edge) edges.get(0)).getFrom(); Vertex to = ((Edge) edges.get(edges.size() - 1)).getTo(); EdgeNode currentEdge = first; VertexNode current = vertex; while (current.vertex() != to) { currentEdge = current.clockwise(currentEdge); result.add(currentEdge.edge()); current = currentEdge.other(current); } return new Surface("", result); } /** * The VertexNode class is used for internal surface calculations */ private static class VertexNode { /** The vertex */ private Vertex vertex; /** The edgenodes */ private List edgenodes; /** The coordinate system */ private CoordinateSystem system; /** * Constructor for VertexNode * @param vertex The vertex * @param system The coordinate systen */ public VertexNode(Vertex vertex, CoordinateSystem system) { this.vertex = vertex; this.system = system; edgenodes = new LinkedList(); } /** * Insert a list of edges into this VertexNode by * finding all edges in that lies in the coordinate * system, and sorting the edges clockwise * @param edges List of edges * @return The edges that are not inserted */ public Set insert(Set edges) { Set result = new HashSet(); Iterator iter = edges.iterator(); while (iter.hasNext()) { Edge current = (Edge) iter.next(); if (insert(current) != null) { result.add(current); } } return result; } /** * Test if this edges is in the coordinate system and * insert if yes. * @param edge The edge * @return The EdgeNode if inserted */ public EdgeNode insert(Edge edge) { Vertex v = edge.otherVertex(vertex).minus(vertex); double dz = v.dot(system.getN()); if (dz == 0.0) { double dx = v.dot(system.getI()); double dy = v.dot(system.getJ()); EdgeNode node = new EdgeNode(edge, dx, dy); insert(node); return node; } else { return null; } } /** * Insert an EdgeNode * @param node The EdgeNode */ public void insert(EdgeNode node) { edgenodes.add(node); } /** * Get the vertex * @return The vertex */ public Vertex vertex() { return vertex; } /** * Get the system * @return The system */ public CoordinateSystem system() { return system; } /** * Sort the EdgeNodes clockwise around the vertex */ public void sort() { LinkedList right = new LinkedList(); LinkedList left = new LinkedList(); Iterator iter = edgenodes.iterator(); while (iter.hasNext()) { EdgeNode current = (EdgeNode) iter.next(); if (current.dx == 0) { if (current.dy < 0) { right.addLast(current); } if (current.dy > 0) { left.addLast(current); } } if (current.dx > 0) { right.addLast(current); } if (current.dx < 0) { left.addLast(current); } } Object[] rights = right.toArray(); Arrays.sort(rights); Object[] lefts = left.toArray(); Arrays.sort(lefts); LinkedList result = new LinkedList(); for (int i = 0; i < rights.length; i++) { result.addLast(((EdgeNode) rights[i]).edge); } for (int i = 0; i < lefts.length; i++) { result.addLast(((EdgeNode) lefts[i]).edge); } edgenodes = result; } /** * Return the edgenode counterclockwise around the vertex from the edge * @param edge The edgenode * @return The counterclockwise edgenode */ public EdgeNode counterclockwise(EdgeNode edge) { Object[] sorted = edgenodes.toArray(); int index = 0; for (int i = 0; i < sorted.length; i++) { if (sorted[i] == edge) { index = i; } } index++; if (index == sorted.length) { return (EdgeNode) sorted[0]; } else { return (EdgeNode) sorted[index]; } } /** * Return the edgenode clockwise around the vertex from the edge * @param edge The edgenode * @return The clockwise edgenode */ public EdgeNode clockwise(EdgeNode edge) { Object[] sorted = edgenodes.toArray(); int index = 0; for (int i = 0; i < sorted.length; i++) { if (sorted[i] == edge) { index = i; } } if (index == 0) { return (EdgeNode) sorted[sorted.length - 1]; } else { return (EdgeNode) sorted[index - 1]; } } /** * Return a String describing this VertexNode * @return String describing this VertexNode */ public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("{" + vertex + "\n"); Iterator iter = edgenodes.iterator(); while (iter.hasNext()) { EdgeNode current = (EdgeNode) iter.next(); buffer.append(" " + current.edge() + "\n"); } buffer.append("}\n"); return buffer.toString(); } } /** * The EdgeNode class is used for surface calculations */ private static class EdgeNode implements Comparable { /** The edge */ private Edge edge; /** The dx */ private double dx; /** The dy */ private double dy; /** * Constructor for EdgeNode * @param edge The edge * @param dx The dx * @param dy The dy */ public EdgeNode(Edge edge, double dx, double dy) { this.edge = edge; this.dx = dx; this.dy = dy; } /** * Return the Edge * @return The Edge */ public Edge edge() { return edge; } /** * Return the other end * @param node The node * @return The other end */ public VertexNode other(VertexNode node) { Vertex other = edge.otherVertex(node.vertex()); CoordinateSystem system = node.system(); VertexNode result = new VertexNode(other, system); Set edges = other.getEdges(); edges.remove(edge); result.insert(edges); result.insert(this); result.sort(); return result; } /** * Compare one edgenode to a nother * @param other The other * @return The result of comparison */ public int compareTo(Object other) { EdgeNode entry = (EdgeNode) other; if (this.dx == 0) { return -1; } if (entry.dx == 0) { return 1; } if ((this.dy / this.dx) < (entry.dy / entry.dx)) { return -1; } else { return 1; } } } } Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CoordinateSystem.java 11 Oct 2005 12:04:51 -0000 1.3 --- CoordinateSystem.java 18 Oct 2005 08:17:07 -0000 1.4 *************** *** 49,52 **** --- 49,81 ---- this.origin = origin; } + + /** + * Constructor for CoordinateSystem that constructs a CoordinateSystem + * from two edges. The edges are assumed to have a common Vertex. + * The origin of the Coordinate System will be the vertex from e1 + * that are not shared between the two edges. + * @param e1 Edge one + * @param e2 Edge two + */ + public CoordinateSystem(Edge e1, Edge e2) { + super(); + Vertex v0, v1, v2; + if (e2.contains(e1.getFrom())) { + v0 = e1.getTo(); + v1 = e1.getFrom(); + } else { + v0 = e1.getFrom(); + v1 = e1.getTo(); + } + v2 = e2.otherVertex(v1); + origin = v0; + i = v1.minus(v0); + i.scale(1 / i.length()); + Vertex v = v2.minus(v1); + n = i.cross(v); + n.scale(1 / n.length()); + j = i.cross(n); + j.scale(1 / j.length()); + } /** |
From: Michael L. <he...@us...> - 2005-10-18 08:16:12
|
Update of /cvsroot/bprocessor/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv703 Modified Files: build.xml Log Message: a fast target is added Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/kernel/build.xml,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** build.xml 27 Jun 2005 09:12:29 -0000 1.1.1.1 --- build.xml 18 Oct 2005 08:16:01 -0000 1.2 *************** *** 106,109 **** --- 106,113 ---- <ant dir="src" target="compile"/> </target> + + <target name="fastcompile" depends="copylib,compile-xml"> + <ant dir="src" target="compile"/> + </target> <target name="doc" depends="copylib,compile-xml"> *************** *** 112,116 **** </target> ! <target name="jar" depends="compile"> <mkdir dir="${dist.dir}"/> <jar jarfile="${dist.dir}/${name}.jar" --- 116,120 ---- </target> ! <target name="jar" depends="prepare"> <mkdir dir="${dist.dir}"/> <jar jarfile="${dist.dir}/${name}.jar" *************** *** 138,143 **** </target> ! <target name="dist" depends="jar"> </target> <target name="release" depends="clean,dist"> --- 142,151 ---- </target> ! <target name="dist" depends="compile,jar"> ! </target> ! ! <target name="fast" depends="fastcompile,jar"> </target> + <target name="release" depends="clean,dist"> |
From: Michael L. <he...@us...> - 2005-10-13 01:17:38
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32007/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Surface.java Log Message: Added definition of Edge.split and Surface.direction Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Surface.java 6 Oct 2005 11:11:07 -0000 1.37 --- Surface.java 10 Oct 2005 12:13:42 -0000 1.38 *************** *** 52,55 **** --- 52,63 ---- private Domain backDomain; + /** Surface is clockwise */ + + public static final int CLOCKWISE = 1; + + /** Surface is counter clock wise **/ + + public static final int COUNTER_CLOCKWISE = 2; + /** * Constructor for persistence layer *************** *** 251,254 **** --- 259,275 ---- } } + + /** + * Calculate the turn direction of the vertices of this + * surface. Return values are CLOCKWISE or COUNTER_CLOCKWISE. + * @return The turn direction. + */ + public int direction() { + /* + * TODO To Calculate direction + */ + return 0; + } + /** * Get the inner surfaces Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Edge.java 6 Oct 2005 11:11:07 -0000 1.14 --- Edge.java 10 Oct 2005 12:13:42 -0000 1.15 *************** *** 274,277 **** --- 274,288 ---- return new Edge("intersection", pa, pb); } + + /** + * Split this edge and update all surfaces + * accordingly. + * @param vertex The vertex + */ + public void split(Vertex vertex) { + /* + * TODO to split this edge by the vertex + */ + } /** |
From: Michael L. <he...@us...> - 2005-10-11 12:05:26
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32529/src/net/sourceforge/bprocessor/gl/view Modified Files: AbstractView.java Log Message: Printout of Surface.angle() Index: AbstractView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/AbstractView.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** AbstractView.java 3 Oct 2005 18:44:50 -0000 1.41 --- AbstractView.java 11 Oct 2005 12:05:15 -0000 1.42 *************** *** 576,579 **** --- 576,580 ---- gl.glPolygonStipple(transparency); Surface s = (Surface) o; + log.info(s.getName() + " angle: " + s.angle()); drawSurface(s); gl.glDisable(GL.GL_POLYGON_STIPPLE); |
From: Michael L. <he...@us...> - 2005-10-11 12:05:26
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32529/src/net/sourceforge/bprocessor/gl/tool Modified Files: SelectTool.java Log Message: Printout of Surface.angle() Index: SelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectTool.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** SelectTool.java 3 Oct 2005 18:39:54 -0000 1.30 --- SelectTool.java 11 Oct 2005 12:05:15 -0000 1.31 *************** *** 80,84 **** protected void moved(MouseEvent e) { //findTarget(e); ! //target = null; } --- 80,84 ---- protected void moved(MouseEvent e) { //findTarget(e); ! target = null; } *************** *** 89,93 **** protected void dragged(MouseEvent e) { //findTarget(e); ! //target = null; } --- 89,93 ---- protected void dragged(MouseEvent e) { //findTarget(e); ! target = null; } |