Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv26258/src/net/sourceforge/bprocessor/gl/model
Modified Files:
SelectionPath.java
Log Message:
Index: SelectionPath.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model/SelectionPath.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** SelectionPath.java 13 Jan 2010 10:58:30 -0000 1.4
--- SelectionPath.java 26 Nov 2010 14:20:27 -0000 1.5
***************
*** 16,19 ****
--- 16,22 ----
import net.sourceforge.bprocessor.model.Geometric;
import net.sourceforge.bprocessor.model.Instance;
+ import net.sourceforge.bprocessor.model.Item;
+ import net.sourceforge.bprocessor.model.Space;
+ import net.sourceforge.bprocessor.model.Surface;
import net.sourceforge.bprocessor.model.Vertex;
***************
*** 121,123 ****
--- 124,149 ----
return translated;
}
+
+ /**
+ *
+ * @return Item
+ */
+ public Item getItem() {
+ Geometric last = getLastInPath();
+ if (last instanceof Surface) {
+ if (getFirstInPath() instanceof Instance) {
+ return (Instance) getFirstInPath();
+ } else {
+ Surface surface = (Surface) last;
+ Space front = surface.getFrontDomain();
+ Space back = surface.getBackDomain();
+ if (front.isConstructionSpace()) {
+ return front;
+ } else if (back.isConstructionSpace()) {
+ return back;
+ }
+ }
+ }
+ return null;
+ }
}
|