Extensions: Introduce classes and port App groups
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user