TaskCheckGeometry settings panel with runBOPCheck option

This commit is contained in:
mwganson
2019-06-24 20:42:13 -05:00
committed by wmayer
parent 47f1f504c3
commit b837ba0c61
2 changed files with 38 additions and 0 deletions

View File

@@ -26,6 +26,7 @@
# include <QCoreApplication>
# include <QHeaderView>
# include <QTextEdit>
# include <QCheckBox>
# include <QTextStream>
# include <QThread>
# include <QTreeWidget>
@@ -930,12 +931,14 @@ TaskCheckGeometryDialog::TaskCheckGeometryDialog() : widget(0), contentLabel(0)
{
this->setButtonPosition(TaskDialog::South);
widget = new TaskCheckGeometryResults();
taskbox = new Gui::TaskView::TaskBox(
Gui::BitmapFactory().pixmap("Part_CheckGeometry"),
widget->windowTitle(), false, 0);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
contentLabel = new QTextEdit();
contentLabel->setText(widget->getShapeContentString());
shapeContentBox = new Gui::TaskView::TaskBox(Gui::BitmapFactory().pixmap("Part_CheckGeometry"),
@@ -943,6 +946,33 @@ TaskCheckGeometryDialog::TaskCheckGeometryDialog() : widget(0), contentLabel(0)
shapeContentBox->groupLayout()->addWidget(contentLabel);
shapeContentBox->hideGroupBox();
Content.push_back(shapeContentBox);
ParameterGrp::handle group = App::GetApplication().GetUserParameter().
GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod")->GetGroup("Part")->GetGroup("CheckGeometry");
runBOPCheckBox = new QCheckBox();
runBOPCheckBox->setText(tr("Run BOP check"));
runBOPCheckBox->setToolTip(tr("Extra boolean operations check that can sometimes \
find errors that the regular geometry check misses,\n but which said errors do not always \
mean the checked object is unusable."));
runBOPCheckBox->setChecked(group->GetBool("RunBOPCheck"));
settingsBox = new Gui::TaskView::TaskBox(Gui::BitmapFactory().pixmap("Part_CheckGeometry"),
tr("Settings"), true, 0);
settingsBox->groupLayout()->addWidget(runBOPCheckBox);
settingsBox->hideGroupBox();
Content.push_back(settingsBox);
connect(runBOPCheckBox, SIGNAL(toggled(bool)),
this, SLOT(on_runBOPCheckBox_toggled(bool)));
}
void TaskCheckGeometryDialog::on_runBOPCheckBox_toggled(bool isOn)
{
ParameterGrp::handle group = App::GetApplication().GetUserParameter().
GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod")->GetGroup("Part")->GetGroup("CheckGeometry");
group->SetBool("RunBOPCheck", isOn);
}
TaskCheckGeometryDialog::~TaskCheckGeometryDialog()

View File

@@ -36,6 +36,7 @@
class SoSeparator;
class SoSwitch;
class QCheckBox;
class QTextEdit;
namespace PartGui {
@@ -105,6 +106,7 @@ public:
private Q_SLOTS:
void currentRowChanged (const QModelIndex &current, const QModelIndex &previous);
private:
void setupInterface();
void goCheck();
@@ -125,6 +127,7 @@ private:
SoSeparator *currentSeparator;
std::vector<FunctionMapType> functionMap;
std::string shapeContentString;
};
class TaskCheckGeometryDialog : public Gui::TaskView::TaskDialog
@@ -140,11 +143,16 @@ public:
{return false;}
virtual bool needsFullSpace() const {return true;}
private Q_SLOTS:
void on_runBOPCheckBox_toggled(bool isOn);
private:
TaskCheckGeometryResults* widget;
Gui::TaskView::TaskBox* taskbox;
Gui::TaskView::TaskBox* shapeContentBox;
Gui::TaskView::TaskBox* settingsBox;
QTextEdit *contentLabel;
QCheckBox *runBOPCheckBox;
};
class BOPProgressIndicator : public Message_ProgressIndicator