X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_MergeDlg.cxx;h=24b96938dd71ef3c4559d7d6e145179087153ea9;hb=5dcd4d5ae91ab46a88b607a5bc2d6afb09e83761;hp=82884701fc835d6ccb2285cf73a6477c13db4d7c;hpb=88b3dbe23b236bd1746405155ae33a76aaf59ecd;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_MergeDlg.cxx b/src/SMESHGUI/SMESHGUI_MergeDlg.cxx index 82884701f..24b96938d 100644 --- a/src/SMESHGUI/SMESHGUI_MergeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MergeDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -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 @@ -124,7 +120,7 @@ namespace SMESH // Create and display actor vtkDataSetMapper* aMapper = vtkDataSetMapper::New(); - aMapper->SetInput( myIdGrid ); + aMapper->SetInputData( myIdGrid ); myIdActor = SALOME_Actor::New(); myIdActor->SetInfinitive(true); @@ -140,19 +136,16 @@ namespace SMESH myPointsNumDataSet = vtkUnstructuredGrid::New(); myPtsMaskPoints = vtkMaskPoints::New(); - myPtsMaskPoints->SetInput(myPointsNumDataSet); + myPtsMaskPoints->SetInputData(myPointsNumDataSet); myPtsMaskPoints->SetOnRatio(1); myPtsSelectVisiblePoints = vtkSelectVisiblePoints::New(); - myPtsSelectVisiblePoints->SetInput(myPtsMaskPoints->GetOutput()); + myPtsSelectVisiblePoints->SetInputConnection(myPtsMaskPoints->GetOutputPort()); myPtsSelectVisiblePoints->SelectInvisibleOff(); myPtsSelectVisiblePoints->SetTolerance(0.1); myPtsLabeledDataMapper = vtkLabeledDataMapper::New(); - myPtsLabeledDataMapper->SetInput(myPtsSelectVisiblePoints->GetOutput()); -#if (VTK_XVERSION < 0x050200) - myPtsLabeledDataMapper->SetLabelFormat("%g"); -#endif + myPtsLabeledDataMapper->SetInputConnection(myPtsSelectVisiblePoints->GetOutputPort()); myPtsLabeledDataMapper->SetLabelModeToLabelScalars(); vtkTextProperty* aPtsTextProp = vtkTextProperty::New(); @@ -250,7 +243,7 @@ namespace SMESH anArray->SetValue( i, myIDs[i] ); aDataSet->GetPointData()->SetScalars( anArray ); anArray->Delete(); - myPtsMaskPoints->SetInput( aDataSet ); + myPtsMaskPoints->SetInputData( aDataSet ); myPointLabels->SetVisibility( theIsActorVisible ); } else { @@ -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(myAction == 1 ? tr("SHOW_ELEMS_IDS") : tr("SHOW_NODES_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; }