X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_GroupDlg.cxx;h=54a1a5c700770693bcfc528ca14a3b566080f644;hb=985e3a36299a495197a5cfab7ab31d17365f3e1f;hp=f0e6f7f636cf9345b682c338f3302715bf4e0580;hpb=e87a86a68d394635790206ff39c90b5ab8b775bc;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index f0e6f7f63..54a1a5c70 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -38,7 +38,7 @@ #include #include -#include +//#include #include // SALOME GEOM includes @@ -921,7 +921,7 @@ bool SMESHGUI_GroupDlg::onApply() QStringList anEntryList; SMESH::SMESH_GroupBase_var resultGroup; - bool isCreation; + bool isCreation, isConversion = false; if (myGrpTypeId == 0) // standalone { @@ -940,8 +940,9 @@ bool SMESHGUI_GroupDlg::onApply() else myGroup = myMesh->ConvertToStandalone( myGroupOnGeom ); - myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); + myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); myGroupOnFilter = SMESH::SMESH_GroupOnFilter::_nil(); + isConversion = true; } } @@ -1150,7 +1151,17 @@ bool SMESHGUI_GroupDlg::onApply() resultGroup->SetName(myName->text().toLatin1().data()); if ( aMeshGroupSO ) + { if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) { + if ( isConversion ) { // need to reset TVisualObj and actor + Handle(SALOME_InteractiveObject) anIO = anActor->getIO(); + SMESH::RemoveVisualObjectWithActors( anIO->getEntry(), true ); + SMESH::Update( anIO,true); + myActorsList.clear(); + anActor = SMESH::FindActorByEntry( anIO->getEntry() ); + if ( !anActor ) return false; + myActorsList.append( anActor ); + } anActor->setName(myName->text().toLatin1().data()); QColor c; int delta; @@ -1160,16 +1171,17 @@ bool SMESHGUI_GroupDlg::onApply() case grpBallSelection: anActor->SetBallColor( aColor.R, aColor.G, aColor.B ); break; case grpEdgeSelection: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break; case grpVolumeSelection: - SMESH::GetColor("SMESH", "volume_color", c , delta, "255,0,170|-100"); - anActor->SetVolumeColor( aColor.R, aColor.G, aColor.B, delta ); break; - break; + SMESH::GetColor("SMESH", "volume_color", c , delta, "255,0,170|-100"); + anActor->SetVolumeColor( aColor.R, aColor.G, aColor.B, delta ); break; + break; case grpFaceSelection: default: - SMESH::GetColor("SMESH", "fill_color", c , delta, "0,170,255|-100"); - anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B, delta ); break; - break; + SMESH::GetColor("SMESH", "fill_color", c , delta, "0,170,255|-100"); + anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B, delta ); break; + break; } } + } } SMESHGUI::Modified(); mySMESHGUI->updateObjBrowser(true); @@ -1193,6 +1205,8 @@ void SMESHGUI_GroupDlg::onOK() if ( onApply() ) reject(); setIsApplyAndClose( false ); + + if ( myFilterDlg ) myFilterDlg->UnRegisterFilters(); } //================================================================================= @@ -2202,6 +2216,8 @@ void SMESHGUI_GroupDlg::reject() mySMESHGUI->ResetState(); QDialog::reject(); + + if ( myFilterDlg ) myFilterDlg->UnRegisterFilters(); } //=================================================================================