]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.network/src/org/simantics/district/network/DistrictNetworkUtil.java
Allow starting/ending of manual network creation to vertices only
[simantics/district.git] / org.simantics.district.network / src / org / simantics / district / network / DistrictNetworkUtil.java
index fde334f770d89d7a68cdfe84361692b62bcbf5ba..bac4707d87cc8fe627e0d24f2604503a2fc6d22d 100644 (file)
@@ -29,11 +29,11 @@ import org.simantics.operation.Layer0X;
 
 public class DistrictNetworkUtil {
 
-    public static Resource createEdge(WriteGraph graph, Resource composite) throws DatabaseException {
-        return createEdge(graph, composite, graph.getPossibleObject(composite, DistrictNetworkResource.getInstance(graph).EdgeDefaultMapping));
+    public static Resource createEdge(WriteGraph graph, Resource composite, double[] detailedGeometryCoords) throws DatabaseException {
+        return createEdge(graph, composite, graph.getPossibleObject(composite, DistrictNetworkResource.getInstance(graph).EdgeDefaultMapping), detailedGeometryCoords);
     }
 
-    public static Resource createEdge(WriteGraph graph, Resource composite, Resource mapping) throws DatabaseException {
+    public static Resource createEdge(WriteGraph graph, Resource composite, Resource mapping, double[] detailedGeometryCoords) throws DatabaseException {
         Layer0 L0 = Layer0.getInstance(graph);
         DistrictNetworkResource DN = DistrictNetworkResource.getInstance(graph);
         if (mapping == null) {
@@ -60,6 +60,8 @@ public class DistrictNetworkUtil {
             });
         }
         
+        // add detailed geometry (if any)
+        graph.claimLiteral(edge, DN.Edge_HasGeometry, detailedGeometryCoords, Bindings.DOUBLE_ARRAY);
         return edge;
     }