Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6186/src/net/sourceforge/bprocessor/model
Modified Files:
CoordinateSystem.java Edge.java
Log Message:
Created a alternative offset that follows connected edges and (when alt is pressed) and a version that connects the edgelist if disconected and offset that, afterwards the connecting edge is removed from the extrusion. Modified isinXYplane to make use of plane and work :-)
Index: Edge.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v
retrieving revision 1.96
retrieving revision 1.97
diff -C2 -d -r1.96 -r1.97
*** Edge.java 27 Sep 2007 10:50:13 -0000 1.96
--- Edge.java 5 Oct 2007 13:30:49 -0000 1.97
***************
*** 885,889 ****
*/
public static List<Edge> offset(Collection<Edge> which, Surface inner, double offset) {
! return offset(which, inner.coordinateSystem(), offset, null);
}
--- 885,889 ----
*/
public static List<Edge> offset(Collection<Edge> which, Surface inner, double offset) {
! return offset(which, inner.coordinateSystem(), offset, null, null);
}
***************
*** 899,903 ****
*/
public static List<Edge> offset(Collection<Edge> which, CoordinateSystem inner, double offset) {
! return offset(which, inner, offset, null);
}
--- 899,903 ----
*/
public static List<Edge> offset(Collection<Edge> which, CoordinateSystem inner, double offset) {
! return offset(which, inner, offset, null, null);
}
***************
*** 909,916 ****
* @param offset The offset size
* @param directions The movement directions send a empty list to retrieve direction map
* @return The generated list of Edges
*/
public static List<Edge> offset(Collection<Edge> which, CoordinateSystem inner,
! double offset, Map<Vertex, Direction> directions) {
HashSet<Edge> edges = new HashSet<Edge>(which);
ArrayList<Edge> res = new ArrayList<Edge>();
--- 909,917 ----
* @param offset The offset size
* @param directions The movement directions send a empty list to retrieve direction map
+ * @param e2e Pass a empty map and you will get a map from old to offset edges
* @return The generated list of Edges
*/
public static List<Edge> offset(Collection<Edge> which, CoordinateSystem inner,
! double offset, Map<Vertex, Direction> directions, Map<Edge, Edge> e2e) {
HashSet<Edge> edges = new HashSet<Edge>(which);
ArrayList<Edge> res = new ArrayList<Edge>();
***************
*** 918,921 ****
--- 919,925 ----
directions = new HashMap<Vertex, Direction>();
}
+ if (e2e == null) {
+ e2e = new HashMap<Edge, Edge>();
+ }
HashMap<Vertex, Edge> to2edge = new HashMap<Vertex, Edge>();
HashMap<Vertex, Edge> from2edge = new HashMap<Vertex, Edge>();
***************
*** 944,948 ****
v2v.put(to, e.getTo());
v2v.put(from, e.getFrom());
! res.add(new Edge(from, to));
}
if (prevEdge != null) {
--- 948,954 ----
v2v.put(to, e.getTo());
v2v.put(from, e.getFrom());
! Edge newE = new Edge(from, to);
! e2e.put(e, newE);
! res.add(newE);
}
if (prevEdge != null) {
***************
*** 994,998 ****
if (e2 == null) {
for (Edge connected : work.getEdges()) {
- Vertex newdirection = dir1;
if (connected != e1 && inner.isInXYPlane(connected)) {
e2 = connected;
--- 1000,1003 ----
Index: CoordinateSystem.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -d -r1.57 -r1.58
*** CoordinateSystem.java 2 Oct 2007 12:37:56 -0000 1.57
--- CoordinateSystem.java 5 Oct 2007 13:30:49 -0000 1.58
***************
*** 81,85 ****
return isInXYPlane(e.getFrom()) & isInXYPlane(e.getTo());
} else if (g instanceof Vertex) {
! return this.translate((Vertex)g).getZ() == 0.0;
} else if (g instanceof Surface) {
for (Vertex v : ((Surface)g).getVertices()) {
--- 81,85 ----
return isInXYPlane(e.getFrom()) & isInXYPlane(e.getTo());
} else if (g instanceof Vertex) {
! return this.plane().contains((Vertex)g);
} else if (g instanceof Surface) {
for (Vertex v : ((Surface)g).getVertices()) {
|