add Approximation option to FeaturePartSection
This commit is contained in:
@@ -37,10 +37,27 @@ PROPERTY_SOURCE(Part::Section, Part::Boolean)
|
||||
|
||||
Section::Section(void)
|
||||
{
|
||||
ADD_PROPERTY_TYPE(Approximation,(false),"Section",App::Prop_None,"Approximate the output edges");
|
||||
}
|
||||
|
||||
BRepAlgoAPI_BooleanOperation* Section::makeOperation(const TopoDS_Shape& base, const TopoDS_Shape& tool) const
|
||||
short Section::mustExecute() const
|
||||
{
|
||||
if (Approximation.isTouched())
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
BRepAlgoAPI_BooleanOperation *Section::makeOperation(const TopoDS_Shape& base, const TopoDS_Shape& tool) const
|
||||
{
|
||||
// Let's call algorithm computing a section operation:
|
||||
return new BRepAlgoAPI_Section(base, tool);
|
||||
// return new BRepAlgoAPI_Section(base, tool);
|
||||
bool approx = Approximation.getValue();
|
||||
BRepAlgoAPI_Section* mkSection = new BRepAlgoAPI_Section();
|
||||
mkSection->Init1(base);
|
||||
mkSection->Init2(tool);
|
||||
mkSection->Approximation(approx);
|
||||
mkSection->Build();
|
||||
if (!mkSection->IsDone())
|
||||
throw Base::RuntimeError("Section failed");
|
||||
return mkSection;
|
||||
}
|
||||
|
||||
@@ -38,9 +38,12 @@ class Section : public Boolean
|
||||
public:
|
||||
Section();
|
||||
|
||||
App::PropertyBool Approximation;
|
||||
|
||||
/** @name methods override Feature */
|
||||
//@{
|
||||
/// recalculate the Feature
|
||||
short mustExecute() const;
|
||||
protected:
|
||||
BRepAlgoAPI_BooleanOperation* makeOperation(const TopoDS_Shape&, const TopoDS_Shape&) const;
|
||||
//@}
|
||||
|
||||
Reference in New Issue
Block a user