panel.setPickType(4);
try {
- ControlPointFactory.preloadCache();
+ ControlPointFactory.preloadCache(getLibraryUri());
ComponentUtils.preloadCache();
} catch (Exception e) {
ExceptionUtils.logAndShowError("Cannot open Plant3D editor",e);
private static Map<String,Instruction> cache = new HashMap<String, Instruction>();
- public static void preloadCache() throws Exception {
- List<Item> items = P3DUtil.getEnds(Plant3D.URIs.Builtin);
- items.addAll(P3DUtil.getInlines(Plant3D.URIs.Builtin));
- items.addAll(P3DUtil.getNozzles(Plant3D.URIs.Builtin));
- items.addAll(P3DUtil.getTurns(Plant3D.URIs.Builtin));
+ public static void preloadCache(String libUri) throws Exception {
+ List<Item> items = P3DUtil.getEnds(libUri);
+ items.addAll(P3DUtil.getInlines(libUri));
+ items.addAll(P3DUtil.getNozzles(libUri));
+ items.addAll(P3DUtil.getTurns(libUri));
for (Item item : items) {
Instruction inst = createInstruction(item.getUri());
import org.simantics.objmap.graph.IMapping;
import org.simantics.objmap.graph.Mappings;
import org.simantics.objmap.graph.schema.IMappingSchema;
+import org.simantics.plant3d.ontology.Plant3D;
import org.simantics.plant3d.scenegraph.P3DRootNode;
import org.simantics.plant3d.scenegraph.SchemaBuilder;
import org.simantics.plant3d.scenegraph.controlpoint.ControlPointFactory;
public static P3DScriptNodeMap load(final Resource root) throws DatabaseException {
try {
- ControlPointFactory.preloadCache();
+ ControlPointFactory.preloadCache(Plant3D.URIs.Builtin);
ComponentUtils.preloadCache();
} catch (Exception e) {
throw new DatabaseException(e);
public static P3DRootNode loadReadOnly(final Resource root) throws DatabaseException {
try {
- ControlPointFactory.preloadCache();
+ ControlPointFactory.preloadCache(Plant3D.URIs.Builtin);
ComponentUtils.preloadCache();
} catch (Exception e) {
throw new DatabaseException(e);