968{
969 bool effective_context_extended{true};
970
972
973
974
975 const auto &context_cfg =
context_.at(idx);
976 const auto &context_matches =
977 dynamic_cast<const class_diagram::model::diagram &>(d)
978 .find<class_diagram::model::class_>(context_cfg.pattern);
979
980 for (const auto &maybe_match : context_matches) {
981 if (maybe_match)
982 effective_context.emplace(maybe_match.value().id());
983 }
984
985 const auto &context_enum_matches =
986 dynamic_cast<const class_diagram::model::diagram &>(d)
987 .find<class_diagram::model::enum_>(context_cfg.pattern);
988
989 for (const auto &maybe_match : context_enum_matches) {
990 if (maybe_match)
991 effective_context.emplace(maybe_match.value().id());
992 }
993
994 const auto &context_concept_matches =
995 dynamic_cast<const class_diagram::model::diagram &>(d)
996 .find<class_diagram::model::concept_>(context_cfg.pattern);
997
998 for (const auto &maybe_match : context_concept_matches) {
999 if (maybe_match)
1000 effective_context.emplace(maybe_match.value().id());
1001 }
1002
1003
1004
1005 auto radius_counter = context_cfg.radius;
1006 std::set<eid_t> current_iteration_context;
1007
1008 while (radius_counter > 0 && effective_context_extended) {
1009
1010
1011 radius_counter--;
1012 effective_context_extended = false;
1013 current_iteration_context.clear();
1014
1015
1017 class_diagram::model::diagram>(
1018 d, context_cfg, effective_context, current_iteration_context);
1019
1020
1022 class_diagram::model::diagram>(
1023 d, context_cfg, effective_context, current_iteration_context);
1024
1025
1027 class_diagram::model::diagram>(
1028 d, context_cfg, effective_context, current_iteration_context);
1029
1030 for (auto id : current_iteration_context) {
1031 if (effective_context.count(id) == 0) {
1032
1033 effective_context.emplace(id);
1034 effective_context_extended = true;
1035 }
1036 }
1037 }
1038}