]> gerrit.simantics Code Review - simantics/3d.git/blob - org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/scenegraph/RootGraphicsNode.java
Set copyright texts for java files in the latest development branches.
[simantics/3d.git] / org.simantics.proconf.g3d / src / org / simantics / proconf / g3d / scenegraph / RootGraphicsNode.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
3  * All rights reserved. This program and the accompanying materials\r
4  * are made available under the terms of the Eclipse Public License v1.0\r
5  * which accompanies this distribution, and is available at\r
6  * http://www.eclipse.org/legal/epl-v10.html\r
7  *\r
8  * Contributors:\r
9  *     VTT Technical Research Centre of Finland - initial API and implementation\r
10  *******************************************************************************/\r
11 package org.simantics.proconf.g3d.scenegraph;\r
12 \r
13 import java.util.ArrayList;\r
14 import java.util.Collection;\r
15 \r
16 import org.simantics.db.Graph;\r
17 import org.simantics.db.Resource;\r
18 import org.simantics.proconf.g3d.base.JmeRenderingComponent;\r
19 import org.simantics.proconf.g3d.stubs.G3DNode;\r
20 \r
21 import com.jme.scene.Node;\r
22 \r
23 public class RootGraphicsNode implements IGraphicsNode {\r
24 \r
25         JmeRenderingComponent component;\r
26     Resource rootNode;\r
27     private ArrayList<IGraphicsNode> children = new ArrayList<IGraphicsNode>();\r
28 \r
29     \r
30     public RootGraphicsNode(JmeRenderingComponent component, Resource rootNode) {\r
31         this.component = component;\r
32         this.rootNode = rootNode;\r
33     }\r
34     \r
35     public void addChild(IGraphicsNode node) {\r
36         children.add(node);\r
37     }\r
38     \r
39     public void removeChild(IGraphicsNode node) {\r
40         children.remove(node);\r
41     }\r
42     \r
43     public Collection<IGraphicsNode> getChildren() {\r
44         return children;\r
45     }\r
46 \r
47     public void dispose() {\r
48         //throw new RuntimeException("Root cannot be disposed");\r
49     }\r
50 \r
51     public Node getGroup() {\r
52         return component.getShadowRoot();\r
53     }\r
54 \r
55     public IGraphicsNode getParent() {\r
56         return null;\r
57     }\r
58 \r
59     public Resource getResource() {\r
60         return rootNode;\r
61     }\r
62 \r
63     public void updateTransform(Graph graph) {\r
64 \r
65     }\r
66     \r
67     public String toString() {\r
68         return this.getClass().toString();\r
69     }\r
70 \r
71     public G3DNode getG3DNode(Graph graph) {\r
72         return new G3DNode(graph, rootNode);\r
73     }\r
74     \r
75 \r
76 \r
77 }