[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool PencilTool.java,1.53,1.54
Status: Pre-Alpha
Brought to you by:
henryml
From: Nordholt <nor...@us...> - 2005-12-29 14:20:49
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10224 Modified Files: PencilTool.java Log Message: snap-constructors are now better aligned when there is a current plane. You are not allowed to draw outside the currentplane if you have allready drawn to edges or more. Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** PencilTool.java 26 Dec 2005 15:10:28 -0000 1.53 --- PencilTool.java 29 Dec 2005 14:20:41 -0000 1.54 *************** *** 203,207 **** if (showConstructors) { clearConstructors(snapConstructors); ! snapConstructors = makeXYZConstructors(vertex); } } --- 203,213 ---- if (showConstructors) { clearConstructors(snapConstructors); ! if (currentPlane != null && edges != null && edges.size() > 0) { ! int size = edges.size(); ! Edge lastEdge = (Edge)edges.get(size - 1); ! snapConstructors = makeInPlaneConstructors(vertex, lastEdge, currentPlane); ! } else { ! snapConstructors = makeXYZConstructors(vertex); ! } } } *************** *** 488,491 **** --- 494,498 ---- setSnapVertex(null); exterior = null; + currentPlane = null; } } *************** *** 716,719 **** --- 723,744 ---- } } + + /* + * Should disallow you to draw out of the current plane if + * you allready have two or more edges. Thus disallowing you + * to draw non-plane surfaces. + */ + if (legal && + currentPlane != null && + edges != null && + edges.size() > 1) { + double[] planeRep = currentPlane.getDoublev(); + if (Math.abs(current.getX() * planeRep[0] + + current.getY() * planeRep[1] + + current.getZ() * planeRep[2] + + planeRep[3]) > 0.00001) { + legal = false; + } + } return legal; } |