PartDesign: Fillet Draft Chamfer Thickness : Add warning message on empty feature creation

This commit is contained in:
Paddle
2023-03-24 14:42:16 +01:00
parent 47cc265b4f
commit d896d00d48
6 changed files with 30 additions and 0 deletions

View File

@@ -318,6 +318,10 @@ void TaskChamferParameters::apply()
ui->chamferAngle->apply();
break;
}
//Alert user if he created an empty feature
if (ui->listWidgetReferences->count() == 0)
Base::Console().Warning(tr("Empty chamfer created !\n").toStdString().c_str());
}
//**************************************************************************

View File

@@ -275,6 +275,14 @@ void TaskDraftParameters::changeEvent(QEvent *e)
}
}
void TaskDraftParameters::apply()
{
//Alert user if he created an empty feature
if (ui->listWidgetReferences->count() == 0)
Base::Console().Warning(tr("Empty draft created !\n").toStdString().c_str());
TaskDressUpParameters::apply();
}
//**************************************************************************
//**************************************************************************
@@ -312,6 +320,8 @@ bool TaskDlgDraftParameters::accept()
if (!tobj->isError())
parameter->showObject();
parameter->apply();
std::vector<std::string> strings;
App::DocumentObject* obj;
TaskDraftParameters* draftparameter = static_cast<TaskDraftParameters*>(parameter);

View File

@@ -40,6 +40,8 @@ public:
explicit TaskDraftParameters(ViewProviderDressUp *DressUpView, QWidget *parent=nullptr);
~TaskDraftParameters() override;
void apply() override;
double getAngle() const;
bool getReversed() const;
const std::vector<std::string> getFaces() const;

View File

@@ -188,6 +188,10 @@ void TaskFilletParameters::apply()
//Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Fillet changed"));
ui->filletRadius->apply();
//Alert user if he created an empty feature
if(ui->listWidgetReferences->count() == 0)
Base::Console().Warning(tr("Empty fillet created !\n").toStdString().c_str());
}
//**************************************************************************

View File

@@ -241,6 +241,12 @@ void TaskThicknessParameters::changeEvent(QEvent *e)
}
}
void TaskThicknessParameters::apply()
{
//Alert user if he created an empty feature
if (ui->listWidgetReferences->count() == 0)
Base::Console().Warning(tr("Empty thickness created !\n").toStdString().c_str());
}
//**************************************************************************
//**************************************************************************
@@ -283,6 +289,8 @@ bool TaskDlgThicknessParameters::accept()
if (!obj->isError())
parameter->showObject();
parameter->apply();
TaskThicknessParameters* draftparameter = static_cast<TaskThicknessParameters*>(parameter);
FCMD_OBJ_CMD(obj,"Value = " << draftparameter->getValue());

View File

@@ -39,6 +39,8 @@ public:
explicit TaskThicknessParameters(ViewProviderDressUp *DressUpView, QWidget *parent=nullptr);
~TaskThicknessParameters() override;
void apply() override;
double getValue(void) const;
bool getReversed(void) const;
bool getIntersection(void) const;