wiering the tet dialog

This commit is contained in:
jriegel 2013-04-29 22:21:55 +02:00
parent 3cca1594da
commit 5f8f9842e4
5 changed files with 39 additions and 31 deletions

View File

@ -72,23 +72,32 @@ void TaskDlgMeshShapeNetgen::open()
} }
void TaskDlgMeshShapeNetgen::clicked(int button)
{
try {
if(QDialogButtonBox::Apply == button)
{
// May throw an exception which we must handle here
FemMeshShapeNetgenObject->execute();
}
}
catch (const Base::Exception& e) {
Base::Console().Warning("FemMeshShapeNetgenObject::execute(): %s\n", e.what());
}
}
bool TaskDlgMeshShapeNetgen::accept() bool TaskDlgMeshShapeNetgen::accept()
{ {
//try { try {
// FemSetNodesObject->Nodes.setValues(param->tempSet); FemMeshShapeNetgenObject->recompute();
// FemSetNodesObject->recompute(); //FemSetNodesObject->Label.setValue(name->name);
// //Gui::Document* doc = Gui::Application::Instance->activeDocument(); Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()");
// //if(doc)
// // doc->resetEdit();
// param->MeshViewProvider->resetHighlightNodes();
// FemSetNodesObject->Label.setValue(name->name);
// Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()");
// return true; return true;
//} }
//catch (const Base::Exception& e) { catch (const Base::Exception& e) {
// Base::Console().Warning("TaskDlgMeshShapeNetgen::accept(): %s\n", e.what()); Base::Console().Warning("TaskDlgMeshShapeNetgen::accept(): %s\n", e.what());
//} }
return false; return false;
} }
@ -100,8 +109,8 @@ bool TaskDlgMeshShapeNetgen::reject()
// //if(doc) // //if(doc)
// // doc->resetEdit(); // // doc->resetEdit();
//param->MeshViewProvider->resetHighlightNodes(); //param->MeshViewProvider->resetHighlightNodes();
//Gui::Command::abortCommand(); Gui::Command::abortCommand();
//Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()"); Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()");
return true; return true;
} }

View File

@ -48,6 +48,8 @@ public:
public: public:
/// is called the TaskView when the dialog is opened /// is called the TaskView when the dialog is opened
virtual void open(); virtual void open();
/// is called by the framework if an button is clicked which has no accept or rject role
virtual void clicked(int);
/// is called by the framework if the dialog is accepted (Ok) /// is called by the framework if the dialog is accepted (Ok)
virtual bool accept(); virtual bool accept();
/// is called by the framework if the dialog is rejected (Cancel) /// is called by the framework if the dialog is rejected (Cancel)
@ -57,7 +59,7 @@ public:
/// returns for Close and Help button /// returns for Close and Help button
virtual QDialogButtonBox::StandardButtons getStandardButtons(void) const virtual QDialogButtonBox::StandardButtons getStandardButtons(void) const
{ return QDialogButtonBox::Ok|QDialogButtonBox::Cancel; } { return QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Apply; }
protected: protected:
TaskTetParameter *param; TaskTetParameter *param;

View File

@ -39,6 +39,7 @@
#include <Gui/View3DInventor.h> #include <Gui/View3DInventor.h>
#include <Gui/View3DInventorViewer.h> #include <Gui/View3DInventorViewer.h>
#include <Gui/Utilities.h> #include <Gui/Utilities.h>
#include <Mod/Fem/App/FemMeshShapeNetgenObject.h>
using namespace FemGui; using namespace FemGui;
@ -60,9 +61,8 @@ TaskTetParameter::TaskTetParameter(Fem::FemMeshShapeNetgenObject *pcObject,QWidg
this->groupLayout()->addWidget(proxy); this->groupLayout()->addWidget(proxy);
//QObject::connect(ui->toolButton_Poly,SIGNAL(clicked()),this,SLOT(Poly())); QObject::connect(ui->doubleSpinBox_MaxSize,SIGNAL(valueChanged(double)),this,SLOT(maxSizeValueChanged(double)));
//QObject::connect(ui->toolButton_Pick,SIGNAL(clicked()),this,SLOT(Pick())); QObject::connect(ui->comboBox_Fineness,SIGNAL(activated (int)),this,SLOT(SwitchMethod(int)));
//QObject::connect(ui->comboBox,SIGNAL(activated (int)),this,SLOT(SwitchMethod(int)));
} }
@ -74,15 +74,12 @@ TaskTetParameter::~TaskTetParameter()
void TaskTetParameter::SwitchMethod(int Value) void TaskTetParameter::SwitchMethod(int Value)
{ {
//if(Value == 1){ pcObject->Fininess.setValue(Value);
// ui->groupBox_AngleSearch->setEnabled(true); }
// ui->toolButton_Pick->setEnabled(true);
// ui->toolButton_Poly->setEnabled(false); void TaskTetParameter::maxSizeValueChanged(double Value)
//}else{ {
// ui->groupBox_AngleSearch->setEnabled(false); pcObject->MaxSize.setValue(Value);
// ui->toolButton_Pick->setEnabled(false);
// ui->toolButton_Poly->setEnabled(true);
//}
} }
@ -90,5 +87,4 @@ void TaskTetParameter::SwitchMethod(int Value)
#include "moc_TaskTetParameter.cpp" #include "moc_TaskTetParameter.cpp"

View File

@ -62,6 +62,7 @@ public:
private Q_SLOTS: private Q_SLOTS:
void SwitchMethod(int Value); void SwitchMethod(int Value);
void maxSizeValueChanged(double Value);
protected: protected:
Fem::FemMeshShapeNetgenObject *pcObject; Fem::FemMeshShapeNetgenObject *pcObject;

View File

@ -30,7 +30,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QDoubleSpinBox" name="doubleSpinBox"/> <widget class="QDoubleSpinBox" name="doubleSpinBox_MaxSize"/>
</item> </item>
</layout> </layout>
</item> </item>