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

Method getScopedObjectsFromLinks

src/App/GeoFeatureGroupExtension.cpp:269–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267
268
269std::vector<DocumentObject*>
270GeoFeatureGroupExtension::getScopedObjectsFromLinks(const DocumentObject* obj, LinkScope scope)
271{
272
273 if (!obj) {
274 return {};
275 }
276
277 // we get all linked objects. We can't use outList() as this includes the links from expressions
278 std::vector<App::DocumentObject*> result;
279 std::vector<App::Property*> list;
280 obj->getPropertyList(list);
281 for (App::Property* prop : list) {
282 auto vec = getScopedObjectsFromLink(prop, scope);
283 result.insert(result.end(), vec.begin(), vec.end());
284 }
285
286 // clear all null objects and duplicates
287 std::sort(result.begin(), result.end());
288 result.erase(std::unique(result.begin(), result.end()), result.end());
289
290 return result;
291}
292
293std::vector<DocumentObject*> GeoFeatureGroupExtension::getScopedObjectsFromLink(App::Property* prop,
294 LinkScope scope)

Callers

nothing calls this directly

Calls 5

getPropertyListMethod · 0.45
insertMethod · 0.45
endMethod · 0.45
beginMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected