X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_GroupDlg.cxx;h=82da54af8c3566903314b83e75b0f201507acef0;hp=2a86d827468eab72b721d81310a63304e02a56c5;hb=82ea47a7c97534a75833d9d46448d10190a72cc6;hpb=a2f0f70d5912ea83c868916f06eaefb58a32ec2e diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index 2a86d8274..82da54af8 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -89,9 +89,8 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name, WStyle_Title | WStyle_SysMenu | WDestructiveClose), mySMESHGUI( theModule ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), - myViewWindow( SMESH::GetViewWindow( theModule ) ), - mySelector( myViewWindow->GetSelector() ), - myIsBusy( false ) + myIsBusy( false ), + myActor( 0 ) { if (!name) setName("SMESHGUI_GroupDlg"); initDialog(true); @@ -104,6 +103,8 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name, myGeomGroupLine->setEnabled(false); } + mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector(); + /* Move widget on the botton right corner of main widget */ int x, y ; mySMESHGUI->DefineDlgPosition(this, x, y); @@ -120,19 +121,23 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name, WStyle_Title | WStyle_SysMenu | WDestructiveClose), mySMESHGUI( theModule ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), - myViewWindow( SMESH::GetViewWindow( theModule ) ), - mySelector( myViewWindow->GetSelector() ), myIsBusy( false ) { if (!name) setName("SMESHGUI_GroupDlg"); + + mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector(); + initDialog(false); if (!theGroup->_is_nil()) init(theGroup); else { mySelectSubMesh->setEnabled(false); mySelectGroup->setEnabled(false); - } + myCurrentLineEdit = myMeshGroupLine; + setSelectionMode(5); + } + /* Move widget on the botton right corner of main widget */ int x, y ; mySMESHGUI->DefineDlgPosition(this, x, y); @@ -532,7 +537,7 @@ void SMESHGUI_GroupDlg::setSelectionMode (int theMode) return; if (mySelectionMode != theMode) { - mySelectionMgr->clearSelected(); + // [PAL10408] mySelectionMgr->clearSelected(); mySelectionMgr->clearFilters(); SMESH::SetPointRepresentation(false); if (theMode < 4) { @@ -542,19 +547,24 @@ void SMESHGUI_GroupDlg::setSelectionMode (int theMode) myActor->SetPointRepresentation(true); else SMESH::SetPointRepresentation(true); - myViewWindow->SetSelectionMode(NodeSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(NodeSelection); break; case 1: - myViewWindow->SetSelectionMode(EdgeSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(EdgeSelection); break; case 2: - myViewWindow->SetSelectionMode(FaceSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(FaceSelection); break; default: - myViewWindow->SetSelectionMode(VolumeSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(VolumeSelection); } } else { - myViewWindow->SetSelectionMode(ActorSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); if (theMode == 4) mySelectionMgr->installFilter(mySubMeshFilter); else if (theMode == 5) @@ -706,7 +716,8 @@ void SMESHGUI_GroupDlg::onListSelectionChanged() SALOME_ListIO aList; aList.Append(myActor->getIO()); mySelectionMgr->setSelectedObjects(aList,false); - myViewWindow->highlight( myActor->getIO(), true, true ); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->highlight( myActor->getIO(), true, true ); } myIsBusy = false; } @@ -833,7 +844,7 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() aGroupMainShape = GEOM::GEOM_Object::_duplicate(myGeomGroup); _PTR(SObject) aGroupMainShapeSO = //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(aGroupMainShape)); - aStudy->FindObjectIOR(aGroupMainShape->GetStudyEntry()); + aStudy->FindObjectID(aGroupMainShape->GetStudyEntry()); // The mesh SObject _PTR(SObject) aMeshSO = SMESH::FindSObject(myMesh); @@ -885,7 +896,7 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() updateButtons(); } else { - if (aNbSel == 1) { + if (aNbSel == 1 && myActor ) { QString aListStr = ""; int aNbItems = 0; if (myTypeId == 0) { @@ -1198,7 +1209,7 @@ void SMESHGUI_GroupDlg::onAdd() if (aGroupType == aType) { _PTR(SObject) aGroupSO = //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(myGeomGroup)); - aStudy->FindObjectIOR(myGeomGroup->GetStudyEntry()); + aStudy->FindObjectID(myGeomGroup->GetStudyEntry()); // Construct filter SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager(); SMESH::Filter_var aFilter = aFilterMgr->CreateFilter(); @@ -1391,7 +1402,8 @@ void SMESHGUI_GroupDlg::onClose() } mySelectionMgr->clearSelected(); - myViewWindow->SetSelectionMode(ActorSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); mySelectionMgr->clearFilters(); mySMESHGUI->ResetState();