From 248783c7c73067c8e2ad7c9cab174338d2d935a6 Mon Sep 17 00:00:00 2001 From: dmv Date: Wed, 21 Apr 2010 06:32:54 +0000 Subject: [PATCH] 0020847: EDF 1378 SMESH : Selection problem with symetry + translation --- src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx | 15 ++++++++++----- src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_RotationDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_ScaleDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx | 12 +++++++----- src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_TranslationDlg.cxx | 5 +++-- 7 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx index 4b4a633e9..868373139 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx @@ -472,7 +472,7 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply() //if (myMesh->_is_nil() || MeshCheck->isChecked() && myIDSource->_is_nil() || // !myMeshActor || myPathMesh->_is_nil() || myPathShape->_is_nil()) if ( myMesh->_is_nil() || MeshCheck->isChecked() && myIDSource->_is_nil() || - !myMeshActor || myPath->_is_nil() ) + /*!myMeshActor ||*/ myPath->_is_nil() ) return false; if (!isValid()) @@ -484,7 +484,10 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply() // If "Select whole mesh, submesh or group" check box is off -> // use only elements of given type selected by user - SMDS_Mesh* aMesh = myMeshActor->GetObject()->GetMesh(); + SMDS_Mesh* aMesh; + if ( myMeshActor ) + aMesh = myMeshActor->GetObject()->GetMesh(); + if (aMesh) { QStringList aListElementsId = ElementsLineEdit->text().split(" ", QString::SkipEmptyParts); anElementsId = new SMESH::long_array; @@ -664,7 +667,9 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply() } //mySelectionMgr->clearSelected(); - SMESH::Update( myMeshActor->getIO(), myMeshActor->GetVisibility() ); + if ( myMeshActor ) + SMESH::Update( myMeshActor->getIO(), myMeshActor->GetVisibility() ); + if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) mySMESHGUI->updateObjBrowser(true); // new groups may appear //SMESH::UpdateView(); @@ -855,7 +860,7 @@ void SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument() } // find actor myMeshActor = SMESH::FindActorByObject(myMesh); - if (!myMeshActor) + if (!myMeshActor && !MeshCheck->isChecked()) return; if (MeshCheck->isChecked()) { @@ -988,7 +993,7 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument() void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button) { disconnect(mySelectionMgr, 0, this, 0); - mySelectionMgr->clearSelected(); + // mySelectionMgr->clearSelected(); mySelectionMgr->clearFilters(); SMESH::SetPickable(); diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx index cae6339b0..d1f35f5fd 100644 --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx @@ -714,7 +714,7 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument() SMESH_Actor* anActor = SMESH::FindActorByObject(aMeshVar); if (!anActor) anActor = SMESH::FindActorByEntry(IO->getEntry()); - if (!anActor) + if (!anActor && !CheckBoxMesh->isChecked()) return; int aNbUnits = 0; diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx index a34ec8c65..bdec01dbf 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx @@ -605,7 +605,7 @@ void SMESHGUI_RotationDlg::SelectionIntoArgument() myActor = SMESH::FindActorByObject(myMesh); if (!myActor) myActor = SMESH::FindActorByEntry(IO->getEntry()); - if (!myActor) + if (!myActor && !CheckBoxMesh->isChecked()) return; int aNbUnits = 0; diff --git a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx index c4706505e..2679ffe6e 100644 --- a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx @@ -675,7 +675,7 @@ void SMESHGUI_ScaleDlg::SelectionIntoArgument() myActor = SMESH::FindActorByObject(myMesh); if (!myActor) myActor = SMESH::FindActorByEntry(IO->getEntry()); - if (!myActor) + if (!myActor && !CheckBoxMesh->isChecked()) return; int aNbUnits = 0; diff --git a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx index d0d6365a6..b66cf70fa 100644 --- a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx @@ -386,11 +386,13 @@ bool SMESHGUI_SmoothingDlg::ClickOnApply() } if (aResult) { - Handle(SALOME_InteractiveObject) anIO = myActor->getIO(); + if ( myActor ) { + Handle(SALOME_InteractiveObject) anIO = myActor->getIO(); + SALOME_ListIO aList; + aList.Append(anIO); + mySelectionMgr->setSelectedObjects(aList, false); + } - SALOME_ListIO aList; - aList.Append(anIO); - mySelectionMgr->setSelectedObjects(aList, false); SMESH::UpdateView(); Init(); @@ -564,7 +566,7 @@ void SMESHGUI_SmoothingDlg::SelectionIntoArgument() return; myActor = SMESH::FindActorByObject(myMesh); - if (!myActor) + if (!myActor && !CheckBoxMesh->isChecked()) return; int aNbUnits = 0; diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index cf863ff4a..661b50bba 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -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; diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx index 354176e92..47ff56c1f 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx @@ -676,8 +676,9 @@ void SMESHGUI_TranslationDlg::SelectionIntoArgument() myActor = SMESH::FindActorByObject(myMesh); if (!myActor) myActor = SMESH::FindActorByEntry(IO->getEntry()); - if (!myActor) - return; + + if (!myActor && !CheckBoxMesh->isChecked()) + return; int aNbUnits = 0; -- 2.30.2