From 10e0608deef2d973bfa96977b3409e5433b7623f Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 22 May 2013 13:35:08 +0000 Subject: [PATCH] 0022097: EDF 2408 SMESH: Hide ID of double node in the function "Merge nodes" --- src/SMESHGUI/SMESHGUI_MergeDlg.cxx | 67 +++++++++++++++++------------- src/SMESHGUI/SMESHGUI_MergeDlg.h | 1 + src/SMESHGUI/SMESH_msg_en.ts | 4 ++ src/SMESHGUI/SMESH_msg_fr.ts | 4 ++ 4 files changed, 46 insertions(+), 30 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_MergeDlg.cxx b/src/SMESHGUI/SMESHGUI_MergeDlg.cxx index dfb2de764..b84999e85 100644 --- a/src/SMESHGUI/SMESHGUI_MergeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MergeDlg.cxx @@ -74,10 +74,6 @@ #include #include #include -#include -#if !defined(VTK_XVERSION) -#define VTK_XVERSION (VTK_MAJOR_VERSION<<16)+(VTK_MINOR_VERSION<<8)+(VTK_BUILD_VERSION) -#endif // Qt includes #include @@ -150,9 +146,6 @@ namespace SMESH myPtsLabeledDataMapper = vtkLabeledDataMapper::New(); myPtsLabeledDataMapper->SetInputConnection(myPtsSelectVisiblePoints->GetOutputPort()); -#if (VTK_XVERSION < 0x050200) - myPtsLabeledDataMapper->SetLabelFormat("%g"); -#endif myPtsLabeledDataMapper->SetLabelModeToLabelScalars(); vtkTextProperty* aPtsTextProp = vtkTextProperty::New(); @@ -437,12 +430,14 @@ SMESHGUI_MergeDlg::SMESHGUI_MergeDlg (SMESHGUI* theModule, int theAction) RemoveGroupButton = new QPushButton(tr("SMESH_BUT_REMOVE"), GroupCoincidentWidget); SelectAllCB = new QCheckBox(tr("SELECT_ALL"), GroupCoincidentWidget); + ShowIDs = new QCheckBox(tr("SHOW_IDS"), GroupCoincidentWidget); GroupCoincidentLayout->addWidget(ListCoincident, 0, 0, 4, 2); GroupCoincidentLayout->addWidget(DetectButton, 0, 2); GroupCoincidentLayout->addWidget(AddGroupButton, 2, 2); GroupCoincidentLayout->addWidget(RemoveGroupButton, 3, 2); - GroupCoincidentLayout->addWidget(SelectAllCB, 4, 0, 1, 3); + GroupCoincidentLayout->addWidget(SelectAllCB, 4, 0); + GroupCoincidentLayout->addWidget(ShowIDs, 4, 1); GroupCoincidentLayout->setRowMinimumHeight(1, 10); GroupCoincidentLayout->setRowStretch(1, 5); @@ -513,6 +508,8 @@ SMESHGUI_MergeDlg::SMESHGUI_MergeDlg (SMESHGUI* theModule, int theAction) this->resize(10,10); + ShowIDs->setChecked( true ); + Init(); // Initialisations } @@ -562,6 +559,7 @@ void SMESHGUI_MergeDlg::Init() connect(AddGroupButton, SIGNAL (clicked()), this, SLOT(onAddGroup())); connect(RemoveGroupButton, SIGNAL (clicked()), this, SLOT(onRemoveGroup())); connect(SelectAllCB, SIGNAL(toggled(bool)), this, SLOT(onSelectAll(bool))); + connect(ShowIDs, SIGNAL(toggled(bool)), this, SLOT(onSelectGroup())); connect(ListEdit, SIGNAL (itemSelectionChanged()), this, SLOT(onSelectElementFromGroup())); connect(AddElemButton, SIGNAL (clicked()), this, SLOT(onAddElement())); connect(RemoveElemButton, SIGNAL (clicked()), this, SLOT(onRemoveElement())); @@ -847,6 +845,7 @@ void SMESHGUI_MergeDlg::onSelectGroup() return; myEditCurrentArgument = (QWidget*)ListCoincident; + myIsBusy = true; ListEdit->clear(); TColStd_MapOfInteger anIndices; @@ -872,18 +871,22 @@ void SMESHGUI_MergeDlg::onSelectGroup() aList.Append(myActor->getIO()); mySelectionMgr->setSelectedObjects(aList,false); - if (myAction == 0) { - myIdPreview->SetPointsData(myActor->GetObject()->GetMesh(), anIndices); - myIdPreview->SetPointsLabeled(!anIndices.IsEmpty(), myActor->GetVisibility()); - } - else { - std::list< gp_XYZ > aGrCentersXYZ; - FindGravityCenter(anIndices, aGrCentersXYZ); - myIdPreview->SetElemsData( anIndices, aGrCentersXYZ); - myIdPreview->SetPointsLabeled(!anIndices.IsEmpty(), myActor->GetVisibility()); - } + if (ShowIDs->isChecked()) + if (myAction == 0) { + myIdPreview->SetPointsData(myActor->GetObject()->GetMesh(), anIndices); + myIdPreview->SetPointsLabeled(!anIndices.IsEmpty(), myActor->GetVisibility()); + } + else { + std::list< gp_XYZ > aGrCentersXYZ; + FindGravityCenter(anIndices, aGrCentersXYZ); + myIdPreview->SetElemsData( anIndices, aGrCentersXYZ); + myIdPreview->SetPointsLabeled(!anIndices.IsEmpty(), myActor->GetVisibility()); + } + else + myIdPreview->SetPointsLabeled(false); updateControls(); + myIsBusy = false; } //================================================================================= @@ -920,17 +923,20 @@ void SMESHGUI_MergeDlg::onSelectElementFromGroup() SALOME_ListIO aList; aList.Append(myActor->getIO()); mySelectionMgr->setSelectedObjects(aList); - - if (myAction == 0) { - myIdPreview->SetPointsData(myActor->GetObject()->GetMesh(), anIndices); - myIdPreview->SetPointsLabeled(!anIndices.IsEmpty(), myActor->GetVisibility()); - } - else { - std::list< gp_XYZ > aGrCentersXYZ; - FindGravityCenter(anIndices, aGrCentersXYZ); - myIdPreview->SetElemsData(anIndices, aGrCentersXYZ); - myIdPreview->SetPointsLabeled(!anIndices.IsEmpty(), myActor->GetVisibility()); - } + + if (ShowIDs->isChecked()) + if (myAction == 0) { + myIdPreview->SetPointsData(myActor->GetObject()->GetMesh(), anIndices); + myIdPreview->SetPointsLabeled(!anIndices.IsEmpty(), myActor->GetVisibility()); + } + else { + std::list< gp_XYZ > aGrCentersXYZ; + FindGravityCenter(anIndices, aGrCentersXYZ); + myIdPreview->SetElemsData(anIndices, aGrCentersXYZ); + myIdPreview->SetPointsLabeled(!anIndices.IsEmpty(), myActor->GetVisibility()); + } + else + myIdPreview->SetPointsLabeled(false); } //================================================================================= @@ -982,8 +988,9 @@ void SMESHGUI_MergeDlg::onRemoveGroup() delete anItem; ListEdit->clear(); + myIdPreview->SetPointsLabeled(false); updateControls(); - + SMESH::UpdateView(); myIsBusy = false; } diff --git a/src/SMESHGUI/SMESHGUI_MergeDlg.h b/src/SMESHGUI/SMESHGUI_MergeDlg.h index 8065b6f35..de4fa51e6 100644 --- a/src/SMESHGUI/SMESHGUI_MergeDlg.h +++ b/src/SMESHGUI/SMESHGUI_MergeDlg.h @@ -130,6 +130,7 @@ private: QPushButton* AddGroupButton; QPushButton* RemoveGroupButton; QCheckBox* SelectAllCB; + QCheckBox* ShowIDs; QGroupBox* GroupEdit; QListWidget* ListEdit; diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index 25b69aa82..d0a239665 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -4834,6 +4834,10 @@ Please select a group and try again SELECT_ALL Select all + + SHOW_IDS + Show double nodes IDs + EXCLUDE_GROUPS Exclude Groups diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index f9ca69371..965aedad9 100755 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -4802,6 +4802,10 @@ Choisissez un groupe et essayez de nouveau SELECT_ALL Tout sélectionner + + SHOW_IDS + Show double nodes IDs + EXCLUDE_GROUPS Exclure les groupes