};
LockType lock = LockType.NONE;
+ boolean lockForced;
private double BRANCH_SNAP_DISTANCE = 0.05;
private double NOZZLE_SNAP_DISTANCE = 0.05;
allowed.add(PositionType.NEXT);
if (this.startComponent.getPrevious() == null && !(this.startComponent instanceof Nozzle))
allowed.add(PositionType.PREVIOUS);
- if (allowBranches && this.startComponent instanceof InlineComponent && !this.startComponent.getControlPoint().isFixed())
+ if (allowBranches && this.startComponent instanceof InlineComponent && !this.startComponent.getControlPoint().isFixedLength())
allowed.add(PositionType.SPLIT);
setEnabled(allowed.size() > 0);
}
public boolean keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ESCAPE)
panel.useDefaultAction();
- if (lock != LockType.CUSTOM) {
+ if (lock != LockType.CUSTOM || !lockForced) {
if ((e.getModifiersEx() & KeyEvent.SHIFT_DOWN_MASK) > 0) {
if (e.getKeyCode() == KeyEvent.VK_X) {
if (lock != LockType.XY && lock != LockType.XZ) {
else
setLockType(LockType.NONE, false);
}
+ if (e.getKeyCode() == KeyEvent.VK_L && direction != null) {
+ if (lock != LockType.CUSTOM)
+ setLockType(LockType.CUSTOM, false);
+ else
+ setLockType(LockType.NONE, false);
+ }
}
}
if (e.getKeyCode() == KeyEvent.VK_C) {
useDefault = !useDefault;
+ if (useDefault)
+ setInfoText("Rotating camera");
System.out.println("UseDefault " + useDefault);
}
if (startComponent instanceof Nozzle) {
direction = startComponent.getControlPoint().getDirectedControlPointDirection();
lock = LockType.CUSTOM;
+ lockForced = true;
} else if (startComponent instanceof PipelineComponent){
if (startComponent instanceof InlineComponent) {
direction = startComponent.getControlPoint().getPathLegDirection(reversed ? Direction.PREVIOUS : Direction.NEXT);
lock = LockType.CUSTOM;
+ lockForced = true;
if (((InlineComponent) startComponent).isVariableLength()) {
startWithTurn = true;
direction = null;
lock = LockType.NONE;
+ lockForced = false;
}
Vector3d v = new Vector3d();
if (!reversed) {
start.getControlPointEnds(previousPosition,v);
}
} else if (startComponent instanceof TurnComponent) {
- if (start.isFixed()) {
+ if (start.asFixedAngle()) {
direction = startComponent.getControlPoint().getPathLegDirection(reversed ? Direction.PREVIOUS : Direction.NEXT);
lock = LockType.CUSTOM;
+ lockForced = start.isFixedAngle();
} else {
direction = null;
lock = LockType.NONE;
+ lockForced = false;
}
} else if (startComponent instanceof EndComponent) {
throw new Exception("Not supported");
}
private void setLockType(LockType type, boolean force) {
- if (force || lock != LockType.CUSTOM) {
+ if (force || (lock != LockType.CUSTOM || !lockForced) ) {
lock = type;
switch (lock) {