- pipeRun.addChild(newComponent);
- // TODO: these options are not stored into DB. Should they?!
- if (newComponent instanceof InlineComponent && ((InlineComponent)newComponent).isVariableLength()) {
- newPcp.setLength(inst.length);
- } else if (newComponent instanceof TurnComponent && ((TurnComponent)newComponent).isVariableAngle()) {
- newPcp.setTurnAngle(inst.angle);
- }
-
- newComponent.updateParameters();
+ pipeRun.addChild(newComponent);
+ if (newPcp.isSizeChange())
+ newComponent.setAlternativePipeRun(pipeRun);
+
+ if (newComponent instanceof InlineComponent) {
+ InlineComponent inlineComponent = (InlineComponent)newComponent;
+ if (inlineComponent.isVariableLength()|| inlineComponent.isModifialble()) {
+ newPcp.setLength(inst.length);
+ newComponent.setParameter("length", inst.length);
+ }
+ if (inst.rotationAngle != null)
+ ((InlineComponent) newComponent).setRotationAngle(inst.rotationAngle);
+ } else if (newComponent instanceof TurnComponent) {
+ TurnComponent turnComponent = (TurnComponent)newComponent;
+ if (turnComponent.isVariableAngle()) {
+ newPcp.setTurnAngle(Math.toRadians(inst.angle));
+ newComponent.setParameter("turnAngle", inst.angle);
+ }
+ if (inst.rotationAngle != null)
+ ((TurnComponent) newComponent).setRotationAngle(inst.rotationAngle);
+ }
+
+ newComponent.updateParameters();
+
+ Vector3d v = new Vector3d(dir);
+ if (insertAdjustable) {
+ // Prevent moving of adjacent components - always insert at end of a connected variable length component
+ if (position == PositionType.NEXT && component.getNext() != null ||
+ position == PositionType.PREVIOUS && component.getPrevious() != null)
+ insertPosition = PositionType.PREVIOUS;