X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_SymmetryDlg.cxx;h=661b50bbaed95771ee2a53b196dfbe01702e8be5;hb=248783c7c73067c8e2ad7c9cab174338d2d935a6;hp=ed49f5217b7e4967dcc6c20a9c58081fa566cece;hpb=0635c9fc80f67d1e5dc0e94ec85f487286a92070;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index ed49f5217..661b50bba 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -144,8 +144,8 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule ) SelectElementsButton->setIcon(image3); LineEditElements = new QLineEdit(GroupArguments); LineEditElements->setValidator(myIdValidator); - QPushButton* filterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments ); - connect(filterBtn, SIGNAL(clicked()), this, SLOT(setFilters())); + myFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments ); + connect(myFilterBtn, SIGNAL(clicked()), this, SLOT(setFilters())); // Control for the whole mesh selection CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments); @@ -224,7 +224,7 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule ) GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0); GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1); GroupArgumentsLayout->addWidget(LineEditElements, 0, 2, 1, 1); - GroupArgumentsLayout->addWidget(filterBtn, 0, 3); + GroupArgumentsLayout->addWidget(myFilterBtn, 0, 3); GroupArgumentsLayout->addWidget(CheckBoxMesh, 1, 0, 1, 4); GroupArgumentsLayout->addWidget(GroupMirror, 2, 0, 1, 4); GroupArgumentsLayout->addWidget(ActionBox, 3, 0, 3, 3); @@ -261,12 +261,12 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule ) SMESHGUI_SymmetryDlgLayout->addWidget(GroupButtons); /* Initialisations */ - SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3); - SpinBox_Y->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3); - SpinBox_Z->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3); - SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3); - SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3); - SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3); + SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision"); + SpinBox_Y->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision"); + SpinBox_Z->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision"); + SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision"); + SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision"); + SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision"); RadioButton1->setChecked(true); @@ -416,8 +416,8 @@ void SMESHGUI_SymmetryDlg::ConstructorsClicked (int constructorId) SMESH::SetPointRepresentation(false); if (!CheckBoxMesh->isChecked()) { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(CellSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(CellSelection); } } @@ -431,7 +431,7 @@ void SMESHGUI_SymmetryDlg::ConstructorsClicked (int constructorId) QApplication::instance()->processEvents(); updateGeometry(); - resize( minimumSize() ); + resize(100,100); } //================================================================================= @@ -499,8 +499,8 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply() else aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, false ); - if( !myMesh->_is_nil()) - myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters)); + if( !myMesh->_is_nil()) + myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); break; } case COPY_ELEMS_BUTTON: { @@ -517,8 +517,8 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply() else aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, true); } - if( !myMesh->_is_nil()) - myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters)); + if( !myMesh->_is_nil()) + myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); break; } case MAKE_MESH_BUTTON: { @@ -529,8 +529,8 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply() else mesh = aMeshEditor->MirrorMakeMesh(anElementsId, aMirror, aMirrorType, makeGroups, LineEditNewMesh->text().toLatin1().data()); - if( !mesh->_is_nil()) - mesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters)); + if( !mesh->_is_nil()) + mesh->SetParameters( aParameters.join(":").toLatin1().constData() ); break; } } @@ -595,10 +595,10 @@ void SMESHGUI_SymmetryDlg::ClickOnHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -633,15 +633,15 @@ void SMESHGUI_SymmetryDlg::onTextChange (const QString& theNewText) if (send == LineEditElements) { for (int i = 0; i < aListId.count(); i++) { - const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt()); - if (e) - newIndices.Add(e->GetID()); - myNbOkElements++; + const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt()); + if (e) + newIndices.Add(e->GetID()); + myNbOkElements++; } mySelector->AddOrRemoveIndex( anIO, newIndices, false ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->highlight( anIO, true, true ); + aViewWindow->highlight( anIO, true, true ); myElementsId = theNewText; } @@ -695,7 +695,7 @@ void SMESHGUI_SymmetryDlg::SelectionIntoArgument() myActor = SMESH::FindActorByObject(myMesh); if (!myActor) myActor = SMESH::FindActorByEntry(IO->getEntry()); - if (!myActor) + if (!myActor && !CheckBoxMesh->isChecked()) return; int aNbUnits = 0; @@ -832,11 +832,11 @@ void SMESHGUI_SymmetryDlg::SetEditCurrentArgument() SMESH::SetPointRepresentation(false); if (CheckBoxMesh->isChecked()) { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(ActorSelection); + aViewWindow->SetSelectionMode(ActorSelection); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); } else { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(CellSelection); + aViewWindow->SetSelectionMode(CellSelection); } } else if (send == SelectPointButton) { myEditCurrentArgument = (QWidget*)SpinBox_X; @@ -931,6 +931,7 @@ void SMESHGUI_SymmetryDlg::onSelectMesh (bool toSelectMesh) TextLabelElements->setText(tr("SMESH_NAME")); else TextLabelElements->setText(tr("SMESH_ID_ELEMENTS")); + myFilterBtn->setEnabled(!toSelectMesh); if (myEditCurrentArgument != LineEditElements) { LineEditElements->clear(); @@ -1073,6 +1074,12 @@ void SMESHGUI_SymmetryDlg::keyPressEvent( QKeyEvent* e ) //================================================================================= void SMESHGUI_SymmetryDlg::setFilters() { + if(myMesh->_is_nil()) { + SUIT_MessageBox::critical(this, + tr("SMESH_ERROR"), + tr("NO_MESH_SELECTED")); + return; + } if ( !myFilterDlg ) myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL );