X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Fscenegraph%2FGeometryComponent.java;h=a25bd4ef63523e11f27a85a7f3b8cd7b5583899a;hb=a3d63f1ba39c56c2b0236932965b9712654fad12;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..a25bd4ef 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/GeometryComponent.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/GeometryComponent.java @@ -7,6 +7,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import org.jcae.opencascade.jni.TopoDS_Shape; @@ -42,8 +43,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 +118,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; } @@ -126,8 +134,11 @@ public class GeometryComponent { for (String id : parameters.keySet()) { Object currentValue = currentParameters.get(id); Object newValue = parameters.get(id); - if (currentValue == newValue) + if (Objects.equals(currentValue, newValue)) continue; + if (newValue == null) { + continue; + } if (currentValue instanceof Double) { if (Math.abs((Double)currentValue-(Double)newValue) < MathTools.NEAR_ZERO) continue; @@ -247,6 +258,7 @@ public class GeometryComponent { if (hover) color = new double[]{1,0,1}; for (vtkProp3D prop : solidObject.getEdges()) { + prop.SetVisibility(hover ? 1 : 0); vtkProperty property = ((vtkActor)prop).GetProperty(); property.SetColor(color); property.Delete();