|
|
@@ -63,26 +63,14 @@ Boolean function main(model : Element):
|
|
|
if (dict_in(as_to_cs, class)):
|
|
|
// Yes, but is it still clean?
|
|
|
Element related_groups
|
|
|
- Boolean dirty
|
|
|
- dirty = False
|
|
|
-
|
|
|
- related_groups = as_to_cs[class]
|
|
|
- while (set_len(related_groups) > 0):
|
|
|
- group = set_pop(related_groups)
|
|
|
- if (value_eq(read_attribute(model, group, "dirty"), True)):
|
|
|
- // No, so mark all as dirty
|
|
|
- dirty = True
|
|
|
- break!
|
|
|
- else:
|
|
|
- // Yes, so just ignore this!
|
|
|
- continue!
|
|
|
-
|
|
|
- if (bool_not(dirty)):
|
|
|
+ group = as_to_cs[class]
|
|
|
+
|
|
|
+ if (bool_not(read_attribute(model, group, "dirty"))):
|
|
|
dict_add(groups, class, group)
|
|
|
+ log("Element not dirty, so reuse group " + group)
|
|
|
continue!
|
|
|
else:
|
|
|
group = as_to_cs[class]
|
|
|
- group = set_pop(related_groups)
|
|
|
to_remove = allAssociationDestinations(model, group, "rendered/contains")
|
|
|
x = create_value(read_attribute(model, group, "x"))
|
|
|
y = create_value(read_attribute(model, group, "y"))
|
|
|
@@ -94,9 +82,11 @@ Boolean function main(model : Element):
|
|
|
else:
|
|
|
model_delete_element(model, elem_to_remove)
|
|
|
model_delete_element(model, group)
|
|
|
+ log("Element dirty, so remove group " + group)
|
|
|
|
|
|
if (dict_in(groups, class)):
|
|
|
// Already rendered this, so skip
|
|
|
+ log("Already rendered, so skip " + class)
|
|
|
continue!
|
|
|
|
|
|
text_loc = 5
|
|
|
@@ -106,6 +96,7 @@ Boolean function main(model : Element):
|
|
|
instantiate_attribute(model, group, "y", y)
|
|
|
instantiate_attribute(model, group, "__asid", list_read(string_split(class, "/"), 1))
|
|
|
dict_add(groups, class, group)
|
|
|
+ log("Created new group " + group + " for element " + class)
|
|
|
|
|
|
loc_x = loc_x + 250
|
|
|
if (loc_x > 2000):
|
|
|
@@ -184,14 +175,16 @@ Boolean function main(model : Element):
|
|
|
class = list_pop_final(to_render)
|
|
|
attr_keys = dict_keys(getAttributes(model, class))
|
|
|
|
|
|
- log("Association: " + class)
|
|
|
- log("Connects " + cast_v2s(readAssociationSource(model, class)))
|
|
|
- log(" to " + cast_v2s(readAssociationDestination(model, class)))
|
|
|
if (bool_not(bool_and(dict_in(groups, readAssociationSource(model, class)), dict_in(groups, readAssociationDestination(model, class))))):
|
|
|
- log("DELAY")
|
|
|
list_append(delayed_elements, class)
|
|
|
continue!
|
|
|
|
|
|
+ log("Association: " + class)
|
|
|
+ log("Connects " + cast_v2s(readAssociationSource(model, class)))
|
|
|
+ log(" (group) " + cast_v2s(groups[readAssociationSource(model, class)]))
|
|
|
+ log(" to " + cast_v2s(readAssociationDestination(model, class)))
|
|
|
+ log(" (group) " + cast_v2s(groups[readAssociationDestination(model, class)]))
|
|
|
+
|
|
|
elem = instantiate_link(model, "rendered/ConnectingLine", "", groups[readAssociationSource(model, class)], groups[readAssociationDestination(model, class)])
|
|
|
dict_add(groups, class, elem)
|
|
|
if (is_edge(model["model"][readAssociationSource(model, class)])):
|