Review cleanups

This commit is contained in:
pre-commit-ci[bot]
2024-06-27 22:25:06 +00:00
committed by Chris Hennes
parent a674729dd3
commit 54920e6611
3 changed files with 16 additions and 14 deletions

View File

@@ -484,10 +484,11 @@ static std::vector<std::pair<long, Data::MappedName>> getElementSource(App::Docu
}
}
if (owner->isDerivedFrom(App::GeoFeature::getClassTypeId())) {
auto o =
static_cast<App::GeoFeature*>(owner)->getElementOwner(ret.back().second);
if (o)
doc = o->getDocument();
auto ownerGeoFeature =
static_cast<App::GeoFeature*>(owner)->getElementOwner(ret.back().second);
if (ownerGeoFeature) {
doc = ownerGeoFeature->getDocument();
}
}
obj = doc->getObjectByID(tag < 0 ? -tag : tag);
if (type) {
@@ -585,11 +586,12 @@ std::list<Data::HistoryItem> Feature::getElementHistory(App::DocumentObject* fea
break;
}
}
if(feature->isDerivedFrom(App::GeoFeature::getClassTypeId())) {
auto owner =
static_cast<App::GeoFeature*>(feature)->getElementOwner(element);
if(owner)
doc = owner->getDocument();
if (feature->isDerivedFrom(App::GeoFeature::getClassTypeId())) {
auto ownerGeoFeature =
static_cast<App::GeoFeature*>(feature)->getElementOwner(element);
if (ownerGeoFeature) {
doc = ownerGeoFeature->getDocument();
}
}
obj = doc->getObjectByID(std::abs(tag));
}

View File

@@ -189,9 +189,6 @@ bool Body::isSolidFeature(const App::DocumentObject *obj)
return false;
}
// if (obj == BaseFeature.getValue())
// return true;
if (obj->isDerivedFrom<PartDesign::Feature>()) {
if (PartDesign::Feature::isDatum(obj)) {
// Datum objects are not solid

View File

@@ -672,8 +672,11 @@ public:
bool& yinv,
eReasonList* rsn = nullptr) const;
DocumentObject *getSubObject(const char *subname, PyObject **pyObj=0,
Base::Matrix4D *mat=0, bool transform=true, int depth=0) const override;
DocumentObject* getSubObject(const char* subname,
PyObject** pyObj = 0,
Base::Matrix4D* mat = 0,
bool transform = true,
int depth = 0) const override;
Part::TopoShape getEdge(const Part::Geometry* geo, const char* name) const;