Salome HOME
updated copyright message
[modules/gui.git] / src / VTKViewer / VTKViewer_GeometryFilter.cxx
index 6dba69fd7219a082f326808579cf93d5bc703f25..2a17bf47caae380ba4675d6a5ce2c2592e9a8257 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -92,7 +92,9 @@
 #endif
 ///////////////////////////////////////////////////////////////////////////////////////////////
 
-vtkStandardNewMacro(VTKViewer_GeometryFilter);
+#include "Qtx.h"
+
+vtkStandardNewMacro(VTKViewer_GeometryFilter)
 
 VTKViewer_GeometryFilter
 ::VTKViewer_GeometryFilter():
@@ -102,7 +104,15 @@ VTKViewer_GeometryFilter
   myAppendCoincident3D(0),
   myMaxArcAngle(2),
   myIsBuildArc(false)
-{}
+{
+  static int forceDelegateToVtk = -1;
+  if ( forceDelegateToVtk < 0 )
+  {
+    QString env = Qtx::getenv( "SALOME_ACTOR_DO_NOT_DELEGATE_TO_VTK" );
+    forceDelegateToVtk = (int)(env != "1");
+  }
+  delegateToVtk = forceDelegateToVtk > 0;
+}
 
 
 VTKViewer_GeometryFilter
@@ -144,6 +154,37 @@ static inline bool toShowEdge( vtkIdType id1, vtkIdType id2, vtkIdType cellId, v
   return ( cells[iCell] == cellId );
 }
 
+//------------------------------------------------------------------------------
+// Excluded faces are defined here.
+struct vtkExcludedFaces
+{
+  vtkStaticCellLinksTemplate<vtkIdType>* Links;
+  vtkExcludedFaces()
+    : Links(nullptr)
+  {
+  }
+  ~vtkExcludedFaces() { delete this->Links; }
+};
+
+// fill myVTK2ObjIds to get the correspondence between vtk ids (displayed edges and faces
+// computed in vtkGeometryFilter::UnstructuredGridExecute) and original cell ids (mesh cells)
+void VTKViewer_GeometryFilter
+::FillVTK2ObjIds(vtkPolyData *output) {
+
+  vtkDataArray* vtkOriginalCellIds = output->GetCellData()->GetArray("vtkOriginalCellIds");
+
+  if (vtkOriginalCellIds == nullptr)
+    throw std::runtime_error("vtkOriginalCellIds is null. Something is wrong.");
+
+  const vtkIdType numTuples = vtkOriginalCellIds->GetNumberOfTuples();
+  myVTK2ObjIds.resize(numTuples);
+
+  // copy ids of vtkOriginalCellIds into myVTK2ObjIds
+  vtkIdTypeArray *vtkOriginalCellIdsInt(vtkIdTypeArray::SafeDownCast(vtkOriginalCellIds));
+  vtkIdType* origIds(vtkOriginalCellIdsInt->GetPointer(0));
+  myVTK2ObjIds.assign(origIds, origIds+numTuples);
+}
+
 int
 VTKViewer_GeometryFilter
 ::RequestData(
@@ -151,36 +192,124 @@ VTKViewer_GeometryFilter
   vtkInformationVector **inputVector,
   vtkInformationVector *outputVector)
 {
+
   // get the info objects
-  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
+  vtkInformation *inInfo  = inputVector[0]->GetInformationObject(0);
   vtkInformation *outInfo = outputVector->GetInformationObject(0);
 
   // get the input and ouptut
   vtkDataSet *input = vtkDataSet::SafeDownCast(
-    inInfo->Get(vtkDataObject::DATA_OBJECT()));
+  inInfo->Get(vtkDataObject::DATA_OBJECT()));
   vtkPolyData *output = vtkPolyData::SafeDownCast(
-    outInfo->Get(vtkDataObject::DATA_OBJECT()));
+  outInfo->Get(vtkDataObject::DATA_OBJECT()));
 
   vtkIdType numCells=input->GetNumberOfCells();
+  vtkIdType numPts = input->GetNumberOfPoints();
 
-  if (numCells == 0)
+  if (numPts == 0 || numCells == 0)
     {
-      return 0;
+     return 0;
     }
 
-  if (input->GetDataObjectType() == VTK_UNSTRUCTURED_GRID){
-    return this->UnstructuredGridExecute(input, output, outInfo);
-  }else
-    return Superclass::RequestData(request,inputVector,outputVector);
+#if VTK_VERSION_NUMBER >= VTK_VERSION_CHECK(9,0,0)
+  if (delegateToVtk)
+    {
 
-  return 1;
+     // get the info objects excluded faces
+     vtkInformation* excInfo = inputVector[1]->GetInformationObject(0);
+
+     vtkExcludedFaces exc; // Will delete exc->Links when goes out of scope
+     vtkPolyData* excFaces = nullptr;
+     if (excInfo)
+       {
+        excFaces = vtkPolyData::SafeDownCast(excInfo->Get(vtkDataObject::DATA_OBJECT()));
+        vtkCellArray* excPolys = excFaces->GetPolys();
+        if (excPolys->GetNumberOfCells() > 0)
+          {
+           exc.Links = new vtkStaticCellLinksTemplate<vtkIdType>;
+           exc.Links->ThreadedBuildLinks(numPts, excPolys->GetNumberOfCells(), excPolys);
+          }
+       }
+
+     switch (input->GetDataObjectType())
+     {
+       case VTK_POLY_DATA:
+          return this->vtkGeometryFilter::PolyDataExecute(input, output, excFaces);
+       case VTK_UNSTRUCTURED_GRID:
+         {
+          vtkUnstructuredGrid* inputUnstructured = static_cast<vtkUnstructuredGrid*>(input);
+
+          // The "info", is passed to provide information about the unstructured grid. This
+          // is done to avoid repeated evaluations of "info" in the vtkGeometryFilter and
+          // the vtkDataSetSurfaceFilter (which vtkGeometryFilter  might delagate to in case
+          // of nonlinear data).
+          vtkGeometryFilterHelper* info = vtkGeometryFilterHelper::CharacterizeUnstructuredGrid(inputUnstructured);
+
+          bool NotFitForDelegation = false;
+          if ( vtkUnsignedCharArray* types = inputUnstructured->GetCellTypesArray() )
+            {
+             std::set<vtkIdType> ElementsNotFitToDelegate;
+
+             //  All quadratic, biquadratic, and triquadratic elements not fit for delegation
+             //  as SMESH has special display with curves mode for  meshes  containing  these
+             //  elements hence such meshes are not handled  by  "vtkGeometryFilter"  instead
+             //  the native  VTKViewer_GeometryFilter::UnstructuredGridExecute is used.
+             ElementsNotFitToDelegate.insert( VTK_QUADRATIC_EDGE );
+             ElementsNotFitToDelegate.insert( VTK_QUADRATIC_TRIANGLE );
+             ElementsNotFitToDelegate.insert( VTK_BIQUADRATIC_TRIANGLE );
+             ElementsNotFitToDelegate.insert( VTK_QUADRATIC_QUAD );
+             ElementsNotFitToDelegate.insert( VTK_BIQUADRATIC_QUAD );
+             ElementsNotFitToDelegate.insert( VTK_QUADRATIC_POLYGON );
+             ElementsNotFitToDelegate.insert( VTK_QUADRATIC_TETRA );
+             ElementsNotFitToDelegate.insert( VTK_QUADRATIC_HEXAHEDRON );
+             ElementsNotFitToDelegate.insert( VTK_TRIQUADRATIC_HEXAHEDRON );
+             ElementsNotFitToDelegate.insert( VTK_QUADRATIC_WEDGE );
+             ElementsNotFitToDelegate.insert( VTK_BIQUADRATIC_QUADRATIC_WEDGE );
+             ElementsNotFitToDelegate.insert( VTK_QUADRATIC_PYRAMID );
+
+             for ( int i = 0; i < types->GetNumberOfTuples() && !NotFitForDelegation; ++i )
+                NotFitForDelegation = ElementsNotFitToDelegate.count( types->GetValue(i) );
+            }
+         if ( NotFitForDelegation )
+            return this->UnstructuredGridExecute(input, output, outInfo);
+         else
+           {
+           int ret;
+            if ( myStoreMapping ) {
+              // pass through cell ids to get original cell ids
+              this->PassThroughCellIds = true;
+              ret = this->vtkGeometryFilter::UnstructuredGridExecute(input, output, info, excFaces);
+              FillVTK2ObjIds(output);
+            }
+            else {
+              // no need to get original cell ids
+              this->PassThroughCellIds = false;
+              ret = this->vtkGeometryFilter::UnstructuredGridExecute(input, output, info, excFaces);
+            }
+            return ret;
+           }
+         }
+     }
+
+     return this->vtkGeometryFilter::DataSetExecute(input, output, excFaces);
+    }  
+    else // !delegateToVtk
+#endif
+    {
+     if (input->GetDataObjectType() == VTK_UNSTRUCTURED_GRID){
+       return this->UnstructuredGridExecute(input, output, outInfo);
+     }
+     else {
+       return Superclass::RequestData(request,inputVector,outputVector);
+     }
+    }
 }
 
 int
 VTKViewer_GeometryFilter
 ::UnstructuredGridExecute(vtkDataSet *dataSetInput,
                           vtkPolyData *output,
-                          vtkInformation *outInfo)
+                          vtkInformation */*outInfo*/)
 {
   vtkUnstructuredGrid *input= (vtkUnstructuredGrid *)dataSetInput;
   vtkCellArray *Connectivity = input->GetCells();
@@ -192,7 +321,7 @@ VTKViewer_GeometryFilter
     }
 
   vtkIdType cellId;
-  int i;
+  vtkIdType i;
   int allVisible;
   vtkIdType npts = 0;
   vtkIdType const *pts = 0;
@@ -276,7 +405,7 @@ VTKViewer_GeometryFilter
       quad1D2DTypes.insert( VTK_BIQUADRATIC_QUAD );
       quad1D2DTypes.insert( VTK_QUADRATIC_POLYGON );
 
-      for ( int i = 0; i < types->GetNumberOfTuples() && !hasQuad1D2D; ++i )
+      for ( auto i = 0; i < types->GetNumberOfTuples() && !hasQuad1D2D; ++i )
         hasQuad1D2D = quad1D2DTypes.count( types->GetValue(i) );
     }
     buildArcs = hasQuad1D2D;
@@ -339,7 +468,7 @@ VTKViewer_GeometryFilter
 
   // Loop over all cells now that visibility is known
   // (Have to compute visibility first for 3D cell boundaries)
-  int progressInterval = numCells/20 + 1;
+  vtkIdType progressInterval = numCells/20 + 1;
   TMapOfVectorId aDimension2VTK2ObjIds;
   if ( myStoreMapping )
     aDimension2VTK2ObjIds.resize( 3 ); // max dimension is 2
@@ -466,7 +595,7 @@ VTKViewer_GeometryFilter
           {
 #ifdef SHOW_COINCIDING_3D_PAL21924
             faceIdsTmp->SetNumberOfIds( npts );
-            for ( int ai = 0; ai < npts; ai++ )
+            for ( auto ai = 0; ai < npts; ai++ )
               faceIdsTmp->SetId( ai, pts[ai] );
             input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
 #endif
@@ -480,7 +609,7 @@ VTKViewer_GeometryFilter
               faceIds->InsertNextId(pts[faceVerts[1]]);
               faceIds->InsertNextId(pts[faceVerts[2]]);
               input->GetCellNeighbors(cellId, faceIds, cellIds);
-              int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+              vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
 #ifdef SHOW_COINCIDING_3D_PAL21924
               bool process = nbNeighbors <= 0;
 #else
@@ -523,7 +652,7 @@ VTKViewer_GeometryFilter
           {
 #ifdef SHOW_COINCIDING_3D_PAL21924
             faceIdsTmp->SetNumberOfIds( npts );
-            for ( int ai = 0; ai < npts; ai++ )
+            for ( auto ai = 0; ai < npts; ai++ )
               faceIdsTmp->SetId( ai, pts[ai] );
             input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
 #endif
@@ -538,7 +667,7 @@ VTKViewer_GeometryFilter
               aCellType = VTK_QUAD;
               numFacePts = 4;
               input->GetCellNeighbors(cellId, faceIds, cellIds);
-              int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+              vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
 #ifdef SHOW_COINCIDING_3D_PAL21924
               bool process = nbNeighbors <= 0;
 #else
@@ -581,7 +710,7 @@ VTKViewer_GeometryFilter
           {
 #ifdef SHOW_COINCIDING_3D_PAL21924
             faceIdsTmp->SetNumberOfIds( npts );
-            for ( int ai = 0; ai < npts; ai++ )
+            for ( auto ai = 0; ai < npts; ai++ )
               faceIdsTmp->SetId( ai, pts[ai] );
             input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
 #endif
@@ -596,7 +725,7 @@ VTKViewer_GeometryFilter
               faceIds->InsertNextId(pts[faceVerts[2]]);
               faceIds->InsertNextId(pts[faceVerts[3]]);
               input->GetCellNeighbors(cellId, faceIds, cellIds);
-              int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+              vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
 #ifdef SHOW_COINCIDING_3D_PAL21924
               bool process = nbNeighbors <= 0;
 #else
@@ -659,7 +788,7 @@ VTKViewer_GeometryFilter
                 numFacePts = 4;
               }
               input->GetCellNeighbors(cellId, faceIds, cellIds);
-              int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+              vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
 #ifdef SHOW_COINCIDING_3D_PAL21924
               bool process = nbNeighbors <= 0;
 #else
@@ -702,7 +831,7 @@ VTKViewer_GeometryFilter
           {
 #ifdef SHOW_COINCIDING_3D_PAL21924
             faceIdsTmp->SetNumberOfIds( npts );
-            for ( int ai = 0; ai < npts; ai++ )
+            for ( auto ai = 0; ai < npts; ai++ )
               faceIdsTmp->SetId( ai, pts[ai] );
             input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
 #endif
@@ -724,7 +853,7 @@ VTKViewer_GeometryFilter
                 numFacePts = 6;
               }
               input->GetCellNeighbors(cellId, faceIds, cellIds);
-              int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+              vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
 #ifdef SHOW_COINCIDING_3D_PAL21924
               bool process = nbNeighbors <= 0;
 #else
@@ -748,7 +877,7 @@ VTKViewer_GeometryFilter
           if ( myShowInside )
           {
             aCellType = VTK_LINE;
-            for ( int edgeID = 0; edgeID < 8; ++edgeID )
+            for ( auto edgeID = 0; edgeID < 8; ++edgeID )
             {
               const vtkIdType *edgeVerts = vtkPyramid::GetEdgeArray( edgeID );
               if ( toShowEdge( pts[edgeVerts[0]], pts[edgeVerts[1]], cellId, input ))
@@ -767,7 +896,7 @@ VTKViewer_GeometryFilter
           {
 #ifdef SHOW_COINCIDING_3D_PAL21924
             faceIdsTmp->SetNumberOfIds( npts );
-            for ( int ai = 0; ai < npts; ai++ )
+            for ( auto ai = 0; ai < npts; ai++ )
               faceIdsTmp->SetId( ai, pts[ai] );
             input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
 #endif
@@ -787,7 +916,7 @@ VTKViewer_GeometryFilter
                 numFacePts = 4;
               }
               input->GetCellNeighbors(cellId, faceIds, cellIds);
-              int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+              vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
 #ifdef SHOW_COINCIDING_3D_PAL21924
               bool process = nbNeighbors <= 0;
 #else
@@ -812,7 +941,7 @@ VTKViewer_GeometryFilter
         {
           vtkIdType nFaces = 0;
           const vtkIdType* ptIds = 0;
-          int idp = 0;
+          vtkIdType idp = 0;
           input->GetFaceStream(cellId, nFaces, ptIds);
 #ifdef SHOW_COINCIDING_3D_PAL21924
           if ( !myShowInside )
@@ -833,7 +962,7 @@ VTKViewer_GeometryFilter
           {
             faceIds->Reset();
             numFacePts = ptIds[idp];
-            int pt0 = ++idp;
+            vtkIdType pt0 = ++idp;
             for (i = 0; i < numFacePts; i++)
             {
               faceIds->InsertNextId(ptIds[idp + i]);
@@ -846,7 +975,7 @@ VTKViewer_GeometryFilter
             default:aCellType = VTK_POLYGON;
             }
             input->GetCellNeighbors(cellId, faceIds, cellIds);
-            int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+            vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
             if ( myShowInside && nbNeighbors > 0 && cellId < cellIds->GetId(0) )
               continue; // don't add twice same internal face in wireframe mode
 #ifdef SHOW_COINCIDING_3D_PAL21924
@@ -940,7 +1069,7 @@ VTKViewer_GeometryFilter
 #ifdef SHOW_COINCIDING_3D_PAL21924
               if ( !myShowInside )
               {
-                int npts1 = 0;
+                vtkIdType npts1 = 0;
                 switch (aCellType ){
                 case VTK_QUADRATIC_TETRA:             npts1 = 4; break;
                 case VTK_QUADRATIC_HEXAHEDRON:        npts1 = 8; break;
@@ -951,7 +1080,7 @@ VTKViewer_GeometryFilter
                 }
                 faceIdsTmp->SetNumberOfIds( npts1 );
                 if ( npts1 > 0 ) {
-                  for (int ai=0; ai<npts1; ai++)
+                  for (auto ai=0; ai<npts1; ai++)
                     faceIdsTmp->SetId( ai, pts[ai] );
                   input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
                 }
@@ -959,8 +1088,8 @@ VTKViewer_GeometryFilter
 #endif
               aCellType = VTK_TRIANGLE;
               numFacePts = 3;
-              int nbNeighbors = 0;
-              for (int j=0; j < cell->GetNumberOfFaces(); j++)
+              vtkIdType nbNeighbors = 0;
+              for (auto j=0; j < cell->GetNumberOfFaces(); j++)
               {
                 vtkCell *face = cell->GetFace(j);
                 if ( !myShowInside ) {
@@ -1117,11 +1246,11 @@ VTKViewer_GeometryFilter
               }
               else
               {
-                int nbCoincident = 0;
+                vtkIdType nbCoincident = 0;
 #ifdef SHOW_COINCIDING_3D_PAL21924
-                int nbPnt = npts - cell->GetNumberOfEdges();
+                vtkIdType nbPnt = npts - cell->GetNumberOfEdges();
                 faceIdsTmp->SetNumberOfIds( nbPnt );
-                for ( int ai = 0; ai < nbPnt; ai++ )
+                for ( auto ai = 0; ai < nbPnt; ai++ )
                   faceIdsTmp->SetId( ai, pts[ai] );
                 input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
                 nbCoincident = cellIdsTmp->GetNumberOfIds();
@@ -1132,11 +1261,11 @@ VTKViewer_GeometryFilter
                 {
                   vtkCell * face = cell->GetFace( faceId );
                   input->GetCellNeighbors( cellId, face->GetPointIds(), cellIds );
-                  int nbNeighbors = cellIds->GetNumberOfIds() - nbCoincident;
+                  vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - nbCoincident;
                   if ( nbNeighbors <= 0 )
                   {
-                    int nbEdges = face->GetNumberOfPoints() / 2;
-                    for ( int edgeId = 0; edgeId < nbEdges; ++edgeId )
+                    vtkIdType nbEdges = face->GetNumberOfPoints() / 2;
+                    for ( auto edgeId = 0; edgeId < nbEdges; ++edgeId )
                     {
                       vtkIdType p1 = ( edgeId );               // corner
                       vtkIdType p2 = ( edgeId + nbEdges );     // medium
@@ -1229,7 +1358,7 @@ void
 VTKViewer_GeometryFilter
 ::InsertId( const vtkIdType theCellId,
             const vtkIdType theCellType,
-            TVectorId& theVTK2ObjIds,
+            TVectorId& /*theVTK2ObjIds*/,
             TMapOfVectorId& theDimension2VTK2ObjIds )
 {
   //theVTK2ObjIds.push_back( theCellId );
@@ -1315,9 +1444,9 @@ VTKViewer_GeometryFilter
 }
 
 
-vtkIdType VTKViewer_GeometryFilter::GetElemObjId( int theVtkID )
+vtkIdType VTKViewer_GeometryFilter::GetElemObjId( vtkIdType theVtkID )
 {
-  if( theVtkID < 0 || theVtkID >= (int)myVTK2ObjIds.size() )
+  if( theVtkID < 0 || theVtkID >= (vtkIdType)myVTK2ObjIds.size() )
     return -1;
   return myVTK2ObjIds[theVtkID];
 }
@@ -1428,10 +1557,10 @@ void VTKViewer_GeometryFilter::BuildArcedPolygon(vtkIdType cellId,
     }
     case VTK_QUADRATIC_POLYGON:
     {
-      int nbP = aCell->GetNumberOfPoints();
+      vtkIdType nbP = aCell->GetNumberOfPoints();
       std::vector< Pnt > pVec( nbP + 2 );
 
-      for ( int i = 0; i < nbP/2; ++i )
+      for ( auto i = 0; i < nbP/2; ++i )
       {
         pVec[i*2 + 0] = CreatePnt( aCell, inputScalars, i );
         pVec[i*2 + 1] = CreatePnt( aCell, inputScalars, i + nbP/2 );
@@ -1439,7 +1568,7 @@ void VTKViewer_GeometryFilter::BuildArcedPolygon(vtkIdType cellId,
       pVec[ nbP   ] = pVec[ 0 ];
       pVec[ nbP+1 ] = pVec[ 1 ];
 
-      for ( int i = 0; i < nbP; i += 2 )
+      for ( auto i = 0; i < nbP; i += 2 )
       {      
         VTKViewer_ArcBuilder aBuilder( pVec[i], pVec[i+1], pVec[i+2], myMaxArcAngle );
         aCollection.push_back( aBuilder.GetPoints() );
@@ -1460,7 +1589,7 @@ void VTKViewer_GeometryFilter::BuildArcedPolygon(vtkIdType cellId,
     vtkIdType aTriangleId;
 
     vtkPolygon *aPlg = vtkPolygon::New();
-    std::map<int, double> aPntId2ScalarValue;
+    std::map<vtkIdType, double> aPntId2ScalarValue;
     aNbPoints = MergevtkPoints(aCollection, aScalarCollection, aPlg->GetPoints(), aPntId2ScalarValue, aNewPoints);
     aPlg->GetPointIds()->SetNumberOfIds(aNbPoints);
 
@@ -1492,7 +1621,7 @@ void VTKViewer_GeometryFilter::BuildArcedPolygon(vtkIdType cellId,
     aPlg->Delete();
   }
   else {
-    std::map<int, double> aPntId2ScalarValue;
+    std::map<vtkIdType, double> aPntId2ScalarValue;
     aNbPoints = MergevtkPoints(aCollection, aScalarCollection, output->GetPoints(), aPntId2ScalarValue, aNewPoints);
     if(outputScalars)
       for(vtkIdType i = 0; i < aNbPoints; i++)