|
|
@@ -99,28 +99,24 @@ Integer function are_connected(model: Element, el1:Element, el2:Element):
|
|
|
el1_mmt = getMetaTypeName(model, el1)
|
|
|
el2_mmt = getMetaTypeName(model, el2)
|
|
|
if ( el1_mmt == "Class" ):
|
|
|
- log("el1 is class")
|
|
|
if(el2_mmt == "Class"):
|
|
|
- log("el2 is class, so 0")
|
|
|
return 0 //not connected, no edge inbetween
|
|
|
elif(el2_mmt == "l5"):
|
|
|
- log("el2 is edge")
|
|
|
if( element_eq(read_edge_src(el2) , el1)): //warning is this the right type of equality?
|
|
|
- log("source of el2 is el1")
|
|
|
return 1 //outgoing
|
|
|
elif( element_eq(read_edge_dst(el2) , el1)): //right type of equality?
|
|
|
- log("destination of el2 is el1")
|
|
|
return 2 //incoming
|
|
|
else:
|
|
|
- log("neither is true")
|
|
|
return 0 //the edge is not connected
|
|
|
else:
|
|
|
log("is_connected_to: unsupported type for second element")
|
|
|
log(string_join("type = ", el2_mmt))
|
|
|
elif (el1_mmt == "l5"):
|
|
|
if( element_eq(read_edge_src(el1) , el2)): //warning is this the right type of equality?
|
|
|
+ log("source of el1 is el2")
|
|
|
return 2 //incoming
|
|
|
elif( element_eq(read_edge_dst(el1) , el2)): //right type of equality?
|
|
|
+ log("destination of el1 is el2")
|
|
|
return 1 //outgoing
|
|
|
else:
|
|
|
return 0 //edge is not connected
|