From a674729dd3f0733353322719dc151983cb4cc3ea Mon Sep 17 00:00:00 2001 From: bgbsww Date: Thu, 27 Jun 2024 18:21:00 -0400 Subject: [PATCH] Toponaming: Cleanups --- src/Mod/Part/App/BodyBase.cpp | 6 --- src/Mod/Part/App/PartFeature.cpp | 1 - src/Mod/PartDesign/App/Body.cpp | 55 --------------------------- src/Mod/Sketcher/App/SketchObject.cpp | 12 ------ 4 files changed, 74 deletions(-) diff --git a/src/Mod/Part/App/BodyBase.cpp b/src/Mod/Part/App/BodyBase.cpp index 7bef103057..8b26c78e14 100644 --- a/src/Mod/Part/App/BodyBase.cpp +++ b/src/Mod/Part/App/BodyBase.cpp @@ -52,12 +52,6 @@ BodyBase* BodyBase::findBodyOf(const App::DocumentObject* f) if (body->hasObject(f)) return body; } - // for(;;) { - // auto group = App::GeoFeatureGroupExtension::getGroupOfObject(f); - // if(!group || group->isDerivedFrom(BodyBase::getClassTypeId())) - // return static_cast(group); - // f = group; - // } } return nullptr; diff --git a/src/Mod/Part/App/PartFeature.cpp b/src/Mod/Part/App/PartFeature.cpp index f64183646a..e6be3036ef 100644 --- a/src/Mod/Part/App/PartFeature.cpp +++ b/src/Mod/Part/App/PartFeature.cpp @@ -390,7 +390,6 @@ App::DocumentObject* Feature::getSubObject(const char* subname, ts.setShape(ts.getShape().Located(TopLoc_Location()), false); } if (subname && *subname && !ts.isNull()) { - // ts = ts.getSubShape(subname); // TODO WAS THIS WRONG? ts = ts.getSubTopoShape(subname,true); } if (doTransform && !ts.isNull()) { diff --git a/src/Mod/PartDesign/App/Body.cpp b/src/Mod/PartDesign/App/Body.cpp index 0ca740c239..4caf52d176 100644 --- a/src/Mod/PartDesign/App/Body.cpp +++ b/src/Mod/PartDesign/App/Body.cpp @@ -119,22 +119,6 @@ App::DocumentObject* Body::getPrevSolidFeature(App::DocumentObject *start) start = Tip.getValue(); } -// -// #ifdef FC_USE_TNP_FIX -// int index; -// if (!start || !start->getNameInDocument() -// // || start->isDerivedFrom(PartDesign::Extrusion::getClassTypeId()) -// || start->isDerivedFrom(PartDesign::Solid::getClassTypeId()) -// || !this->Group.find(start->getNameInDocument(), &index)) { // No Tip -// return nullptr; -// } -// const auto & objs = this->Group.getValues(); -// for (--index; index>=0; --index) { -// if (isSolidFeature(objs[index])) -// return objs[index]; -// } -// -// #else if (!start) { // No Tip return nullptr; } @@ -153,7 +137,6 @@ App::DocumentObject* Body::getPrevSolidFeature(App::DocumentObject *start) if (rvIt != features.rend()) { // the solid found in model list return *rvIt; } -// #endif return nullptr; } @@ -163,20 +146,6 @@ App::DocumentObject* Body::getNextSolidFeature(App::DocumentObject *start) start = Tip.getValue(); } -// #ifdef FC_USE_TNP_FIX -// int index; -// if (!start || !start->getNameInDocument() -// || !this->Group.find(start->getNameInDocument(), &index)) { // No Tip -// return nullptr; -// } -// -// const auto & objs = this->Group.getValues(); -// int count = this->Group.getSize(); -// for (++index; index Body::getSubObjects(int reason) const { App::DocumentObject *Body::getSubObject(const char *subname, PyObject **pyObj, Base::Matrix4D *pmat, bool transform, int depth) const { - // while(subname && *subname=='.') ++subname; // skip leading . - // - // // PartDesign::Feature now support grouping sibling features, and the user - // // is free to expand/collapse at any time. To not disrupt subname path - // // because of this, the body will peek the next two sub-objects reference, - // // and skip the first sub-object if possible. - // if(subname) { - // const char * firstDot = strchr(subname,'.'); - // if (firstDot) { - // const char * secondDot = strchr(firstDot+1, '.'); - // if (secondDot) { - // auto firstObj = Group.find(std::string(subname, firstDot).c_str()); - // if (!firstObj || firstObj->isDerivedFrom(PartDesign::Feature::getClassTypeId())) { - // auto secondObj = Group.find(std::string(firstDot+1, secondDot).c_str()); - // if (secondObj) { - // // we support only one level of sibling grouping, so no - // // recursive call to our own getSubObject() - // return Part::BodyBase::getSubObject(firstDot+1,pyObj,pmat,transform,depth+1); - // } - // } - // } - // } - // } #if 1 return Part::BodyBase::getSubObject(subname,pyObj,pmat,transform,depth); #else diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index f45284e5ff..a60e8d8576 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -9435,16 +9435,6 @@ App::DocumentObject *SketchObject::getSubObject( if(!subname || !subname[0]) return Part2DObject::getSubObject(subname,pyObj,pmat,transform,depth); const char *element = Data::findElementName(subname); - // if(element != subname) { - // const char *dot = strchr(subname,'.'); - // if(!dot) - // return 0; - // std::string name(subname,dot-subname); - // auto child = Exports.find(name.c_str()); - // if(!child) - // return 0; - // return child->getSubObject(dot+1,pyObj,pmat,true,depth+1); - // } Data::IndexedName indexedName = checkSubName(subname); int index = indexedName.getIndex(); @@ -9455,12 +9445,10 @@ App::DocumentObject *SketchObject::getSubObject( if (auto realType = convertInternalName(indexedName.getType())) { if (realType[0] == '\0') - // subshape = InternalShape.getShape(); subshape = Shape.getShape(); else { auto shapeType = Part::TopoShape::shapeType(realType, true); if (shapeType != TopAbs_SHAPE) - // subshape = InternalShape.getShape().getSubTopoShape(shapeType, indexedName.getIndex(), true); subshape = Shape.getShape().getSubTopoShape(shapeType, indexedName.getIndex(), true); } if (subshape.isNull())