Browse Source

Add CBD rendering example (graphical)

Yentl Van Tendeloo 6 years ago
parent
commit
ed913b074b

+ 18 - 0
examples/render_DTCBD_graphical.py

@@ -0,0 +1,18 @@
+import sys
+sys.path.append("wrappers")
+from modelverse import *
+
+init()
+login("admin", "admin")
+
+model_add("formalisms/DTCBD/Design_MM", "formalisms/SimpleClassDiagrams", open("models/DTCBD/metamodels/DTCBD_MM.mvc", 'r').read())
+model_add("models/DTCBD_model", "formalisms/DTCBD/Design_MM", open("models/DTCBD/models/simple_equation.mvc", 'r').read())
+
+model_add("formalisms/MM_render/graphical", "formalisms/SimpleClassDiagrams", open("models/render/metamodels/graphical.mvc", 'r').read())
+
+def add_trace_CBD(model):
+    instantiate(model, "Association", ("abstract/Block", "rendered/Group"), ID="TracabilityClass")
+
+transformation_add_AL({"abstract": "formalisms/DTCBD/Design_MM", "rendered": "formalisms/MM_render/graphical"}, {"rendered": "formalisms/MM_render/graphical"}, "models/DTCBD/render_graphical", open("models/DTCBD/transformations/render.alc", 'r').read(), add_trace_CBD)
+
+print(model_render("models/DTCBD_model", "models/DTCBD/render_graphical", "perceptualized/DTCBD_model"))

+ 0 - 72
models/Graphics/metamodels/graphical.mvc

@@ -1,72 +0,0 @@
-include "primitives.alh"
-
-SimpleAttribute Natural {
-    name = "Natural"
-}
-SimpleAttribute String {
-    name = "String"
-}
-
-Class GraphicalElement {
-    name = "GraphicalElement"
-    x : Natural
-    y : Natural
-    __asid? : String
-}
-
-Class Group : GraphicalElement {
-    name = "Group"
-}
-
-Class LineElement : GraphicalElement {
-    name = "LineElement"
-    lineWidth : Natural
-    lineColour : String
-}
-
-Class Text : LineElement {
-    name = "Text"
-    text : String
-}
-
-Class Line : LineElement {
-    name = "Line"
-    targetX : Natural
-    targetY : Natural
-}
-
-Class Shape : LineElement {
-    name = "Shape"
-    fillColour : String
-    width : Natural
-    height : Natural
-}
-
-Class Figure : GraphicalElement {
-    name = "Figure"
-    width : Natural
-    height : Natural
-}
-
-Class SVG {
-    name = "SVG"
-    data : String
-}
-
-Class Rectangle : Shape {
-    name = "Rectangle"
-}
-
-Class Ellipse : Shape {
-    name = "Ellipse"
-}
-
-Association contains (Group, GraphicalElement) {
-    name = "contains"
-}
-Association renders (Figure, SVG) {
-    name = "renders"
-    source_lower_cardinality = 1
-    target_lower_cardinality = 1
-    target_upper_cardinality = 1
-}

models/Graphics/metamodels/render.mvc → models/render/metamodels/graphical.mvc


models/Graphics/metamodels/plot.mvc → models/render/metamodels/plot.mvc


models/Graphics/transformations/render_SCD.alc → models/render/transformations/render_SCD.alc


+ 1 - 1
wrappers/modelverse_SCCD.py

@@ -1,7 +1,7 @@
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
-Date:   Thu May 17 13:53:07 2018
+Date:   Thu May 17 14:11:26 2018
 
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server