]> gerrit.simantics Code Review - simantics/3d.git/blob - org.simantics.g3d/src/org/simantics/g3d/scenegraph/base/INode.java
Copyrights
[simantics/3d.git] / org.simantics.g3d / src / org / simantics / g3d / scenegraph / base / INode.java
1 /*******************************************************************************\r
2  * Copyright (c) 2012, 2013 Association for Decentralized Information Management in\r
3  * Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.g3d.scenegraph.base;\r
13 \r
14 import java.util.List;\r
15 \r
16 \r
17 \r
18 \r
19 \r
20 public interface INode {\r
21         \r
22         /**\r
23      * \r
24      * @return unique node identifier\r
25      */\r
26     public Long getId();\r
27 \r
28          /**\r
29      * @return root node of the scene graph or <code>null</code> if this node is\r
30      *         not part of a properly rooted scene graph hierarchy\r
31      */\r
32     public ParentNode<?> getRootNode();\r
33 \r
34     /**\r
35      * @return Parent node reference or <code>null</code> if not set\r
36      */\r
37     public ParentNode<?> getParent();\r
38     \r
39     public String getParentRel();\r
40     /**\r
41      * Set parent node. This method is for scene graph internal use only and\r
42      * should not be called outside the scene graph structure. This method\r
43      * simply sets the parent node parent field, and does not affect on parent\r
44      * node (i.e., should be called only from parent node).\r
45      */\r
46     public void setParent(ParentNode<?> parent, String name);\r
47 \r
48     /**\r
49      * Perform cleanup for this node and for the child nodes. Any resources\r
50      * (including child nodes) related to this node are unusable after this\r
51      * operation. This method is for scene graph internal use only, thus should\r
52      * not be called outside the scene graph structure.\r
53      */\r
54     public void cleanup();\r
55     /**\r
56      * Remove this node and its children from the scene graph.\r
57      */\r
58     public void remove();\r
59 \r
60     \r
61     public void addListener(NodeListener listener);\r
62         public void removeListener(NodeListener listener);\r
63         \r
64         public List<NodeListener> getListeners();\r
65 \r
66 }\r