PD: Use SuppressibleExtension

This commit is contained in:
Florian Foinant-Willig
2024-02-14 22:37:40 +01:00
committed by Adrián Insaurralde Avalos
parent 68fd2934cf
commit 677cadee5e
5 changed files with 12 additions and 7 deletions

View File

@@ -54,12 +54,13 @@ PROPERTY_SOURCE(PartDesign::Feature,Part::Feature)
Feature::Feature()
{
ADD_PROPERTY(BaseFeature,(nullptr));
ADD_PROPERTY(Suppressed,(false));
ADD_PROPERTY_TYPE(_Body,(nullptr),"Base",(App::PropertyType)(
App::Prop_ReadOnly|App::Prop_Hidden|App::Prop_Output|App::Prop_Transient),0);
Placement.setStatus(App::Property::Hidden, true);
BaseFeature.setStatus(App::Property::Hidden, true);
Suppressed.setStatus(App::Property::Hidden, true);
App::SuppressibleExtension::initExtension(this);
Suppressed.setStatus(App::Property::Status::Hidden, true); //Todo: remove when TNP fixed
}
App::DocumentObjectExecReturn* Feature::recompute()

View File

@@ -25,6 +25,7 @@
#define PARTDESIGN_Feature_H
#include <App/PropertyStandard.h>
#include <App/SuppressibleExtension.h>
#include <Mod/Part/App/PartFeature.h>
#include <Mod/PartDesign/PartDesignGlobal.h>
@@ -44,7 +45,7 @@ class Body;
* Base class of all PartDesign features.
* This kind of features only produce solids or fail.
*/
class PartDesignExport Feature : public Part::Feature
class PartDesignExport Feature : public Part::Feature, public App::SuppressibleExtension
{
PROPERTY_HEADER_WITH_OVERRIDE(PartDesign::Feature);
@@ -55,8 +56,6 @@ public:
App::PropertyLink BaseFeature;
App::PropertyLinkHidden _Body;
App::PropertyBool Suppressed;
App::DocumentObjectExecReturn* recompute() override;
short mustExecute() const override;

View File

@@ -57,7 +57,8 @@ Boolean::Boolean()
this->Refine.setValue(hGrp->GetBool("RefineModel", false));
ADD_PROPERTY_TYPE(UsePlacement,(0),"Part Design",(App::PropertyType)(App::Prop_None),"Apply the placement of the second ( tool ) object");
this->UsePlacement.setValue(false);
initExtension(this);
App::GeoFeatureGroupExtension::initExtension(this);
}
short Boolean::mustExecute() const

View File

@@ -51,6 +51,7 @@ PROPERTY_SOURCE_WITH_EXTENSIONS(PartDesignGui::ViewProvider, PartGui::ViewProvid
ViewProvider::ViewProvider()
{
ViewProviderSuppressibleExtension::initExtension(this);
PartGui::ViewProviderAttachExtension::initExtension(this);
}

View File

@@ -27,6 +27,7 @@
#include <Mod/Part/Gui/ViewProvider.h>
#include "ViewProviderBody.h"
#include <Gui/ViewProviderPythonFeature.h>
#include "Gui/ViewProviderSuppressibleExtension.h"
#include <Mod/Part/Gui/ViewProviderAttachExtension.h>
@@ -37,7 +38,9 @@ class TaskDlgFeatureParameters;
/**
* A common base class for all part design features view providers
*/
class PartDesignGuiExport ViewProvider : public PartGui::ViewProviderPart, PartGui::ViewProviderAttachExtension
class PartDesignGuiExport ViewProvider : public PartGui::ViewProviderPart,
Gui::ViewProviderSuppressibleExtension,
PartGui::ViewProviderAttachExtension
{
using inherited = PartGui::ViewProviderPart;
PROPERTY_HEADER_WITH_OVERRIDE(PartDesignGui::ViewProvider);