import org.simantics.db.exception.DatabaseException;
import org.simantics.g3d.scenegraph.IG3DNode;
import org.simantics.g3d.scenegraph.NodeMap;
+import org.simantics.g3d.scenegraph.RenderListener;
import org.simantics.g3d.scenegraph.base.INode;
import org.simantics.g3d.vtk.action.RemoveAction;
import org.simantics.g3d.vtk.common.HoverHighlighter;
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void run(ReadGraph graph) throws DatabaseException {
+ System.out.println("START PLANT3D LOAD");
PipingRules.setEnabled(false);
IMappingSchema<Resource, Object> schema = getSchema(graph);
mapping = Mappings.createWithListening(schema);
rootNode = (P3DRootNode)mapping.map(graph, input);
// update control points.
// TODO : this should be optimized.
+
+
+
try {
- P3DUtil.finalizeDBLoad(rootNode);
-
- } catch (Exception e) {
- throw new DatabaseException(e);
- }
- nodeMap = createNodeMap(getSession(), mapping, panel,rootNode);
+ P3DUtil.finalizeDBLoad(rootNode);
+ nodeMap = createNodeMap(getSession(), mapping, panel,rootNode);
+
+ } catch (Exception e) {
+ throw new DatabaseException(e);
+ }
+
+ System.out.println("END PLANT3D LOAD");
}
});
@Override
public void run() {
nodeMap.populate();
+ panel.addListener(new RenderListener() {
+
+ @Override
+ public void preRender() {
+
+ }
+
+ @Override
+ public void postRender() {
+ try {
+ P3DUtil.finalizeDBLoad2(rootNode);
+ if (nodeMap.isRangeModified());
+ nodeMap.commit("Load sync");
+ } catch (Exception e) {
+ //throw new DatabaseException(e);
+ }
+ panel.removeListener(this);
+
+ }
+ });
+
}
});