# Collect all modules contained in `self`
fun collect_all_mmodules(view: ModelView): HashSet[MModule] do
var res = new HashSet[MModule]
- for mgroup in collect_mgroups(view) do
+ for mgroup in collect_all_mgroups(view) do
res.add_all mgroup.collect_mmodules(view)
end
return res
# This method uses a flattened hierarchy containing all the mclassdefs.
redef fun collect_parents(view) do
var res = new HashSet[MENTITY]
+ if not view.mainmodule.flatten_mclass_hierarchy.has(self) then return res
for mclass in in_hierarchy(view.mainmodule).direct_greaters do
if mclass == self or not view.accept_mentity(mclass) then continue
res.add mclass
# This method uses a flattened hierarchy containing all the mclassdefs.
redef fun collect_children(view) do
var res = new HashSet[MENTITY]
+ if not view.mainmodule.flatten_mclass_hierarchy.has(self) then return res
for mclass in in_hierarchy(view.mainmodule).direct_smallers do
if mclass == self or not view.accept_mentity(mclass) then continue
res.add mclass