]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/P3DRootNode.java
Use unique names at the model scope instead of pipe run
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / scenegraph / P3DRootNode.java
index 7a5ce551a7c317c16df776455125398213378934..93f4ecf27d4be74d4e67ade02c20a983a884eda1 100644 (file)
@@ -141,6 +141,10 @@ public class P3DRootNode extends ParentNode<INode> implements IG3DNode, NodeMapP
                throw new NodeException("Cannot set root node orientation");
        }
        
+       /**
+        * Get a unique name in the Plant3D model with a given prefix followed by
+        * an underscore and number.
+        */
        public String getUniqueName(String prefix) {
                Set<String> names = new HashSet<String>();
                for (INode node : getChild()) {
@@ -148,6 +152,8 @@ public class P3DRootNode extends ParentNode<INode> implements IG3DNode, NodeMapP
                                continue;
                        IP3DVisualNode n = (IP3DVisualNode)node;
                        names.add(n.getName());
+                       if (node instanceof P3DParentNode)
+                               ((P3DParentNode<?>) node).getComponentNames(names);
                }
                int i = 1;
                while (true) {