]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/GeometryComponent.java
Allow multiple radii for turns.
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / scenegraph / GeometryComponent.java
index 9b2b750fde45a5a812f90eac25e2f47ea030cc07..6c6c1b66a7f555b4097197a6473c6312b258abce 100644 (file)
@@ -42,8 +42,8 @@ public class GeometryComponent {
        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) {
@@ -117,6 +117,13 @@ public class GeometryComponent {
                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;
        }
@@ -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;