Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27332/src/net/sourceforge/bprocessor/model
Modified Files:
Camera.java Selection.java
Log Message:
"View entire model" looks at selection and active space
Index: Camera.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** Camera.java 13 Jul 2006 13:31:26 -0000 1.19
--- Camera.java 28 Aug 2006 06:51:29 -0000 1.20
***************
*** 400,404 ****
*/
public void viewEntireModel(double aspect) {
! Set allVertices = Project.getInstance().world().collect();
if (!allVertices.isEmpty()) {
//Computing center and radius of the minimal bounding sphere
--- 400,412 ----
*/
public void viewEntireModel(double aspect) {
! Set allVertices;
!
! if (Selection.primary().isEmpty()) {
! Space space = Project.getInstance().getActiveSpace();
! allVertices = space.collect();
! } else {
! allVertices = Selection.primary().collect();
! }
!
if (!allVertices.isEmpty()) {
//Computing center and radius of the minimal bounding sphere
Index: Selection.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Selection.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Selection.java 28 Aug 2006 05:53:58 -0000 1.13
--- Selection.java 28 Aug 2006 06:51:29 -0000 1.14
***************
*** 269,272 ****
--- 269,286 ----
/**
+ *
+ * @return Collection of Vertex
+ */
+ public Set collect() {
+ Set vertices = new HashSet();
+ Iterator iter = iterator();
+ while (iter.hasNext()) {
+ Geometric current = (Geometric) iter.next();
+ vertices.addAll(current.collect());
+ }
+ return vertices;
+ }
+
+ /**
* @return String
*/
|