#include <SVTK_ViewModel.h>
#include <SVTK_ViewWindow.h>
+#include <SalomeApp_IntSpinBox.h>
+
// OCCT includes
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
#include <QPushButton>
#include <QRadioButton>
#include <QCheckBox>
-#include <QSpinBox>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QGridLayout>
// Controls for nb. steps defining
TextLabelNbSteps = new QLabel(tr("SMESH_NUMBEROFSTEPS"), GroupArguments);
- SpinBox_NbSteps = new QSpinBox(GroupArguments);
+ SpinBox_NbSteps = new SalomeApp_IntSpinBox(GroupArguments);
// CheckBox for groups generation
MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
if (mySMESHGUI->isActiveStudyLocked())
return false;
+ if (!isValid())
+ return false;
+
if (myNbOkElements) {
SMESH::DirStruct aVector;
long aNbSteps = (long)SpinBox_NbSteps->value();
+ QStringList aParameters;
+ aParameters << SpinBox_Dx->text();
+ aParameters << SpinBox_Dy->text();
+ aParameters << SpinBox_Dz->text();
+ aParameters << SpinBox_NbSteps->text();
+
try {
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
else
aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
+ myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
+
} catch (...) {
}
ClickOnHelp();
}
}
+
+//=================================================================================
+// function : isValid
+// purpose :
+//=================================================================================
+bool SMESHGUI_ExtrusionDlg::isValid()
+{
+ QString msg;
+ bool ok = true;
+ ok = SpinBox_Dx->isValid( msg, true ) && ok;
+ ok = SpinBox_Dy->isValid( msg, true ) && ok;
+ ok = SpinBox_Dz->isValid( msg, true ) && ok;
+ ok = SpinBox_NbSteps->isValid( msg, true ) && ok;
+
+ if( !ok ) {
+ QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+ if ( !msg.isEmpty() )
+ str += "\n" + msg;
+ SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+ return false;
+ }
+ return true;
+}