Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11932/src/net/sourceforge/bprocessor/gl/view
Modified Files:
View.java
Log Message:
Hit-detection improved
Index: View.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v
retrieving revision 1.173
retrieving revision 1.174
diff -C2 -d -r1.173 -r1.174
*** View.java 24 Jan 2007 22:42:58 -0000 1.173
--- View.java 25 Jan 2007 10:20:52 -0000 1.174
***************
*** 924,937 ****
invisibles = new HashSet();
highligts = new HashSet();
{
! Iterator iter = selection.iterator();
! while (iter.hasNext()) {
! Object object = iter.next();
if (object instanceof Space) {
Space space = (Space) object;
! Collection envelope = space.getEnvelope();
! Iterator i = envelope.iterator();
! while (i.hasNext()) {
! Surface surface = (Surface) i.next();
highligts.addAll(surface.getEdges());
invisibles.add(surface);
--- 924,934 ----
invisibles = new HashSet();
highligts = new HashSet();
+
{
! for (Geometric object : (Collection<Geometric>) selection) {
if (object instanceof Space) {
Space space = (Space) object;
! Collection<Surface> envelope = space.getEnvelope();
! for (Surface surface : envelope) {
highligts.addAll(surface.getEdges());
invisibles.add(surface);
***************
*** 2013,2018 ****
! Collection edges = new LinkedList();
edges.addAll(space.getEdges());
edges.addAll(tempEdges);
Collection vertices = new LinkedList();
--- 2010,2016 ----
! Collection<Edge> edges = new HashSet<Edge>();
edges.addAll(space.getEdges());
+ edges.addAll(Surface.edges(surfaces));
edges.addAll(tempEdges);
Collection vertices = new LinkedList();
***************
*** 2758,2761 ****
--- 2756,2772 ----
Object object = processSelect(unWantedEntities, mode == INTERSECTIONS, xy);
clearNames();
+
+ if (mode == View.OBJECTS) {
+ if (object instanceof Geometric) {
+ Geometric current = (Geometric) object;
+ Space active = Project.getInstance().getActiveSpace();
+ while (current != null && current.getOwner() != active) {
+ current = current.getOwner();
+ }
+ if (current != null) {
+ object = current;
+ }
+ }
+ }
return object;
}
|