Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23991/src/net/sourceforge/bprocessor/model
Modified Files:
Space.java Entity.java
Log Message:
New PencilTool implements a new algorithm to find surface. Currently not incremental
Index: Space.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v
retrieving revision 1.104
retrieving revision 1.105
diff -C2 -d -r1.104 -r1.105
*** Space.java 28 Nov 2006 16:15:44 -0000 1.104
--- Space.java 30 Nov 2006 22:03:46 -0000 1.105
***************
*** 546,549 ****
--- 546,569 ----
this.constructors = constructors;
}
+
+ /**
+ * Answer with a collection of coordinatesystems in this space
+ * @return collection of coordinatesystems
+ */
+ public Collection getCoordinateSystems() {
+ Collection planes = new LinkedList();
+ {
+ Collection constructors = getConstructors();
+ Iterator iter = constructors.iterator();
+ while (iter.hasNext()) {
+ Constructor current = (Constructor) iter.next();
+ if (current instanceof CoordinateSystem) {
+ planes.add(current);
+ }
+ }
+ }
+ return planes;
+ }
+
/**
* Add a vertex
Index: Entity.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Entity.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Entity.java 6 Nov 2006 11:00:54 -0000 1.10
--- Entity.java 30 Nov 2006 22:03:46 -0000 1.11
***************
*** 9,13 ****
--- 9,16 ----
import java.io.Serializable;
import java.util.Collection;
+ import java.util.Collections;
+ import java.util.Comparator;
import java.util.Iterator;
+ import java.util.List;
/**
***************
*** 36,39 ****
--- 39,56 ----
return value;
}
+
+ /**
+ * Sort list of entities with respect to id
+ * @param entities List of entities to be sorted
+ */
+ public static void sort(List entities) {
+ final Comparator comparator =
+ new Comparator() {
+ public int compare(Object s1, Object s2) {
+ return ((Entity) s1).getId().compareTo(((Entity) s2).getId());
+ }
+ };
+ Collections.sort(entities, comparator);
+ }
/**
|