Core: Add a possibility to extract active object based on extension
This commit is contained in:
committed by
Benjamin Nauck
parent
661d2052b7
commit
908941f2d1
@@ -197,3 +197,15 @@ void ActiveObjectList::objectDeleted(const ViewProviderDocumentObject &vp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
App::DocumentObject* ActiveObjectList::getObjectWithExtension(const Base::Type extensionTypeId) const
|
||||
{
|
||||
for (const auto& pair : _ObjectMap) {
|
||||
App::DocumentObject* obj = getObject(pair.second, true);
|
||||
if (obj && obj->hasExtension(extensionTypeId)) {
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user