#include <QVBoxLayout>
#include <QGridLayout>
#include <QKeyEvent>
+#include <QButtonGroup>
// IDL includes
#include <SALOMEconfig.h>
/***************************************************************/
GroupConstructors = new QGroupBox(tr("SMESH_SMOOTHING"), this);
+ QButtonGroup* ButtonGroup = new QButtonGroup(this);
QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors);
GroupConstructorsLayout->setSpacing(SPACING);
GroupConstructorsLayout->setMargin(MARGIN);
Constructor1->setIcon(image0);
Constructor1->setChecked(true);
GroupConstructorsLayout->addWidget(Constructor1);
- GroupConstructorsLayout->addStretch();
+ ButtonGroup->addButton(Constructor1, 0);
/***************************************************************/
GroupArguments = new QGroupBox(tr("SMESH_ARGUMENTS"), this);
GroupArgumentsLayout->setSpacing(SPACING);
GroupArgumentsLayout->setMargin(MARGIN);
+ myIdValidator = new SMESHGUI_IdValidator(this);
+
// Controls for elements selection
TextLabelElements = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments);
SelectElementsButton->setIcon(image1);
LineEditElements = new QLineEdit(GroupArguments);
- LineEditElements->setValidator(new SMESHGUI_IdValidator(this));
+ LineEditElements->setValidator(myIdValidator);
// Control for the whole mesh selection
CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
SelectNodesButton->setIcon(image1);
LineEditNodes = new QLineEdit(GroupArguments);
- LineEditNodes->setValidator(new SMESHGUI_IdValidator(this));
+ LineEditNodes->setValidator(myIdValidator);
// Controls for method selection
TextLabelMethod = new QLabel(tr("METHOD"), GroupArguments);
GroupButtonsLayout->setSpacing(SPACING);
GroupButtonsLayout->setMargin(MARGIN);
- buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons);
+ buttonOk = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), GroupButtons);
buttonOk->setAutoDefault(true);
buttonOk->setDefault(true);
buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
if (mySMESHGUI->isActiveStudyLocked())
return;
- if (myNbOkElements &&
- (myNbOkNodes || LineEditNodes->text().trimmed().isEmpty())) {
+ if (myNbOkElements && (myNbOkNodes || LineEditNodes->text().trimmed().isEmpty())) {
QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
QStringList aListNodesId = LineEditNodes->text().split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListElementsId.count(); i++)
anElementsId[i] = aListElementsId[i].toInt();
- if (myNbOkNodes) {
+ if ( myNbOkNodes && aListNodesId.count() > 0 ) {
aNodesId->length(aListNodesId.count());
for (int i = 0; i < aListNodesId.count(); i++)
aNodesId[i] = aListNodesId[i].toInt();
bool aResult = false;
try {
+ SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- QApplication::setOverrideCursor(Qt::WaitCursor);
+
if ( CheckBoxParametric->isChecked() )
aResult = aMeshEditor->SmoothParametric(anElementsId.inout(), aNodesId.inout(),
anIterationLimit, aMaxAspectRatio, aMethod);
else
aResult = aMeshEditor->Smooth(anElementsId.inout(), aNodesId.inout(),
anIterationLimit, aMaxAspectRatio, aMethod);
- QApplication::restoreOverrideCursor();
} catch (...) {
}
if (myBusy) return;
// clear
- myActor = 0;
QString aString = "";
myBusy = true;
myNbOkElements = 0;
buttonOk->setEnabled(false);
buttonApply->setEnabled(false);
+ myActor = 0;
}
myBusy = false;
myBusy = true;
myEditCurrentArgument->setText(aString);
+ myEditCurrentArgument->repaint();
+ myEditCurrentArgument->setEnabled(false); // to update lineedit IPAL 19809
+ myEditCurrentArgument->setEnabled(true);
myBusy = false;
// OK
else if (myEditCurrentArgument == LineEditNodes)
myNbOkNodes = true;
- if (myNbOkElements) {
+ if (myNbOkElements && (myNbOkNodes || LineEditNodes->text().trimmed().isEmpty())) {
buttonOk->setEnabled(true);
buttonApply->setEnabled(true);
}
myEditCurrentArgument = LineEditElements;
SMESH::SetPointRepresentation(false);
if (CheckBoxMesh->isChecked()) {
- mySelectionMgr->setSelectionModes(ActorSelection);
- mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
+ // mySelectionMgr->setSelectionModes(ActorSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(ActorSelection);
+ mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(CellSelection);
+ aViewWindow->SetSelectionMode(FaceSelection);
}
- } else if (send == SelectNodesButton) {
+ } else if (send == SelectNodesButton) {
+ LineEditNodes->clear();
myEditCurrentArgument = LineEditNodes;
SMESH::SetPointRepresentation(true);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) {
aViewWindow->SetSelectionMode(NodeSelection);
+ }
}
myEditCurrentArgument->setFocus();
mySMESHGUI->SetActiveDialogBox(this);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(CellSelection);
+ aViewWindow->SetSelectionMode(FaceSelection);
SelectionIntoArgument();
}
SMESH::SetPointRepresentation(false);
if (toSelectMesh) {
- mySelectionMgr->setSelectionModes(ActorSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(ActorSelection);
+ // mySelectionMgr->setSelectionModes(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
LineEditElements->setReadOnly(true);
+ LineEditElements->setValidator(0);
} else {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(CellSelection);
+ aViewWindow->SetSelectionMode(FaceSelection);
LineEditElements->setReadOnly(false);
+ LineEditElements->setValidator(myIdValidator);
onTextChange(LineEditElements->text());
}