import javax.vecmath.Tuple3d;
import javax.vecmath.Vector3d;
+import org.simantics.db.Resource;
import org.simantics.g3d.math.MathTools;
import org.simantics.g3d.math.Ray;
import org.simantics.g3d.scenegraph.NodeMap;
private SplitPointSelectionGizmo splitPointSelectionGizmo;
private ConstraintPointGizmo constraintPointGizmo;
private TerminalSelectionGizmo terminalSelectionGizmo;
- private NodeMap<vtkProp,INode> nodeMap;
+ private NodeMap<Resource,vtkProp,INode> nodeMap;
private enum ToolState{NOT_ACTIVE, INITIALIZING, SELECTING_POSITION, SELECTING_SPLIT, ROUTING};
private ToolState state = ToolState.NOT_ACTIVE;
public void deattach() {
deactivate();
startComponent = null;
- nodeMap.commit("Route pipe");
+
deattachUI();
super.deattach();
panel.refresh();
state = ToolState.SELECTING_SPLIT;
}
public void deactivate() {
- for (PipelineComponent component : added) {
- component.getControlPoint().setDeletable(true);
- }
+ if (added.size() > 0) {
+ for (PipelineComponent component : added) {
+ component.getControlPoint().setDeletable(true);
+ }
+
+ for (PipelineComponent comp : added) {
+ PipingRules.requestUpdate(comp.getControlPoint());
+ }
+ try {
+ PipingRules.update();
+ nodeMap.commit("Route pipe");
+ } catch (Exception e) {
+ ExceptionUtils.logAndShowError(e);
+ }
+ added.clear();
+ }
- added.clear();
startComponent.getControlPoint().setDeletable(startRemovable);
direction = null;