--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\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.proconf.g3d.scenegraph;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+\r
+import org.simantics.db.Graph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.proconf.g3d.base.JmeRenderingComponent;\r
+import org.simantics.proconf.g3d.stubs.G3DNode;\r
+\r
+import com.jme.scene.Node;\r
+\r
+public class RootGraphicsNode implements IGraphicsNode {\r
+\r
+ JmeRenderingComponent component;\r
+ Resource rootNode;\r
+ private ArrayList<IGraphicsNode> children = new ArrayList<IGraphicsNode>();\r
+\r
+ \r
+ public RootGraphicsNode(JmeRenderingComponent component, Resource rootNode) {\r
+ this.component = component;\r
+ this.rootNode = rootNode;\r
+ }\r
+ \r
+ public void addChild(IGraphicsNode node) {\r
+ children.add(node);\r
+ }\r
+ \r
+ public void removeChild(IGraphicsNode node) {\r
+ children.remove(node);\r
+ }\r
+ \r
+ public Collection<IGraphicsNode> getChildren() {\r
+ return children;\r
+ }\r
+\r
+ public void dispose() {\r
+ //throw new RuntimeException("Root cannot be disposed");\r
+ }\r
+\r
+ public Node getGroup() {\r
+ return component.getShadowRoot();\r
+ }\r
+\r
+ public IGraphicsNode getParent() {\r
+ return null;\r
+ }\r
+\r
+ public Resource getResource() {\r
+ return rootNode;\r
+ }\r
+\r
+ public void updateTransform(Graph graph) {\r
+\r
+ }\r
+ \r
+ public String toString() {\r
+ return this.getClass().toString();\r
+ }\r
+\r
+ public G3DNode getG3DNode(Graph graph) {\r
+ return new G3DNode(graph, rootNode);\r
+ }\r
+ \r
+\r
+\r
+}
\ No newline at end of file