private GeometryProvider geometryProvider;
public GeometryComponent() {
- currentParameters = new HashMap<String, Object>();
- calculatedParameters = new HashMap<String, Object>();
+ currentParameters = new HashMap<>();
+ calculatedParameters = new HashMap<>();
}
public void visualize(VtkView panel) {
return calculatedParameters;
}
+ public Map<String, Object> getTotalParameters() {
+ Map<String,Object> params = new HashMap<>();
+ params.putAll(currentParameters);
+ params.putAll(calculatedParameters);
+ return params;
+ }
+
public void setParametersUpdated(boolean parametersUpdated) {
this.parametersUpdated = parametersUpdated;
}
return component.getCalculatedParameters();
}
+
+ public Map<String, Object> getTotalParameters() {
+ return component.getTotalParameters();
+ }
+
public void setParametersUpdated(boolean parametersUpdated) {
component.setParametersUpdated(parametersUpdated);
}
public void updateParameters() {
super.updateParameters();
if (!isVariableLength()) {
- Map<String,Object> calculated = getCalculatedParameters();
+ Map<String,Object> calculated = getTotalParameters();
if (calculated.containsKey("length")) {
controlPoint.setLength((Double)calculated.get("length"));
}
} else {
componentCalculatedOffset = false;
}
+ PipingRules.requestUpdate(getControlPoint());
}
}
public Map<String, Object> updateParameterMap() {
Map<String,Object> map = new HashMap<String, Object>();
if (controlPoint != null) {
- if (!Double.isNaN(controlPoint.getLength()))
+ if (!Double.isNaN(controlPoint.getLength()) && controlPoint.isVariableLength())
map.put("length", controlPoint.getLength());
if (controlPoint.isDualInline()) {
PipeControlPoint sub = controlPoint.getSubPoint().get(0);
@Override
@CompoundRelatedGetValue(objRelation=Plant3D.URIs.hasParameter,objType=Plant3D.URIs.Parameter,valRelation=Plant3D.URIs.hasParameterValue)
- @CompoundGetPropertyValue(name="Parameters",tabId="Parameters",value="parameters")
public Map<String, Object> getParameterMap() {
return super.getParameterMap();
}
// TODO : how to filter parameters that are calculated by geometry provider?
Map<String,Object> map = new HashMap<String, Object>(getParameterMap());
map.remove("radius");
+ map.remove("radius2");
+ map.remove("offset");
return map;
}
if (next == comp) {
next = null;
syncnext = false;
+ if (DEBUG) System.out.println(this + " remove next " + comp);
firePropertyChanged(Plant3D.URIs.HasNext);
syncNext();
} else if (previous == comp) {
previous = null;
syncprev = false;
+ if (DEBUG) System.out.println(this + " remove prev " + comp);
firePropertyChanged(Plant3D.URIs.HasPrevious);
syncPrevious();
} else if (branch0 == comp) {
branch0 = null;
syncbr0 = false;
+ if (DEBUG) System.out.println(this + " remove br0 " + comp);
firePropertyChanged(Plant3D.URIs.HasBranch0);
syncBranch0();
}
if (calculated.containsKey("length")) {
controlPoint.setLength((Double)calculated.get("length"));
}
+ PipingRules.requestUpdate(getControlPoint());
}
}