filters.min_visibility = protected_visibility
end
- var view = new ModelView(mainmodule.model, mainmodule, filters)
- var d = new UMLModel(view, mainmodule)
+ var d = new UMLModel(toolcontext.modelbuilder.model, mainmodule, filters)
if toolcontext.opt_gen.value == 0 then
print d.generate_class_uml.write_to_string
else if toolcontext.opt_gen.value == 1 then
# UML model builder.
class UMLModel
- # Model view
- var view: ModelView
+ # Model to access mentities
+ var model: Model
# Main module used for linearization.
var mainmodule: MModule
+
+ # Filters to apply on model if any
+ var filter: nullable ModelFilter
end
fontname = "Bitstream Vera Sans"
fontsize = 8
]\n"""
- for mclass in view.mclasses do
+ for mclass in model.collect_mclasses(filter) do
tpl.add mclass.tpl_class(self)
tpl.add "\n"
end
t.add "]"
end
t.add "|"
- var props = collect_intro_mproperties(model.view)
+ var props = collect_intro_mproperties(model.filter)
for i in props do
if not i isa MAttribute then continue
t.add i.tpl_class(model)
t.add "\}\"\n]\n"
var g = in_hierarchy(model.mainmodule).direct_greaters
for i in g do
- if not model.view.accept_mentity(i) then continue
+ if not model.filter.accept_mentity(i) then continue
t.add "{i.name} -> {name} [dir=back"
if i.kind == interface_kind then
t.add " arrowtail=open style=dashed"
t.add "subgraph cluster{name} \{\n"
t.add "label = \"{name}\"\n"
for i in mclassdefs do
- if not model.view.accept_mentity(i) then continue
+ if not model.filter.accept_mentity(i) then continue
t.add i.tpl_module(model)
end
t.add "\}\n"
t.add "|"
for i in mpropdefs do
if not i isa MAttributeDef then continue
- if not model.view.accept_mentity(i) then continue
+ if not model.filter.accept_mentity(i) then continue
t.add i.tpl_module(model)
t.add "\\l"
end
t.add "|"
for i in mpropdefs do
if not i isa MMethodDef then continue
- if not model.view.accept_mentity(i) then continue
+ if not model.filter.accept_mentity(i) then continue
t.add i.tpl_module(model)
t.add "\\l"
end