MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / getDepObjects

Method getDepObjects

src/App/Expression.cpp:948–976  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

946}
947
948void Expression::getDepObjects(std::map<App::DocumentObject*, bool>& deps,
949 std::vector<std::string>* labels,
950 std::map<std::pair<std::string, App::DocumentObject*>, bool>* propDeps) const
951{
952 for(auto &v : getIdentifiers()) {
953 bool hidden = v.second;
954 const ObjectIdentifier &var = v.first;
955 std::vector<std::string> strings;
956 for(auto &dep : var.getDep(propDeps != nullptr, &strings)) {
957 DocumentObject *obj = dep.first;
958 if (!obj->testStatus(ObjectStatus::Remove)) {
959 if (labels) {
960 std::copy(strings.begin(), strings.end(), std::back_inserter(*labels));
961 }
962
963 auto res = deps.insert(std::make_pair(obj, hidden));
964 if (!hidden || res.second)
965 res.first->second = hidden;
966 if (propDeps) {
967 for (auto &propName : dep.second) {
968 (*propDeps)[std::make_pair(propName, obj)] = hidden;
969 }
970 }
971 }
972
973 strings.clear();
974 }
975 }
976}
977
978std::map<App::DocumentObject*,bool> Expression::getDepObjects(std::vector<std::string> *labels) const {
979 std::map<App::DocumentObject*,bool> deps;

Callers 4

hasSetValueMethod · 0.80
validateExpressionMethod · 0.80
hasSetValueMethod · 0.80
adjustLinkMethod · 0.80

Calls 7

getDepMethod · 0.80
copyFunction · 0.70
testStatusMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected