[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool AbstractPencil.java, 1.36, 1.37
Status: Pre-Alpha
Brought to you by:
henryml
From: Nordholt <nor...@us...> - 2006-07-10 15:29:27
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28763 Modified Files: AbstractPencil.java Log Message: fixed so a edge cannot be inserted if both vertices are the same Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** AbstractPencil.java 9 Jul 2006 16:22:19 -0000 1.36 --- AbstractPencil.java 10 Jul 2006 15:29:23 -0000 1.37 *************** *** 197,202 **** public Edge insertEdge(Edge edge, boolean split) { Edge actual = edge; ! edge.setFrom(insertVertex(edge.getFrom(), split)); ! edge.setTo(insertVertex(edge.getTo(), split)); { Collection edges = mesh().getEdges(); --- 197,208 ---- public Edge insertEdge(Edge edge, boolean split) { Edge actual = edge; ! Vertex from = insertVertex(edge.getFrom(), split); ! Vertex to = insertVertex(edge.getTo(), split); ! if (from == to) { ! log.error("Cannot insert edge: " + edge + " to and from vertices are the same"); ! return null; ! } ! edge.setFrom(from); ! edge.setTo(to); { Collection edges = mesh().getEdges(); *************** *** 234,238 **** while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! actual.add(insertEdge(current, false)); } Surface surface = new Surface(actual); --- 240,249 ---- while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! Edge edge = insertEdge(current, false); ! if (edge != null) { ! actual.add(edge); ! } else { ! return; ! } } Surface surface = new Surface(actual); *************** *** 244,248 **** while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! actual.add(insertEdge(current, true)); } Geometry.insert(actual); --- 255,264 ---- while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! Edge edge = insertEdge(current, true); ! if (edge != null) { ! actual.add(edge); ! } else { ! return; ! } } Geometry.insert(actual); |