]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Restore SCL-compatible API to P3DUtil 34/3934/2
authorReino Ruusu <reino.ruusu@semantum.fi>
Wed, 26 Feb 2020 12:28:50 +0000 (14:28 +0200)
committerReino Ruusu <reino.ruusu@semantum.fi>
Wed, 26 Feb 2020 12:38:31 +0000 (14:38 +0200)
P3DUtil.scl was broken by d207cfa3235339e7d7b894494be400160b121bd5

gitlab #88

Change-Id: I047f0e94ca8f3320097be2b64cbbc3dbbf62b6bd

org.simantics.plant3d/src/org/simantics/plant3d/utils/P3DUtil.java

index 2f5972a8d86a160dd4fd022fd93c605cc2706194..42a3b9a0f5277c3ee5aff8d8e09d4790c840cd0f 100644 (file)
@@ -25,13 +25,21 @@ import org.simantics.plant3d.scenegraph.PipeRun;
 import org.simantics.plant3d.scenegraph.PipelineComponent;
 import org.simantics.plant3d.scenegraph.controlpoint.PipeControlPoint;
 import org.simantics.plant3d.scenegraph.controlpoint.PipingRules;
+import org.simantics.plant3d.scl.SCLUtil;
 import org.simantics.plant3d.utils.Item.Type;
 
 public class P3DUtil {
+       public static List<Item> getEquipments() throws DatabaseException {
+               return getEquipments(SCLUtil.getRequestProcessor());
+       }
        
        public static List<Item> getEquipments(RequestProcessor session) throws DatabaseException {
                return getEquipments(session, Plant3D.URIs.Builtin);
        }
+
+       public static List<Item> getEquipments(final String libUri) throws DatabaseException {
+               return getEquipments(SCLUtil.getRequestProcessor(), libUri);
+       }
        
        public static List<Item> getEquipments(RequestProcessor session, final String libUri) throws DatabaseException {
                return session.syncRequest(new Read<List<Item>>() {
@@ -49,6 +57,10 @@ public class P3DUtil {
                });
        }
        
+       public static List<Item> getNozzles(String libUri) throws DatabaseException {
+               return getNozzles(SCLUtil.getRequestProcessor(), libUri);
+       }
+       
        public static List<Item> getNozzles(RequestProcessor session, String libUri) throws DatabaseException {
                return session.syncRequest(new Read<List<Item>>() {
                        @Override
@@ -94,6 +106,10 @@ public class P3DUtil {
                }
        }
 
+       public static List<Item> getEnds(String libUri) throws DatabaseException {
+               return getEnds(SCLUtil.getRequestProcessor(), libUri);
+       }
+       
        public static List<Item> getEnds(RequestProcessor session, String libUri) throws DatabaseException {
                return session.syncRequest(new Read<List<Item>>() {
                        @Override
@@ -104,6 +120,10 @@ public class P3DUtil {
                        }
                });
        }
+
+       public static List<Item> getTurns(String libUri) throws DatabaseException {
+               return getTurns(SCLUtil.getRequestProcessor(), libUri);
+       }
        
        public static List<Item> getTurns(RequestProcessor session, String libUri) throws DatabaseException {
                return session.syncRequest(new Read<List<Item>>() {
@@ -115,6 +135,10 @@ public class P3DUtil {
                        }
                });
        }
+
+       public static List<Item> getInlines(String libUri) throws DatabaseException {
+               return getInlines(SCLUtil.getRequestProcessor(), libUri);
+       }
        
        public static List<Item> getInlines(RequestProcessor session, String libUri) throws DatabaseException {
                return session.syncRequest(new Read<List<Item>>() {