X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Feditor%2FPlant3DEditor.java;fp=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Feditor%2FPlant3DEditor.java;h=2dc90bdd57466abf8f3bd2c4f4bc8d9002799fe4;hb=064a7d0401dba71baae82737271620ca7bcb6bfa;hp=d3f3c5e47e11d199b838225ee16f7afa6a0fd4e0;hpb=5cd9bf2669ef6907cff73670a393af5355241f56;p=simantics%2F3d.git diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/editor/Plant3DEditor.java b/org.simantics.plant3d/src/org/simantics/plant3d/editor/Plant3DEditor.java index d3f3c5e4..2dc90bdd 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/editor/Plant3DEditor.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/editor/Plant3DEditor.java @@ -45,6 +45,7 @@ import org.simantics.plant3d.actions.AddEquipmentAction; import org.simantics.plant3d.actions.AddNozzleAction; import org.simantics.plant3d.actions.RemoveAndSplitAction; import org.simantics.plant3d.actions.RoutePipeAction; +import org.simantics.plant3d.actions.TranslateFreeVariableLengthAction; import org.simantics.plant3d.actions.TranslateInlineAction; import org.simantics.plant3d.ontology.Plant3D; import org.simantics.plant3d.scenegraph.EndComponent; @@ -90,14 +91,15 @@ public class Plant3DEditor extends ResourceEditorPart { private NodeSelectionProvider2 selectionProvider; - private vtkCameraAndSelectorAction cameraAction; - private TranslateAction translateAction; - private TranslateInlineAction translateInlineAction; - private RotateAction rotateAction; - private RemoveAction removeAction; - private RemoveAndSplitAction removeSplitAction; - private RoutePipeAction routePipeAction; - private AddComponentAction addComponentAction; + protected vtkCameraAndSelectorAction cameraAction; + protected TranslateAction translateAction; + protected TranslateInlineAction translateInlineAction; + protected TranslateFreeVariableLengthAction translateFreeVariableLengthAction; + protected RotateAction rotateAction; + protected RemoveAction removeAction; + protected RemoveAndSplitAction removeSplitAction; + protected RoutePipeAction routePipeAction; + protected AddComponentAction addComponentAction; private P3DNodeMap nodeMap; @@ -129,8 +131,6 @@ public class Plant3DEditor extends ResourceEditorPart { hookContextMenu(); createScene(); - - //component.syncPopulate(); new ContextMenuListener(panel, contextMenu); @@ -160,9 +160,7 @@ public class Plant3DEditor extends ResourceEditorPart { rootNode = (P3DRootNode)mapping.map(graph, input); // update control points. // TODO : this should be optimized. - - - + try { P3DUtil.finalizeDBLoad(rootNode); nodeMap = createNodeMap(getSession(), mapping, panel,rootNode); @@ -239,6 +237,7 @@ public class Plant3DEditor extends ResourceEditorPart { protected void createActions() { translateAction = new TranslateAction(panel,nodeMap); translateInlineAction = new TranslateInlineAction(panel, nodeMap); + translateFreeVariableLengthAction = new TranslateFreeVariableLengthAction(panel, getRootNode()); rotateAction = new RotateAction(panel,nodeMap); removeAction = new RemoveAction(nodeMap) { public void setNode(IG3DNode node) { @@ -406,7 +405,10 @@ public class Plant3DEditor extends ResourceEditorPart { } else if (node instanceof InlineComponent) { //m.add(translateInlineAction); InlineComponent component = (InlineComponent)node; - m.add(translateInlineAction); + if (component.isVariableLength()) + m.add(translateFreeVariableLengthAction); + else + m.add(translateInlineAction); m.add(routePipeAction); routePipeAction.setComponent(component); m.add(addComponentAction); @@ -421,6 +423,7 @@ public class Plant3DEditor extends ResourceEditorPart { translateAction.setNode(node); translateInlineAction.setNode(node); + translateFreeVariableLengthAction.setNode(node); rotateAction.setNode(node); removeAction.setNode(node);