0022097: EDF 2408 SMESH: Hide ID of double node in the function "Merge nodes"

This commit is contained in:
vsr 2013-05-22 13:35:08 +00:00
parent b31e67c0a2
commit 10e0608dee
4 changed files with 46 additions and 30 deletions

View File

@ -74,10 +74,6 @@
#include <vtkIntArray.h> #include <vtkIntArray.h>
#include <vtkProperty2D.h> #include <vtkProperty2D.h>
#include <vtkPointData.h> #include <vtkPointData.h>
#include <vtkConfigure.h>
#if !defined(VTK_XVERSION)
#define VTK_XVERSION (VTK_MAJOR_VERSION<<16)+(VTK_MINOR_VERSION<<8)+(VTK_BUILD_VERSION)
#endif
// Qt includes // Qt includes
#include <QApplication> #include <QApplication>
@ -150,9 +146,6 @@ namespace SMESH
myPtsLabeledDataMapper = vtkLabeledDataMapper::New(); myPtsLabeledDataMapper = vtkLabeledDataMapper::New();
myPtsLabeledDataMapper->SetInputConnection(myPtsSelectVisiblePoints->GetOutputPort()); myPtsLabeledDataMapper->SetInputConnection(myPtsSelectVisiblePoints->GetOutputPort());
#if (VTK_XVERSION < 0x050200)
myPtsLabeledDataMapper->SetLabelFormat("%g");
#endif
myPtsLabeledDataMapper->SetLabelModeToLabelScalars(); myPtsLabeledDataMapper->SetLabelModeToLabelScalars();
vtkTextProperty* aPtsTextProp = vtkTextProperty::New(); vtkTextProperty* aPtsTextProp = vtkTextProperty::New();
@ -437,12 +430,14 @@ SMESHGUI_MergeDlg::SMESHGUI_MergeDlg (SMESHGUI* theModule, int theAction)
RemoveGroupButton = new QPushButton(tr("SMESH_BUT_REMOVE"), GroupCoincidentWidget); RemoveGroupButton = new QPushButton(tr("SMESH_BUT_REMOVE"), GroupCoincidentWidget);
SelectAllCB = new QCheckBox(tr("SELECT_ALL"), GroupCoincidentWidget); SelectAllCB = new QCheckBox(tr("SELECT_ALL"), GroupCoincidentWidget);
ShowIDs = new QCheckBox(tr("SHOW_IDS"), GroupCoincidentWidget);
GroupCoincidentLayout->addWidget(ListCoincident, 0, 0, 4, 2); GroupCoincidentLayout->addWidget(ListCoincident, 0, 0, 4, 2);
GroupCoincidentLayout->addWidget(DetectButton, 0, 2); GroupCoincidentLayout->addWidget(DetectButton, 0, 2);
GroupCoincidentLayout->addWidget(AddGroupButton, 2, 2); GroupCoincidentLayout->addWidget(AddGroupButton, 2, 2);
GroupCoincidentLayout->addWidget(RemoveGroupButton, 3, 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->setRowMinimumHeight(1, 10);
GroupCoincidentLayout->setRowStretch(1, 5); GroupCoincidentLayout->setRowStretch(1, 5);
@ -513,6 +508,8 @@ SMESHGUI_MergeDlg::SMESHGUI_MergeDlg (SMESHGUI* theModule, int theAction)
this->resize(10,10); this->resize(10,10);
ShowIDs->setChecked( true );
Init(); // Initialisations Init(); // Initialisations
} }
@ -562,6 +559,7 @@ void SMESHGUI_MergeDlg::Init()
connect(AddGroupButton, SIGNAL (clicked()), this, SLOT(onAddGroup())); connect(AddGroupButton, SIGNAL (clicked()), this, SLOT(onAddGroup()));
connect(RemoveGroupButton, SIGNAL (clicked()), this, SLOT(onRemoveGroup())); connect(RemoveGroupButton, SIGNAL (clicked()), this, SLOT(onRemoveGroup()));
connect(SelectAllCB, SIGNAL(toggled(bool)), this, SLOT(onSelectAll(bool))); 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(ListEdit, SIGNAL (itemSelectionChanged()), this, SLOT(onSelectElementFromGroup()));
connect(AddElemButton, SIGNAL (clicked()), this, SLOT(onAddElement())); connect(AddElemButton, SIGNAL (clicked()), this, SLOT(onAddElement()));
connect(RemoveElemButton, SIGNAL (clicked()), this, SLOT(onRemoveElement())); connect(RemoveElemButton, SIGNAL (clicked()), this, SLOT(onRemoveElement()));
@ -847,6 +845,7 @@ void SMESHGUI_MergeDlg::onSelectGroup()
return; return;
myEditCurrentArgument = (QWidget*)ListCoincident; myEditCurrentArgument = (QWidget*)ListCoincident;
myIsBusy = true;
ListEdit->clear(); ListEdit->clear();
TColStd_MapOfInteger anIndices; TColStd_MapOfInteger anIndices;
@ -872,6 +871,7 @@ void SMESHGUI_MergeDlg::onSelectGroup()
aList.Append(myActor->getIO()); aList.Append(myActor->getIO());
mySelectionMgr->setSelectedObjects(aList,false); mySelectionMgr->setSelectedObjects(aList,false);
if (ShowIDs->isChecked())
if (myAction == 0) { if (myAction == 0) {
myIdPreview->SetPointsData(myActor->GetObject()->GetMesh(), anIndices); myIdPreview->SetPointsData(myActor->GetObject()->GetMesh(), anIndices);
myIdPreview->SetPointsLabeled(!anIndices.IsEmpty(), myActor->GetVisibility()); myIdPreview->SetPointsLabeled(!anIndices.IsEmpty(), myActor->GetVisibility());
@ -882,8 +882,11 @@ void SMESHGUI_MergeDlg::onSelectGroup()
myIdPreview->SetElemsData( anIndices, aGrCentersXYZ); myIdPreview->SetElemsData( anIndices, aGrCentersXYZ);
myIdPreview->SetPointsLabeled(!anIndices.IsEmpty(), myActor->GetVisibility()); myIdPreview->SetPointsLabeled(!anIndices.IsEmpty(), myActor->GetVisibility());
} }
else
myIdPreview->SetPointsLabeled(false);
updateControls(); updateControls();
myIsBusy = false;
} }
//================================================================================= //=================================================================================
@ -921,6 +924,7 @@ void SMESHGUI_MergeDlg::onSelectElementFromGroup()
aList.Append(myActor->getIO()); aList.Append(myActor->getIO());
mySelectionMgr->setSelectedObjects(aList); mySelectionMgr->setSelectedObjects(aList);
if (ShowIDs->isChecked())
if (myAction == 0) { if (myAction == 0) {
myIdPreview->SetPointsData(myActor->GetObject()->GetMesh(), anIndices); myIdPreview->SetPointsData(myActor->GetObject()->GetMesh(), anIndices);
myIdPreview->SetPointsLabeled(!anIndices.IsEmpty(), myActor->GetVisibility()); myIdPreview->SetPointsLabeled(!anIndices.IsEmpty(), myActor->GetVisibility());
@ -931,6 +935,8 @@ void SMESHGUI_MergeDlg::onSelectElementFromGroup()
myIdPreview->SetElemsData(anIndices, aGrCentersXYZ); myIdPreview->SetElemsData(anIndices, aGrCentersXYZ);
myIdPreview->SetPointsLabeled(!anIndices.IsEmpty(), myActor->GetVisibility()); myIdPreview->SetPointsLabeled(!anIndices.IsEmpty(), myActor->GetVisibility());
} }
else
myIdPreview->SetPointsLabeled(false);
} }
//================================================================================= //=================================================================================
@ -982,8 +988,9 @@ void SMESHGUI_MergeDlg::onRemoveGroup()
delete anItem; delete anItem;
ListEdit->clear(); ListEdit->clear();
myIdPreview->SetPointsLabeled(false);
updateControls(); updateControls();
SMESH::UpdateView();
myIsBusy = false; myIsBusy = false;
} }

View File

@ -130,6 +130,7 @@ private:
QPushButton* AddGroupButton; QPushButton* AddGroupButton;
QPushButton* RemoveGroupButton; QPushButton* RemoveGroupButton;
QCheckBox* SelectAllCB; QCheckBox* SelectAllCB;
QCheckBox* ShowIDs;
QGroupBox* GroupEdit; QGroupBox* GroupEdit;
QListWidget* ListEdit; QListWidget* ListEdit;

View File

@ -4834,6 +4834,10 @@ Please select a group and try again</translation>
<source>SELECT_ALL</source> <source>SELECT_ALL</source>
<translation>Select all</translation> <translation>Select all</translation>
</message> </message>
<message>
<source>SHOW_IDS</source>
<translation>Show double nodes IDs</translation>
</message>
<message> <message>
<source>EXCLUDE_GROUPS</source> <source>EXCLUDE_GROUPS</source>
<translation>Exclude Groups</translation> <translation>Exclude Groups</translation>

View File

@ -4802,6 +4802,10 @@ Choisissez un groupe et essayez de nouveau</translation>
<source>SELECT_ALL</source> <source>SELECT_ALL</source>
<translation>Tout sélectionner</translation> <translation>Tout sélectionner</translation>
</message> </message>
<message>
<source>SHOW_IDS</source>
<translation type="unfinished">Show double nodes IDs</translation>
</message>
<message> <message>
<source>EXCLUDE_GROUPS</source> <source>EXCLUDE_GROUPS</source>
<translation>Exclure les groupes</translation> <translation>Exclure les groupes</translation>