Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8347/src/net/sourceforge/bprocessor/gl/tool
Modified Files:
FinalMoveTool.java
Log Message:
adjusted move tool
Index: FinalMoveTool.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** FinalMoveTool.java 20 Dec 2007 15:36:51 -0000 1.49
--- FinalMoveTool.java 28 Dec 2007 11:17:05 -0000 1.50
***************
*** 24,27 ****
--- 24,28 ----
import net.sourceforge.bprocessor.gl.view.View;
import net.sourceforge.bprocessor.gui.GUI;
+ import net.sourceforge.bprocessor.model.ClippingPlane;
import net.sourceforge.bprocessor.model.CoordinateSystem;
import net.sourceforge.bprocessor.model.Direction;
***************
*** 179,182 ****
--- 180,189 ----
Vertex original = originals.get(current);
current.set(original.add(delta));
+ current.update();
+ }
+ for (Geometric current : geometrics) {
+ if (current instanceof ClippingPlane) {
+ current.update();
+ }
}
}
***************
*** 187,190 ****
--- 194,198 ----
Vertex original = originals.get(current);
current.set(original);
+ current.update();
}
}
***************
*** 501,505 ****
actual.addAll(Selection.primary());
}
! activate(actual, intersection);
} else {
finish();
--- 509,515 ----
actual.addAll(Selection.primary());
}
! if (actual.size() > 0) {
! activate(actual, intersection);
! }
} else {
finish();
***************
*** 608,661 ****
*/
public void activate(Collection<? extends Geometric> geoms, Intersection intersection) {
! current = intersection;
start = current;
geometrics = (Collection<Geometric>)geoms;
owner = Project.getInstance().getActiveSpace();
- for (Geometric current : geometrics) {
- if (current.getOwner() != owner) {
- GUI.getInstance().alert("All objects must belong to active space");
- cleanUp();
- return;
- }
- }
- if (!geometrics.isEmpty()) {
- if (copy) {
- mesh = new Mesh(geometrics);
- mesh = mesh.copy(new HashMap());
- geometrics = mesh.geometrics();
- Project.getInstance().getActiveSpace().addProtected(geometrics);
- } else {
- mesh = null;
- }
! vertices = Geometry.collect(geometrics);
! mover = new VectorMove(vertices);
!
! affected = getAffected(geometrics);
!
! if (geometrics.size() == 1) {
! Geometric work = geometrics.iterator().next();
! if (work instanceof Instance) {
! Instance space = (Instance)work;
! if (space.isInstance()) {
! CoordinateSystem anchor = null;
! for (CoordinateSystem currentSystem : space.getProto().getCoordinateSystems()) {
! anchor = currentSystem;
! break;
! }
! if (anchor == null) {
! anchor = Project.getInstance().getActiveCoordinateSystem().copy();
! }
! mover = new InstanceMove(space, anchor);
! }
}
}
- updateFeedback();
- setTip(secondClickTip());
- } else {
- geometrics = null;
}
}
}
--- 618,658 ----
*/
public void activate(Collection<? extends Geometric> geoms, Intersection intersection) {
! current = intersection.copy();
start = current;
geometrics = (Collection<Geometric>)geoms;
owner = Project.getInstance().getActiveSpace();
+ if (copy) {
+ mesh = new Mesh(geometrics);
+ mesh = mesh.copy(new HashMap());
+ geometrics = mesh.geometrics();
+ Project.getInstance().getActiveSpace().addProtected(geometrics);
+ } else {
+ mesh = null;
+ }
! vertices = Geometry.collect(geometrics);
! mover = new VectorMove(vertices);
!
! affected = getAffected(geometrics);
!
! if (geometrics.size() == 1) {
! Geometric work = geometrics.iterator().next();
! if (work instanceof Instance) {
! Instance space = (Instance)work;
! CoordinateSystem anchor = null;
! for (CoordinateSystem currentSystem : space.getProto().getCoordinateSystems()) {
! anchor = currentSystem;
! break;
}
+ if (anchor == null) {
+ anchor = Project.getInstance().getActiveCoordinateSystem().copy();
+ }
+ mover = new InstanceMove(space, anchor);
}
}
+ updateFeedback();
+ setTip(secondClickTip());
}
}
|