X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_GroupDlg.cxx;h=30d77de3b69dbcccedafc511c53c96a6d4a1bd69;hp=e7b45e88913ac29e326f4b725fd08bf60ea130f5;hb=9fed37edd48010fc4d0cd601078d6f3896d6ca2f;hpb=b178951ce48ba01ac0fafb6610f07ad75784d31e diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index e7b45e889..30d77de3b 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -61,7 +61,6 @@ #include #include -#include #include @@ -447,16 +446,17 @@ void SMESHGUI_GroupDlg::initDialog( bool create) mySMESHGUI->SetActiveDialogBox(this); mySMESHGUI->SetState(800); + SalomeApp_Study* aStudy = dynamic_cast( mySMESHGUI->application()->activeStudy() ); mySelectionMode = grpNoSelection; - myMeshFilter = new SMESH_TypeFilter(SMESH::MESH); + + myMeshFilter = new SMESH_TypeFilter(SMESH::MESH); mySubMeshFilter = new SMESH_LogicalFilter(QList(), SMESH_LogicalFilter::LO_OR, /*takeOwnership=*/true); - myGroupFilter = new SMESH_LogicalFilter(QList(), - SMESH_LogicalFilter::LO_OR, - /*takeOwnership=*/true); - SalomeApp_Study* aStudy = dynamic_cast( mySMESHGUI->application()->activeStudy() ); - myGeomFilter = new GEOM_SelectionFilter( aStudy, true ); + myGroupFilter = new SMESH_LogicalFilter(QList(), + SMESH_LogicalFilter::LO_OR, + /*takeOwnership=*/true); + myGeomFilter = new GEOM_SelectionFilter( aStudy, true ); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(onDeactivate())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject())); @@ -519,7 +519,7 @@ QString SMESHGUI_GroupDlg::GetDefaultName(const QString& theOperation) bool isUnique = false; while (!isUnique) { aName = theOperation + "_" + QString::number(++aNumber); - isUnique = (aSet.count(aName.toUtf8().data()) == 0); + isUnique = (aSet.count(std::string(SMESH::toUtf8(aName))) == 0); } return aName; @@ -535,7 +535,7 @@ void SMESHGUI_GroupDlg::setDefaultName() const do { aResName = aPrefix + QString::number( i++ ); - anObj = aStudy->FindObject( aResName.toUtf8().data() ); + anObj = aStudy->FindObject( SMESH::toUtf8(aResName) ); } while ( anObj ); myName->setText(aResName); @@ -594,14 +594,14 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup, myNameChanged = true; myName->blockSignals(true); - myName->setText(QString::fromUtf8(theGroup->GetName())); + myName->setText(SMESH::fromUtf8(theGroup->GetName())); myName->blockSignals(false); myName->home(false); SALOMEDS::Color aColor = theGroup->GetColor(); setGroupColor( aColor ); - myMeshGroupLine->setText(QString::fromUtf8(theGroup->GetName())); + myMeshGroupLine->setText(SMESH::fromUtf8(theGroup->GetName())); int aType = 0; switch(theGroup->GetType()) { @@ -686,7 +686,7 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup, { myNameChanged = true; myName->blockSignals(true); - myName->setText(QString::fromUtf8(theGroup->GetName())); + myName->setText(SMESH::fromUtf8(theGroup->GetName())); myName->blockSignals(false); } @@ -1041,7 +1041,7 @@ bool SMESHGUI_GroupDlg::onApply() if (myGeomObjects->length() == 1) { myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType, - myName->text().toUtf8().data(), + SMESH::toUtf8(myName->text()), myGeomObjects[0]); } else { @@ -1083,11 +1083,11 @@ bool SMESHGUI_GroupDlg::onApply() aNewGeomGroupName += myName->text(); SALOMEDS::SObject_var aNewGroupSO = geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGroupVar, - aNewGeomGroupName.toUtf8().data(), aMeshShape); + SMESH::toUtf8(aNewGeomGroupName), aMeshShape); } myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType, - myName->text().toUtf8().data(), + SMESH::toUtf8(myName->text()), aGroupVar); } resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnGeom ); @@ -1110,7 +1110,7 @@ bool SMESHGUI_GroupDlg::onApply() return false; myGroupOnFilter = myMesh->CreateGroupFromFilter(aType, - myName->text().toUtf8().data(), + SMESH::toUtf8(myName->text()), myFilter); resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnFilter ); @@ -1151,7 +1151,7 @@ bool SMESHGUI_GroupDlg::onApply() } else { - resultGroup->SetName(myName->text().toUtf8().data()); + resultGroup->SetName(SMESH::toUtf8(myName->text())); if ( aMeshGroupSO ) { @@ -1166,7 +1166,7 @@ bool SMESHGUI_GroupDlg::onApply() if ( !anActor ) return false; myActorsList.append( anActor ); } - anActor->setName(myName->text().toUtf8().data()); + anActor->setName(SMESH::toUtf8(myName->text())); QColor c; int delta; switch ( myTypeId ) { @@ -1648,7 +1648,7 @@ void SMESHGUI_GroupDlg::onSelectGroup(bool on) //================================================================================= // function : (onSelectGeomGroup) -// purpose : Called when group type changed. on == "on group" or "on filter" +// purpose : Called when group type changed. on == "on geometry" or "on filter" //================================================================================= void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on) { @@ -1659,7 +1659,7 @@ void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on) else if (mySelectGroup->isChecked()) { mySelectGroup->setChecked(false); } - if ( myGrpTypeId == 1 ) { // on group + if ( myGrpTypeId == 1 ) { // on geometry myCurrentLineEdit = myGeomGroupLine; updateGeomPopup(); } @@ -1747,10 +1747,14 @@ void SMESHGUI_GroupDlg::setFilters() myFilterDlg->Init( aType ); } + bool isStandalone = ( sender() == myFilterBtn ); + myFilterDlg->SetEnabled( /*setInViewer=*/isStandalone, + /*diffSources=*/isStandalone ); myFilterDlg->SetMesh( myMesh ); myFilterDlg->SetSelection(); myFilterDlg->SetSourceWg( myElements, false ); + myFilterDlg->show(); }