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

Method printInvalidLinks

src/App/DocumentObject.cpp:101–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101void DocumentObject::printInvalidLinks() const
102{
103 try {
104 // Get objects that have invalid link scope, and print their names.
105 // Truncate the invalid object list name strings for readability, if they happen to be very
106 // long.
107 std::vector<App::DocumentObject*> invalid_linkobjs;
108 std::string objnames, scopenames;
109 GeoFeatureGroupExtension::getInvalidLinkObjects(this, invalid_linkobjs);
110 for (auto& obj : invalid_linkobjs) {
111 objnames += obj->getNameInDocument();
112 objnames += " ";
113 for (auto& scope : obj->getParents()) {
114 if (scopenames.length() > 80) {
115 scopenames += "... ";
116 break;
117 }
118
119 scopenames += scope.first->getNameInDocument();
120 scopenames += " ";
121 }
122
123 if (objnames.length() > 80) {
124 objnames += "... ";
125 break;
126 }
127 }
128
129 if (objnames.empty()) {
130 objnames = "N/A";
131 }
132 else {
133 objnames.pop_back();
134 }
135
136 if (scopenames.empty()) {
137 scopenames = "N/A";
138 }
139 else {
140 scopenames.pop_back();
141 }
142
143 Base::Console().warning("%s: %s links are out of scope. Out of scope links to: %s\n",
144 getTypeId().getName(),
145 getNameInDocument(),
146 objnames.c_str());
147 }
148 catch (const Base::Exception& e) {
149 e.reportException();
150 }
151}
152
153App::DocumentObjectExecReturn* DocumentObject::recompute()
154{

Callers

nothing calls this directly

Calls 8

getNameInDocumentMethod · 0.45
getParentsMethod · 0.45
lengthMethod · 0.45
emptyMethod · 0.45
warningMethod · 0.45
getNameMethod · 0.45
c_strMethod · 0.45
reportExceptionMethod · 0.45

Tested by

no test coverage detected