[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Surface.java,1.47,1.48
Status: Pre-Alpha
Brought to you by:
henryml
From: Nordholt <nor...@us...> - 2005-11-23 13:22:02
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2669/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: new surrounds method Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** Surface.java 18 Nov 2005 12:15:44 -0000 1.47 --- Surface.java 23 Nov 2005 13:21:50 -0000 1.48 *************** *** 806,815 **** return edges.contains(e); } /** * Tells whether or not a Vertex is contained inside the surface. * @param v the vertex * @return boolean whether or not the vertex is surrounded by the surface. */ ! public boolean surrounds(Vertex v) { CoordinateSystem cs = this.coordinateSystem(); Vertex lv = cs.translate(v); --- 806,818 ---- return edges.contains(e); } + /** * Tells whether or not a Vertex is contained inside the surface. * @param v the vertex + * @param planePrecision the precision to wich the vertex must be in the same + * plane as this surface. * @return boolean whether or not the vertex is surrounded by the surface. */ ! public boolean surrounds(Vertex v, double planePrecision) { CoordinateSystem cs = this.coordinateSystem(); Vertex lv = cs.translate(v); *************** *** 818,822 **** this surface */ ! if (lv.getZ() > 0.00001) { return false; } else { --- 821,826 ---- this surface */ ! ! if (lv.getZ() > planePrecision || -lv.getZ() > planePrecision) { return false; } else { *************** *** 859,862 **** --- 863,875 ---- } } + + /** + * Tells whether or not a Vertex is contained inside the surface. + * @param v the vertex + * @return boolean whether or not the vertex is surrounded by the surface. + */ + public boolean surrounds(Vertex v) { + return surrounds(v, 0.00001); + } /** * Find the intersection point of an endge with this Surface. |