X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=org.simantics.g3d%2Fsrc%2Forg%2Fsimantics%2Fproconf%2Fg3d%2Fbase%2FScenegraphAdapter.java;fp=org.simantics.g3d%2Fsrc%2Forg%2Fsimantics%2Fproconf%2Fg3d%2Fbase%2FScenegraphAdapter.java;h=40154a653ba676c36dfa9f86e91761d9843ab35b;hb=10f144a2bb2d7bec98b812b83acecb333fd098ea;hp=0000000000000000000000000000000000000000;hpb=3055b543aa5afc0cca4bb3b341704e7c5103fa6a;p=simantics%2F3d.git 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 index 00000000..40154a65 --- /dev/null +++ b/org.simantics.g3d/src/org/simantics/proconf/g3d/base/ScenegraphAdapter.java @@ -0,0 +1,122 @@ +/******************************************************************************* + * Copyright (c) 2007- VTT Technical Research Centre of Finland. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.proconf.g3d.base; + +import java.util.Collection; + +import org.simantics.db.Graph; +import org.simantics.db.Resource; +import org.simantics.layer0.utils.IEntity; +import org.simantics.proconf.g3d.scenegraph.IGeometryNode; +import org.simantics.proconf.g3d.scenegraph.IGraphicsNode; +import org.simantics.proconf.g3d.stubs.G3DNode; + +import com.jme.scene.Node; + +public interface ScenegraphAdapter { + + /** + * Disposes the adapter + */ + public void dispose(); + + /** + * Returns scene-graph node of the resource + * @param resource + * @return + */ + public IGraphicsNode getNode(Resource resource); + + /** + * Returns scene-graph node of the resource + * @param thing + * @return + */ + public IGraphicsNode getNode(IEntity thing); + + /** + * Returns node (resource) for the uid. + * @param uid + * @return the node (resource) + */ + public Resource getNodeResource(String uid); + + /** + * @return all nodes in the scene-graph + */ + public Collection getNodes(); + + /** + * Returns uid of the node. + * @param nodeResource + * @return + */ + public String getNodeUID(Resource nodeResource); + + public JmeRenderingComponent getRenderingComponent(); + + public Node getRoot(); + + public IGraphicsNode getRootNode(); + + public Resource getRootResource(); + + /** + * Returns true if the scene-graph contains the node + * @param resource + * @return + */ + public boolean hasNode(Resource resource); + + /** + * Checks if the view has been changed (and needs redrawing). + * @return + */ + public boolean isChanged(); + + /** + * Checks if any geometries needs updating + * @return + */ + public boolean needsUpdateGeometry(); + + /** + * + * @param changed + */ + public void setChanged(boolean changed); + + /** + * Sets the root node of the scene-graph + * @param rootNode + */ + public void setRootNode(G3DNode rootNode); + + /** + * Updates requested geometries. + * + * @param graph + */ + public void updateGeometry(Graph graph); + + /** + * Updates node's geometry + * @param node + */ + public void updateGeometry(IGeometryNode node); + + /** + * Updates node's geometry + * @param nodeResource + */ + public void updateGeometry(Resource nodeResource); + +} \ No newline at end of file