Moved BaseFeature Property from SketchBased to PartDesign::Feature because all PartDesign features need it

This commit is contained in:
jrheinlaender
2013-04-08 20:25:59 +04:30
committed by Stefan Tröger
parent f7d9bf90c4
commit df7983fe10
4 changed files with 40 additions and 29 deletions

View File

@@ -98,7 +98,6 @@ PROPERTY_SOURCE(PartDesign::SketchBased, PartDesign::Feature)
SketchBased::SketchBased()
{
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,12 +105,11 @@ SketchBased::SketchBased()
short SketchBased::mustExecute() const
{
if (BaseFeature.isTouched() ||
Sketch.isTouched() ||
if (Sketch.isTouched() ||
Midplane.isTouched() ||
Reversed.isTouched())
return 1;
return 0; // PartDesign::Feature::mustExecute();
return PartDesign::Feature::mustExecute();
}
void SketchBased::positionBySketch(void)
@@ -233,26 +231,6 @@ const TopoDS_Shape& SketchBased::getSupportShape() const {
return result;
}
const TopoDS_Shape& SketchBased::getBaseShape() const {
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()))
BaseObject = static_cast<Part::Feature*>(BaseLink);
if (BaseObject == NULL)
throw Base::Exception("No base feature linked");
const TopoDS_Shape& result = BaseObject->Shape.getValue();
if (result.IsNull())
throw Base::Exception("Base feature's shape is invalid");
TopExp_Explorer xp (result, TopAbs_SOLID);
if (!xp.More())
throw Base::Exception("Base feature's shape is not a solid");
return result;
}
int SketchBased::getSketchAxisCount(void) const
{
Part::Part2DObject *sketch = static_cast<Part::Part2DObject*>(Sketch.getValue());