[Bprocessor-commit] /model/src/net/sourceforge/bprocessor/model Geometry.java, 1.56, 1.57
Status: Pre-Alpha
Brought to you by:
henryml
|
From: rimestad <rim...@us...> - 2007-05-20 10:19:57
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12562/src/net/sourceforge/bprocessor/model Modified Files: Geometry.java Log Message: refactored angle from facade to Geometry Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** Geometry.java 15 May 2007 16:28:09 -0000 1.56 --- Geometry.java 20 May 2007 10:19:41 -0000 1.57 *************** *** 866,870 **** /** * Replaces a list of edges with a new edge. The list of edges are assummed ! * to be a connected sequence of parrallel edges, that all longs to one * set of surfaces. The new edge will replace the sequence of edges in all of * the surfaces that the sequence belonged to. --- 866,870 ---- /** * Replaces a list of edges with a new edge. The list of edges are assummed ! * to be a connected sequence of parrallel edges, that all belongs to one * set of surfaces. The new edge will replace the sequence of edges in all of * the surfaces that the sequence belonged to. *************** *** 953,957 **** public static void assignSame(Surface s1, Surface s2, Space sp1, Space sp2) { if (s1.getFrontDomain() == sp1) { ! if (s1.normal().dot(s2.normal()) > 0) { s2.setFrontDomain(sp2); } else { --- 953,959 ---- public static void assignSame(Surface s1, Surface s2, Space sp1, Space sp2) { if (s1.getFrontDomain() == sp1) { ! Vertex n1 = s1.normal(); ! Vertex n2 = s2.normal(); ! if (n1.dot(n2) > 0) { s2.setFrontDomain(sp2); } else { *************** *** 959,968 **** } } else if (s1.getBackDomain() == sp1) { ! if (s1.normal().dot(s2.normal()) > 0) { s2.setBackDomain(sp2); } else { s2.setFrontDomain(sp2); } ! } } --- 961,974 ---- } } else if (s1.getBackDomain() == sp1) { ! Vertex n1 = s1.normal(); ! Vertex n2 = s2.normal(); ! if (n1.dot(n2) > 0) { s2.setBackDomain(sp2); } else { s2.setFrontDomain(sp2); } ! } else { ! log.warn(s1 + " werent assigned " + sp1 + " at all"); ! } } *************** *** 974,978 **** * @param system the coordinate system to untranslate according to */ ! public static void unTranslateGeometry(Set geometry, CoordinateSystem system) { List<Vertex> vertices = new LinkedList<Vertex>(collect(geometry)); List<Vertex> unTranslatedVertices = system.unTranslate(vertices); --- 980,984 ---- * @param system the coordinate system to untranslate according to */ ! public static void unTranslateGeometry(Collection geometry, CoordinateSystem system) { List<Vertex> vertices = new LinkedList<Vertex>(collect(geometry)); List<Vertex> unTranslatedVertices = system.unTranslate(vertices); *************** *** 989,998 **** /** ! * @param geometry the geometry to copy ! * @return A copy of the geometry */ ! public static Collection<Geometric> copy(Collection<? extends Geometric> geometry) { ! //TODO implement the method ! return null; ! } } --- 995,1013 ---- /** ! * Find the angle between two edges, where both edges are treated as if they pointed ! * away from each other ! * @param e1 the first edge ! * @param e2 the second edge ! * @return the angle between the edges in radian */ ! public static double angle(Edge e1, Edge e2) { ! double angle = Double.NaN; ! Vertex common = Edge.commonVertex(e1, e2); ! if (common != null) { ! Vertex dir1 = e1.otherVertex(common).minus(common); ! Vertex dir2 = e2.otherVertex(common).minus(common); ! angle = dir1.angle(dir2); ! } ! return angle; ! } } |