bprocessor-commit Mailing List for B-processor (Page 56)
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...> - 2007-09-05 06:24:46
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7455/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Removed Files: TapeMeasureTool.java Log Message: Removed old tapemeasure tool --- TapeMeasureTool.java DELETED --- Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** AbstractPencil.java 4 Sep 2007 13:37:18 -0000 1.91 --- AbstractPencil.java 5 Sep 2007 06:24:47 -0000 1.92 *************** *** 113,116 **** --- 113,118 ---- protected Plane plane; + + /** Number */ protected String number; |
From: Michael L. <he...@us...> - 2007-09-04 13:37:22
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25516/src/net/sourceforge/bprocessor/gl/tool Modified Files: FinalMoveTool.java AbstractPencil.java Log Message: experimenting with hitdetection Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** FinalMoveTool.java 30 Aug 2007 13:57:46 -0000 1.18 --- FinalMoveTool.java 4 Sep 2007 13:37:18 -0000 1.19 *************** *** 69,81 **** Map<Vertex, Direction> slidemap = new HashMap(); Map<Vertex, Collection<Edge>> edgemap = space.edgeMap(vertices); - System.out.println("-- map --"); for (Vertex current : vertices) { Collection<Edge> edges = edgemap.get(current); Direction direction; if (edges.size() == 0) { - System.out.println(" free"); direction = new Direction(current.copy(), null); } else if (edges.size() == 1) { - System.out.println(" constrained"); Edge edge = edges.iterator().next(); Vertex to = edge.otherVertex(current); --- 69,78 ---- *************** *** 85,89 **** direction = new Direction(current.copy(), v, Double.NEGATIVE_INFINITY, length); } else { - System.out.println(" bound"); direction = new Direction(current.copy(), null, 0, 0); } --- 82,85 ---- Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** AbstractPencil.java 3 Sep 2007 11:31:34 -0000 1.90 --- AbstractPencil.java 4 Sep 2007 13:37:18 -0000 1.91 *************** *** 156,168 **** boolean constrain = lock || e.isShiftDown(); ! if (start != null) { ! Vertex planeNormal = plane.normal(); ! plane = new Plane(planeNormal.getX(), ! planeNormal.getY(), ! planeNormal.getZ(), ! -(planeNormal.getX() * start.vertex().getX() + ! planeNormal.getY() * start.vertex().getY() + ! planeNormal.getZ() * start.vertex().getZ())); ! } if (current != null) { if (!constrain) { --- 156,160 ---- boolean constrain = lock || e.isShiftDown(); ! if (current != null) { if (!constrain) { *************** *** 181,185 **** } } ! Plane work = plane; Intersection intersection = null; --- 173,177 ---- } } ! Intersection intersection = null; *************** *** 193,196 **** --- 185,211 ---- ray = transformation.unProject(ray); + { + Vertex n = new Vertex(0, 0, 1.0); + n = transformation.unProject(n); + n.normalize(); + if (start != null) { + Vertex planeNormal; + if (Math.abs(n.getZ()) < 0.45) { + planeNormal = plane.normal(); + } else { + planeNormal = plane.normal(); + } + plane = new Plane(planeNormal.getX(), + planeNormal.getY(), + planeNormal.getZ(), + -(planeNormal.getX() * start.vertex().getX() + + planeNormal.getY() * start.vertex().getY() + + planeNormal.getZ() * start.vertex().getZ())); + + } + } + + Plane work = plane; + if (constrain) { if (lockingEdge != null) { *************** *** 214,217 **** --- 229,233 ---- unwanted.add(lockSnapVertex); } + intersection = (Intersection) glv.getView().getObjectAtPoint(e.getX(), e.getY(), |
From: Michael L. <he...@us...> - 2007-09-03 17:34:13
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22933/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: flip implemented Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** PopupMenu.java 31 Aug 2007 09:45:23 -0000 1.41 --- PopupMenu.java 3 Sep 2007 11:50:58 -0000 1.42 *************** *** 89,92 **** --- 89,99 ---- }; jm.add(holeanalysis); + AbstractAction flip = new EntityMenuAction(s, "Flip") { + public void actionPerformed(ActionEvent arg0) { + Surface surface = (Surface) entity; + surface.flip(); + } + }; + jm.add(flip); } if (c.size() == 2) { *************** *** 126,129 **** --- 133,137 ---- ); jm.add(mergeItem); + return jm; } |
From: rimestad <rim...@us...> - 2007-09-03 16:08:45
|
Update of /cvsroot/bprocessor//gl/src/gfx In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30658/src/gfx Modified Files: BcursorError.gif Log Message: Modified cursor Index: BcursorError.gif =================================================================== RCS file: /cvsroot/bprocessor//gl/src/gfx/BcursorError.gif,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsasSagh and /tmp/cvsKMzzLi differ |
From: rimestad <rim...@us...> - 2007-09-03 16:06:31
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29864/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Forgot to commit surface for offset functions Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.172 retrieving revision 1.173 diff -C2 -d -r1.172 -r1.173 *** Surface.java 9 Aug 2007 16:07:53 -0000 1.172 --- Surface.java 3 Sep 2007 16:06:28 -0000 1.173 *************** *** 1842,1862 **** * Find the nearest intersection with a edge in the surface * @param vertex the mouse position on the surface * @return the nearest edge */ ! public Edge findClosestEdge(Vertex vertex) { ! Iterator iter = getEdges().iterator(); ! Vertex v = null; ! Edge closest = null; ! double distance = Double.MAX_VALUE; ! while (iter.hasNext()) { ! Edge cur = (Edge)iter.next(); ! Vertex tmp = cur.intersection(vertex); ! if (tmp.minus(vertex).length() < distance) { ! distance = tmp.minus(vertex).length(); ! v = tmp; ! closest = cur; } } - return closest; } --- 1842,1866 ---- * Find the nearest intersection with a edge in the surface * @param vertex the mouse position on the surface + * @param includes the edges to include in the search * @return the nearest edge */ ! public Edge findClosestEdge(Vertex vertex, Collection<? extends Geometric> includes) { ! if (this.getEdges().containsAll(includes)) { ! Vertex v = null; ! Edge closest = null; ! double distance = Double.MAX_VALUE; ! for (Geometric g : includes) { ! Edge cur = (Edge)g; ! Vertex tmp = cur.intersection(vertex); ! if (tmp.minus(vertex).length() < distance) { ! distance = tmp.minus(vertex).length(); ! v = tmp; ! closest = cur; ! } } + return closest; + } else { + return null; } } |
From: rimestad <rim...@us...> - 2007-09-03 16:00:20
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27284/src/net/sourceforge/bprocessor/gl/tool Modified Files: ToolFactory.java OffsetTool.java Log Message: Made offsettool work better with line offset, and give better feedback when something illligal happens Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** ToolFactory.java 3 Sep 2007 13:36:52 -0000 1.82 --- ToolFactory.java 3 Sep 2007 16:00:13 -0000 1.83 *************** *** 170,173 **** --- 170,175 ---- private JToggleButton altRectBut; + protected static Cursor errorCursor; + /** * Constructor *************** *** 185,189 **** Cursor pencilcursor = Toolkit.getDefaultToolkit().createCustomCursor(pencilimage, new Point(7, 8), "Pencil"); ! url = cl.getResource("Bcursorrotcam.gif"); Image rotationImage = Toolkit.getDefaultToolkit().getImage(url); --- 187,196 ---- Cursor pencilcursor = Toolkit.getDefaultToolkit().createCustomCursor(pencilimage, new Point(7, 8), "Pencil"); ! ! url = cl.getResource("BcursorError.gif"); ! Image errorImage = Toolkit.getDefaultToolkit().getImage(url); ! errorCursor ! = Toolkit.getDefaultToolkit().createCustomCursor(errorImage, new Point(7, 8), "Error"); ! url = cl.getResource("Bcursorrotcam.gif"); Image rotationImage = Toolkit.getDefaultToolkit().getImage(url); Index: OffsetTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OffsetTool.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** OffsetTool.java 20 Jun 2007 13:17:55 -0000 1.15 --- OffsetTool.java 3 Sep 2007 16:00:13 -0000 1.16 *************** *** 90,98 **** surfaceFound = true; Surface surface = (Surface)current.object(); ! List edges = new LinkedList(); edges.addAll(surface.getEdges()); Collection selection = Selection.primary(); if (selection.size() > 0 && edges.containsAll(selection)) { ! System.out.println("Did contain all"); edges.clear(); edges.addAll(selection); --- 90,98 ---- surfaceFound = true; Surface surface = (Surface)current.object(); ! List<Edge> edges = new LinkedList<Edge>(); edges.addAll(surface.getEdges()); Collection selection = Selection.primary(); if (selection.size() > 0 && edges.containsAll(selection)) { ! log.info("Did contain all"); edges.clear(); edges.addAll(selection); *************** *** 126,134 **** if (start == null && current.object() instanceof Surface) { Surface s = (Surface)current.object(); ! edge = s.findClosestEdge(current.vertex()); ! edgePoint = edge.intersection(current.vertex()); ! LinkedList feedback = new LinkedList(); ! feedback.add(new Point(edgePoint)); ! feedback(feedback); } updateLength(); --- 126,146 ---- if (start == null && current.object() instanceof Surface) { Surface s = (Surface)current.object(); ! if (Selection.primary().isEmpty()) { ! edge = s.findClosestEdge(current.vertex(), s.getEdges()); ! } else { ! edge = s.findClosestEdge(current.vertex(), Selection.primary()); ! } ! if (edge != null) { ! glv.setCursor(this.getCursor()); ! edgePoint = edge.intersection(current.vertex()); ! LinkedList feedback = new LinkedList(); ! feedback.add(new Point(edgePoint)); ! feedback(feedback); ! setTip(initialTip()); ! } else { ! setTip(errorString()); ! glv.setCursor(ToolFactory.errorCursor); ! current = null; ! } } updateLength(); *************** *** 138,141 **** --- 150,161 ---- /** + * Tip when the selection is wrong + * @return + */ + private String errorString() { + return "All selected edges have to be part of same surface"; + } + + /** * Moves the offset contour by the sepcified length * @param length the length to move the offset |
From: rimestad <rim...@us...> - 2007-09-03 16:00:19
|
Update of /cvsroot/bprocessor/gl/src/gfx In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27284/src/gfx Added Files: BcursorError.gif Log Message: Made offsettool work better with line offset, and give better feedback when something illligal happens --- NEW FILE: BcursorError.gif --- (This appears to be a binary file; contents omitted.) |
From: rimestad <rim...@us...> - 2007-09-03 14:22:07
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15479/src/net/sourceforge/bprocessor/gl/tool Modified Files: ToolFactory.java SpaceTool.java AbstractTool.java Tool.java AbstractPencil.java SelectStrategy.java SelectTool.java Added Files: DragTool.java Log Message: Added a drag tool and changed the way strategy tools in abstractTool works to be more flexible and responcive Index: Tool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Tool.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Tool.java 31 Aug 2007 12:47:48 -0000 1.34 --- Tool.java 3 Sep 2007 11:31:34 -0000 1.35 *************** *** 70,73 **** --- 70,75 ---- /** the final tool to move them all */ public static final int FINAL_MOVE_TOOL = 24; + /** the drag tool */ + public static final int DRAG_TOOL = 25; /** Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** ToolFactory.java 8 May 2007 13:24:04 -0000 1.80 --- ToolFactory.java 3 Sep 2007 11:31:34 -0000 1.81 *************** *** 125,128 **** --- 125,131 ---- /** The tool for moving edges alternatively */ private EdgeMoveTool edgeMoveTool; + + /** Tool for navigating in the model */ + private DragTool dragTool; /** The selection button */ *************** *** 197,201 **** Cursor arrowAddCursor = Toolkit.getDefaultToolkit().createCustomCursor(arrowAddImage, new Point(0, 0), "Add"); ! select = new SpaceTool(glv, null); pencil = new Pencil(glv, pencilcursor); --- 200,207 ---- Cursor arrowAddCursor = Toolkit.getDefaultToolkit().createCustomCursor(arrowAddImage, new Point(0, 0), "Add"); ! url = cl.getResource("Bcursordrag.gif"); ! Image dragImage = Toolkit.getDefaultToolkit().getImage(url); ! Cursor dragCursor = ! Toolkit.getDefaultToolkit().createCustomCursor(dragImage, new Point(7, 8), "Drag"); select = new SpaceTool(glv, null); pencil = new Pencil(glv, pencilcursor); *************** *** 220,223 **** --- 226,230 ---- finalMoveTool = new FinalMoveTool(glv, pencilcursor); edgeMoveTool = new EdgeMoveTool(glv, pencilcursor); + dragTool = new DragTool(glv, dragCursor); Toolbar tb = Toolbar.getInstance(); *************** *** 254,257 **** --- 261,265 ---- cRotBut = this.registerTool(Tool.CAMERA_TOOL, camera, "Biconrotcam.gif", "Orbit (Space)"); + this.registerTool(Tool.DRAG_TOOL, dragTool, "Bicondrag.gif", "Drag (Space)"); flyBut = this.registerTool(Tool.FLY_TOOL, fly, "Biconfly.gif", "Fly"); walkBut = this.registerTool(Tool.WALK_TOOL, walk, "Biconwalk.gif", "Walk"); *************** *** 351,354 **** --- 359,366 ---- previousTool = currentTool; currentTool = temp; + if (currentTool != null) { + JToggleButton button = (JToggleButton)buttons.get(currentTool); + button.setSelected(true); + } return temp; } *************** *** 389,392 **** --- 401,407 ---- return currentTool; } else { + if (i == -1) { + return getPrevious(); + } log.error("[get] No such tool " + i); return null; Index: SelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectTool.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** SelectTool.java 24 Aug 2007 09:54:27 -0000 1.64 --- SelectTool.java 3 Sep 2007 11:31:34 -0000 1.65 *************** *** 34,39 **** */ protected void moved(MouseEvent e) { ! findTarget(e); ! glv.getView().makeTarget(target); } --- 34,40 ---- */ protected void moved(MouseEvent e) { ! select.moved(e); ! // findTarget(e); ! // glv.getView().makeTarget(target); } *************** *** 43,47 **** * @param e The MouseEvent object */ ! protected void pressed(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { select.pressed(e); --- 44,48 ---- * @param e The MouseEvent object */ ! protected void pressed(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { select.pressed(e); *************** *** 63,67 **** * @param e The MouseEvent */ ! protected void released(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { select.released(e); --- 64,68 ---- * @param e The MouseEvent */ ! protected void released(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { select.released(e); Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** AbstractPencil.java 31 Aug 2007 12:25:11 -0000 1.89 --- AbstractPencil.java 3 Sep 2007 11:31:34 -0000 1.90 *************** *** 762,770 **** points(new LinkedList()); number = ""; - glv.repaint(); timer.stop(); active = false; dragging = false; setTip(initialTip()); super.cleanUp(); } --- 762,770 ---- points(new LinkedList()); number = ""; timer.stop(); active = false; dragging = false; setTip(initialTip()); + glv.repaint(); super.cleanUp(); } Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.128 retrieving revision 1.129 diff -C2 -d -r1.128 -r1.129 *** AbstractTool.java 31 Aug 2007 12:47:48 -0000 1.128 --- AbstractTool.java 3 Sep 2007 11:31:34 -0000 1.129 *************** *** 35,41 **** import java.awt.Cursor; - import java.awt.Image; - import java.awt.Point; - import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; --- 35,38 ---- *************** *** 46,50 **** import java.io.Reader; import java.io.StringReader; - import java.net.URL; import java.util.HashMap; import java.util.HashSet; --- 43,46 ---- *************** *** 79,90 **** private static Logger log = Logger.getLogger(AbstractTool.class); ! /** TransformStack */ ! private TransformStack transform; ! ! /** ID */ ! private Transform id; ! ! private MouseEvent parked; ! private Timer dragtimer; --- 75,79 ---- private static Logger log = Logger.getLogger(AbstractTool.class); ! /** A timer to check if drag is long enough */ private Timer dragtimer; *************** *** 92,103 **** protected int dragDelay = 200; ! /** Simple selection mechanism **/ ! protected boolean directMode = false; ! /** Camera active */ ! protected boolean cameraMode = false; ! /** Select is active */ ! protected boolean selectMode = false; /** Pan strategy */ --- 81,91 ---- protected int dragDelay = 200; ! /** TransformStack */ ! private TransformStack transform; ! /** ID */ ! private Transform id; ! private MouseEvent parked; /** Pan strategy */ *************** *** 110,113 **** --- 98,104 ---- protected static Strategy orbit; + /** The active strategy */ + protected static Strategy activeStrategy; + /** The x axis */ protected Edge xAxis = new Edge(new Vertex(-50, 0, 0), new Vertex(50, 0, 0)); *************** *** 146,155 **** protected boolean typing; - /** The cursor for drag */ - private Cursor dragCursor; - - /** The cursor for orbit */ - private Cursor orbitCursor; - /** true if meta is pressed otherwise false */ protected boolean metaPressed = false; --- 137,140 ---- *************** *** 181,195 **** this.glv = glv; this.cursor = cursor; - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - URL url = cl.getResource("Bcursordrag.gif"); - Image dragImage = Toolkit.getDefaultToolkit().getImage(url); - dragCursor = - Toolkit.getDefaultToolkit().createCustomCursor(dragImage, new Point(7, 8), "Drag"); - - - url = cl.getResource("Bcursorrotcam.gif"); - Image rotationImage = Toolkit.getDefaultToolkit().getImage(url); - orbitCursor = - Toolkit.getDefaultToolkit().createCustomCursor(rotationImage, new Point(7, 8), "Rotation"); if (pan == null) { --- 166,169 ---- *************** *** 203,215 **** } } ! ! private class DragAction implements ActionListener { ! public void actionPerformed(ActionEvent e) { ! if (parked != null) { ! dragged(parked); ! parked = null; ! glv.repaint(true); } } } --- 177,202 ---- } } ! ! /** ! * Set the active strategy ! */ ! protected void setActiveStrategy(Strategy which) { ! Tool tool = null; ! ToolFactory factory = ToolFactory.getFactory(glv); ! if (which == AbstractTool.pan) { ! tool = factory.get(Tool.DRAG_TOOL); ! } else if (which == AbstractTool.orbit) { ! tool = factory.get(Tool.CAMERA_TOOL); ! } else if (which == AbstractTool.select) { ! tool = factory.get(Tool.SELECT_TOOL); ! } else { ! Tool prev = factory.getPrevious(); ! if (prev != this) { ! factory.getPrevious(); } + tool = this; } + glv.setCursor(tool.getCursor()); + activeStrategy = which; } *************** *** 318,329 **** } if (e.getKeyCode() == KeyEvent.VK_CONTROL) { ! selectMode = true; ! glv.setCursor(null); return; } if (e.getKeyCode() == KeyEvent.VK_SPACE) { if (!typing) { ! cameraMode = true; ! glv.setCursor(orbitCursor); return; } --- 305,314 ---- } if (e.getKeyCode() == KeyEvent.VK_CONTROL) { ! setActiveStrategy(AbstractTool.select); return; } if (e.getKeyCode() == KeyEvent.VK_SPACE) { if (!typing) { ! setActiveStrategy(AbstractTool.orbit); return; } *************** *** 366,381 **** */ public void keyReleased(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_META || e.getKeyCode() == KeyEvent.VK_ALT) { metaPressed = false; glv.setCursor(cursor); } - if (e.getKeyCode() == KeyEvent.VK_CONTROL) { - selectMode = false; - glv.setCursor(cursor); - } - if (e.getKeyCode() == KeyEvent.VK_SPACE) { - cameraMode = false; - glv.setCursor(cursor); - } if (e.getKeyCode() == KeyEvent.VK_S) { glv.getView().removeGlObjects3D(glCams); --- 351,361 ---- */ public void keyReleased(KeyEvent e) { + if (e.getKeyCode() == KeyEvent.VK_CONTROL || e.getKeyCode() == KeyEvent.VK_SPACE) { + setActiveStrategy(null); + } if (e.getKeyCode() == KeyEvent.VK_META || e.getKeyCode() == KeyEvent.VK_ALT) { metaPressed = false; glv.setCursor(cursor); } if (e.getKeyCode() == KeyEvent.VK_S) { glv.getView().removeGlObjects3D(glCams); *************** *** 402,422 **** AbstractTool.dx = x - pressPos[0]; AbstractTool.dy = y - pressPos[1]; ! if ((e.getModifiersEx() | MouseEvent.BUTTON2_DOWN_MASK) == MouseEvent.BUTTON2_DOWN_MASK) { ! pan.dragged(e); } else { ! if (cameraMode) { ! orbit.dragged(e); ! } else if (selectMode) { ! select.dragged(e); } else { ! if (e.getWhen() > pressedTime + dragDelay) { ! dragged(e); ! } else { ! parked = e; ! int delay = (int) (dragDelay - (e.getWhen() - pressedTime)); ! dragtimer = new Timer(delay, new DragAction()); ! dragtimer.setRepeats(false); ! dragtimer.start(); ! } } } --- 382,396 ---- AbstractTool.dx = x - pressPos[0]; AbstractTool.dy = y - pressPos[1]; ! if (activeStrategy != null) { ! activeStrategy.dragged(e); } else { ! if (e.getWhen() > AbstractTool.pressedTime + dragDelay) { ! dragged(e); } else { ! parked = e; ! int delay = (int) (dragDelay - (e.getWhen() - AbstractTool.pressedTime)); ! dragtimer = new Timer(delay, new DragAction()); ! dragtimer.setRepeats(false); ! dragtimer.start(); } } *************** *** 436,442 **** dx = x - pressPos[0]; dy = y - pressPos[1]; ! if (!(cameraMode || selectMode)) { moved(e); ! } previousPos[0] = x; previousPos[1] = y; --- 410,418 ---- dx = x - pressPos[0]; dy = y - pressPos[1]; ! if (activeStrategy != null) { ! activeStrategy.moved(e); ! } else { moved(e); ! } previousPos[0] = x; previousPos[1] = y; *************** *** 467,470 **** --- 443,447 ---- /** * Invoked when a mouse button has been pressed on a component. + * Calls getObjectAtPoint for all objects so just use target as it is * @param e The MouseEvent object */ *************** *** 478,504 **** previousPos[0] = pressPos[0]; previousPos[1] = pressPos[1]; ! Object o = glv.getView().getObjectAtPoint(e.getX(), e.getY(), View.OBJECTS); if (e.getButton() == MouseEvent.BUTTON2) { ! glv.setCursor(dragCursor); ! pan.pressed(e); } else { ! if (cameraMode) { ! orbit.pressed(e); ! } else if (selectMode) { ! if (this instanceof SpaceTool) { ! pressed(e); ! } else { ! select.pressed(e); ! } } else { ! if (o instanceof Widget) { ! Widget widget = (Widget) o; ! widget.action(); ! } else if (o instanceof ClickBox) { ! ClickBox clickbox = (ClickBox) o; ! Project.getInstance().setActiveSpace(clickbox.space()); ! } else { ! pressed(e); ! } } } --- 455,473 ---- previousPos[0] = pressPos[0]; previousPos[1] = pressPos[1]; ! target = glv.getView().getObjectAtPoint(e.getX(), e.getY(), View.OBJECTS); if (e.getButton() == MouseEvent.BUTTON2) { ! setActiveStrategy(AbstractTool.pan); ! } ! if (activeStrategy != null) { ! activeStrategy.pressed(e); } else { ! if (target instanceof Widget) { ! Widget widget = (Widget) target; ! widget.action(); ! } else if (target instanceof ClickBox) { ! ClickBox clickbox = (ClickBox) target; ! Project.getInstance().setActiveSpace(clickbox.space()); } else { ! pressed(e); } } *************** *** 512,526 **** public void mouseReleased(MouseEvent e) { parked = null; ! if (e.getButton() == MouseEvent.BUTTON2) { ! glv.setCursor(cursor); ! pan.released(e); } else { ! if (cameraMode) { ! orbit.released(e); ! } else if (selectMode) { ! select.released(e); ! } else { ! released(e); ! } } glv.repaint(true); --- 481,491 ---- public void mouseReleased(MouseEvent e) { parked = null; ! if (activeStrategy != null) { ! activeStrategy.released(e); } else { ! released(e); ! } ! if (e.getButton() == MouseEvent.BUTTON2) { ! setActiveStrategy(null); } glv.repaint(true); *************** *** 630,638 **** /** ! * ! * */ protected void remove() { ! } --- 595,608 ---- /** ! * The delete or backspace key has been pressed */ protected void remove() { ! for (Geometric current : Selection.primary()) { ! current.erase(); ! } ! Selection.primary().clear(); ! glv.getView().makeTarget(null); ! Project.getInstance().changed(Project.getInstance().getActiveSpace()); ! Project.getInstance().checkpoint(); } *************** *** 649,656 **** /** * The escape key has been pressed - * */ protected void escape() { ! } --- 619,630 ---- /** * The escape key has been pressed */ protected void escape() { ! Selection.primary().clear(); ! glv.getView().makeTarget(null); ! Project p = Project.getInstance(); ! p.setActiveSpace(p.world()); ! p.changed(p); ! glv.repaint(); } *************** *** 945,947 **** --- 919,931 ---- log.info(object); } + + private class DragAction implements ActionListener { + public void actionPerformed(ActionEvent e) { + if (parked != null) { + dragged(parked); + parked = null; + glv.repaint(true); + } + } + } } Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** SpaceTool.java 28 Aug 2007 07:04:47 -0000 1.85 --- SpaceTool.java 3 Sep 2007 11:31:34 -0000 1.86 *************** *** 373,402 **** return null; } - - - - /** - * Delete - */ - @Override - public void remove() { - for (Geometric current : Selection.primary()) { - current.erase(); - } - Selection.primary().clear(); - glv.getView().makeTarget(null); - Project.getInstance().changed(Project.getInstance().getActiveSpace()); - Project.getInstance().checkpoint(); - } - - /** - * Escape - */ - public void escape() { - Selection.primary().clear(); - glv.getView().makeTarget(null); - Project p = Project.getInstance(); - p.setActiveSpace(p.world()); - p.changed(p); - } } --- 373,375 ---- --- NEW FILE: DragTool.java --- //--------------------------------------------------------------------------------- // $Id: DragTool.java,v 1.1 2007/09/03 11:31:34 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gl.tool; import net.sourceforge.bprocessor.gl.GLView; import java.awt.Cursor; import java.awt.event.MouseEvent; import org.apache.log4j.Logger; /** * The selecttool */ public class DragTool extends AbstractTool { /** The logger */ private static Logger log = Logger.getLogger(DragTool.class); /** * The constructor * @param glv The 3D canvas * @param cursor The cursor */ public DragTool(GLView glv, Cursor cursor) { super(glv, cursor); dragDelay = 0; } /** * Invoked when the mouse cursor has been moved * @param e The MouseEvent object */ protected void moved(MouseEvent e) { pan.moved(e); } /** * Invoked when a mouse button has been pressed on a component. * @param e The MouseEvent object */ protected void pressed(MouseEvent e) { pan.pressed(e); } /** * Invoked when the mouse is held pressed and moved * @param e The MouseEvent object */ protected void dragged(MouseEvent e) { pan.dragged(e); } /** * Invoked when a mouse button has been released on a component. * @param e The MouseEvent */ protected void released(MouseEvent e) { pan.released(e); } /** * {@inheritDoc} */ public String initialTip() { return "Click and move mouse to navigate the model."; } } Index: SelectStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectStrategy.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** SelectStrategy.java 24 Aug 2007 09:54:27 -0000 1.17 --- SelectStrategy.java 3 Sep 2007 11:31:34 -0000 1.18 *************** *** 12,15 **** --- 12,16 ---- import java.util.Set; + import org.apache.log4j.Logger; *************** *** 95,98 **** --- 96,101 ---- */ public void moved(MouseEvent e) { + target = glv.getView().getObjectAtPoint(e.getX(), e.getY(), View.OBJECTS); + glv.getView().makeTarget(target); } *************** *** 109,114 **** x = e.getX(); y = e.getY(); - View view = glv.getView(); - target = view.getObjectAtPoint(x, y, View.OBJECTS); if (target == null || target instanceof Geometric) { activated = true; --- 112,115 ---- |
From: rimestad <rim...@us...> - 2007-09-03 14:01:48
|
Update of /cvsroot/bprocessor//gl/src/gfx In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10647/src/gfx Added Files: Bcursorzoominout.gif Removed Files: Bcursorzoominout.GIF Log Message: fixed the transparency --- NEW FILE: Bcursorzoominout.gif --- (This appears to be a binary file; contents omitted.) --- Bcursorzoominout.GIF DELETED --- |
From: rimestad <rim...@us...> - 2007-09-03 13:39:08
|
Update of /cvsroot/bprocessor/gl/src/gfx In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv991/src/gfx Added Files: Bcursorzoominout.GIF Log Message: zoom cursor --- NEW FILE: Bcursorzoominout.GIF --- (This appears to be a binary file; contents omitted.) |
From: rimestad <rim...@us...> - 2007-09-03 13:36:52
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32610/src/net/sourceforge/bprocessor/gl/tool Modified Files: ToolFactory.java Tool.java Added Files: ZoomTool.java PanTool.java Removed Files: DragTool.java Log Message: zoomtool Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** ToolFactory.java 3 Sep 2007 11:31:34 -0000 1.81 --- ToolFactory.java 3 Sep 2007 13:36:52 -0000 1.82 *************** *** 127,131 **** /** Tool for navigating in the model */ ! private DragTool dragTool; /** The selection button */ --- 127,133 ---- /** Tool for navigating in the model */ ! private PanTool panTool; ! ! private ZoomTool zoomTool; /** The selection button */ *************** *** 201,207 **** Toolkit.getDefaultToolkit().createCustomCursor(arrowAddImage, new Point(0, 0), "Add"); url = cl.getResource("Bcursordrag.gif"); ! Image dragImage = Toolkit.getDefaultToolkit().getImage(url); ! Cursor dragCursor = ! Toolkit.getDefaultToolkit().createCustomCursor(dragImage, new Point(7, 8), "Drag"); select = new SpaceTool(glv, null); pencil = new Pencil(glv, pencilcursor); --- 203,213 ---- Toolkit.getDefaultToolkit().createCustomCursor(arrowAddImage, new Point(0, 0), "Add"); url = cl.getResource("Bcursordrag.gif"); ! Image panImage = Toolkit.getDefaultToolkit().getImage(url); ! Cursor panCursor = ! Toolkit.getDefaultToolkit().createCustomCursor(panImage, new Point(7, 8), "Pan"); ! url = cl.getResource("Bcursorzoominout.gif"); ! Image zoomImage = Toolkit.getDefaultToolkit().getImage(url); ! Cursor zoomCursor = ! Toolkit.getDefaultToolkit().createCustomCursor(zoomImage, new Point(7, 8), "Zoom"); select = new SpaceTool(glv, null); pencil = new Pencil(glv, pencilcursor); *************** *** 226,231 **** finalMoveTool = new FinalMoveTool(glv, pencilcursor); edgeMoveTool = new EdgeMoveTool(glv, pencilcursor); ! dragTool = new DragTool(glv, dragCursor); ! Toolbar tb = Toolbar.getInstance(); --- 232,237 ---- finalMoveTool = new FinalMoveTool(glv, pencilcursor); edgeMoveTool = new EdgeMoveTool(glv, pencilcursor); ! panTool = new PanTool(glv, panCursor); ! zoomTool = new ZoomTool(glv, zoomCursor); Toolbar tb = Toolbar.getInstance(); *************** *** 261,267 **** cRotBut = this.registerTool(Tool.CAMERA_TOOL, camera, "Biconrotcam.gif", "Orbit (Space)"); ! this.registerTool(Tool.DRAG_TOOL, dragTool, "Bicondrag.gif", "Drag (Space)"); ! flyBut = this.registerTool(Tool.FLY_TOOL, fly, "Biconfly.gif", "Fly"); ! walkBut = this.registerTool(Tool.WALK_TOOL, walk, "Biconwalk.gif", "Walk"); Action zoomAction = new ToolAction(glv, 0, "Biconzomeall.gif") { --- 267,274 ---- cRotBut = this.registerTool(Tool.CAMERA_TOOL, camera, "Biconrotcam.gif", "Orbit (Space)"); ! this.registerTool(Tool.DRAG_TOOL, panTool, "Bicondrag.gif", "Drag (Space)"); ! this.registerTool(Tool.ZOOM_TOOL, zoomTool, "Biconzomeinout.gif", "Zoom in/out"); ! //flyBut = this.registerTool(Tool.FLY_TOOL, fly, "Biconfly.gif", "Fly"); ! //walkBut = this.registerTool(Tool.WALK_TOOL, walk, "Biconwalk.gif", "Walk"); Action zoomAction = new ToolAction(glv, 0, "Biconzomeall.gif") { --- NEW FILE: PanTool.java --- //--------------------------------------------------------------------------------- // $Id: PanTool.java,v 1.1 2007/09/03 13:36:52 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gl.tool; import net.sourceforge.bprocessor.gl.GLView; import java.awt.Cursor; import java.awt.event.MouseEvent; import org.apache.log4j.Logger; /** * The selecttool */ public class PanTool extends AbstractTool { /** The logger */ private static Logger log = Logger.getLogger(PanTool.class); /** * The constructor * @param glv The 3D canvas * @param cursor The cursor */ public PanTool(GLView glv, Cursor cursor) { super(glv, cursor); dragDelay = 0; } /** * Invoked when the mouse cursor has been moved * @param e The MouseEvent object */ protected void moved(MouseEvent e) { pan.moved(e); } /** * Invoked when a mouse button has been pressed on a component. * @param e The MouseEvent object */ protected void pressed(MouseEvent e) { pan.pressed(e); } /** * Invoked when the mouse is held pressed and moved * @param e The MouseEvent object */ protected void dragged(MouseEvent e) { pan.dragged(e); } /** * Invoked when a mouse button has been released on a component. * @param e The MouseEvent */ protected void released(MouseEvent e) { pan.released(e); } /** * {@inheritDoc} */ public String initialTip() { return "Click and move mouse to navigate the model."; } } Index: Tool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Tool.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Tool.java 3 Sep 2007 11:31:34 -0000 1.35 --- Tool.java 3 Sep 2007 13:36:52 -0000 1.36 *************** *** 72,75 **** --- 72,77 ---- /** the drag tool */ public static final int DRAG_TOOL = 25; + /** the zoom tool */ + public static final int ZOOM_TOOL = 26; /** --- NEW FILE: ZoomTool.java --- //--------------------------------------------------------------------------------- // $Id: ZoomTool.java,v 1.1 2007/09/03 13:36:52 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gl.tool; import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.model.Project; import java.awt.Cursor; import java.awt.event.MouseEvent; import org.apache.log4j.Logger; /** * The selecttool */ public class ZoomTool extends AbstractTool { /** The logger */ private static Logger log = Logger.getLogger(ZoomTool.class); private int prevY; private final int moveDist = 5; /** * The constructor * @param glv The 3D canvas * @param cursor The cursor */ public ZoomTool(GLView glv, Cursor cursor) { super(glv, cursor); dragDelay = 0; } /** * Invoked when the mouse cursor has been moved * @param e The MouseEvent object */ protected void moved(MouseEvent e) { } /** * Invoked when a mouse button has been pressed on a component. * @param e The MouseEvent object */ protected void pressed(MouseEvent e) { prevY = e.getY(); } /** * Invoked when the mouse is held pressed and moved * @param e The MouseEvent object */ protected void dragged(MouseEvent e) { if (prevY + moveDist < e.getY()) { prevY = e.getY(); Project.getInstance().getCurrentCamera().zoomout(); } if (prevY - moveDist > e.getY()) { prevY = e.getY(); Project.getInstance().getCurrentCamera().zoomin(); } } /** * Invoked when a mouse button has been released on a component. * @param e The MouseEvent */ protected void released(MouseEvent e) { } /** * {@inheritDoc} */ public String initialTip() { return "Click and move mouse to navigate the model."; } } --- DragTool.java DELETED --- |
From: Michael L. <he...@us...> - 2007-09-03 12:48:08
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11810/src/net/sourceforge/bprocessor/gl/view Modified Files: ViewToolbarFactory.java View.java Log Message: grid on/off button added to toolbar Index: ViewToolbarFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/ViewToolbarFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ViewToolbarFactory.java 28 Jun 2007 00:13:31 -0000 1.2 --- ViewToolbarFactory.java 3 Sep 2007 11:22:32 -0000 1.3 *************** *** 59,62 **** --- 59,90 ---- but.setMnemonic(KeyEvent.VK_F8); + but = tb.registerAction(new ViewGrid(glv)); + but.setToolTipText("Grid"); + but.setSelected(true); + } + + + class ViewGrid extends AbstractAction { + private GLView glv; + + ViewGrid(GLView glv) { + this.glv = glv; + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + URL url = cl.getResource("Bgrid.gif"); + ImageIcon im = new ImageIcon(url); + putValue(Action.SMALL_ICON, im); + } + + /** {@inheritDoc} */ + public void actionPerformed(ActionEvent event) { + JToggleButton button = (JToggleButton) event.getSource(); + glv.getView(); + if (button.isSelected()) { + glv.getView().enableGrid(); + } else { + glv.getView().disableGrid(); + } + glv.repaint(); + } } Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.227 retrieving revision 1.228 diff -C2 -d -r1.227 -r1.228 *** View.java 31 Aug 2007 12:25:11 -0000 1.227 --- View.java 3 Sep 2007 11:22:32 -0000 1.228 *************** *** 321,324 **** --- 321,327 ---- */ private boolean stipple; + + /** grid enabled */ + private boolean gridEnabled; /** The mode of selecting. Either edges or surfaces */ *************** *** 504,507 **** --- 507,511 ---- constructorColor = CONSTRUCTOR_COLOR; noneColor = NONE_COLOR; + gridEnabled = true; tempConstructors = new HashSet<Constructor>(); tempEdges = new HashSet<Edge>(); *************** *** 607,610 **** --- 611,628 ---- } + /** + * Enable grid + * + */ + public void enableGrid() { + gridEnabled = true; + } + + /** + * Disable grid + */ + public void disableGrid() { + gridEnabled = false; + } /** *************** *** 1011,1015 **** } } ! grid(Project.getInstance().getActiveCoordinateSystem()); drawConstructorPlanes(); } --- 1029,1035 ---- } } ! if (gridEnabled) { ! grid(Project.getInstance().getActiveCoordinateSystem()); ! } drawConstructorPlanes(); } |
From: Michael L. <he...@us...> - 2007-08-31 12:47:49
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22399/src/net/sourceforge/bprocessor/gl/tool Modified Files: Tool.java AbstractTool.java Pencil.java EraserTool.java Log Message: Fixed eraser to delete constructors. Clears selection when starting pencil or eraser Index: Pencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Pencil.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Pencil.java 19 Jun 2007 20:10:24 -0000 1.17 --- Pencil.java 31 Aug 2007 12:47:48 -0000 1.18 *************** *** 19,22 **** --- 19,23 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Selection; /** *************** *** 107,110 **** --- 108,117 ---- } + /** + * {@inheritDoc} + */ + public void prepare() { + Selection.primary().clear(); + } /** Index: EraserTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/EraserTool.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** EraserTool.java 19 Jul 2007 12:23:32 -0000 1.9 --- EraserTool.java 31 Aug 2007 12:47:48 -0000 1.10 *************** *** 14,20 **** --- 14,22 ---- import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.model.ClippingPlane; + import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Selection; /** *************** *** 38,42 **** protected void moved(MouseEvent e) { findTarget(e); ! glv.getView().makeTarget(target); } --- 40,55 ---- protected void moved(MouseEvent e) { findTarget(e); ! if (relevant(target)) { ! glv.getView().makeTarget(target); ! } else { ! glv.getView().makeTarget(null); ! } ! } ! ! ! private boolean relevant(Object geometric) { ! return target instanceof Edge ! || target instanceof ClippingPlane ! || target instanceof Constructor; } *************** *** 47,51 **** protected void pressed(MouseEvent e) { findTarget(e); ! if (target instanceof Edge || target instanceof ClippingPlane) { ((Geometric) target).erase(); Project.getInstance().changed(target); --- 60,64 ---- protected void pressed(MouseEvent e) { findTarget(e); ! if (relevant(target)) { ((Geometric) target).erase(); Project.getInstance().changed(target); *************** *** 69,72 **** --- 82,92 ---- /** + * {@inheritDoc} + */ + public void prepare() { + Selection.primary().clear(); + } + + /** * Tip on how to set the first click * @return short describtion of what to do Index: Tool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Tool.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Tool.java 19 Jun 2007 16:11:06 -0000 1.33 --- Tool.java 31 Aug 2007 12:47:48 -0000 1.34 *************** *** 88,91 **** --- 88,96 ---- public void cleanUp(); + /** + * Prepare + */ + public void prepare(); + /** * Gives a tip on how to use the tool Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -d -r1.127 -r1.128 *** AbstractTool.java 9 Jul 2007 13:30:40 -0000 1.127 --- AbstractTool.java 31 Aug 2007 12:47:48 -0000 1.128 *************** *** 696,699 **** --- 696,706 ---- /** + * {@inheritDoc} + */ + public void prepare() { + + } + + /** * Builtin function */ |
From: Michael L. <he...@us...> - 2007-08-31 12:47:49
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22399/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: Fixed eraser to delete constructors. Clears selection when starting pencil or eraser Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** GLView.java 28 Jun 2007 00:04:59 -0000 1.62 --- GLView.java 31 Aug 2007 12:47:48 -0000 1.63 *************** *** 203,206 **** --- 203,207 ---- setCursor(tool.getCursor()); setTip(tool.initialTip()); + tool.prepare(); } else { log.error("[changeMode] tool was null"); |
From: Michael L. <he...@us...> - 2007-08-31 12:25:18
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13818/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: Got rid of the yellow line and the blue dot Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** AbstractPencil.java 31 Aug 2007 08:59:19 -0000 1.88 --- AbstractPencil.java 31 Aug 2007 12:25:11 -0000 1.89 *************** *** 132,135 **** --- 132,137 ---- private Edge lockHighlightEdge; + private static final boolean FALSE = false; + /** * Constructor *************** *** 586,590 **** if (intersection.type() == Intersection.LOCK_INTERSECTION) { actual = (Intersection)actual.object(); ! lockSnapVertex = actual.vertex(); targetColor = targetColor(actual); glv.getView().addTempVertex(lockSnapVertex); --- 588,592 ---- if (intersection.type() == Intersection.LOCK_INTERSECTION) { actual = (Intersection)actual.object(); ! lockSnapVertex = actual.vertex().copy(); targetColor = targetColor(actual); glv.getView().addTempVertex(lockSnapVertex); *************** *** 592,600 **** if (lockingEdge != null) { EdgeAttributes ea = new EdgeAttributes(); ! ea.setColor(View.TARGET_COLOR); ea.setLineWidth(ea.getLineWidth() * 2); lockHighlightEdge = lockingEdge; ! glv.getView().addTempEdge(lockHighlightEdge); ! glv.getView().changeEdgeStyle(lockHighlightEdge, ea); if (!lockingEdge.coincides(targetVertex)) { Vertex to = lockingEdge.getTo(); --- 594,606 ---- if (lockingEdge != null) { EdgeAttributes ea = new EdgeAttributes(); ! ea.setColor(View.UGLY_COLOR); ea.setLineWidth(ea.getLineWidth() * 2); lockHighlightEdge = lockingEdge; ! ! if (FALSE) { ! glv.getView().addTempEdge(lockHighlightEdge); ! glv.getView().changeEdgeStyle(lockHighlightEdge, ea); ! } ! if (!lockingEdge.coincides(targetVertex)) { Vertex to = lockingEdge.getTo(); *************** *** 748,751 **** --- 754,760 ---- lockingEdge = null; lockingPlane = null; + glv.getView().removeTempVertex(lockSnapVertex); + glv.getView().clearColor(lockSnapVertex); + lockSnapVertex = null; constructors(new LinkedList()); feedback(new LinkedList()); |
From: Michael L. <he...@us...> - 2007-08-31 12:25:18
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13818/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Got rid of the yellow line and the blue dot Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.226 retrieving revision 1.227 diff -C2 -d -r1.226 -r1.227 *** View.java 31 Aug 2007 10:04:27 -0000 1.226 --- View.java 31 Aug 2007 12:25:11 -0000 1.227 *************** *** 145,149 **** /** Used for vertices on edges */ ! public static final float[] EDGE_ON_COLOR = new float[] {0.2f, 0.3f, 0.6f}; /** Used for constructor objects */ --- 145,152 ---- /** Used for vertices on edges */ ! public static final float[] EDGE_ON_COLOR = new float[] {0.2f, 0.3f, 0.6f}; ! ! /** Used for testing */ ! public static final float[] UGLY_COLOR = new float[] {0.0f, 1.0f, 1.0f}; /** Used for constructor objects */ |
From: rimestad <rim...@us...> - 2007-08-31 10:04:30
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21737/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Changed the view sort of back to its usual Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.225 retrieving revision 1.226 diff -C2 -d -r1.225 -r1.226 *** View.java 28 Aug 2007 07:04:47 -0000 1.225 --- View.java 31 Aug 2007 10:04:27 -0000 1.226 *************** *** 1123,1140 **** transform(space.getTransformations()); if (active) { ! Collection<Surface> surfaces = new HashSet<Surface>(); ! for (Space s : space.getElements()) { ! if (s == space.getEmpty()) { ! for (Surface sur : s.getEnvelope()) { ! if (sur.getFrontDomain() == s && sur.getBackDomain() == s) { ! surfaces.add(sur); ! } ! } ! } else { ! if (s.getLevel() <= drawDepth) { ! surfaces.addAll(s.getEnvelope()); ! } ! } ! } switch (drawMode) { case SPACE_ASSGN_MODE: { --- 1123,1127 ---- transform(space.getTransformations()); if (active) { ! Collection<Surface> surfaces = space.getSurfaces(); switch (drawMode) { case SPACE_ASSGN_MODE: { *************** *** 1181,1190 **** drawGeneralEdges(space.getEdges(), !active); } ! ! if (space.getLevel() < drawDepth) { ! for (Space current : space.getElements()) { ! if (!(current instanceof Net) || Project.getInstance().getActiveSpace() == current) { ! drawSpace(current, active, selected); ! } } } --- 1168,1175 ---- drawGeneralEdges(space.getEdges(), !active); } ! ! for (Space current : space.getElements()) { ! if (!(current instanceof Net) || Project.getInstance().getActiveSpace() == current) { ! drawSpace(current, active, selected); } } |
From: rimestad <rim...@us...> - 2007-08-31 09:45:31
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14230/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Made D-view selection work more intuitive (tried to copy eclipse way) Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** GenericTreeView.java 28 Aug 2007 07:00:52 -0000 1.102 --- GenericTreeView.java 31 Aug 2007 09:45:23 -0000 1.103 *************** *** 1361,1364 **** --- 1361,1377 ---- if (path != null) { if (e.isPopupTrigger()) { + if (getSelectionCount() < 2) { + setSelectionPath(path); + } else { + boolean wereFound = false; + for (TreePath treepath : getSelectionPaths()) { + if (treepath.equals(path)) { + wereFound = true; + } + } + if (!wereFound) { + setSelectionPath(path); + } + } Object object = path.getLastPathComponent(); if (object instanceof GenericNode) { |
From: rimestad <rim...@us...> - 2007-08-31 09:45:24
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14230/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: Made D-view selection work more intuitive (tried to copy eclipse way) Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** PopupMenu.java 28 Aug 2007 07:00:52 -0000 1.40 --- PopupMenu.java 31 Aug 2007 09:45:23 -0000 1.41 *************** *** 433,436 **** --- 433,438 ---- for (Space space : interior) { surfaces.addAll(space.getEnvelope()); + spaces.add(space); + owner = space.getOwner(); } *************** *** 555,573 **** } else { Iterator sel = Selection.primary().iterator(); ! Class<? extends Object> type = null; while (sel.hasNext()) { Object next = sel.next(); if (type == null) { ! type = next.getClass(); ! } else if (type == next.getClass()) { ! // do nothing just continue; ! continue; ! } else { return PopupMenu.getEntiesMenu(new LinkedList(Selection.primary())); ! } } ! if (type == Space.class) { return PopupMenu.getSpaceMenu(Selection.primary()); ! } else if (type == Surface.class) { return PopupMenu.getSurfaceMenu(Selection.primary()); } else { --- 557,572 ---- } else { Iterator sel = Selection.primary().iterator(); ! Object type = null; while (sel.hasNext()) { Object next = sel.next(); if (type == null) { ! type = next; ! } else if (!next.getClass().isInstance(type)) { return PopupMenu.getEntiesMenu(new LinkedList(Selection.primary())); ! } } ! if (type instanceof Space) { return PopupMenu.getSpaceMenu(Selection.primary()); ! } else if (type instanceof Surface) { return PopupMenu.getSurfaceMenu(Selection.primary()); } else { |
From: rimestad <rim...@us...> - 2007-08-31 09:09:17
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32269/src/net/sourceforge/bprocessor/model/modellor Modified Files: TileModellor.java Log Message: Made the tile modellor use a outline net instead Index: TileModellor.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/modellor/TileModellor.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** TileModellor.java 18 Jul 2007 12:24:09 -0000 1.17 --- TileModellor.java 31 Aug 2007 09:09:08 -0000 1.18 *************** *** 26,29 **** --- 26,30 ---- import net.sourceforge.bprocessor.model.Net; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Selector; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; *************** *** 63,66 **** --- 64,69 ---- private Net net; + + private Net outline; private Set<Surface> ignoredSurfaces = new HashSet<Surface>(); *************** *** 90,93 **** --- 93,97 ---- space.getOwner().add(startPoint); space.add(tileColor); + updateOutline(); updateNet(startPoint); Project.getInstance().addObserver(this); *************** *** 137,140 **** --- 141,145 ---- @Override public void update(Object entity) { + boolean updateNet = false; if (!isActive()) { return; *************** *** 144,149 **** --- 149,164 ---- return; } + if (entity == outline) { + parameterizeOutline(); + updateNet = true; + } else if (entity == startPoint || outline.getSurfaces().contains(entity)) { + updateNet = true; + } + if (updateNet) { + updateNet(startPoint); + } log.info("Modellor update on " + entity); space.clear(); + space.add(outline); space.add(net); int sign = 1; *************** *** 191,194 **** --- 206,238 ---- /** + * Construct the outline net + */ + private void updateOutline() { + if (outline == null) { + outline = new Net("Tile-outline"); + } + outline.clear(); + surface.copyall(outline); + + parameterizeOutline(); + } + + private void parameterizeOutline() { + for (Surface s : outline.getSurfaces()) { + boolean contained = false; + for (Attribute a : s.getParameters().getAttributes()) { + if (a.getName().equalsIgnoreCase("Fill")) { + contained = true; + break; + } + } + if (!contained) { + Selector sel = new Selector<String>("Tile", "Wall", "Glasv¾v"); + s.getParameters().add(new Attribute("Fill", sel)); + } + } + } + + /** * @param cs the coordinatesystem to use as origin */ *************** *** 198,204 **** } net.clear(); double maxX = Double.MIN_VALUE, maxY = Double.MIN_VALUE, ! minX = Double.MAX_VALUE, minY = Double.MAX_VALUE; ! for (Vertex v : surface.collect()) { Vertex translated = cs.translate(v); if (translated.getX() > maxX) { --- 242,267 ---- } net.clear(); + Collection<Edge> edges = new ArrayList<Edge>(); + for (Surface s : outline.getSurfaces()) { + for (Attribute a : s.getParameters().getAttributes()) { + if (a.getName().equalsIgnoreCase("Fill")) { + String current = ((Selector<String>)a.getValue()).getCurrentValue(); + if (!current.equalsIgnoreCase("Tile")) { + ignoredSurfaces.add(s); + } else { + edges.addAll(Edge.copy(s.getEdges())); + for (Surface hole : s.getHoles()) { + ignoredSurfaces.add(hole); + } + } + } + } + } + net.insert(edges); + + //Find min and max in given CS double maxX = Double.MIN_VALUE, maxY = Double.MIN_VALUE, ! minX = Double.MAX_VALUE, minY = Double.MAX_VALUE; ! for (Vertex v : Edge.vertices(edges)) { Vertex translated = cs.translate(v); if (translated.getX() > maxX) { *************** *** 215,224 **** } } ! surface.copyall(net); ! Collection<Edge> edges = new ArrayList<Edge>(surface.getEdges()); ! for (Surface s : surface.getHoles()) { ! ignoredSurfaces.add(s); ! edges.addAll(s.getEdges()); ! } Collection<Edge> horEdges = new LinkedList<Edge>(); Collection<Edge> vertEdges = new LinkedList<Edge>(); --- 278,282 ---- } } ! Collection<Edge> horEdges = new LinkedList<Edge>(); Collection<Edge> vertEdges = new LinkedList<Edge>(); *************** *** 234,239 **** Vertex localHori = new Vertex(0, tileSize.getHeight() / 1000.0 + jointSize / 1000.0, 0); Vertex horizontalAdd = cs.unTranslate(localHori).minus(cs.center()); ! Edge slider = new Edge(cs.unTranslate(new Vertex(minX, 0, 0)).minus(horizontalAdd), ! cs.unTranslate(new Vertex(maxX, 0, 0)).minus(horizontalAdd)); findIntersectingEdges(cs, slider, maxX, maxY, minX, minY, edges, horEdges, horVerts, horizontalAdd); --- 292,297 ---- Vertex localHori = new Vertex(0, tileSize.getHeight() / 1000.0 + jointSize / 1000.0, 0); Vertex horizontalAdd = cs.unTranslate(localHori).minus(cs.center()); ! Edge slider = new Edge(cs.unTranslate(new Vertex(minX, 0, 0)), ! cs.unTranslate(new Vertex(maxX, 0, 0))); findIntersectingEdges(cs, slider, maxX, maxY, minX, minY, edges, horEdges, horVerts, horizontalAdd); *************** *** 241,246 **** Vertex localVertical = new Vertex(tileSize.getWidth() / 1000.0 + jointSize / 1000.0, 0, 0); Vertex verticalAdd = cs.unTranslate(localVertical).minus(cs.center()); ! slider = new Edge(cs.unTranslate(new Vertex(0, minY, 0)).minus(verticalAdd), ! cs.unTranslate(new Vertex(0, maxY, 0)).minus(verticalAdd)); findIntersectingEdges(cs, slider, maxX, maxY, minX, minY, edges, vertEdges, vertVerts, verticalAdd); --- 299,304 ---- Vertex localVertical = new Vertex(tileSize.getWidth() / 1000.0 + jointSize / 1000.0, 0, 0); Vertex verticalAdd = cs.unTranslate(localVertical).minus(cs.center()); ! slider = new Edge(cs.unTranslate(new Vertex(0, minY, 0)), ! cs.unTranslate(new Vertex(0, maxY, 0))); findIntersectingEdges(cs, slider, maxX, maxY, minX, minY, edges, vertEdges, vertVerts, verticalAdd); *************** *** 407,410 **** --- 465,469 ---- space.getOwner().insert(startPoint); startPoint.relate(surface); + updateOutline(); updateNet = true; } |
From: rimestad <rim...@us...> - 2007-08-31 09:09:16
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32269/src/net/sourceforge/bprocessor/model Modified Files: Selector.java Log Message: Made the tile modellor use a outline net instead Index: Selector.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Selector.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Selector.java 24 May 2007 10:56:16 -0000 1.3 --- Selector.java 31 Aug 2007 09:09:09 -0000 1.4 *************** *** 33,36 **** --- 33,39 ---- public Selector(List<Type> options) { this.options = options; + if (!options.isEmpty()) { + currentValue = options.get(0); + } } *************** *** 45,48 **** --- 48,54 ---- this.options.add(t); } + if (options.length > 0) { + setCurrentValue(options[0]); + } } |
From: Michael L. <he...@us...> - 2007-08-31 08:59:25
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28098/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: Removed some warnings Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** AbstractPencil.java 24 Aug 2007 09:54:27 -0000 1.87 --- AbstractPencil.java 31 Aug 2007 08:59:19 -0000 1.88 *************** *** 592,596 **** if (lockingEdge != null) { EdgeAttributes ea = new EdgeAttributes(); ! ea.setColor(glv.getView().TARGET_COLOR); ea.setLineWidth(ea.getLineWidth() * 2); lockHighlightEdge = lockingEdge; --- 592,596 ---- if (lockingEdge != null) { EdgeAttributes ea = new EdgeAttributes(); ! ea.setColor(View.TARGET_COLOR); ea.setLineWidth(ea.getLineWidth() * 2); lockHighlightEdge = lockingEdge; *************** *** 790,792 **** --- 790,800 ---- return affected; } + + /** + * Info + * @param object Object + */ + public static void info(Object object) { + log.info(object); + } } |
From: Michael L. <he...@us...> - 2007-08-30 13:57:51
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3260/src/net/sourceforge/bprocessor/gl/tool Modified Files: FinalMoveTool.java Log Message: progress on the move tool Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** FinalMoveTool.java 27 Aug 2007 13:39:05 -0000 1.17 --- FinalMoveTool.java 30 Aug 2007 13:57:46 -0000 1.18 *************** *** 18,21 **** --- 18,22 ---- import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.view.View; + import net.sourceforge.bprocessor.model.Direction; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometric; *************** *** 35,45 **** private Collection<Vertex> vertices; private Collection<Geometric> affected; - private Vertex from; private Vertex last; - private Vertex to; private boolean copy; private Mesh mesh; private Vertex direction; --- 36,46 ---- private Collection<Vertex> vertices; private Collection<Geometric> affected; private Vertex last; private boolean copy; private Mesh mesh; private Vertex direction; + private Map<Vertex, Vertex> originals; + private Map<Vertex, Direction> slide; *************** *** 55,60 **** private Map<Vertex, Vertex> computeMap(Collection<Vertex> vertices) { ! ! return null; } --- 56,110 ---- private Map<Vertex, Vertex> computeMap(Collection<Vertex> vertices) { ! if (vertices.size() > 0) { ! Space space = vertices.iterator().next().getOwner(); ! return space.directionMap(vertices); ! } else { ! return null; ! } ! } ! ! private Map<Vertex, Direction> computeDirectionMap(Collection<Vertex> vertices) { ! if (vertices.size() > 0) { ! Space space = vertices.iterator().next().getOwner(); ! Map<Vertex, Direction> slidemap = new HashMap(); ! Map<Vertex, Collection<Edge>> edgemap = space.edgeMap(vertices); ! System.out.println("-- map --"); ! for (Vertex current : vertices) { ! Collection<Edge> edges = edgemap.get(current); ! Direction direction; ! if (edges.size() == 0) { ! System.out.println(" free"); ! direction = new Direction(current.copy(), null); ! } else if (edges.size() == 1) { ! System.out.println(" constrained"); ! Edge edge = edges.iterator().next(); ! Vertex to = edge.otherVertex(current); ! Vertex v = to.minus(current); ! double length = v.length(); ! v.scale(1 / length); ! direction = new Direction(current.copy(), v, Double.NEGATIVE_INFINITY, length); ! } else { ! System.out.println(" bound"); ! direction = new Direction(current.copy(), null, 0, 0); ! } ! slidemap.put(current, direction); ! } ! return slidemap; ! } else { ! return null; ! } ! } ! ! private Map<Vertex, Direction> computeSlideMap(Collection<Vertex> vertices) { ! Map<Vertex, Vertex> edgemap = computeMap(vertices); ! if (edgemap != null) { ! Map<Vertex, Direction> slidemap = new HashMap(); ! for (Vertex current : vertices) { ! slidemap.put(current, new Direction(current.copy(), edgemap.get(current))); ! } ! return slidemap; ! } else { ! return null; ! } } *************** *** 69,76 **** } else { if (current != null) { - Edge edge = new Edge(from, to); - edge.setStrippled(true); Collection feedback = new LinkedList(); ! feedback.add(edge); feedback(feedback); makeTarget(current); --- 119,128 ---- } else { if (current != null) { Collection feedback = new LinkedList(); ! for (Vertex vertex : vertices) { ! Edge edge = new Edge(current.vertex(), vertex); ! edge.setStrippled(true); ! feedback.add(edge); ! } feedback(feedback); makeTarget(current); *************** *** 82,88 **** private void move() { current = current.copy(); ! to = current.vertex(); ! move(vertices, to.minus(last)); ! last = to; updateFeedback(); } --- 134,139 ---- private void move() { current = current.copy(); ! last = current.vertex(); ! move(vertices, current.vertex().minus(start.vertex())); updateFeedback(); } *************** *** 91,95 **** private void move(Collection<Vertex> vertices, Vertex delta) { for (Vertex current : vertices) { ! current.move(delta.getX(), delta.getY(), delta.getZ()); } } --- 142,164 ---- private void move(Collection<Vertex> vertices, Vertex delta) { for (Vertex current : vertices) { ! Vertex original = originals.get(current); ! current.set(original.add(delta)); ! if (slide != null) { ! Direction direction = slide.get(current); ! Vertex n = direction.getDirection(); ! if (n != null) { ! Vertex v = current.minus(original); ! double t = n.dot(v); ! if (t > direction.upper()) { ! t = direction.upper(); ! } ! if (t < direction.lower()) { ! t = direction.lower(); ! } ! Vertex u = n.copy(); ! u.scale(t); ! current.set(original.add(u)); ! } ! } } } *************** *** 170,178 **** vertices = Geometry.collect(geometrics); affected = getAffected(geometrics); current = findIntersection(e); start = current.copy(); ! from = current.vertex(); ! last = from; updateFeedback(); setTip(secondClickTip()); --- 239,251 ---- vertices = Geometry.collect(geometrics); + originals = new HashMap(); + for (Vertex current : vertices) { + originals.put(current, current.copy()); + } + slide = computeDirectionMap(vertices); affected = getAffected(geometrics); current = findIntersection(e); start = current.copy(); ! last = current.vertex(); updateFeedback(); setTip(secondClickTip()); *************** *** 232,237 **** public void cleanUp() { if (start != null) { ! current = start; ! move(); } super.cleanUp(); --- 305,312 ---- public void cleanUp() { if (start != null) { ! for (Vertex current : vertices) { ! Vertex original = originals.get(current); ! current.set(original); ! } } super.cleanUp(); *************** *** 244,247 **** --- 319,324 ---- affected = null; copy = false; + originals = null; + slide = null; } |
From: Michael L. <he...@us...> - 2007-08-30 13:57:45
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3245/src/net/sourceforge/bprocessor/model Modified Files: Direction.java Log Message: progress on the move tool Index: Direction.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Direction.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Direction.java 23 Feb 2006 14:05:13 -0000 1.13 --- Direction.java 30 Aug 2007 13:57:35 -0000 1.14 *************** *** 17,20 **** --- 17,24 ---- private Vertex direction; + private double lower; + private double upper; + + /** * Constructor *************** *** 25,28 **** --- 29,48 ---- vertex = which; direction = dir; + lower = Double.NEGATIVE_INFINITY; + upper = Double.POSITIVE_INFINITY; + } + + /** + * Constrcutor + * @param which the point + * @param dir the direction of the point + * @param lower lower limit of movement + * @param upper upper limit of movement + */ + public Direction(Vertex which, Vertex dir, double lower, double upper) { + vertex = which; + direction = dir; + this.lower = lower; + this.upper = upper; } *************** *** 76,79 **** --- 96,115 ---- /** + * Returns upper + * @return upper + */ + public double upper() { + return upper; + } + + /** + * Returns lower + * @return lower + */ + public double lower() { + return lower; + } + + /** * The string representation of the Direstion * @return The string representation of the Direstion |
From: rimestad <rim...@us...> - 2007-08-28 07:04:55
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20300/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: made some changes in the way spaces are drawn Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** SpaceTool.java 24 Aug 2007 09:54:27 -0000 1.84 --- SpaceTool.java 28 Aug 2007 07:04:47 -0000 1.85 *************** *** 109,131 **** } } else { ! Iterator sel = Selection.primary().iterator(); ! Class<? extends Object> type = null; ! while (sel.hasNext()) { ! Object next = sel.next(); ! if (type == null) { ! type = next.getClass(); ! } else if (type == next.getClass()) { ! // do nothing just continue; ! continue; ! } else { ! return PopupMenu.getEntiesMenu(new LinkedList(Selection.primary())); ! } ! } ! if (type == Space.class) { ! return PopupMenu.getSpaceMenu(Selection.primary()); ! } else if (type == Surface.class) { ! return PopupMenu.getSurfaceMenu(Selection.primary()); } else { ! return PopupMenu.getEntiesMenu(new LinkedList(Selection.primary())); } } --- 109,116 ---- } } else { ! if (Selection.primary().contains(target)) { ! return PopupMenu.makeSelectionMenu(); } else { ! return PopupMenu.getBackgroundMenu(); } } |