[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool ExtrusionTool.java, 1.59, 1.60
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-06-21 09:52:55
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4089/src/net/sourceforge/bprocessor/gl/tool Modified Files: ExtrusionTool.java Log Message: Removed some random comments Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** ExtrusionTool.java 20 Jun 2007 13:17:56 -0000 1.59 --- ExtrusionTool.java 21 Jun 2007 09:52:54 -0000 1.60 *************** *** 99,107 **** /** * Extrude ! * @param p the plane to extrude onto * @param all Extrude all * @param finish Finish extrusion */ ! private void extrudeOnto(Plane p, boolean all, boolean finish) { Space space = Project.getInstance().getActiveSpace(); if (extrusion != null) { --- 99,107 ---- /** * Extrude ! * @param plane the plane to extrude onto * @param all Extrude all * @param finish Finish extrusion */ ! private void extrudeOnto(Plane plane, boolean all, boolean finish) { Space space = Project.getInstance().getActiveSpace(); if (extrusion != null) { *************** *** 114,119 **** Set<Surface> tops = new HashSet<Surface>(); Surface top = null; ! if (p == null) { ! // just extrude the distance if (all) { extrudesurface.extrusionall(distance, sides, tops); --- 114,118 ---- Set<Surface> tops = new HashSet<Surface>(); Surface top = null; ! if (plane == null) { if (all) { extrudesurface.extrusionall(distance, sides, tops); *************** *** 123,131 **** } } else { - // extrude to the plane if (all) { ! extrudesurface.extrusionAllOnto(p, sides, tops); } else { ! top = extrudesurface.extrusionOnto(p, sides); extrusion.add(top); } --- 122,129 ---- } } else { if (all) { ! extrudesurface.extrusionAllOnto(plane, sides, tops); } else { ! top = extrudesurface.extrusionOnto(plane, sides); extrusion.add(top); } *************** *** 135,139 **** if (finish) { insert(space, extrusion); - } else { space.addProtected(extrusion); --- 133,136 ---- *************** *** 155,159 **** Vertex dir = to.minus(from); if (plane != null && Math.abs(plane.normal().dot(dir)) <= 0.1) { - // if the planes are parallel plane = null; } --- 152,155 ---- *************** *** 172,181 **** protected void moved(MouseEvent e) { if (extrudesurface != null) { - // a extrudesurface have been chosen to = glv.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); Vertex normal = extrudesurface.normal(); - //a bit cleanup ontoPlane = null; - // the list of all extruded geometric objects Set<Geometric> elements = new HashSet<Geometric>(); if (extrusion != null) { --- 168,174 ---- *************** *** 184,188 **** elements.add(extrudesurface); } - //ignore the extruded surface and holes when extruding Set<Surface> ignore = new HashSet<Surface>(2); ignore.add(extrudesurface); --- 177,180 ---- *************** *** 198,202 **** Vertex cross = normal.cross(n); if (cross.isZero()) { - // the surfaces are coplanar Vertex v = surface.getFirstVertex(); if (!extrudesurface.plane().contains(v)) { --- 190,193 ---- *************** *** 207,211 **** ontoPlane = surface.plane(); if (Math.abs(ontoPlane.normal().dot(normal)) <= 0.1) { - // the two normals have a greater angle between 0 and 84 or 94 and 180 degrees calcDistCallExtrude(to, from, normal); } else { --- 198,201 ---- *************** *** 233,240 **** } } else if (extrudeEdges != null) { - // make the extrusion of edges to = glv.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); - - //list of moving elements Set<Geometric> elements = new HashSet<Geometric>(extrudeEdges); if (extrusion != null) { --- 223,227 ---- *************** *** 242,247 **** elements.addAll(Surface.edges(extrusion)); } - - // ignore the extruded surface and holes when extruding List<Geometric> ignore = new LinkedList<Geometric>(extrudeEdges); if (extrusion != null) { --- 229,232 ---- *************** *** 279,285 **** extrudeEdgesOnto(ontoPlane, false); } else { - // do highlighting if (Selection.primary().isEmpty()) { - //the extrusion isn't started yet findTarget(e); if (target instanceof Surface) { --- 264,268 ---- *************** *** 317,321 **** protected void pressed(MouseEvent e) { if (e.getClickCount() > 1 && extrusion == null) { - // do a extrusion of the same length once more if (extrudesurface != null) { extrudeOnto(ontoPlane, true, true); --- 300,303 ---- *************** *** 326,332 **** if (start == null) { - // initialize the extrusion if (!Selection.primary().isEmpty()) { - //find the selected object to extrude extrudeEdges = new ArrayList<Edge>(); for (Object o : Selection.primary()) { --- 308,312 ---- *************** *** 352,356 **** } else { if (extrudesurface != null) { - // there were both edges and surfaces in the selection extrudesurface = null; extrudeEdges = null; --- 332,335 ---- *************** *** 359,363 **** } } else { - //find the target to extrude findTarget(e); if (target instanceof Surface) { --- 338,341 ---- *************** *** 367,371 **** } } - // Do initialization if (extrudeEdges != null) { startx = e.getX(); --- 345,348 ---- *************** *** 405,409 **** } } else { - // stop the extrusion if (extrudeEdges != null) { if (extrusion != null) { --- 382,385 ---- *************** *** 418,424 **** extrudeOnto(ontoPlane, all, true); } - } else { - //something weird happend - log.error("Got into a finalize state without initialization of either edges or surface"); } extrusion = null; --- 394,397 ---- *************** *** 490,495 **** all = false; dragplane = null; - //keep for repeat - //ontoPlane = null; from = null; to = null; --- 463,466 ---- *************** *** 497,501 **** Project.getInstance().getActiveSpace().removeProtected(extrusion); Project.getInstance().getActiveSpace().computeNextId(); - //Project.getInstance().getActiveSpace().changed(); extrusion = null; } --- 468,471 ---- |