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=3f17b6e42935927f12683fc26ecd5808bf66cde6;hp=a11f912d1609230e34bccf1246fac5dc178d44f1;hpb=86739231beb0535bde4abae49d2011e3a042810b;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 a11f912d..6c6c1b66 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/GeometryComponent.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/GeometryComponent.java @@ -16,6 +16,7 @@ import org.simantics.g3d.scenegraph.MeshProvider; import org.simantics.g3d.scenegraph.NodeHighlighter.HighlightEventType; import org.simantics.g3d.scenegraph.ParametricGeometryProvider; import org.simantics.g3d.shape.Mesh; +import org.simantics.g3d.vtk.common.VtkView; import org.simantics.g3d.vtk.shape.MeshActor; import org.simantics.g3d.vtk.shape.vtkMeshObject; import org.simantics.opencascade.OccTriangulator; @@ -23,7 +24,6 @@ import org.simantics.opencascade.SolidModelProvider; import org.simantics.opencascade.vtk.vtkSolidObject; import vtk.vtkActor; -import vtk.vtkPanel; import vtk.vtkProp3D; import vtk.vtkProperty; @@ -42,11 +42,11 @@ public class GeometryComponent { private GeometryProvider geometryProvider; public GeometryComponent() { - currentParameters = new HashMap(); - calculatedParameters = new HashMap(); + currentParameters = new HashMap<>(); + calculatedParameters = new HashMap<>(); } - public void visualize(vtkPanel panel) { + public void visualize(VtkView panel) { if (geometryProvider != null) { updateParameters(); @@ -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; @@ -183,7 +193,7 @@ public class GeometryComponent { public void stopVisualize() { if (solidObject != null) { - solidObject.clearActorsAWT(); + solidObject.clearActorsVTK(); solidObject = null; } if (solidModel != null) { @@ -191,7 +201,7 @@ public class GeometryComponent { solidModel = null; } if (meshObject != null) { - meshObject.clearActorsAWT(); + meshObject.clearActorsVTK(); meshObject = null; } if (mesh != null)