Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18654/src/net/sourceforge/bprocessor/model
Modified Files:
Vertex.java Selection.java
Log Message:
Refactored CameraTool into Tool + Strategy
Index: Vertex.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** Vertex.java 12 Apr 2006 14:29:27 -0000 1.34
--- Vertex.java 3 Jul 2006 14:25:07 -0000 1.35
***************
*** 126,129 ****
--- 126,137 ----
/**
+ * Return x, y, z in a double array
+ * @return Values
+ */
+ public double[] values() {
+ return new double[] {x, y, z};
+ }
+
+ /**
* returns the edges connected to this vertex
* @return The connected vertexes
Index: Selection.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Selection.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Selection.java 16 Jun 2006 09:41:37 -0000 1.9
--- Selection.java 3 Jul 2006 14:25:07 -0000 1.10
***************
*** 247,249 ****
--- 247,266 ----
return true;
}
+
+ /**
+ * Calculate center of selection
+ * @return Center
+ */
+ public Vertex center() {
+ Vertex center = null;
+ Iterator it = iterator();
+ if (it.hasNext()) {
+ Object o = it.next();
+ if (o instanceof Entity) {
+ Vertex v = ((Entity)o).center();
+ center = v;
+ }
+ }
+ return center;
+ }
}
|