From 90ff9bfc3e2c82d2fbef0b542fd3a7529850e8b7 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 26 Dec 2014 18:39:04 +0300 Subject: [PATCH] 0022752: [EDF] Provide explicit feedback on what has been done by Shape Processing operation Additional changes: - Add "Select All" check box to quickly select/deselect all operators. --- src/GEOMGUI/GEOM_msg_en.ts | 4 +++ src/GEOMGUI/GEOM_msg_fr.ts | 16 ++++++++++ src/GEOMGUI/GEOM_msg_ja.ts | 16 ++++++++++ src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx | 35 +++++++++++++++++++++ src/RepairGUI/RepairGUI_ShapeProcessDlg.h | 3 ++ 5 files changed, 74 insertions(+) diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts index 7ee84ce0c..87ee386b3 100644 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -6768,6 +6768,10 @@ Would you like to continue? TO_MERGE_SOLIDS To merge solids + + SELECT_ALL + Select All + GEOMToolsGUI_DeleteDlg diff --git a/src/GEOMGUI/GEOM_msg_fr.ts b/src/GEOMGUI/GEOM_msg_fr.ts index 9648154f7..1e6cbdd4c 100644 --- a/src/GEOMGUI/GEOM_msg_fr.ts +++ b/src/GEOMGUI/GEOM_msg_fr.ts @@ -6696,6 +6696,22 @@ Fermez cette boîte d'alerte et choisissez les arêtes à recoller.L'activation de cette option peut résulter en une perte de temps sur certains objets. Voulez-vous continuer? + + WIDTH_FACTOR_TOL + Width factor tol. + + + VOLUME_TOL + Volume tol. + + + TO_MERGE_SOLIDS + To merge solids + + + SELECT_ALL + Tout sélectionner + GEOMToolsGUI_DeleteDlg diff --git a/src/GEOMGUI/GEOM_msg_ja.ts b/src/GEOMGUI/GEOM_msg_ja.ts index a0f4c94bb..458bfcd44 100644 --- a/src/GEOMGUI/GEOM_msg_ja.ts +++ b/src/GEOMGUI/GEOM_msg_ja.ts @@ -6674,6 +6674,22 @@ TIME_CONSUMING このオプションを有効にすると、特定のオブジェクトを時間の無駄が可能性があります。続行しますか。 + + WIDTH_FACTOR_TOL + Width factor tol. + + + VOLUME_TOL + Volume tol. + + + TO_MERGE_SOLIDS + To merge solids + + + SELECT_ALL + 全選択 + GEOMToolsGUI_DeleteDlg diff --git a/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx b/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx index 716b79286..dc32f058e 100755 --- a/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx +++ b/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx @@ -97,6 +97,10 @@ void RepairGUI_ShapeProcessDlg::init() // layout the two group boxes in the middle, add a list of operations QGroupBox* anOperGr = new QGroupBox( tr( "GEOM_OPERATIONS" ), centralWidget() ); + // "select all" button + mySelectAll = new QCheckBox( tr( "SELECT_ALL" ), anOperGr ); + mySelectAll->setTristate( true ); + // operations list widget myOpList = new QListWidget( anOperGr ); myOpList->setSortingEnabled( false ); @@ -104,6 +108,7 @@ void RepairGUI_ShapeProcessDlg::init() QVBoxLayout* aOperLay = new QVBoxLayout( anOperGr ); aOperLay->setMargin( 9 ); + aOperLay->addWidget( mySelectAll ); aOperLay->addWidget( myOpList ); QGroupBox* aParamsGr = new QGroupBox( tr( "GEOM_PARAMETERS" ), centralWidget() ); @@ -347,6 +352,7 @@ void RepairGUI_ShapeProcessDlg::init() connect( myOpList, SIGNAL( currentRowChanged( int )), myStack, SLOT( setCurrentIndex( int ))); connect( myOpList, SIGNAL( itemChanged( QListWidgetItem* )), this, SLOT( operatorChecked( QListWidgetItem* ))); + connect( mySelectAll, SIGNAL( stateChanged( int ) ), this, SLOT( onSelectAll( int ))); adjustSize(); loadDefaults(); // init dialog fields with values from resource file @@ -357,6 +363,7 @@ void RepairGUI_ShapeProcessDlg::init() initName( tr( "PROCESS_SHAPE_NEW_OBJ_NAME" )); selectionChanged(); + updateSelectAll(); } //================================================================================= @@ -952,4 +959,32 @@ void RepairGUI_ShapeProcessDlg::operatorChecked( QListWidgetItem * item ) { myStack->setCurrentIndex( myOpList->row( item )); } + updateSelectAll(); +} + +void RepairGUI_ShapeProcessDlg::updateSelectAll() +{ + Qt::CheckState state = myOpList->count() > 0 ? myOpList->item(0)->checkState() : Qt::Unchecked; + for ( int i = 1; i < myOpList->count(); i++ ) { + if ( myOpList->item(i)->checkState() != state ) { + state = Qt::PartiallyChecked; + break; + } + } + mySelectAll->blockSignals( true ); + mySelectAll->setCheckState( state ); + mySelectAll->blockSignals( false ); +} + +void RepairGUI_ShapeProcessDlg::onSelectAll( int state ) +{ + if ( state == Qt::PartiallyChecked ) { + mySelectAll->setCheckState( Qt::Checked ); + return; + } + myOpList->blockSignals( true ); + for ( int i = 0; i < myOpList->count(); i++ ) { + myOpList->item(i)->setCheckState( (Qt::CheckState)state ); + } + myOpList->blockSignals( false ); } diff --git a/src/RepairGUI/RepairGUI_ShapeProcessDlg.h b/src/RepairGUI/RepairGUI_ShapeProcessDlg.h index 2049a0d62..61ce42c79 100755 --- a/src/RepairGUI/RepairGUI_ShapeProcessDlg.h +++ b/src/RepairGUI/RepairGUI_ShapeProcessDlg.h @@ -80,6 +80,7 @@ private: //QDict myCtrlMap; // map of controls (values) of parameters void initParamsValues(); // initialize the data structures void initSelection(); + void updateSelectAll(); private: QStringList myOpLst; // list of available Shape Healing Operators @@ -88,6 +89,7 @@ private: GEOM::ListOfGO_var myObjects; // selected objects DlgRef_1Sel* mySelectWdgt; + QCheckBox* mySelectAll; QListWidget* myOpList; QStackedLayout* myStack; @@ -141,6 +143,7 @@ private slots: void selectClicked(); void advOptionToggled( bool ); void operatorChecked( QListWidgetItem * item ); + void onSelectAll( int ); }; #endif // REPAIRGUI_SHAPEPROCESSDLG_H