X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Fscenegraph%2FGeometryComponent.java;h=6c6c1b66a7f555b4097197a6473c6312b258abce;hb=b93886889422a3111b05a6944b3bcb2cdd8c416a;hp=9b2b750fde45a5a812f90eac25e2f47ea030cc07;hpb=84132a1d750c45f9161afbd58b78572964e50d26;p=simantics%2F3d.git diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/GeometryComponent.java b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/GeometryComponent.java index 9b2b750f..6c6c1b66 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/GeometryComponent.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/GeometryComponent.java @@ -42,8 +42,8 @@ public class GeometryComponent { private GeometryProvider geometryProvider; public GeometryComponent() { - currentParameters = new HashMap(); - calculatedParameters = new HashMap(); + currentParameters = new HashMap<>(); + calculatedParameters = new HashMap<>(); } public void visualize(VtkView panel) { @@ -117,6 +117,13 @@ public class GeometryComponent { return calculatedParameters; } + public Map getTotalParameters() { + Map params = new HashMap<>(); + params.putAll(currentParameters); + params.putAll(calculatedParameters); + return params; + } + public void setParametersUpdated(boolean parametersUpdated) { this.parametersUpdated = parametersUpdated; } @@ -128,6 +135,9 @@ public class GeometryComponent { Object newValue = parameters.get(id); if (currentValue == newValue) continue; + if (newValue == null) { + continue; + } if (currentValue instanceof Double) { if (Math.abs((Double)currentValue-(Double)newValue) < MathTools.NEAR_ZERO) continue;