]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.g3d.csg/src/org/simantics/g3d/csg/scenegraph2/CylinderNode.java
Remove listener calls when property values not updated.
[simantics/3d.git] / org.simantics.g3d.csg / src / org / simantics / g3d / csg / scenegraph2 / CylinderNode.java
index d4a3f704d2add982080405290b20183fba024daa..cf2e0183269c280c39b1a452547985d24c578ca0 100644 (file)
@@ -1,5 +1,18 @@
+/*******************************************************************************\r
+ * Copyright (c) 2012, 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
 package org.simantics.g3d.csg.scenegraph2;\r
 \r
+import java.util.Objects;\r
+\r
 import org.jcae.opencascade.jni.TopoDS_Shape;\r
 import org.simantics.g3d.csg.ontology.CSG;\r
 import org.simantics.g3d.property.annotations.GetPropertyValue;\r
@@ -18,6 +31,8 @@ public class CylinderNode extends CSGnode {
        @RelatedSetValue(CSG.URIs.HasRadius)\r
        @SetPropertyValue(CSG.URIs.HasRadius)\r
        public void setR(double r) {\r
+               if (this.r == r)\r
+                       return;\r
                this.r = r;\r
                firePropertyChanged(CSG.URIs.HasRadius);\r
        }\r
@@ -25,6 +40,8 @@ public class CylinderNode extends CSGnode {
        @RelatedSetValue(CSG.URIs.HasHeight)\r
        @SetPropertyValue(CSG.URIs.HasHeight)\r
        public void setH(double h) {\r
+               if (this.h == h)\r
+                       return;\r
                this.h = h;\r
                firePropertyChanged(CSG.URIs.HasHeight);\r
        }\r