From 7745fdb72688e9420e04178840c78209d10928b7 Mon Sep 17 00:00:00 2001 From: Viktor Uzlov Date: Mon, 8 Mar 2021 14:02:45 +0300 Subject: [PATCH] fix Group Dialog --- src/OBJECT/SMESH_Actor.cxx | 2 +- src/OBJECT/SMESH_ActorDef.h | 2 +- src/OBJECT/SMESH_CellLabelActor.cxx | 5 +---- src/OBJECT/SMESH_NodeLabelActor.cxx | 2 +- src/OBJECT/SMESH_SVTKActor.cxx | 6 +++--- src/SMESHGUI/SMESHGUI_GroupDlg.cxx | 12 ++++++++---- src/SMESHGUI/SMESHGUI_VTKUtils.cxx | 2 +- 7 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index 48b0c7d0f..05bec17b3 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.cxx @@ -2225,7 +2225,7 @@ void SMESH_ActorDef::SetBallScale( double theVal ) Modified(); } -int SMESH_ActorDef::GetObjDimension( const int theObjId ) +int SMESH_ActorDef::GetObjDimension( const vtkIdType theObjId ) { return myVisualObj->GetElemDimension( theObjId ); } diff --git a/src/OBJECT/SMESH_ActorDef.h b/src/OBJECT/SMESH_ActorDef.h index de1e91a63..467ab46db 100644 --- a/src/OBJECT/SMESH_ActorDef.h +++ b/src/OBJECT/SMESH_ActorDef.h @@ -151,7 +151,7 @@ class SMESH_ActorDef : public SMESH_Actor virtual vtkIdType GetElemObjId(vtkIdType theVtkID); virtual vtkCell* GetElemCell(vtkIdType theObjID); - virtual int GetObjDimension( const int theObjId ); + virtual int GetObjDimension( const vtkIdType theObjId ) override; virtual void SetVisibility(int theMode); void SetVisibility(int theMode, bool theIsUpdateRepersentation); diff --git a/src/OBJECT/SMESH_CellLabelActor.cxx b/src/OBJECT/SMESH_CellLabelActor.cxx index 34220b870..693dcb44c 100644 --- a/src/OBJECT/SMESH_CellLabelActor.cxx +++ b/src/OBJECT/SMESH_CellLabelActor.cxx @@ -71,7 +71,7 @@ SMESH_CellLabelActor::SMESH_CellLabelActor() myClsLabeledDataMapper = vtkLabeledDataMapper::New(); myClsLabeledDataMapper->SetInputConnection(myClsSelectVisiblePoints->GetOutputPort()); - myClsLabeledDataMapper->SetLabelFormat("%d"); + //myClsLabeledDataMapper->SetLabelFormat("%d"); myClsLabeledDataMapper->SetLabelModeToLabelScalars(); myClsTextProp = vtkTextProperty::New(); @@ -159,9 +159,6 @@ void SMESH_CellLabelActor::SetCellsLabeled(bool theIsCellsLabeled) vtkUnstructuredGrid *aDataSet = myCellsNumDataSet; vtkIdType aNbElem = aDataSet->GetNumberOfCells(); vtkIdTypeArray *anArray = vtkIdTypeArray::New(); - // - std::cout << "\n\n\n***********\nSizeof vtkIdType: " << sizeof(vtkIdType) << "\nSizeof smIdType: " << sizeof(smIdType) << "\n"; - // anArray->SetNumberOfValues(aNbElem); myExtractUnstructuredGrid->BuildOut2InMap(); for(vtkIdType anId = 0; anId < aNbElem; anId++) diff --git a/src/OBJECT/SMESH_NodeLabelActor.cxx b/src/OBJECT/SMESH_NodeLabelActor.cxx index 1b04fe731..150d89b59 100644 --- a/src/OBJECT/SMESH_NodeLabelActor.cxx +++ b/src/OBJECT/SMESH_NodeLabelActor.cxx @@ -61,7 +61,7 @@ SMESH_NodeLabelActor::SMESH_NodeLabelActor() myPtsLabeledDataMapper = vtkLabeledDataMapper::New(); myPtsLabeledDataMapper->SetInputConnection(myPtsSelectVisiblePoints->GetOutputPort()); - myPtsLabeledDataMapper->SetLabelFormat("%d"); + //myPtsLabeledDataMapper->SetLabelFormat("%d"); myPtsLabeledDataMapper->SetLabelModeToLabelScalars(); myPtsTextProp = vtkTextProperty::New(); diff --git a/src/OBJECT/SMESH_SVTKActor.cxx b/src/OBJECT/SMESH_SVTKActor.cxx index dd72914b0..2d32fce94 100644 --- a/src/OBJECT/SMESH_SVTKActor.cxx +++ b/src/OBJECT/SMESH_SVTKActor.cxx @@ -124,7 +124,7 @@ SMESH_SVTKActor myBallGrid->SetPoints( aSourceGrid->GetPoints() ); my0DGrid->SetPoints( aSourceGrid->GetPoints() ); - int aNbOfParts = theMapIndex.Extent(); + vtkIdType aNbOfParts = theMapIndex.Extent(); vtkCellData* cd = 0; vtkCellData* outputCD = 0; @@ -134,8 +134,8 @@ SMESH_SVTKActor cd = aSourceGrid->GetCellData(); } outputCD->CopyAllocate(cd,aNbOfParts,aNbOfParts/2); - for(int ind = 1; ind <= aNbOfParts; ind++){ - int aPartId = theMapIndex( ind ); + for(vtkIdType ind = 1; ind <= aNbOfParts; ind++){ + vtkIdType aPartId = theMapIndex( ind ); if(vtkCell* aCell = theMapActor->GetElemCell(aPartId)) { if (aCell->GetCellType() != VTK_POLYHEDRON) diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index 2dc454d81..6964928d1 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -2213,15 +2213,19 @@ void SMESHGUI_GroupDlg::onSort() // PAL5412: sorts items in ascending by "string" value // myElements->sort(true); // myElements->update(); - int i, k = myElements->count(); + vtkIdType i, k = myElements->count(); if (k > 0) { myIsBusy = true; - QList aSelected; - std::vector anArray(k); + QList aSelected; + std::vector anArray(k); // QMemArray anArray(k); // fill the array for (i = 0; i < k; i++) { - int id = myElements->item(i)->text().toInt(); + vtkIdType id; + if (sizeof(vtkIdType)==8) + id = myElements->item(i)->text().toLongLong(); + else + id = myElements->item(i)->text().toInt(); anArray[i] = id; if (myElements->item(i)->isSelected()) aSelected.append(id); diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx index 1cc4206eb..865f10a65 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx @@ -1211,7 +1211,7 @@ namespace SMESH SVTK_TIndexedMapOfVtkId aMapIndex; theSelector->GetIndex(theIO,aMapIndex); - typedef std::set TIdContainer; + typedef std::set TIdContainer; TIdContainer anIdContainer; for( int i = 1; i <= aMapIndex.Extent(); i++) anIdContainer.insert(aMapIndex(i));