/******************************************************************************* * 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); }