diff --git a/src/Mod/PartDesign/App/FeatureThickness.cpp b/src/Mod/PartDesign/App/FeatureThickness.cpp index 6ce73a7f8a..3f91def855 100644 --- a/src/Mod/PartDesign/App/FeatureThickness.cpp +++ b/src/Mod/PartDesign/App/FeatureThickness.cpp @@ -46,6 +46,7 @@ Thickness::Thickness() ADD_PROPERTY_TYPE(Join,(long(0)),"Thickness",App::Prop_None,"Join type"); Join.setEnums(JoinEnums); ADD_PROPERTY_TYPE(Reversed,(false),"Thickness",App::Prop_None,"Apply the thickness towards the solids interior"); + ADD_PROPERTY_TYPE(Intersection,(false),"Thickness",App::Prop_None,"Enable intersection-handling"); } short Thickness::mustExecute() const @@ -76,6 +77,7 @@ App::DocumentObjectExecReturn *Thickness::execute(void) } bool reversed = Reversed.getValue(); + bool intersection = Intersection.getValue(); double thickness = (reversed ? -1. : 1. )*Value.getValue(); double tol = Precision::Confusion(); short mode = (short)Mode.getValue(); @@ -85,7 +87,7 @@ App::DocumentObjectExecReturn *Thickness::execute(void) join = 2; if (fabs(thickness) > 2*tol) - this->Shape.setValue(getSolid(TopShape.makeThickSolid(closingFaces, thickness, tol, false, false, mode, join))); + this->Shape.setValue(getSolid(TopShape.makeThickSolid(closingFaces, thickness, tol, intersection, false, mode, join))); else this->Shape.setValue(getSolid(TopShape.getShape())); return App::DocumentObject::StdReturn; diff --git a/src/Mod/PartDesign/App/FeatureThickness.h b/src/Mod/PartDesign/App/FeatureThickness.h index 20c323dead..a2cab8eb55 100644 --- a/src/Mod/PartDesign/App/FeatureThickness.h +++ b/src/Mod/PartDesign/App/FeatureThickness.h @@ -41,6 +41,7 @@ public: App::PropertyLength Value; App::PropertyBool Reversed; + App::PropertyBool Intersection; App::PropertyEnumeration Mode; App::PropertyEnumeration Join; diff --git a/src/Mod/PartDesign/Gui/TaskThicknessParameters.cpp b/src/Mod/PartDesign/Gui/TaskThicknessParameters.cpp index 595457db6a..02bb13e86a 100644 --- a/src/Mod/PartDesign/Gui/TaskThicknessParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskThicknessParameters.cpp @@ -73,6 +73,9 @@ TaskThicknessParameters::TaskThicknessParameters(ViewProviderDressUp *DressUpVie bool r = pcThickness->Reversed.getValue(); ui->checkReverse->setChecked(r); + bool i = pcThickness->Intersection.getValue(); + ui->checkIntersection->setChecked(i); + std::vector strings = pcThickness->Base.getSubValues(); for (std::vector::const_iterator i = strings.begin(); i != strings.end(); i++) { @@ -85,6 +88,8 @@ TaskThicknessParameters::TaskThicknessParameters(ViewProviderDressUp *DressUpVie this, SLOT(onValueChanged(double))); connect(ui->checkReverse, SIGNAL(toggled(bool)), this, SLOT(onReversedChanged(bool))); + connect(ui->checkIntersection, SIGNAL(toggled(bool)), + this, SLOT(onIntersectionChanged(bool))); connect(ui->buttonRefAdd, SIGNAL(toggled(bool)), this, SLOT(onButtonRefAdd(bool))); connect(ui->buttonRefRemove, SIGNAL(toggled(bool)), @@ -192,6 +197,18 @@ bool TaskThicknessParameters::getReversed(void) const return ui->checkReverse->isChecked(); } +void TaskThicknessParameters::onIntersectionChanged(const bool on) { + clearButtons(none); + PartDesign::Thickness* pcThickness = static_cast(DressUpView->getObject()); + pcThickness->Intersection.setValue(on); + pcThickness->getDocument()->recomputeFeature(pcThickness); +} + +bool TaskThicknessParameters::getIntersection(void) const +{ + return ui->checkIntersection->isChecked(); +} + int TaskThicknessParameters::getJoinType(void) const { return ui->joinComboBox->currentIndex(); @@ -264,6 +281,7 @@ bool TaskDlgThicknessParameters::accept() FCMD_OBJ_CMD(obj,"Value = " << draftparameter->getValue()); FCMD_OBJ_CMD(obj,"Reversed = " << draftparameter->getReversed()); FCMD_OBJ_CMD(obj,"Mode = " << draftparameter->getMode()); + FCMD_OBJ_CMD(obj,"Intersection = " << draftparameter->getIntersection()); FCMD_OBJ_CMD(obj,"Join = " << draftparameter->getJoinType()); return TaskDlgDressUpParameters::accept(); diff --git a/src/Mod/PartDesign/Gui/TaskThicknessParameters.h b/src/Mod/PartDesign/Gui/TaskThicknessParameters.h index 455894dfa8..b090f37369 100644 --- a/src/Mod/PartDesign/Gui/TaskThicknessParameters.h +++ b/src/Mod/PartDesign/Gui/TaskThicknessParameters.h @@ -41,6 +41,7 @@ public: double getValue(void) const; bool getReversed(void) const; + bool getIntersection(void) const; int getMode(void) const; int getJoinType(void) const; @@ -49,6 +50,7 @@ private Q_SLOTS: void onModeChanged(int mode); void onJoinTypeChanged(int join); void onReversedChanged(bool reversed); + void onIntersectionChanged(bool intersection); void onRefDeleted(void); protected: diff --git a/src/Mod/PartDesign/Gui/TaskThicknessParameters.ui b/src/Mod/PartDesign/Gui/TaskThicknessParameters.ui index 38173d04d0..e4812e09f8 100644 --- a/src/Mod/PartDesign/Gui/TaskThicknessParameters.ui +++ b/src/Mod/PartDesign/Gui/TaskThicknessParameters.ui @@ -52,6 +52,9 @@ + + Qt::TabFocus + mm @@ -118,6 +121,13 @@ + + + + Intersection + + + @@ -134,6 +144,16 @@
Gui/QuantitySpinBox.h
+ + Value + modeComboBox + joinComboBox + checkIntersection + checkReverse + buttonRefAdd + buttonRefRemove + listWidgetReferences +