[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Grid.java, 1.11, 1.12 Space.java, 1.
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2009-09-23 07:50:35
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27060/src/net/sourceforge/bprocessor/model Modified Files: Grid.java Space.java Log Message: Grid Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.245 retrieving revision 1.246 diff -C2 -d -r1.245 -r1.246 *** Space.java 21 Sep 2009 11:00:46 -0000 1.245 --- Space.java 23 Sep 2009 07:50:21 -0000 1.246 *************** *** 1593,1596 **** --- 1593,1598 ---- */ public void orient(Surface leader) { + + if (leader.getFrontDomain() == this) { leader.flip(); *************** *** 1598,1601 **** --- 1600,1606 ---- List<Surface> envelope = new LinkedList(getEnvelope()); + + + Command.Inverse inv = new Command.Inverse(envelope); Set<Surface> mark = new HashSet(); Index: Grid.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Grid.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Grid.java 18 Sep 2009 10:16:21 -0000 1.11 --- Grid.java 23 Sep 2009 07:50:21 -0000 1.12 *************** *** 18,21 **** --- 18,22 ---- private double height; private double distance; + private int subdivisions; /** *************** *** 28,31 **** --- 29,33 ---- width = 12 * distance; height = 8 * distance; + subdivisions = 2; } *************** *** 90,93 **** --- 92,96 ---- attributes.add(new Attribute("Height", new Double(height))); attributes.add(new Attribute("Distance", new Double(distance))); + attributes.add(new Attribute("Subdivisions", new Integer(subdivisions))); return attributes; } *************** *** 102,148 **** } else if (current.getName().equals("Distance")) { distance = (Double)(current.getValue()); } } } - - - /** - * - * @return lines - */ - public Collection<Line> lines() { - - double size = getWidth(); - double delta = getDistance(); - CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); - Vertex origin = system.getOrigin(); - Vertex v = system.getI(); - Vertex u = system.getJ(); - int n = (int) Math.round((size / 2) / delta); - - Collection<Line> lines = new LinkedList(); - - for (int i = 0; i < n; i++) { - Vertex o = origin.add(u.scale(i * delta)); - Line line = new Line(o, v); - lines.add(line); - } - for (int i = 1; i < n; i++) { - Vertex o = origin.add(u.scale(-i * delta)); - Line line = new Line(o, v); - lines.add(line); - } - for (int i = 0; i < n; i++) { - Vertex o = origin.add(v.scale(i * delta)); - Line line = new Line(o, u); - lines.add(line); - } - for (int i = 1; i < n; i++) { - Vertex o = origin.add(v.scale(-i * delta)); - Line line = new Line(o, u); - lines.add(line); - } - return lines; - } /** --- 105,113 ---- } else if (current.getName().equals("Distance")) { distance = (Double)(current.getValue()); + } else if (current.getName().equals("Subdivisions")) { + subdivisions = (Integer)(current.getValue()); } } } /** *************** *** 151,159 **** public Collection<Edge> guides(double length) { Collection<Edge> guides = super.guides(length); - Collection<Line> lines = lines(); - for (Line line : lines) { - Edge edge = line.edge(length); - guides.add(edge); - } return guides; } --- 116,119 ---- *************** *** 181,184 **** --- 141,157 ---- Edge edge = new Edge(from, to); guides.add(edge); + if (subdivisions > 1 && (k < n)) { + { + Vertex f = from.copy(); + double e = d / subdivisions; + for (int s = 0; s < (subdivisions - 1); s++) { + f = f.add(i.scale(e)); + Vertex t = f.add(j.scale(h)); + Edge l = new Edge(f, t); + l.setStrippled(true); + guides.add(l); + } + } + } from = from.add(i.scale(d)); } *************** *** 188,191 **** --- 161,180 ---- Edge edge = new Edge(from, to); guides.add(edge); + + if (subdivisions > 1 && (k < m)) { + { + Vertex f = from.copy(); + double e = d / subdivisions; + for (int s = 0; s < (subdivisions - 1); s++) { + f = f.add(j.scale(e)); + Vertex t = f.add(i.scale(w)); + Edge l = new Edge(f, t); + l.setStrippled(true); + guides.add(l); + } + } + } + + from = from.add(j.scale(d)); } |