Extensions: Introduce classes and port App groups

This commit is contained in:
Stefan Tröger
2016-05-26 21:42:12 +02:00
committed by wmayer
parent a50bd5dc88
commit c5a2419e14
55 changed files with 17135 additions and 191 deletions

View File

@@ -1901,7 +1901,7 @@ DocumentObject * Document::addObject(const char* sType, const char* pObjectName,
throw Base::TypeError(str.str());
}
App::DocumentObject* pcObject = static_cast<App::DocumentObject*>(base);
App::DocumentObject* pcObject = dynamic_cast<App::DocumentObject*>(base);
pcObject->setDocument(this);
// do no transactions if we do a rollback!
@@ -2400,6 +2400,17 @@ std::vector<DocumentObject*> Document::getObjectsOfType(const Base::Type& typeId
return Objects;
}
std::vector< DocumentObject* > Document::getObjectsWithExtension(const Base::Type& typeId) const {
std::vector<DocumentObject*> Objects;
for (std::vector<DocumentObject*>::const_iterator it = d->objectArray.begin(); it != d->objectArray.end(); ++it) {
if ((*it)->hasExtension(typeId))
Objects.push_back(*it);
}
return Objects;
}
std::vector<DocumentObject*> Document::findObjects(const Base::Type& typeId, const char* objname) const
{
boost::regex rx(objname);