[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool SelectTool.java,1.4,1.5
Status: Pre-Alpha
Brought to you by:
henryml
From: Nordholt <nor...@us...> - 2005-08-17 10:55:25
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16183 Modified Files: SelectTool.java Log Message: Selection in 3D added Index: SelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectTool.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SelectTool.java 15 Aug 2005 12:49:31 -0000 1.4 --- SelectTool.java 17 Aug 2005 10:55:15 -0000 1.5 *************** *** 108,117 **** coordsx[0] == 0 && coordsx[1] == 0 && coordsx[2] == 0 && coordsy[0] == 0 && coordsy[1] == 0 && coordsy[2] == 0) { viewType = View.VIEW_3D; ! Edge edge = edgeCollide3D(x, y); ! if (edge != null) { Notification n = new Notification(Notification.EDGE_SELECTED, edge.getId()); Notifier.getInstance().sendNotification(n); } } else { Vertex v = vertexCollide(coords); --- 108,124 ---- coordsx[0] == 0 && coordsx[1] == 0 && coordsx[2] == 0 && coordsy[0] == 0 && coordsy[1] == 0 && coordsy[2] == 0) { + Object o; viewType = View.VIEW_3D; ! o = view.getObjectAtPoint(x, y); ! if (o instanceof Edge) { ! Edge edge = (Edge)o; Notification n = new Notification(Notification.EDGE_SELECTED, edge.getId()); Notifier.getInstance().sendNotification(n); } + if (o instanceof Surface) { + Surface surface = (Surface)o; + Notification n = new Notification(Notification.SURFACE_SELECTED, surface.getId()); + Notifier.getInstance().sendNotification(n); + } } else { Vertex v = vertexCollide(coords); *************** *** 296,315 **** } - - /** - * Check if a point is over any edge in 3D. - * @param x the x coordinate of the point - * @param y the y coordinate of the point - * @return an Edge the point is over, null if no Edge is found - */ - protected Edge edgeCollide3D(double x, double y) { - View view = glv.getView(); - Long id = view.getObjectAtPoint(x, y); - if (id != null) { - return EdgeFacade.getInstance().findById(id); - } - return null; - } - /** * Handle a notification --- 303,306 ---- |