diff --git a/src/Mod/Part/App/BodyBase.cpp b/src/Mod/Part/App/BodyBase.cpp index 8474a0de71..701d0e6a54 100644 --- a/src/Mod/Part/App/BodyBase.cpp +++ b/src/Mod/Part/App/BodyBase.cpp @@ -78,4 +78,15 @@ BodyBase* BodyBase::findBodyOf(const App::DocumentObject* f) return NULL; } +const bool BodyBase::isAfterTip(const App::DocumentObject *f) const { + App::DocumentObject* tipFeature = Tip.getValue(); + if (tipFeature == NULL) + return true; + + std::vector features = Model.getValues(); + std::vector::const_iterator it = std::find(features.begin(), features.end(), f); + std::vector::const_iterator tip = std::find(features.begin(), features.end(), tipFeature); + return (it > tip); +} + } diff --git a/src/Mod/Part/App/BodyBase.h b/src/Mod/Part/App/BodyBase.h index dc0b2dfbaf..c8c1d42e70 100644 --- a/src/Mod/Part/App/BodyBase.h +++ b/src/Mod/Part/App/BodyBase.h @@ -72,10 +72,12 @@ public: virtual App::DocumentObject *getPrevSolidFeature(App::DocumentObject *start = NULL, const bool inclusive = true) { return NULL; } + /// Return true if the feature is located after the current Tip feature + const bool isAfterTip(const App::DocumentObject *f) const; + /// Return the body which this feature belongs too, or NULL static BodyBase* findBodyOf(const App::DocumentObject* f); - }; } //namespace Part diff --git a/src/Mod/PartDesign/App/Body.cpp b/src/Mod/PartDesign/App/Body.cpp index 0e65ba2699..42dda0394d 100644 --- a/src/Mod/PartDesign/App/Body.cpp +++ b/src/Mod/PartDesign/App/Body.cpp @@ -191,17 +191,6 @@ App::DocumentObject* Body::getNextSolidFeature(App::DocumentObject *start, const return *it; } -const bool Body::isAfterTip(const App::DocumentObject *f) { - App::DocumentObject* tipFeature = Tip.getValue(); - if (tipFeature == NULL) - return true; - - std::vector features = Model.getValues(); - std::vector::const_iterator it = std::find(features.begin(), features.end(), f); - std::vector::const_iterator tip = std::find(features.begin(), features.end(), tipFeature); - return (it > tip); -} - const bool Body::isMemberOfMultiTransform(const App::DocumentObject* f) { if (f == NULL) diff --git a/src/Mod/PartDesign/App/Body.h b/src/Mod/PartDesign/App/Body.h index a07f011126..6d3c27f25b 100644 --- a/src/Mod/PartDesign/App/Body.h +++ b/src/Mod/PartDesign/App/Body.h @@ -78,9 +78,6 @@ public: // Return the shape of the feature preceding this feature //const Part::TopoShape getPreviousSolid(const PartDesign::Feature* f); - /// Return true if the feature is located after the current Tip feature - const bool isAfterTip(const App::DocumentObject *f); - /// Add the feature into the body at the current insert point (Tip feature) void addFeature(App::DocumentObject* feature);