X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_GroupOpDlg.cxx;h=bfcf3189502170562df58bd22adcedb98fdf9983;hp=3462495c88ff9bdfa2872b89450f848057b6ed9b;hb=bb40f7c1d3542da1ff59b6c3bface0574789dded;hpb=066f625a46b60642f228a0c10fc6c2dcdc20d304 diff --git a/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx index 3462495c8..bfcf31895 100644 --- a/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx @@ -30,37 +30,34 @@ #include "SMESHGUI.h" #include "SMESHGUI_Utils.h" #include "SMESHGUI_VTKUtils.h" - -#include - -// SALOME GUI includes -#include -#include -#include -#include +#include "SMESH_TypeFilter.hxx" #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include - -// SALOME KERNEL includes -#include // Qt includes -#include -#include +#include +#include +#include #include -#include #include +#include +#include #include #include -#include #include -#include -#include -#include +#include +#include #define SPACING 6 #define MARGIN 11 @@ -110,7 +107,7 @@ QWidget* SMESHGUI_GroupOpDlg::createMainFrame( QWidget* theParent ) aLay->setSpacing(SPACING); // ------------------------------------------------------ - QGroupBox* aNameGrp = new QGroupBox(tr("NAME"), aMainGrp); + QGroupBox* aNameGrp = new QGroupBox(tr("RESULT"), aMainGrp); QHBoxLayout* aNameGrpLayout = new QHBoxLayout(aNameGrp); aNameGrpLayout->setMargin(MARGIN); aNameGrpLayout->setSpacing(SPACING); @@ -312,6 +309,7 @@ bool SMESHGUI_GroupOpDlg::isValid( const QList& theL */ void SMESHGUI_GroupOpDlg::onOk() { + SUIT_OverrideCursor oc; setIsApplyAndClose( true ); if ( onApply() ) reject(); @@ -951,35 +949,55 @@ void SMESHGUI_CutGroupsDlg::onSelectionDone() \param theModule module */ SMESHGUI_DimGroupDlg::SMESHGUI_DimGroupDlg( SMESHGUI* theModule ) -: SMESHGUI_GroupOpDlg( theModule ) + : SMESHGUI_GroupOpDlg( theModule ) { setWindowTitle( tr( "CREATE_GROUP_OF_UNDERLYING_ELEMS" ) ); setHelpFileName( "group_of_underlying_elements_page.html" ); QGroupBox* anArgGrp = getArgGrp(); - QLabel* aLbl = new QLabel( tr( "ELEMENTS_TYPE" ), anArgGrp ); - - myCombo = new QComboBox( anArgGrp ); - static QStringList anItems; - if ( anItems.isEmpty() ) + QLabel* aTypeLbl = new QLabel( tr( "ELEMENTS_TYPE" ), anArgGrp ); + + myTypeCombo = new QComboBox( anArgGrp ); + QStringList anItems; { - anItems.append( tr( "NODE" ) ); - anItems.append( tr( "EDGE" ) ); - anItems.append( tr( "FACE" ) ); - anItems.append( tr( "VOLUME" ) ); + anItems.append( tr( "MESH_NODE" ) ); + anItems.append( tr( "SMESH_EDGE" ) ); + anItems.append( tr( "SMESH_FACE" ) ); + anItems.append( tr( "SMESH_VOLUME" ) ); + anItems.append( tr( "SMESH_ELEM0D" ) ); + anItems.append( tr( "SMESH_BALL" ) ); } - myCombo->addItems( anItems ); - myCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - + myTypeCombo->addItems( anItems ); + myTypeCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); + + QLabel* aNbNoLbl = new QLabel( tr( "NUMBER_OF_COMMON_NODES" ), anArgGrp ); + + myNbNoCombo = new QComboBox( anArgGrp ); + anItems.clear(); + { + anItems.append( tr( "ALL" ) ); + anItems.append( tr( "MAIN" ) ); + anItems.append( tr( "AT_LEAST_ONE" ) ); + anItems.append( tr( "MAJORITY" ) ); + } + myNbNoCombo->addItems( anItems ); + myNbNoCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); + myListWg = new QListWidget( anArgGrp ); + myUnderlOnlyChk = new QCheckBox( tr("UNDERLYING_ENTITIES_ONLY"), anArgGrp ); + myUnderlOnlyChk->setChecked( false ); + // layout QGridLayout* aLay = new QGridLayout( anArgGrp ); aLay->setSpacing( SPACING ); - aLay->addWidget( aLbl, 0, 0 ); - aLay->addWidget( myCombo, 0, 1 ); - aLay->addWidget( myListWg, 1, 0, 1, 2 ); + aLay->addWidget( aTypeLbl, 0, 0 ); + aLay->addWidget( myTypeCombo, 0, 1 ); + aLay->addWidget( aNbNoLbl, 1, 0 ); + aLay->addWidget( myNbNoCombo, 1, 1 ); + aLay->addWidget( myListWg, 2, 0, 1, 2 ); + aLay->addWidget( myUnderlOnlyChk, 3, 0 ); } /*! @@ -1007,7 +1025,7 @@ void SMESHGUI_DimGroupDlg::reset() */ SMESH::ElementType SMESHGUI_DimGroupDlg::getElementType() const { - return (SMESH::ElementType)( myCombo->currentIndex() + 1 ); + return (SMESH::ElementType)( myTypeCombo->currentIndex() + 1 ); } /*! @@ -1017,7 +1035,7 @@ SMESH::ElementType SMESHGUI_DimGroupDlg::getElementType() const */ void SMESHGUI_DimGroupDlg::setElementType( const SMESH::ElementType& theElemType ) { - myCombo->setCurrentIndex( theElemType - 1 ); + myTypeCombo->setCurrentIndex( theElemType - 1 ); } /*! @@ -1047,10 +1065,19 @@ bool SMESHGUI_DimGroupDlg::onApply() QStringList anEntryList; try { - SMESH::ListOfGroups_var aList = convert( myGroups ); + SMESH::ListOfIDSources_var aList = new SMESH::ListOfIDSources(); + aList->length( myGroups.count() ); + QList::const_iterator anIter = myGroups.begin(); + for ( int i = 0; anIter != myGroups.end(); ++anIter, ++i ) + aList[ i ] = SMESH::SMESH_IDSource::_narrow( *anIter ); + SMESH::ElementType anElemType = getElementType(); - SMESH::SMESH_Group_var aNewGrp = - aMesh->CreateDimGroup( aList, anElemType, aName.toLatin1().constData() ); + SMESH::NB_COMMON_NODES_ENUM aNbCoNodes = + (SMESH::NB_COMMON_NODES_ENUM) myNbNoCombo->currentIndex(); + + SMESH::SMESH_Group_var aNewGrp = + aMesh->CreateDimGroup( aList, anElemType, aName.toLatin1().constData(), + aNbCoNodes, myUnderlOnlyChk->isChecked() ); if ( !CORBA::is_nil( aNewGrp ) ) { aNewGrp->SetColor( getColor() ); @@ -1092,5 +1119,3 @@ void SMESHGUI_DimGroupDlg::onSelectionDone() myListWg->clear(); myListWg->addItems( aNames ); } - -