From c93d4253935d723b5d7da3ef2f7bfcfc4f7a5e3e Mon Sep 17 00:00:00 2001 From: jrheinlaender Date: Sun, 7 Apr 2013 08:06:53 +0430 Subject: [PATCH] Renamed SketchBased::Base property to BaseFeature because of name clash with Revolution::Base property --- src/Mod/PartDesign/App/Feature.cpp | 12 +----------- src/Mod/PartDesign/App/Feature.h | 7 ++----- src/Mod/PartDesign/App/FeatureSketchBased.cpp | 7 ++++--- src/Mod/PartDesign/App/FeatureSketchBased.h | 2 +- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/src/Mod/PartDesign/App/Feature.cpp b/src/Mod/PartDesign/App/Feature.cpp index 3c08112d5..dfb1d050c 100644 --- a/src/Mod/PartDesign/App/Feature.cpp +++ b/src/Mod/PartDesign/App/Feature.cpp @@ -37,6 +37,7 @@ #include "Body.h" #include "Feature.h" +#include namespace PartDesign { @@ -61,17 +62,6 @@ TopoDS_Shape Feature::getSolid(const TopoDS_Shape& shape) return TopoDS_Shape(); } -PartDesign::Body* Feature::getBody() -{ - std::vector bodies = this->getDocument()->getObjectsOfType(PartDesign::Body::getClassTypeId()); - for (std::vector::const_iterator b = bodies.begin(); b != bodies.end(); b++) { - PartDesign::Body* body = static_cast(*b); - if (body->hasFeature(this)) - return body; - } - return NULL; -} - const gp_Pnt Feature::getPointFromFace(const TopoDS_Face& f) { if (!f.Infinite()) { diff --git a/src/Mod/PartDesign/App/Feature.h b/src/Mod/PartDesign/App/Feature.h index 43e1be04c..41125fb64 100644 --- a/src/Mod/PartDesign/App/Feature.h +++ b/src/Mod/PartDesign/App/Feature.h @@ -45,12 +45,9 @@ class PartDesignExport Feature : public Part::Feature PROPERTY_HEADER(PartDesign::Feature); public: - Feature(); - -protected: - /// Get the body feature which this feature belongs to - Body* getBody(); + Feature(); +protected: /** * Get a solid of the given shape. If no solid is found an exception is raised. */ diff --git a/src/Mod/PartDesign/App/FeatureSketchBased.cpp b/src/Mod/PartDesign/App/FeatureSketchBased.cpp index 52b58c084..2d7c2db95 100644 --- a/src/Mod/PartDesign/App/FeatureSketchBased.cpp +++ b/src/Mod/PartDesign/App/FeatureSketchBased.cpp @@ -98,7 +98,7 @@ PROPERTY_SOURCE(PartDesign::SketchBased, PartDesign::Feature) SketchBased::SketchBased() { - ADD_PROPERTY(Base,(0)); + ADD_PROPERTY(BaseFeature,(0)); ADD_PROPERTY_TYPE(Sketch,(0),"SketchBased", App::Prop_None, "Reference to sketch"); ADD_PROPERTY_TYPE(Midplane,(0),"SketchBased", App::Prop_None, "Extrude symmetric to sketch face"); ADD_PROPERTY_TYPE(Reversed, (0),"SketchBased", App::Prop_None, "Reverse extrusion direction"); @@ -106,7 +106,8 @@ SketchBased::SketchBased() short SketchBased::mustExecute() const { - if (Sketch.isTouched() || + if (BaseFeature.isTouched() || + Sketch.isTouched() || Midplane.isTouched() || Reversed.isTouched()) return 1; @@ -233,7 +234,7 @@ const TopoDS_Shape& SketchBased::getSupportShape() const { } const TopoDS_Shape& SketchBased::getBaseShape() const { - App::DocumentObject* BaseLink = Base.getValue(); + App::DocumentObject* BaseLink = BaseFeature.getValue(); if (BaseLink == NULL) throw Base::Exception("Base property not set"); Part::Feature* BaseObject = NULL; if (BaseLink->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) diff --git a/src/Mod/PartDesign/App/FeatureSketchBased.h b/src/Mod/PartDesign/App/FeatureSketchBased.h index 84269ef9f..b663fb125 100644 --- a/src/Mod/PartDesign/App/FeatureSketchBased.h +++ b/src/Mod/PartDesign/App/FeatureSketchBased.h @@ -46,7 +46,7 @@ public: // Common properties for all sketch based features /// Base feature which this feature will be fused into or cut out of - App::PropertyLink Base; + App::PropertyLink BaseFeature; /// Sketch used to create this feature App::PropertyLink Sketch; /// Reverse extrusion direction