PartDesign: Make Base Feature compatible with GeoFeatureGroup. fixes #0003080
The Original BaseFeature implementation had some serious issues with scoped links. It failed completely for e.g. sketches on the BaseFeature as it made a local link to refere to a out of body object. The only solution to make this work correctly is to add a proxy object into the body which is alloed to exactly that, to link outside oof the body. Something like shapebinder.
This commit is contained in:
@@ -55,6 +55,7 @@ Feature::Feature()
|
||||
{
|
||||
ADD_PROPERTY(BaseFeature,(0));
|
||||
Placement.setStatus(App::Property::Hidden, true);
|
||||
BaseFeature.setStatus(App::Property::Hidden, true);
|
||||
}
|
||||
|
||||
short Feature::mustExecute() const
|
||||
@@ -176,6 +177,20 @@ TopoDS_Shape Feature::makeShapeFromPlane(const App::DocumentObject* obj)
|
||||
return builder.Shape();
|
||||
}
|
||||
|
||||
Body* Feature::getFeatureBody() {
|
||||
|
||||
auto list = getInList();
|
||||
for (auto in : list) {
|
||||
if(in->isDerivedFrom(Body::getClassTypeId()) && //is Body?
|
||||
static_cast<Body*>(in)->hasObject(this)) { //is part of this Body?
|
||||
|
||||
return static_cast<Body*>(in);
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
};
|
||||
|
||||
}//namespace PartDesign
|
||||
|
||||
namespace App {
|
||||
|
||||
Reference in New Issue
Block a user