1 /*******************************************************************************
\r
2 * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.
\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
9 * VTT Technical Research Centre of Finland - initial API and implementation
\r
10 *******************************************************************************/
\r
11 package org.simantics.proconf.g3d.base;
\r
13 import java.util.Collection;
\r
15 import org.simantics.db.Graph;
\r
16 import org.simantics.db.Resource;
\r
17 import org.simantics.layer0.utils.IEntity;
\r
18 import org.simantics.proconf.g3d.scenegraph.IGeometryNode;
\r
19 import org.simantics.proconf.g3d.scenegraph.IGraphicsNode;
\r
20 import org.simantics.proconf.g3d.stubs.G3DNode;
\r
22 import com.jme.scene.Node;
\r
24 public interface ScenegraphAdapter {
\r
27 * Disposes the adapter
\r
29 public void dispose();
\r
32 * Returns scene-graph node of the resource
\r
36 public IGraphicsNode getNode(Resource resource);
\r
39 * Returns scene-graph node of the resource
\r
43 public IGraphicsNode getNode(IEntity thing);
\r
46 * Returns node (resource) for the uid.
\r
48 * @return the node (resource)
\r
50 public Resource getNodeResource(String uid);
\r
53 * @return all nodes in the scene-graph
\r
55 public Collection<IGraphicsNode> getNodes();
\r
58 * Returns uid of the node.
\r
59 * @param nodeResource
\r
62 public String getNodeUID(Resource nodeResource);
\r
64 public JmeRenderingComponent getRenderingComponent();
\r
66 public Node getRoot();
\r
68 public IGraphicsNode getRootNode();
\r
70 public Resource getRootResource();
\r
73 * Returns true if the scene-graph contains the node
\r
77 public boolean hasNode(Resource resource);
\r
80 * Checks if the view has been changed (and needs redrawing).
\r
83 public boolean isChanged();
\r
86 * Checks if any geometries needs updating
\r
89 public boolean needsUpdateGeometry();
\r
95 public void setChanged(boolean changed);
\r
98 * Sets the root node of the scene-graph
\r
101 public void setRootNode(G3DNode rootNode);
\r
104 * Updates requested geometries.
\r
108 public void updateGeometry(Graph graph);
\r
111 * Updates node's geometry
\r
114 public void updateGeometry(IGeometryNode node);
\r
117 * Updates node's geometry
\r
118 * @param nodeResource
\r
120 public void updateGeometry(Resource nodeResource);
\r