Salome HOME
Updated copyright comment
[modules/hexablock.git] / src / HEXABLOCKGUI / HEXABLOCKGUI_VtkDocumentGraphicView.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 0c4d3bd..ab2cd5a
@@ -1,9 +1,9 @@
-// Copyright (C) 2009-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2009-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // VTK includes
 #include <vtkRenderer.h>
 #include <vtkUnstructuredGrid.h>
+#include <vtkUnsignedCharArray.h>
 #include <vtkDataSetMapper.h>
 #include "vtkCellArray.h"
 #include "vtkPolyData.h"
 
-#include <VTKViewer_CellLocationsArray.h>
+//#include <VTKViewer_CellLocationsArray.h>
 #include <SVTK_ViewModel.h>
 
 #include "HEXABLOCKGUI_Trace.hxx"
 #include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx"
 #include "HEXABLOCKGUI.hxx"
 
+#include <QScrollBar>
+
 #ifndef M_PI
 #define M_PI 3.1415927
 #endif
@@ -215,13 +218,14 @@ vtkUnstructuredGrid* Document_Actor::getUnstructuredGrid()
     // 0        1     3      2        4    5      7      6
 
     // Insert cells in grid
-    VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
+    vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
     aCellLocationsArray->SetNumberOfComponents( 1 );
     aCellLocationsArray->SetNumberOfTuples( aNbCells );
     //   std::cout << "aNbCells =>" << aNbCells << std::endl;
 
     aConnectivity->InitTraversal();
-    for( vtkIdType idType = 0, *pts, npts; aConnectivity->GetNextCell( npts, pts ); idType++ ){
+       vtkIdType const *pts(nullptr);
+    for( vtkIdType idType = 0, npts; aConnectivity->GetNextCell( npts, pts ); idType++ ){
         aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) );
     }
     theGrid->SetCells( aCellTypesArray, aCellLocationsArray,aConnectivity );
@@ -405,13 +409,14 @@ vtkUnstructuredGrid* Associate_Actor::getUnstructuredGrid()
     // 0        1     3      2        4    5      7      6
 
     // Insert cells in grid
-    VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
+    vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
     aCellLocationsArray->SetNumberOfComponents( 1 );
     aCellLocationsArray->SetNumberOfTuples( aNbCells );
     //   std::cout << "aNbCells =>" << aNbCells << std::endl;
 
     aConnectivity->InitTraversal();
-    for( vtkIdType idType = 0, *pts, npts; aConnectivity->GetNextCell( npts, pts ); idType++ ){
+       vtkIdType const *pts(nullptr);
+    for( vtkIdType idType = 0, npts; aConnectivity->GetNextCell( npts, pts ); idType++ ){
         aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) );
     }
     theGrid->SetCells( aCellTypesArray, aCellLocationsArray,aConnectivity );
@@ -645,8 +650,8 @@ void VtkDocumentGraphicView::highlight( const QModelIndexList& elts )
 //    viewWindow->SetSelectionMode(VolumeSelection);
 
     // --- elements highlight ---
-    TColStd_IndexedMapOfInteger aMap;
-    int vtkElemsId;
+    SVTK_TIndexedMapOfVtkId aMap;
+    vtkIdType vtkElemsId;
     QString eltEntry;
 
     foreach( const QModelIndex& iElt, elts ){
@@ -692,8 +697,8 @@ void VtkDocumentGraphicView::highlightGroups( const QModelIndex& eltIndex )
      case VertexNode: viewWindow->SetSelectionMode(NodeSelection); break;
     }
 
-    TColStd_MapOfInteger aMap;
-    int vtkElemsId;
+    SVTK_TVtkIDsMap aMap;
+    vtkIdType vtkElemsId;
     QString eltEntry;
 
     foreach( const QModelIndex& iElt, iElements ){
@@ -735,8 +740,8 @@ void VtkDocumentGraphicView::highlightPropagation( const QModelIndex& eltIndex )
     // Set selection mode in VTK view
     viewWindow->SetSelectionMode(EdgeSelection);
 
-    TColStd_MapOfInteger aMap;
-    int vtkElemsId;
+    SVTK_TVtkIDsMap aMap;
+    vtkIdType vtkElemsId;
     QString edgeEntry;
 
     foreach( const QModelIndex& iEdge, iEdges ){