X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_RevolutionDlg.cxx;h=dd3f2af306b89cc4c71d3ff8dda16284079ef516;hb=refs%2Ftags%2FV5_1_2rc3;hp=355e01ec3f5d695d38dabb8b13b1b8325d190a31;hpb=0635c9fc80f67d1e5dc0e94ec85f487286a92070;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx index 355e01ec3..dd3f2af30 100644 --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx @@ -144,8 +144,8 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule ) 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); @@ -238,7 +238,7 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule ) GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0); GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1); GroupArgumentsLayout->addWidget(LineEditElements, 0, 2); - GroupArgumentsLayout->addWidget(filterBtn, 0, 3); + GroupArgumentsLayout->addWidget(myFilterBtn, 0, 3); GroupArgumentsLayout->addWidget(CheckBoxMesh, 1, 0, 1, 4); GroupArgumentsLayout->addWidget(GroupAxis, 2, 0, 1, 4); GroupArgumentsLayout->addWidget(GroupAngleBox, 3, 0, 1, 4); @@ -383,6 +383,7 @@ void SMESHGUI_RevolutionDlg::Init (bool ResetControls) LineEditElements->clear(); myElementsId = ""; myNbOkElements = 0; + myIDs.clear(); myActor = 0; myMesh = SMESH::SMESH_Mesh::_nil(); @@ -412,14 +413,13 @@ void SMESHGUI_RevolutionDlg::Init (bool ResetControls) //================================================================================= void SMESHGUI_RevolutionDlg::ConstructorsClicked (int constructorId) { - //disconnect(mySelectionMgr, 0, this, 0); + disconnect(mySelectionMgr, 0, this, 0); - SALOME_ListIO io; + /* SALOME_ListIO io; mySelectionMgr->selectedObjects( io ); SALOME_ListIO aList; - mySelectionMgr->setSelectedObjects( aList ); -// LineEditElements->clear(); - myNbOkElements = 0; + mySelectionMgr->setSelectedObjects( aList );*/ + buttonApply->setEnabled(false); buttonOk->setEnabled(false); mySimulation->SetVisibility(false); @@ -447,6 +447,9 @@ void SMESHGUI_RevolutionDlg::ConstructorsClicked (int constructorId) if (!CheckBoxMesh->isChecked()) { + LineEditElements->clear(); + myIDs.clear(); + myNbOkElements = 0; if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(aSelMode); } @@ -457,8 +460,8 @@ void SMESHGUI_RevolutionDlg::ConstructorsClicked (int constructorId) if (CheckBoxMesh->isChecked()) onSelectMesh(true); - //connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - mySelectionMgr->setSelectedObjects( io ); + connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + // mySelectionMgr->setSelectedObjects( io ); } //================================================================================= @@ -836,6 +839,7 @@ void SMESHGUI_RevolutionDlg::SetEditCurrentArgument() mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); } else { int aConstructorId = GetConstructorId(); + myEditCurrentArgument = (QWidget*)SpinBox_X; if (aConstructorId == 0) { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) @@ -928,10 +932,13 @@ void SMESHGUI_RevolutionDlg::hideEvent (QHideEvent*) //======================================================================= void SMESHGUI_RevolutionDlg::onSelectMesh (bool toSelectMesh) { - if (toSelectMesh) + if (toSelectMesh) { + myIDs = LineEditElements->text(); TextLabelElements->setText(tr("SMESH_NAME")); + } else TextLabelElements->setText(tr("SMESH_ID_ELEMENTS")); + myFilterBtn->setEnabled(!toSelectMesh); if (myEditCurrentArgument != LineEditElements) { LineEditElements->clear(); @@ -955,7 +962,7 @@ void SMESHGUI_RevolutionDlg::onSelectMesh (bool toSelectMesh) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(EdgeSelection); } - else if (aConstructorId == 0) + else if (aConstructorId == 1) { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(FaceSelection); @@ -968,6 +975,9 @@ void SMESHGUI_RevolutionDlg::onSelectMesh (bool toSelectMesh) } SelectionIntoArgument(); + + if (!toSelectMesh) + LineEditElements->setText( myIDs ); } //================================================================================= @@ -1144,6 +1154,12 @@ void SMESHGUI_RevolutionDlg::onSelectVectorMenu( QAction* action){ //================================================================================= void SMESHGUI_RevolutionDlg::setFilters() { + if(myMesh->_is_nil()) { + SUIT_MessageBox::critical(this, + tr("SMESH_ERROR"), + tr("NO_MESH_SELECTED")); + return; + } if ( !myFilterDlg ) { QList types;