]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.g3d/src/org/simantics/proconf/g3d/base/ScenegraphAdapter.java
git-svn-id: https://www.simantics.org/svn/simantics/3d/trunk@22280 ac1ea38d-2e2b...
[simantics/3d.git] / org.simantics.g3d / src / org / simantics / proconf / g3d / base / ScenegraphAdapter.java
diff --git a/org.simantics.g3d/src/org/simantics/proconf/g3d/base/ScenegraphAdapter.java b/org.simantics.g3d/src/org/simantics/proconf/g3d/base/ScenegraphAdapter.java
new file mode 100644 (file)
index 0000000..40154a6
--- /dev/null
@@ -0,0 +1,122 @@
+/*******************************************************************************\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.base;\r
+\r
+import java.util.Collection;\r
+\r
+import org.simantics.db.Graph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.proconf.g3d.scenegraph.IGeometryNode;\r
+import org.simantics.proconf.g3d.scenegraph.IGraphicsNode;\r
+import org.simantics.proconf.g3d.stubs.G3DNode;\r
+\r
+import com.jme.scene.Node;\r
+\r
+public interface ScenegraphAdapter {\r
+\r
+       /**\r
+        * Disposes the adapter\r
+        */\r
+       public void dispose();\r
+\r
+       /**\r
+        * Returns scene-graph node of the resource\r
+        * @param resource\r
+        * @return\r
+        */\r
+       public IGraphicsNode getNode(Resource resource);\r
+\r
+       /**\r
+        * Returns scene-graph node of the resource\r
+        * @param thing\r
+        * @return\r
+        */\r
+       public IGraphicsNode getNode(IEntity thing);\r
+\r
+       /**\r
+        * Returns node (resource) for the uid.\r
+        * @param uid\r
+        * @return the node (resource)\r
+        */\r
+       public Resource getNodeResource(String uid);\r
+\r
+       /**\r
+        * @return all nodes in the scene-graph\r
+        */\r
+       public Collection<IGraphicsNode> getNodes();\r
+\r
+       /**\r
+        * Returns uid of the node.\r
+        * @param nodeResource\r
+        * @return\r
+        */\r
+       public String getNodeUID(Resource nodeResource);\r
+\r
+       public JmeRenderingComponent getRenderingComponent();\r
+\r
+       public Node getRoot();\r
+\r
+       public IGraphicsNode getRootNode();\r
+\r
+       public Resource getRootResource();\r
+\r
+       /**\r
+        * Returns true if the scene-graph contains the node\r
+        * @param resource\r
+        * @return\r
+        */\r
+       public boolean hasNode(Resource resource);\r
+\r
+       /**\r
+        * Checks if the view has been changed (and needs redrawing).\r
+        * @return\r
+        */\r
+       public boolean isChanged();\r
+\r
+       /**\r
+        * Checks if any geometries needs updating\r
+        * @return \r
+        */\r
+       public boolean needsUpdateGeometry();\r
+\r
+       /**\r
+        * \r
+        * @param changed\r
+        */\r
+       public void setChanged(boolean changed);\r
+\r
+       /**\r
+        * Sets the root node of the scene-graph\r
+        * @param rootNode\r
+        */\r
+       public void setRootNode(G3DNode rootNode);\r
+\r
+       /**\r
+        * Updates requested geometries.\r
+        * \r
+        * @param graph\r
+        */\r
+       public void updateGeometry(Graph graph);\r
+\r
+       /**\r
+        * Updates node's geometry\r
+        * @param node\r
+        */\r
+       public void updateGeometry(IGeometryNode node);\r
+       \r
+       /**\r
+        * Updates node's geometry\r
+        * @param nodeResource\r
+        */\r
+       public void updateGeometry(Resource nodeResource);\r
+\r
+}
\ No newline at end of file