P3D.OffsetComponent<R P3D.PipelineComponentTag
L0.HasDescription "Component that offsets the center of piperun." : L0.String
P3D.RotateComponent<R P3D.PipelineComponentTag
- L0.HasDescription "Inline Component that can be rotated around pipe axis." : L0.String
+ L0.HasDescription "Inline Component that can be rotated around pipe axis." : L0.String
+P3D.ReverseComponent<R P3D.PipelineComponentTag
+ L0.HasDescription "Inline Component that can be reversed (rotated 180 deg)" : L0.String
P3D.CodeComponent <T P3D.PipelineComponentTag
L0.HasDescription "Component that cannot be added directly by user" : L0.String
P3D.NonVisibleComponent <R P3D.PipelineComponentTag
}
}
+ @RelatedGetValue(Plant3D.URIs.IsReversed)
+ @GetPropertyValue(name="Reverse", value=Plant3D.URIs.IsReversed, tabId = "Default")
+ public Boolean isReversed() {
+ if (!controlPoint.isReverse())
+ return null;
+ Boolean d = controlPoint.getReversed();
+ if (d == null)
+ return false;
+ return d;
+ }
+ @RelatedSetValue(Plant3D.URIs.IsReversed)
+ @SetPropertyValue(value=Plant3D.URIs.IsReversed)
+ public void setReverse(Boolean reverse) {
+ if (!controlPoint.isReverse())
+ return;
+
+ if (reverse == null) {
+ return;
+ }
+ controlPoint.setReversed(reverse);
+ try {
+ PipingRules.requestUpdate(getControlPoint());
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
@Override
public void updateParameters() {
super.updateParameters();
private Type type;
private boolean fixed = true;
private boolean rotate = false;
+ private boolean reverse = false;
private boolean deletable = true;
private boolean sub = false;
return rotate;
}
-
public void setRotate(boolean rotate) {
this.rotate = rotate;
}
+ @GetPropertyValue(name="Reverse",tabId="Debug",value="reverse")
+ public boolean isReverse() {
+ return reverse;
+ }
+
+ public void setReverse(boolean reverse) {
+ this.reverse = reverse;
+ }
+
public void setSub(boolean sub) {
this.sub = sub;
}
private Double offset;
private Double rotationAngle;
+ private Boolean reversed;
@GetPropertyValue(name="Length",tabId="Debug",value="length")
public double getLength() {
return rotationAngle;
}
+ @GetPropertyValue(name="Reversed",tabId="Debug",value="reversed")
+ public Boolean getReversed() {
+ return reversed;
+ }
+
public void setTurnAngle(Double turnAngle) {
if (Double.isInfinite(turnAngle) || Double.isNaN(turnAngle)) {
return;
firePropertyChanged("rotationAngle");
}
+ public void setReversed(Boolean reversed) {
+ this.reversed = reversed;
+ firePropertyChanged("rotationAngle");
+ }
+
public Vector3d getSizeChangeOffsetVector(Vector3d dir) {
Quat4d q;
if (rotationAngle == null)
return type.name();
}
- public Quat4d getControlPointOrientationQuat(double angle) {
+ public Quat4d getControlPointOrientationQuat(double angle) {
if (turnAxis == null) {
Vector3d dir = getPathLegDirection(Direction.NEXT);
dir.normalize();
return getControlPointOrientationQuat(dir, turnAxis, angle);
}
- }
+ }
+
+ public Quat4d getControlPointOrientationQuat(double angle, boolean reversed) {
+
+ if (turnAxis == null) {
+ Vector3d dir = getPathLegDirection(Direction.NEXT);
+ if (dir.lengthSquared() > MathTools.NEAR_ZERO)
+ dir.normalize();
+ Quat4d q = getControlPointOrientationQuat(dir, angle);
+ if (reversed) {
+ Quat4d q2 = new Quat4d();
+ q2.set(new AxisAngle4d(MathTools.Y_AXIS, Math.PI));
+ q.mulInverse(q2);
+ }
+ return q;
+ } else {
+ Vector3d dir = getPathLegDirection(Direction.PREVIOUS);
+ dir.negate();
+ if (dir.lengthSquared() > MathTools.NEAR_ZERO)
+ dir.normalize();
+ return getControlPointOrientationQuat(dir, turnAxis, angle);
+ }
+ }
- public static Quat4d getControlPointOrientationQuat(Vector3d dir, double angle) {
+ public static Quat4d getControlPointOrientationQuat(Vector3d dir, double angle) {
if (dir.lengthSquared() < MathTools.NEAR_ZERO)
return MathTools.getIdentityQuat();