Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21013/src/net/sourceforge/bprocessor/gl/tool
Modified Files:
SelectStrategy.java
Log Message:
Connected geometry
Index: SelectStrategy.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectStrategy.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** SelectStrategy.java 16 Jan 2008 15:05:41 -0000 1.27
--- SelectStrategy.java 21 Jan 2008 13:37:21 -0000 1.28
***************
*** 21,27 ****
import net.sourceforge.bprocessor.gl.view.Transformation;
import net.sourceforge.bprocessor.gl.view.View;
- import net.sourceforge.bprocessor.model.ClippingPlane;
import net.sourceforge.bprocessor.model.Command;
- import net.sourceforge.bprocessor.model.Constructor;
import net.sourceforge.bprocessor.model.Edge;
import net.sourceforge.bprocessor.model.Geometric;
--- 21,25 ----
***************
*** 322,362 ****
if (e.getClickCount() >= 2) {
if (e.getClickCount() == 2) {
! Collection<Geometric> extended = new HashSet();
! extended.addAll(Selection.primary());
! if (extended.isEmpty()) {
! //Move out one space/union level if possible
Container sp = Project.getInstance().getActiveSpace();
if (sp.getOwner() != null) {
sp.getOwner().edit();
}
}
- for (Geometric current : Selection.primary()) {
- if (current instanceof Edge) {
- Edge edge = (Edge) current;
- extended.addAll(edge.getSurfaces());
- } else if (current instanceof Surface) {
- Surface surface = (Surface) current;
- extended.addAll(surface.getEdges());
- } else if (target instanceof Container) {
- Container space = (Container) target;
- extended.clear();
- space.edit();
- break;
- } else if (target instanceof Constructor) {
- Constructor c = (Constructor)target;
- c.setActive(!c.isActive());
- } else if (target instanceof ClippingPlane) {
- ClippingPlane cp = (ClippingPlane)target;
- cp.setActive(!cp.isActive());
- } else if (target instanceof GlCamera) {
- GlCamera glcam = (GlCamera)target;
- Project.getInstance().setCurrentCamera(glcam.getCamera());
- }
- }
- Selection.primary().clear();
- Selection.primary().addAll(extended);
} else {
Collection<Geometric> geometrics =
! Geometric.connected(Selection.primary());
Selection.primary().set(geometrics);
}
--- 320,336 ----
if (e.getClickCount() >= 2) {
if (e.getClickCount() == 2) {
! if (selection.isEmpty()) {
Container sp = Project.getInstance().getActiveSpace();
if (sp.getOwner() != null) {
sp.getOwner().edit();
}
+ } else {
+ Collection<Geometric> geometrics =
+ Geometric.connected(Selection.primary(), false);
+ Selection.primary().set(geometrics);
}
} else {
Collection<Geometric> geometrics =
! Geometric.connected(Selection.primary(), true);
Selection.primary().set(geometrics);
}
|