Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6852/src/net/sourceforge/bprocessor/model
Modified Files:
Surface.java Geometry.java Camera.java
Log Message:
Fixed small issues
Index: Surface.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -d -r1.57 -r1.58
*** Surface.java 19 Dec 2005 19:37:54 -0000 1.57
--- Surface.java 20 Dec 2005 12:23:14 -0000 1.58
***************
*** 228,231 ****
--- 228,245 ----
/**
+ * Reverse the order of the edges thereby flipping
+ * front and back of this Surface.
+ */
+ void flip() {
+ List lst = new ArrayList(edges.size());
+ Edge[] edges = new Edge[getEdges().size()];
+ getEdges().toArray(edges);
+ for (int i = 0; i < edges.length; i++) {
+ lst.add(edges[edges.length - i - 1]);
+ }
+ setEdges(lst);
+ }
+
+ /**
* Replace the edge with the edges
* @param edge The original edge
Index: Camera.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Camera.java 19 Dec 2005 07:50:06 -0000 1.5
--- Camera.java 20 Dec 2005 12:23:14 -0000 1.6
***************
*** 56,60 ****
if (type == VIEW_3D) {
res = new Camera("3d", new double[]{0, 0, 0},
! new double[]{20, 5, 5},
new double[] {0, 0, 1});
} else if (type == VIEW_XZ) {
--- 56,60 ----
if (type == VIEW_3D) {
res = new Camera("3d", new double[]{0, 0, 0},
! new double[]{22, 19, 22},
new double[] {0, 0, 1});
} else if (type == VIEW_XZ) {
***************
*** 334,336 ****
--- 334,349 ----
forward.getY(), forward.getZ(), c.roll, new double[] {0, 0, 0});
}
+
+ /**
+ * Print camera
+ * @return String
+ */
+ public String toString() {
+ String s = getName()
+ + "[("
+ + camera[0] + ", " + camera[1] + ", " + camera[2] + ",) -> ("
+ + center[0] + ", " + center[1] + ", " + center[2] + ",) ^ ("
+ + roll[0] + ", " + roll[1] + ", " + roll[2] + "]";
+ return s;
+ }
}
Index: Geometry.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Geometry.java 19 Dec 2005 07:50:06 -0000 1.7
--- Geometry.java 20 Dec 2005 12:23:14 -0000 1.8
***************
*** 202,205 ****
--- 202,207 ----
private static void findSurfaces(VertexNode vertex, EdgeNode last, List edges, Surface exterior) {
int count = 0;
+ List surfaces = new LinkedList();
+
{
Surface clockwise = clockwiseSurface(vertex, last, edges);
***************
*** 207,210 ****
--- 209,213 ----
if (clockwise.angle(vertex.system()) < 0) {
Project.getInstance().intern(clockwise);
+ surfaces.add(clockwise);
count++;
}
***************
*** 216,219 ****
--- 219,223 ----
if (counterclockwise.angle(vertex.system()) > 0) {
Project.getInstance().intern(counterclockwise);
+ surfaces.add(counterclockwise);
count++;
}
***************
*** 222,225 ****
--- 226,243 ----
if (exterior != null) {
if (count == 2) {
+ Iterator iter = surfaces.iterator();
+ Vertex normal = exterior.normal();
+ normal.scale(1 / normal.length());
+ while (iter.hasNext()) {
+ Surface current = (Surface) iter.next();
+ Vertex n = current.normal();
+ n.scale(1 / n.length());
+ Vertex o = n.add(normal);
+ if (o.isZero()) {
+ current.flip();
+ }
+ current.setBackDomain(exterior.getBackDomain());
+ current.setFrontDomain(exterior.getFrontDomain());
+ }
Project.getInstance().remove(exterior);
}
|