From: eap Date: Wed, 11 Nov 2015 13:13:01 +0000 (+0300) Subject: 52943: "Apply and Close" button does not active on symmetry dialog box X-Git-Tag: V8_0_0a1~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7b33b10e89859b5599e5d4819b87a183b64ea42c;p=modules%2Fsmesh.git 52943: "Apply and Close" button does not active on symmetry dialog box Fix same pb in all similar dlg --- diff --git a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx index 9f85f5c27..35611dfe5 100644 --- a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx @@ -494,6 +494,9 @@ void SMESHGUI_CopyMeshDlg::onTextChange (const QString& theNewText) void SMESHGUI_CopyMeshDlg::SelectionIntoArgument() { if (myBusy) return; + if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active + if (!GroupButtons->isEnabled()) return; // inactive + BusyLocker lock( myBusy ); // clear @@ -677,6 +680,15 @@ void SMESHGUI_CopyMeshDlg::setFilters() if ( !myFilterDlg ) myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL ); + QList types; + if ( myMesh->NbEdges() ) types << SMESH::EDGE; + if ( myMesh->NbFaces() ) types << SMESH::FACE; + if ( myMesh->NbVolumes() ) types << SMESH::VOLUME; + if ( myMesh->NbBalls() ) types << SMESH::BALL; + if ( myMesh->Nb0DElements()) types << SMESH::ELEM0D; + if ( types.count() > 1 ) types << SMESH::ALL; + + myFilterDlg->Init( types ); myFilterDlg->SetSelection(); myFilterDlg->SetMesh( myMesh ); myFilterDlg->SetSourceWg( myLineEditElements ); diff --git a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx index 199bdf420..1767a2805 100644 --- a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx +++ b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx @@ -299,14 +299,14 @@ void SMESHGUI_Make2DFrom3DOp::selectionDone() myDlg->selectObject( names, types, ids ); // enable/desable "new mesh" button - bool isMesh = true; // EAP - it's sometimes necessary to copy to a new mesh - // for ( int i = 0; i < ids.count() && isMesh; ++i ) - // { - // _PTR(SObject) sobj = - // SMESHGUI::activeStudy()->studyDS()->FindObjectID( ids[i].toLatin1().constData() ); - // mySrcMesh = SMESH::SObjectToInterface( sobj ); - // isMesh = !mySrcMesh->_is_nil(); - // } + bool isMesh = true; + for ( int i = 0; i < ids.count() && isMesh; ++i ) + { + _PTR(SObject) sobj = + SMESHGUI::activeStudy()->studyDS()->FindObjectID( ids[i].toLatin1().constData() ); + mySrcMesh = SMESH::SObjectToInterface( sobj ); + //isMesh = !mySrcMesh->_is_nil(); // EAP - it's sometimes necessary to copy to a new mesh + } myDlg->setNewMeshEnabled( isMesh ); } catch ( const SALOME::SALOME_Exception& S_ex ) { diff --git a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx index a8cdcb1ea..1ebfd0622 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx @@ -377,7 +377,7 @@ void SMESHGUI_RemoveElementsDlg::onTextChange(const QString& theNewText) void SMESHGUI_RemoveElementsDlg::SelectionIntoArgument() { if (myBusy) return; // busy - if (myFilterDlg && myFilterDlg->isVisible()) return; // filter digl active + if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active if (!GroupButtons->isEnabled()) return; // inactive // clear diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx index 9531609ab..1ed6e0a79 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx @@ -677,6 +677,7 @@ void SMESHGUI_RotationDlg::onTextChange (const QString& theNewText) void SMESHGUI_RotationDlg::SelectionIntoArgument() { if (myBusy) return; + if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active // clear myActor = 0; @@ -1064,6 +1065,15 @@ void SMESHGUI_RotationDlg::setFilters() if ( !myFilterDlg ) myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL ); + QList types; + if ( myMeshes[0]->NbEdges() ) types << SMESH::EDGE; + if ( myMeshes[0]->NbFaces() ) types << SMESH::FACE; + if ( myMeshes[0]->NbVolumes() ) types << SMESH::VOLUME; + if ( myMeshes[0]->NbBalls() ) types << SMESH::BALL; + if ( myMeshes[0]->Nb0DElements()) types << SMESH::ELEM0D; + if ( types.count() > 1 ) types << SMESH::ALL; + + myFilterDlg->Init( types ); myFilterDlg->SetSelection(); myFilterDlg->SetMesh( myMeshes[0] ); myFilterDlg->SetSourceWg( LineEditElements ); diff --git a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx index 1e712f0a3..8f4ab6993 100644 --- a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx @@ -715,6 +715,8 @@ void SMESHGUI_ScaleDlg::onTextChange (const QString& theNewText) void SMESHGUI_ScaleDlg::SelectionIntoArgument() { if (myBusy) return; + if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active + BusyLocker lock( myBusy ); // clear myActor = 0; @@ -1112,6 +1114,15 @@ void SMESHGUI_ScaleDlg::setFilters() if ( !myFilterDlg ) myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL ); + QList types; + if ( myMeshes[0]->NbEdges() ) types << SMESH::EDGE; + if ( myMeshes[0]->NbFaces() ) types << SMESH::FACE; + if ( myMeshes[0]->NbVolumes() ) types << SMESH::VOLUME; + if ( myMeshes[0]->NbBalls() ) types << SMESH::BALL; + if ( myMeshes[0]->Nb0DElements()) types << SMESH::ELEM0D; + if ( types.count() > 1 ) types << SMESH::ALL; + + myFilterDlg->Init( types ); myFilterDlg->SetSelection(); myFilterDlg->SetMesh( myMeshes[0] ); myFilterDlg->SetSourceWg( LineEditElements ); diff --git a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx index 30c98a6aa..e272d010c 100644 --- a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx @@ -566,6 +566,7 @@ void SMESHGUI_SmoothingDlg::onTextChange (const QString& theNewText) void SMESHGUI_SmoothingDlg::SelectionIntoArgument() { if (myBusy) return; + if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active // clear QString aString = ""; @@ -574,7 +575,8 @@ void SMESHGUI_SmoothingDlg::SelectionIntoArgument() BusyLocker lock( myBusy ); if (myEditCurrentArgument == LineEditElements || - myEditCurrentArgument == LineEditNodes) { + myEditCurrentArgument == LineEditNodes) + { myEditCurrentArgument->setText(aString); if (myEditCurrentArgument == LineEditElements) { myNbOkElements = 0; diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index 1b484b5b3..eebc605df 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -736,6 +736,7 @@ void SMESHGUI_SymmetryDlg::onTextChange (const QString& theNewText) void SMESHGUI_SymmetryDlg::SelectionIntoArgument() { if (myBusy) return; + if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active // clear myActor = 0; @@ -1134,6 +1135,15 @@ void SMESHGUI_SymmetryDlg::setFilters() if ( !myFilterDlg ) myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL ); + QList types; + if ( myMeshes[0]->NbEdges() ) types << SMESH::EDGE; + if ( myMeshes[0]->NbFaces() ) types << SMESH::FACE; + if ( myMeshes[0]->NbVolumes() ) types << SMESH::VOLUME; + if ( myMeshes[0]->NbBalls() ) types << SMESH::BALL; + if ( myMeshes[0]->Nb0DElements()) types << SMESH::ELEM0D; + if ( types.count() > 1 ) types << SMESH::ALL; + + myFilterDlg->Init( types ); myFilterDlg->SetSelection(); myFilterDlg->SetMesh( myMeshes[0] ); myFilterDlg->SetSourceWg( LineEditElements ); @@ -1173,10 +1183,13 @@ bool SMESHGUI_SymmetryDlg::isValid() // function : onDisplaySimulation // purpose : Show/Hide preview //================================================================================= -void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) { - if (myPreviewCheckBox->isChecked() && toDisplayPreview) { - if ( myNbOkElements && isValid() && IsMirrorOk() ) { - QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts); +void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) +{ + if (myPreviewCheckBox->isChecked() && toDisplayPreview) + { + if ( myNbOkElements && isValid() && IsMirrorOk() ) + { + QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts); SMESH::long_array_var anElementsId = new SMESH::long_array; anElementsId->length(aListElementsId.count()); @@ -1185,7 +1198,7 @@ void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) { SMESH::AxisStruct aMirror; SMESH::SMESH_MeshEditor::MirrorType aMirrorType; - + getMirror(aMirror,aMirrorType); try { @@ -1201,7 +1214,7 @@ void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) { } else { SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditPreviewer(); - aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, copy ); + aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, copy ); aMeshPreviewStruct << aMeshEditor->GetPreviewData(); } setSimulationPreview(aMeshPreviewStruct); @@ -1210,7 +1223,7 @@ void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) { } } else { hidePreview(); - } + } } else { hidePreview(); } @@ -1220,7 +1233,9 @@ void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) { // function : getMirror // purpose : return mirror parameters //================================================================================= -void SMESHGUI_SymmetryDlg::getMirror(SMESH::AxisStruct& theMirror, SMESH::SMESH_MeshEditor::MirrorType& theMirrorType) { +void SMESHGUI_SymmetryDlg::getMirror(SMESH::AxisStruct& theMirror, + SMESH::SMESH_MeshEditor::MirrorType& theMirrorType) +{ theMirror.x = SpinBox_X->GetValue(); theMirror.y = SpinBox_Y->GetValue(); theMirror.z = SpinBox_Z->GetValue(); diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx index 32c94694a..5d1c66901 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx @@ -745,6 +745,8 @@ void SMESHGUI_TranslationDlg::onTextChange (const QString& theNewText) void SMESHGUI_TranslationDlg::SelectionIntoArgument() { if (myBusy) return; + if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active + BusyLocker lock( myBusy ); // clear myActor = 0; @@ -1106,6 +1108,15 @@ void SMESHGUI_TranslationDlg::setFilters() if ( !myFilterDlg ) myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL ); + QList types; + if ( myMeshes[0]->NbEdges() ) types << SMESH::EDGE; + if ( myMeshes[0]->NbFaces() ) types << SMESH::FACE; + if ( myMeshes[0]->NbVolumes() ) types << SMESH::VOLUME; + if ( myMeshes[0]->NbBalls() ) types << SMESH::BALL; + if ( myMeshes[0]->Nb0DElements()) types << SMESH::ELEM0D; + if ( types.count() > 1 ) types << SMESH::ALL; + + myFilterDlg->Init( types ); myFilterDlg->SetSelection(); myFilterDlg->SetMesh( myMeshes[0] ); myFilterDlg->SetSourceWg( LineEditElements ); @@ -1147,9 +1158,10 @@ bool SMESHGUI_TranslationDlg::isValid() //================================================================================= void SMESHGUI_TranslationDlg::onDisplaySimulation( bool toDisplayPreview ) { - if (myPreviewCheckBox->isChecked() && toDisplayPreview) { - - if (isValid() && myNbOkElements) { + if (myPreviewCheckBox->isChecked() && toDisplayPreview) + { + if (isValid() && myNbOkElements) + { QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts); SMESH::long_array_var anElementsId = new SMESH::long_array;