}
public boolean isVariableAngle() {
- return !controlPoint.isFixed();
- }
+ return !controlPoint.isFixed();
+ }
@Override
public void updateParameters() {
- super.updateParameters();
- if (!isVariableAngle()) {
- Map<String,Object> calculated = getCalculatedParameters();
- if (calculated.containsKey("length")) {
- controlPoint.setLength((Double)calculated.get("length"));
- }
- }
+ super.updateParameters();
+ if (!isVariableAngle()) {
+ Map<String,Object> calculated = getCalculatedParameters();
+ if (calculated.containsKey("length")) {
+ controlPoint.setLength((Double)calculated.get("length"));
+ }
+ PipingRules.requestUpdate(getControlPoint());
+ }
}
@RelatedGetValue(Plant3D.URIs.HasTurnAngle)
@RelatedSetValue(Plant3D.URIs.HasTurnAngle)
public void setTurnAngle(Double a) {
- if (!getControlPoint().isFixed())
- return;
- getControlPoint().setTurnAngle(a);
+ if (!getControlPoint().isFixed())
+ return;
+ getControlPoint().setTurnAngle(a);
}
@GetPropertyValue(name="Turn Angle", value="turn angle", tabId = "Default")
}
@RelatedGetValue(Plant3D.URIs.HasRotationAngle)
- @GetPropertyValue(name="Rotation Angle", value=Plant3D.URIs.HasRotationAngle, tabId = "Default")
- public Double getRotationAngle() {
- if (!controlPoint.isFixed())
- return null;
- Double d = controlPoint.getRotationAngle();
- if (d == null)
- return 0.0;
- return MathTools.radToDeg(d);
- }
- @RelatedSetValue(Plant3D.URIs.HasRotationAngle)
- @SetPropertyValue(value=Plant3D.URIs.HasRotationAngle)
- public void setRotationAngle(Double angle) {
- if (!controlPoint.isFixed())
- return;
-
- if (angle == null || Double.isInfinite(angle) || Double.isNaN(angle)) {
- return;
- }
- angle = MathTools.degToRad(angle);
- if (controlPoint.getRotationAngle() != null && Math.abs(controlPoint.getRotationAngle()-angle) < MathTools.NEAR_ZERO)
- return;
- controlPoint.setRotationAngle(angle);
- try {
- PipingRules.requestUpdate(getControlPoint());
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
+ @GetPropertyValue(name="Rotation Angle", value=Plant3D.URIs.HasRotationAngle, tabId = "Default")
+ public Double getRotationAngle() {
+ if (!controlPoint.isFixed())
+ return null;
+ Double d = controlPoint.getRotationAngle();
+ if (d == null)
+ return 0.0;
+ return MathTools.radToDeg(d);
+ }
+ @RelatedSetValue(Plant3D.URIs.HasRotationAngle)
+ @SetPropertyValue(value=Plant3D.URIs.HasRotationAngle)
+ public void setRotationAngle(Double angle) {
+ if (!controlPoint.isFixed())
+ return;
+
+ if (angle == null || Double.isInfinite(angle) || Double.isNaN(angle)) {
+ return;
+ }
+ angle = MathTools.degToRad(angle);
+ if (controlPoint.getRotationAngle() != null && Math.abs(controlPoint.getRotationAngle()-angle) < MathTools.NEAR_ZERO)
+ return;
+ controlPoint.setRotationAngle(angle);
+ try {
+ PipingRules.requestUpdate(getControlPoint());
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ @RelatedGetValue(Plant3D.URIs.IsReversed)
+ @GetPropertyValue(name="Reverse", value=Plant3D.URIs.IsReversed, tabId = "Default")
+ public Boolean isReversed() {
+ if (!controlPoint.isFixed())
+ return null;
+ Boolean d = controlPoint._getReversed();
+ return d;
+ }
+ @RelatedSetValue(Plant3D.URIs.IsReversed)
+ //@SetPropertyValue(value=Plant3D.URIs.IsReversed)
+ public void setReversed(Boolean reverse) {
+ if (!controlPoint.isFixed())
+ return;
+
+ if (reverse == null) {
+ return;
+ }
+ controlPoint.setReversed(reverse);
+ try {
+ PipingRules.requestUpdate(getControlPoint());
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
@Override
protected double[] getColor() {