Salome HOME
bos #20256: [CEA 18523] Porting SMESH to int 64 bits
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MultiEditDlg.cxx
index 10cd338dba7a95903d4be90d7bcc861aafb5aaf1..fb6bb6d5b16f76d3359a29e428042b72bbf3b4b5 100644 (file)
@@ -57,7 +57,7 @@
 
 #include <SVTK_Selector.h>
 #include <SVTK_ViewWindow.h>
-#include <VTKViewer_CellLocationsArray.h>
+//#include <VTKViewer_CellLocationsArray.h>
 
 // OCCT includes
 #include <Bnd_B3d.hxx>
@@ -437,9 +437,9 @@ void SMESHGUI_MultiEditDlg::onOk()
 // Purpose : Retrieve identifiers from list box or the whole object
 //=======================================================================
 
-SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds(SMESH::SMESH_IDSource_var& obj)
+SMESH::smIdType_array_var SMESHGUI_MultiEditDlg::getIds(SMESH::SMESH_IDSource_var& obj)
 {
-  SMESH::long_array_var anIds = new SMESH::long_array;
+  SMESH::smIdType_array_var anIds = new SMESH::smIdType_array;
 
   if (myToAllChk->isChecked())
   {
@@ -697,7 +697,7 @@ void SMESHGUI_MultiEditDlg::onAddBtn()
   if (nbSelected == 0)
     return;
 
-  TColStd_IndexedMapOfInteger toBeAdded;
+  SVTK_TIndexedMapOfVtkId toBeAdded;
 
   if (!mySubmeshChk->isChecked() && !myGroupChk->isChecked()) {
     if (nbSelected > 0)
@@ -709,9 +709,9 @@ void SMESHGUI_MultiEditDlg::onAddBtn()
         SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIter.Value());
       if (!aSubMesh->_is_nil()) {
         if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
-          SMESH::long_array_var anIds = aSubMesh->GetElementsId();
+          SMESH::smIdType_array_var anIds = aSubMesh->GetElementsId();
           for (int i = 0, n = anIds->length(); i < n; i++) {
-            if (isIdValid(anIds[ i ]))
+            if (isIdValid(FromSmIdType<int>(anIds[ i ])))
               toBeAdded.Add(anIds[ i ]);
           }
         }
@@ -725,9 +725,9 @@ void SMESHGUI_MultiEditDlg::onAddBtn()
       if (!aGroup->_is_nil() && ((aGroup->GetType() == SMESH::FACE && entityType() == 0) || 
                                  (aGroup->GetType() == SMESH::VOLUME && entityType() == 1))) {
         if (aGroup->GetMesh()->GetId() == myMesh->GetId()) {
-          SMESH::long_array_var anIds = aGroup->GetListOfID();
+          SMESH::smIdType_array_var anIds = aGroup->GetListOfID();
           for (int i = 0, n = anIds->length(); i < n; i++) {
-            if (isIdValid(anIds[ i ]))
+            if (isIdValid(FromSmIdType<int>(anIds[ i ])))
               toBeAdded.Add(anIds[ i ]);
           }
         }
@@ -875,7 +875,7 @@ void SMESHGUI_MultiEditDlg::onListSelectionChanged()
     anActor = myActor;
   TVisualObjPtr anObj = anActor->GetObject();
 
-  TColStd_MapOfInteger anIndexes;
+  SVTK_TVtkIDsMap anIndexes;
   int total = myListBox->count();
   for (int i = 0; i < total; i++)
   {
@@ -1008,7 +1008,7 @@ bool SMESHGUI_MultiEditDlg::onApply()
   SUIT_OverrideCursor aWaitCursor;
 
   SMESH::SMESH_IDSource_var obj;
-  SMESH::long_array_var anIds = getIds(obj);
+  SMESH::smIdType_array_var anIds = getIds(obj);
 
   bool aResult = process(aMeshEditor, anIds.inout(), obj);
   if (aResult) {
@@ -1099,9 +1099,9 @@ SMESHGUI_ChangeOrientationDlg::~SMESHGUI_ChangeOrientationDlg()
 {
 }
 
-bool SMESHGUI_ChangeOrientationDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
-                                             const SMESH::long_array&    theIds,
-                                             SMESH::SMESH_IDSource_ptr   obj)
+bool SMESHGUI_ChangeOrientationDlg::process (SMESH::SMESH_MeshEditor_ptr  theEditor,
+                                             const SMESH::smIdType_array& theIds,
+                                             SMESH::SMESH_IDSource_ptr    obj)
 {
   if ( CORBA::is_nil( obj ))
     return theEditor->Reorient(theIds);
@@ -1109,7 +1109,7 @@ bool SMESHGUI_ChangeOrientationDlg::process (SMESH::SMESH_MeshEditor_ptr theEdit
     return theEditor->ReorientObject( obj );
 }
 
-int SMESHGUI_ChangeOrientationDlg::nbElemsInMesh()
+smIdType SMESHGUI_ChangeOrientationDlg::nbElemsInMesh()
 {
   return ( myFilterType == SMESH::FaceFilter ) ? myMesh->NbFaces() : myMesh->NbVolumes();
 }
@@ -1189,7 +1189,7 @@ bool SMESHGUI_UnionOfTrianglesDlg::isValid (const bool theMess)
 }
 
 bool SMESHGUI_UnionOfTrianglesDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
-                                            const SMESH::long_array&    theIds,
+                                            const SMESH::smIdType_array&    theIds,
                                             SMESH::SMESH_IDSource_ptr   obj)
 {
   {
@@ -1207,7 +1207,7 @@ bool SMESHGUI_UnionOfTrianglesDlg::process (SMESH::SMESH_MeshEditor_ptr theEdito
   return ok;
 }
 
-int SMESHGUI_UnionOfTrianglesDlg::nbElemsInMesh()
+smIdType SMESHGUI_UnionOfTrianglesDlg::nbElemsInMesh()
 {
   return myMesh->NbTriangles();
 }
@@ -1220,7 +1220,7 @@ void SMESHGUI_UnionOfTrianglesDlg::onDisplaySimulation( bool toDisplayPreview )
         SUIT_OverrideCursor aWaitCursor;
         // get Ids of elements
         SMESH::SMESH_IDSource_var obj;
-        SMESH::long_array_var anElemIds = getIds( obj );
+        SMESH::smIdType_array_var anElemIds = getIds( obj );
 
         SMESH::NumericalFunctor_var aCriterion  = getNumericalFunctor();
         SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
@@ -1302,7 +1302,7 @@ void SMESHGUI_CuttingOfQuadsDlg::reject()
 }
 
 bool SMESHGUI_CuttingOfQuadsDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
-                                          const SMESH::long_array&    theIds,
+                                          const SMESH::smIdType_array&    theIds,
                                           SMESH::SMESH_IDSource_ptr   obj)
 {
   bool hasObj = (! CORBA::is_nil( obj ));
@@ -1327,7 +1327,7 @@ bool SMESHGUI_CuttingOfQuadsDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
   return hasObj ? theEditor->QuadToTriObject(obj, aCrit) : theEditor->QuadToTri(theIds, aCrit);
 }
 
-int SMESHGUI_CuttingOfQuadsDlg::nbElemsInMesh()
+smIdType SMESHGUI_CuttingOfQuadsDlg::nbElemsInMesh()
 {
   return myMesh->NbQuadrangles();
 }
@@ -1382,7 +1382,7 @@ void SMESHGUI_CuttingOfQuadsDlg::displayPreview()
   SUIT_OverrideCursor aWaitCursor;
   // get Ids of elements
   SMESH::SMESH_IDSource_var obj;
-  SMESH::long_array_var anElemIds = getIds(obj);
+  SMESH::smIdType_array_var anElemIds = getIds(obj);
   if (anElemIds->length() == 0 && obj->_is_nil() )
     return;
 
@@ -1439,13 +1439,13 @@ void SMESHGUI_CuttingOfQuadsDlg::displayPreview()
       const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>(anIter->next());
       if (aNode)
       {
-        if (!anIdToVtk.IsBound(aNode->GetID()))
+        if (!anIdToVtk.IsBound(FromSmIdType<int>(aNode->GetID())))
         {
           aPoints->SetPoint(++nbPoints, aNode->X(), aNode->Y(), aNode->Z());
-          anIdToVtk.Bind(aNode->GetID(), nbPoints);
+          anIdToVtk.Bind(FromSmIdType<int>(aNode->GetID()), nbPoints);
         }
 
-        aNodes[ k++ ] = aNode->GetID();
+        aNodes[ k++ ] = FromSmIdType<int>(aNode->GetID());
       }
     }
 
@@ -1464,7 +1464,7 @@ void SMESHGUI_CuttingOfQuadsDlg::displayPreview()
     else // use numerical functor
     {
       // compare two sets of possible triangles
-      int diag = aMeshEditor->BestSplit(anElemIds[i], aCriterion);
+      smIdType diag = aMeshEditor->BestSplit(anElemIds[i], aCriterion);
       if (diag == 1) // 1-3
         isDiag13 = true;
       else if (diag == 2) // 2-4
@@ -1503,7 +1503,7 @@ void SMESHGUI_CuttingOfQuadsDlg::displayPreview()
     }
   }
 
-  VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
+  vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
   aCellLocationsArray->SetNumberOfComponents(1);
   aCellLocationsArray->SetNumberOfTuples(aNbCells);
 
@@ -1648,7 +1648,7 @@ SMESHGUI_SplitVolumesDlg::~SMESHGUI_SplitVolumesDlg()
 }
 
 bool SMESHGUI_SplitVolumesDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
-                                        const SMESH::long_array&    theIds,
+                                        const SMESH::smIdType_array&    theIds,
                                         SMESH::SMESH_IDSource_ptr   theObj)
 {
   SMESH::IDSource_wrap obj = theObj;
@@ -1696,7 +1696,7 @@ bool SMESHGUI_SplitVolumesDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
   return true;
 }
 
-int SMESHGUI_SplitVolumesDlg::nbElemsInMesh()
+smIdType SMESHGUI_SplitVolumesDlg::nbElemsInMesh()
 {
   return isIntoPrisms() ? myMesh->NbHexas() : myMesh->NbVolumes() - myMesh->NbTetras();
 }
@@ -1818,7 +1818,7 @@ void SMESHGUI_SplitVolumesDlg::onSelectionDone()
       if (!aSelMesh->_is_nil())
         myMesh = aSelMesh;
 
-      TColStd_IndexedMapOfInteger aMapIndex;
+      SVTK_TIndexedMapOfVtkId aMapIndex;
       mySelector->GetIndex( anIO, aMapIndex );
       if ( !aMapIndex.IsEmpty() )
         showFacetByElement( aMapIndex(1) );