From c9c3fe8924452af01274d358e5d6d391b1b27375 Mon Sep 17 00:00:00 2001 From: Pascal Obry Date: Fri, 31 Jan 2020 11:56:07 +0100 Subject: [PATCH] Porting to ParaView 5.8 --- doc/salome/examples/testme.py | 2 +- src/Controls/CMakeLists.txt | 3 +- src/DriverCGNS/CMakeLists.txt | 1 - src/DriverDAT/CMakeLists.txt | 1 - src/DriverGMF/CMakeLists.txt | 1 - src/DriverMED/CMakeLists.txt | 1 - src/DriverSTL/CMakeLists.txt | 1 - src/DriverUNV/CMakeLists.txt | 1 - src/OBJECT/CMakeLists.txt | 5 +-- src/OBJECT/SMESH_DeviceActor.cxx | 9 +++-- src/OBJECT/SMESH_Object.cxx | 3 +- src/PluginUtils/CMakeLists.txt | 2 - src/SMDS/CMakeLists.txt | 4 +- src/SMDS/SMDS_Downward.cxx | 40 ++++++++++---------- src/SMDS/SMDS_MeshCell.cxx | 15 +++++--- src/SMDS/SMDS_MeshVolume.cxx | 25 ++++++------ src/SMDS/SMDS_UnstructuredGrid.cxx | 32 +++++++++------- src/SMDS/SMDS_VtkCellIterator.cxx | 8 ++-- src/SMESH/CMakeLists.txt | 1 - src/SMESH/SMESH_MeshEditor.cxx | 8 ++-- src/SMESHClient/CMakeLists.txt | 1 - src/SMESHDS/CMakeLists.txt | 1 - src/SMESHFiltersSelection/CMakeLists.txt | 3 -- src/SMESHGUI/CMakeLists.txt | 1 - src/SMESHGUI/SMESHGUI_Measurements.cxx | 6 ++- src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx | 3 +- src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx | 3 +- src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx | 3 +- src/SMESHUtils/CMakeLists.txt | 1 - src/SMESH_I/CMakeLists.txt | 2 +- src/SMESH_SWIG_WITHIHM/CMakeLists.txt | 2 - src/StdMeshers/CMakeLists.txt | 1 - src/StdMeshersGUI/CMakeLists.txt | 2 - src/StdMeshers_I/CMakeLists.txt | 1 - src/Tools/padder/meshjob/impl/CMakeLists.txt | 1 - 35 files changed, 95 insertions(+), 99 deletions(-) diff --git a/doc/salome/examples/testme.py b/doc/salome/examples/testme.py index d881f13a4..59b67d004 100755 --- a/doc/salome/examples/testme.py +++ b/doc/salome/examples/testme.py @@ -31,7 +31,7 @@ class SalomeSession(object): pass sys.argv = [run_script] sys.argv += ["--terminal"] - sys.argv += ["--modules=GEOM,MED,SMESH"] + sys.argv += ["--modules=GEOM,SMESH"] sys.argv += ["%s" % script] if sys.platform == 'win32': main_module_path = sys.modules['__main__'].__file__ diff --git a/src/Controls/CMakeLists.txt b/src/Controls/CMakeLists.txt index 85b95d4c4..d6ed44753 100644 --- a/src/Controls/CMakeLists.txt +++ b/src/Controls/CMakeLists.txt @@ -21,7 +21,6 @@ # additional include directories INCLUDE_DIRECTORIES( ${OpenCASCADE_INCLUDE_DIR} - ${VTK_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${KERNEL_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/src/SMDS @@ -37,13 +36,13 @@ ADD_DEFINITIONS( # libraries to link to SET(_link_LIBRARIES - ${VTK_LIBRARIES} ${OpenCASCADE_FoundationClasses_LIBRARIES} ${OpenCASCADE_ModelingData_LIBRARIES} ${OpenCASCADE_ModelingAlgorithms_LIBRARIES} SMDS SMESHDS SMESHUtils + VTK::FiltersVerdict ) # --- headers --- diff --git a/src/DriverCGNS/CMakeLists.txt b/src/DriverCGNS/CMakeLists.txt index 9a92daa1a..06bd4069b 100644 --- a/src/DriverCGNS/CMakeLists.txt +++ b/src/DriverCGNS/CMakeLists.txt @@ -23,7 +23,6 @@ INCLUDE_DIRECTORIES( ${KERNEL_INCLUDE_DIRS} ${OpenCASCADE_INCLUDE_DIR} ${CGNS_INCLUDE_DIRS} - ${VTK_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/src/Driver ${PROJECT_SOURCE_DIR}/src/SMDS diff --git a/src/DriverDAT/CMakeLists.txt b/src/DriverDAT/CMakeLists.txt index 1d0fe904f..9de2cd653 100644 --- a/src/DriverDAT/CMakeLists.txt +++ b/src/DriverDAT/CMakeLists.txt @@ -22,7 +22,6 @@ INCLUDE_DIRECTORIES( ${KERNEL_INCLUDE_DIRS} ${OpenCASCADE_INCLUDE_DIR} - ${VTK_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/src/Driver ${PROJECT_SOURCE_DIR}/src/SMDS diff --git a/src/DriverGMF/CMakeLists.txt b/src/DriverGMF/CMakeLists.txt index 7bdfdfa77..deab235a5 100644 --- a/src/DriverGMF/CMakeLists.txt +++ b/src/DriverGMF/CMakeLists.txt @@ -22,7 +22,6 @@ INCLUDE_DIRECTORIES( ${KERNEL_INCLUDE_DIRS} ${OpenCASCADE_INCLUDE_DIR} - ${VTK_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/src/Driver ${PROJECT_SOURCE_DIR}/src/SMDS diff --git a/src/DriverMED/CMakeLists.txt b/src/DriverMED/CMakeLists.txt index 1179e80e0..568a87f6f 100644 --- a/src/DriverMED/CMakeLists.txt +++ b/src/DriverMED/CMakeLists.txt @@ -24,7 +24,6 @@ INCLUDE_DIRECTORIES( ${HDF5_INCLUDE_DIRS} ${KERNEL_INCLUDE_DIRS} ${OpenCASCADE_INCLUDE_DIR} - ${VTK_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/src/MEDWrapper ${PROJECT_SOURCE_DIR}/src/Driver diff --git a/src/DriverSTL/CMakeLists.txt b/src/DriverSTL/CMakeLists.txt index 903f874b9..9895c53c4 100644 --- a/src/DriverSTL/CMakeLists.txt +++ b/src/DriverSTL/CMakeLists.txt @@ -22,7 +22,6 @@ INCLUDE_DIRECTORIES( ${KERNEL_INCLUDE_DIRS} ${OpenCASCADE_INCLUDE_DIR} - ${VTK_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/src/Driver ${PROJECT_SOURCE_DIR}/src/SMDS diff --git a/src/DriverUNV/CMakeLists.txt b/src/DriverUNV/CMakeLists.txt index 37b4ff64e..d82bfc4a1 100644 --- a/src/DriverUNV/CMakeLists.txt +++ b/src/DriverUNV/CMakeLists.txt @@ -22,7 +22,6 @@ INCLUDE_DIRECTORIES( ${KERNEL_INCLUDE_DIRS} ${OpenCASCADE_INCLUDE_DIR} - ${VTK_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/src/Driver ${PROJECT_SOURCE_DIR}/src/SMDS diff --git a/src/OBJECT/CMakeLists.txt b/src/OBJECT/CMakeLists.txt index 8f31976f0..480e86a4b 100644 --- a/src/OBJECT/CMakeLists.txt +++ b/src/OBJECT/CMakeLists.txt @@ -26,7 +26,6 @@ INCLUDE_DIRECTORIES( ${QWT_INCLUDE_DIR} ${GEOM_INCLUDE_DIRS} ${OpenCASCADE_INCLUDE_DIR} - ${VTK_INCLUDE_DIRS} ${OMNIORB_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/src/Controls @@ -50,19 +49,19 @@ ADD_DEFINITIONS( # libraries to link to SET(_link_LIBRARIES ${QT_LIBRARIES} - ${VTK_LIBRARIES} ${OpenCASCADE_KERNEL} ${GEOM_GEOMObject} - ${GUI_SalomeApp} ${GUI_SalomeObject} ${GUI_SVTK} ${GUI_VTKViewer} ${GUI_qtx} ${GUI_suit} ${GUI_std} + ${GUI_SalomeApp} SMESHClient SMDS SMESHControls + VTK::RenderingLabel ) IF(SALOME_USE_PLOT2DVIEWER) diff --git a/src/OBJECT/SMESH_DeviceActor.cxx b/src/OBJECT/SMESH_DeviceActor.cxx index e9c904f25..77cdc214f 100644 --- a/src/OBJECT/SMESH_DeviceActor.cxx +++ b/src/OBJECT/SMESH_DeviceActor.cxx @@ -431,7 +431,8 @@ SMESH_DeviceActor aCellLocationsArray->SetNumberOfTuples( aNbCells ); 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 ) ); aDataSet->SetCells( aCellTypesArray, aCellLocationsArray, aConnectivity ); @@ -495,7 +496,8 @@ SMESH_DeviceActor aCellLocationsArray->SetNumberOfTuples( aNbCells ); 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 ) ); aDataSet->SetCells( aCellTypesArray, aCellLocationsArray,aConnectivity ); @@ -589,7 +591,8 @@ SMESH_DeviceActor aCellLocationsArray->SetNumberOfTuples( aNbCells ); 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 ) ); aDataSet->SetCells( aCellTypesArray, aCellLocationsArray,aConnectivity ); diff --git a/src/OBJECT/SMESH_Object.cxx b/src/OBJECT/SMESH_Object.cxx index 550dac28f..245f6467c 100644 --- a/src/OBJECT/SMESH_Object.cxx +++ b/src/OBJECT/SMESH_Object.cxx @@ -472,7 +472,8 @@ void SMESH_VisualObjDef::buildElemPrs() SMDS_Mesh::CheckMemory(); // PAL16631 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 ) ); myGrid->SetCells( aCellTypesArray, aCellLocationsArray,aConnectivity ); diff --git a/src/PluginUtils/CMakeLists.txt b/src/PluginUtils/CMakeLists.txt index 106c29aee..cc0c0dfc3 100644 --- a/src/PluginUtils/CMakeLists.txt +++ b/src/PluginUtils/CMakeLists.txt @@ -52,8 +52,6 @@ SET(_link_LIBRARIES ${QT_MT_LIBS} ${GUI_SalomeObject} ${GUI_suit} - ${GUI_LightApp} - ${GUI_SalomeApp} SalomeIDLSMESH SMESH ) diff --git a/src/SMDS/CMakeLists.txt b/src/SMDS/CMakeLists.txt index 867e0b2df..015d9808f 100644 --- a/src/SMDS/CMakeLists.txt +++ b/src/SMDS/CMakeLists.txt @@ -21,7 +21,6 @@ # additional include directories INCLUDE_DIRECTORIES( ${KERNEL_INCLUDE_DIRS} - ${VTK_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ) @@ -32,9 +31,10 @@ ADD_DEFINITIONS( # libraries to link to SET(_link_LIBRARIES - ${VTK_LIBRARIES} ${KERNEL_SALOMELocalTrace} ${KERNEL_OpUtil} + VTK::CommonCore + VTK::CommonDataModel ) # --- headers --- diff --git a/src/SMDS/SMDS_Downward.cxx b/src/SMDS/SMDS_Downward.cxx index 9ff98a9b7..e94f4ea4d 100644 --- a/src/SMDS/SMDS_Downward.cxx +++ b/src/SMDS/SMDS_Downward.cxx @@ -304,7 +304,7 @@ int SMDS_Down1D::getNodeSet(int cellId, int* nodeSet) void SMDS_Down1D::setNodes(int cellId, int vtkId) { vtkIdType npts = 0; - vtkIdType *pts; // will refer to the point id's of the face + vtkIdType const *pts(nullptr); // will refer to the point id's of the face _grid->GetCellPoints(vtkId, npts, pts); // MESSAGE(vtkId << " " << npts << " " << _nbDownCells); //ASSERT(npts == _nbDownCells); @@ -533,7 +533,7 @@ int SMDS_Down2D::computeVolumeIds(int cellId, int* ids) // --- find point id's of the face vtkIdType npts = 0; - vtkIdType *pts; // will refer to the point id's of the face + vtkIdType const *pts(nullptr); // will refer to the point id's of the face _grid->GetCellPoints(cellId, npts, pts); vector nodes; for (int i = 0; i < npts; i++) @@ -628,7 +628,7 @@ int SMDS_Down2D::computeVolumeIdsFromNodesFace(int* pts, int npts, int* ids) void SMDS_Down2D::setTempNodes(int cellId, int vtkId) { vtkIdType npts = 0; - vtkIdType *pts; // will refer to the point id's of the face + vtkIdType const *pts(nullptr); // will refer to the point id's of the face _grid->GetCellPoints(vtkId, npts, pts); // MESSAGE(vtkId << " " << npts << " " << _nbNodes); //ASSERT(npts == _nbNodes); @@ -796,7 +796,7 @@ void SMDS_Down3D::getNodeIds(int cellId, std::set& nodeSet) { int vtkId = this->_vtkCellIds[cellId]; vtkIdType npts = 0; - vtkIdType *nodes; // will refer to the point id's of the volume + vtkIdType const *nodes(nullptr); // will refer to the point id's of the volume _grid->GetCellPoints(vtkId, npts, nodes); for (int i = 0; i < npts; i++) nodeSet.insert(nodes[i]); @@ -1127,7 +1127,7 @@ void SMDS_DownTetra::getOrderedNodesOfFace(int cellId, std::vector& o //MESSAGE("cellId = " << cellId); vtkIdType npts = 0; - vtkIdType *nodes; // will refer to the point id's of the volume + vtkIdType const *nodes(nullptr); // will refer to the point id's of the volume _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes); set tofind; @@ -1179,7 +1179,7 @@ void SMDS_DownTetra::computeFacesWithNodes(int cellId, ListElemByNodesType& face // --- find point id's of the volume vtkIdType npts = 0; - vtkIdType *nodes; // will refer to the point id's of the volume + vtkIdType const *nodes(nullptr); // will refer to the point id's of the volume _grid->GetCellPoints(cellId, npts, nodes); // --- create all the ordered list of node id's for each face @@ -1235,7 +1235,7 @@ void SMDS_DownQuadTetra::getOrderedNodesOfFace(int cellId, std::vector " << theNbNodes); @@ -519,7 +521,8 @@ int SMDS_MeshCell::NbNodes() const { if ( GetVtkType() == VTK_POLYHEDRON ) return static_cast< const SMDS_MeshVolume* >( this )->SMDS_MeshVolume::NbNodes(); - vtkIdType *pts, npts; + vtkIdType npts; + vtkIdType const *pts; getGrid()->GetCellPoints( GetVtkID(), npts, pts ); return npts; } @@ -631,7 +634,8 @@ const SMDS_MeshNode* SMDS_MeshCell::GetNode(const int ind) const if ( GetVtkType() == VTK_POLYHEDRON ) return static_cast< const SMDS_MeshVolume* >( this )->SMDS_MeshVolume::GetNode( ind ); - vtkIdType npts, *pts; + vtkIdType npts; + vtkIdType const *pts; getGrid()->GetCellPoints( GetVtkID(), npts, pts ); const std::vector& interlace = SMDS_MeshCell::fromVtkOrder( VTKCellType( GetVtkType() )); return GetMesh()->FindNodeVtk( pts[ interlace.empty() ? ind : interlace[ ind ]]); @@ -645,7 +649,8 @@ int SMDS_MeshCell::GetNodeIndex( const SMDS_MeshNode* node ) const if ( GetVtkType() == VTK_POLYHEDRON ) return static_cast< const SMDS_MeshVolume* >( this )->SMDS_MeshVolume::GetNodeIndex( node ); - vtkIdType npts, *pts; + vtkIdType npts; + vtkIdType const *pts; getGrid()->GetCellPoints( GetVtkID(), npts, pts ); for ( vtkIdType i = 0; i < npts; ++i ) if ( pts[i] == node->GetVtkID() ) diff --git a/src/SMDS/SMDS_MeshVolume.cxx b/src/SMDS/SMDS_MeshVolume.cxx index ee9eb939f..1c6ee20db 100644 --- a/src/SMDS/SMDS_MeshVolume.cxx +++ b/src/SMDS/SMDS_MeshVolume.cxx @@ -82,8 +82,9 @@ bool SMDS_MeshVolume::ChangeNodes(const std::vector& nodes return false; vtkIdType nFaces = 0; - vtkIdType* ptIds = 0; - getGrid()->GetFaceStream( GetVtkID(), nFaces, ptIds ); + vtkIdType const *tmp(nullptr); + getGrid()->GetFaceStream( GetVtkID(), nFaces, tmp ); + vtkIdType *ptIds = const_cast( tmp ); // stream size and nb faces should not change @@ -91,14 +92,14 @@ bool SMDS_MeshVolume::ChangeNodes(const std::vector& nodes { return false; } - int id = 0, nbPoints = 0; + size_t id = 0, nbPoints = 0; for ( int i = 0; i < nFaces; i++ ) { int nodesInFace = ptIds[id]; nbPoints += nodesInFace; id += (nodesInFace + 1); } - if ((int) nodes.size() != nbPoints ) + if ( nodes.size() != nbPoints ) { return false; } @@ -120,7 +121,7 @@ const SMDS_MeshNode* SMDS_MeshVolume::GetNode(const int ind) const return SMDS_MeshCell::GetNode( ind ); vtkIdType nFaces = 0; - vtkIdType* ptIds = 0; + vtkIdType const *ptIds(nullptr); getGrid()->GetFaceStream( GetVtkID(), nFaces, ptIds ); int id = 0, nbPoints = 0; for (int i = 0; i < nFaces; i++) @@ -139,7 +140,7 @@ int SMDS_MeshVolume::NbNodes() const return SMDS_MeshCell::NbNodes(); vtkIdType nFaces = 0; - vtkIdType* ptIds = 0; + vtkIdType const *ptIds(nullptr); getGrid()->GetFaceStream( GetVtkID(), nFaces, ptIds ); int id = 0, nbPoints = 0; for (int i = 0; i < nFaces; i++) @@ -157,7 +158,7 @@ int SMDS_MeshVolume::NbFaces() const return SMDS_MeshCell::NbFaces(); vtkIdType nFaces = 0; - vtkIdType* ptIds = 0; + vtkIdType const *ptIds(nullptr); getGrid()->GetFaceStream( GetVtkID(), nFaces, ptIds ); return nFaces; @@ -168,7 +169,7 @@ int SMDS_MeshVolume::NbEdges() const return SMDS_MeshCell::NbEdges(); vtkIdType nFaces = 0; - vtkIdType* ptIds = 0; + vtkIdType const *ptIds(nullptr); getGrid()->GetFaceStream( GetVtkID(), nFaces, ptIds ); int id = 0, nbEdges = 0; for (int i = 0; i < nFaces; i++) @@ -187,7 +188,7 @@ int SMDS_MeshVolume::GetNodeIndex( const SMDS_MeshNode* node ) const return SMDS_MeshCell::GetNodeIndex( node ); vtkIdType nFaces = 0; - vtkIdType* ptIds = 0; + vtkIdType const *ptIds(nullptr); getGrid()->GetFaceStream( GetVtkID(), nFaces, ptIds ); int id = 0; for (int iF = 0; iF < nFaces; iF++) @@ -227,7 +228,7 @@ int SMDS_MeshVolume::NbFaceNodes (const int face_ind) const return SMDS_VolumeTool( this ).NbFaceNodes( face_ind-1 ); vtkIdType nFaces = 0; - vtkIdType* ptIds = 0; + vtkIdType const *ptIds(nullptr); getGrid()->GetFaceStream( GetVtkID(), nFaces, ptIds ); int id = 0, nbNodes = 0; for (int i = 0; i < nFaces; i++) @@ -249,7 +250,7 @@ const SMDS_MeshNode* SMDS_MeshVolume::GetFaceNode (const int face_ind, const int return SMDS_VolumeTool( this ).GetFaceNodes( face_ind-1 )[ node_ind - 1 ]; vtkIdType nFaces = 0; - vtkIdType* ptIds = 0; + vtkIdType const *ptIds(nullptr); getGrid()->GetFaceStream( GetVtkID(), nFaces, ptIds); int id = 0; for (int i = 0; i < nFaces; i++) @@ -271,7 +272,7 @@ std::vector SMDS_MeshVolume::GetQuantities() const if ( IsPoly() ) { vtkIdType nFaces = 0; - vtkIdType* ptIds = 0; + vtkIdType const *ptIds(nullptr); getGrid()->GetFaceStream( GetVtkID(), nFaces, ptIds ); int id = 0; for (int i = 0; i < nFaces; i++) diff --git a/src/SMDS/SMDS_UnstructuredGrid.cxx b/src/SMDS/SMDS_UnstructuredGrid.cxx index 8594efb8f..d73ccbaf5 100644 --- a/src/SMDS/SMDS_UnstructuredGrid.cxx +++ b/src/SMDS/SMDS_UnstructuredGrid.cxx @@ -46,7 +46,7 @@ void SMDS_CellLinks::ResizeForPoint(vtkIdType vtkID) if ( vtkID > this->MaxId ) { this->MaxId = vtkID; - if ( vtkID >= this->Size ) + if ( vtkID >= this->Size ) vtkCellLinks::Resize( vtkID+SMDS_Mesh::chunkSize ); } } @@ -59,7 +59,7 @@ void SMDS_CellLinks::BuildLinks(vtkDataSet *data, vtkCellArray *Connectivity, vt vtkIdType j, cellId = 0; unsigned short *linkLoc; vtkIdType npts=0; - vtkIdType *pts=0; + vtkIdType const *pts(nullptr); vtkIdType loc = Connectivity->GetTraversalLocation(); // traverse data to determine number of uses of each point @@ -160,8 +160,8 @@ int SMDS_UnstructuredGrid::InsertNextLinkedCell(int type, int npts, vtkIdType *p { if ( setOfNodes.insert( pts[i] ).second ) { - this->Links->ResizeCellList( pts[i], 1 ); - this->Links->AddCellReference( cellid, pts[i] ); + (static_cast< vtkCellLinks * >(this->Links.GetPointer()))->ResizeCellList( pts[i], 1 ); + (static_cast< vtkCellLinks * >(this->Links.GetPointer()))->AddCellReference( cellid, pts[i] ); } i++; } @@ -225,7 +225,7 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, int n if ( false /*!updateCells*/ ) // no holes in elements { this->Connectivity->Squeeze(); - this->Locations->Squeeze(); + this->CellLocations->Squeeze(); this->Types->Squeeze(); if ( this->FaceLocations ) { @@ -249,7 +249,7 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, int n if ( newCellSize != oldCellSize ) for ( int i = 0; i < oldCellSize - 1; ++i ) if ( this->Types->GetValue( i ) == VTK_EMPTY_CELL ) - newConnectivitySize -= this->Locations->GetValue( i+1 ) - this->Locations->GetValue( i ); + newConnectivitySize -= this->Connectivity->GetCellSize( i ); vtkCellArray *newConnectivity = vtkCellArray::New(); newConnectivity->Initialize(); @@ -320,12 +320,14 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, int n newFaceLocations->Squeeze(); newFaces->Squeeze(); this->SetCells( newTypes, newLocations, newConnectivity, newFaceLocations, newFaces ); + this->CellLocations = newLocations; newFaceLocations->Delete(); newFaces->Delete(); } else { this->SetCells( newTypes, newLocations, newConnectivity, FaceLocations, Faces ); + this->CellLocations = newLocations; } newTypes->Delete(); @@ -360,10 +362,11 @@ void SMDS_UnstructuredGrid::copyBloc(vtkUnsignedCharArray * newTypes, { int iOld = idCellsNewToOld[ iNew ]; newTypes->SetValue( iNew, this->Types->GetValue( iOld )); - vtkIdType oldLoc = this->Locations->GetValue( iOld ); + + vtkIdType oldLoc = ((vtkIdTypeArray *)(this->Connectivity->GetOffsetsArray()))->GetValue( iOld ); vtkIdType nbpts; - vtkIdType *oldPtsCell = 0; - this->Connectivity->GetCell( oldLoc, nbpts, oldPtsCell ); + vtkIdType const *oldPtsCell(nullptr); + this->Connectivity->GetCell( oldLoc+iOld, nbpts, oldPtsCell ); if ((vtkIdType) pointsCell.size() < nbpts ) pointsCell.resize( nbpts ); for ( int l = 0; l < nbpts; l++ ) @@ -976,8 +979,10 @@ void SMDS_UnstructuredGrid::GetNodeIds(std::set& nodeSet, int downId, unsig void SMDS_UnstructuredGrid::ModifyCellNodes(int vtkVolId, std::map localClonedNodeIds) { vtkIdType npts = 0; - vtkIdType *pts; // will refer to the point id's of the face - this->GetCellPoints(vtkVolId, npts, pts); + vtkIdType const *tmp(nullptr); // will refer to the point id's of the face + vtkIdType *pts; // will refer to the point id's of the face + this->GetCellPoints(vtkVolId, npts, tmp); + pts = const_cast< vtkIdType*>( tmp ); for (int i = 0; i < npts; i++) { if (localClonedNodeIds.count(pts[i])) @@ -1020,7 +1025,7 @@ void SMDS_UnstructuredGrid::BuildLinks() SMDS_CellLinks* links; this->Links = links = SMDS_CellLinks::New(); - this->Links->Allocate(this->GetNumberOfPoints()); + (static_cast< vtkCellLinks *>(this->Links.GetPointer()))->Allocate(this->GetNumberOfPoints()); this->Links->Register(this); links->BuildLinks(this, this->Connectivity,this->GetCellTypesArray() ); this->Links->Delete(); @@ -1039,7 +1044,7 @@ SMDS_CellLinks* SMDS_UnstructuredGrid::GetLinks() { if ( !this->Links ) BuildLinks(); - return static_cast< SMDS_CellLinks* >( this->Links ); + return static_cast< SMDS_CellLinks* >( this->Links.GetPointer() ); } /*! Create a volume (prism or hexahedron) by duplication of a face. @@ -1202,4 +1207,3 @@ double SMDS_UnstructuredGrid::GetBallDiameter( vtkIdType vtkID ) const return vtkDoubleArray::SafeDownCast( vtkDataSet::CellData->GetScalars() )->GetValue( vtkID ); return 0; } - diff --git a/src/SMDS/SMDS_VtkCellIterator.cxx b/src/SMDS/SMDS_VtkCellIterator.cxx index 5c6aec32d..acd4ccb22 100644 --- a/src/SMDS/SMDS_VtkCellIterator.cxx +++ b/src/SMDS/SMDS_VtkCellIterator.cxx @@ -30,7 +30,8 @@ _GetVtkNodes::_GetVtkNodes( TVtkIdList& vtkIds, { vtkUnstructuredGrid* grid = mesh->GetGrid(); const std::vector& interlace = SMDS_MeshCell::fromVtkOrder( type ); - vtkIdType npts, *pts; + vtkIdType npts; + vtkIdType const *pts(nullptr); grid->GetCellPoints( vtkCellId, npts, pts ); vtkIds.resize( npts ); if ( interlace.empty() ) @@ -50,7 +51,8 @@ _GetVtkNodesToUNV::_GetVtkNodesToUNV( TVtkIdList& vtkIds, SMDSAbs_EntityType type ) { vtkUnstructuredGrid* grid = mesh->GetGrid(); - vtkIdType npts, *pts; + vtkIdType npts; + vtkIdType const *pts(nullptr); grid->GetCellPoints( vtkCellId, npts, pts ); const int *ids = 0; switch ( type ) @@ -140,7 +142,7 @@ _GetVtkNodesPolyh::_GetVtkNodesPolyh( TVtkIdList& vtkIds, case SMDSEntity_Polyhedra: { vtkIdType nFaces = 0; - vtkIdType* ptIds = 0; + vtkIdType const *ptIds(nullptr); grid->GetFaceStream( vtkCellId, nFaces, ptIds ); int id = 0, nbNodesInFaces = 0; for ( int i = 0; i < nFaces; i++ ) diff --git a/src/SMESH/CMakeLists.txt b/src/SMESH/CMakeLists.txt index 1f033142e..9e380b75a 100644 --- a/src/SMESH/CMakeLists.txt +++ b/src/SMESH/CMakeLists.txt @@ -23,7 +23,6 @@ INCLUDE_DIRECTORIES( ${KERNEL_INCLUDE_DIRS} ${GEOM_INCLUDE_DIRS} ${OpenCASCADE_INCLUDE_DIR} - ${VTK_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${HDF5_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index b8a4dc81d..732ed654d 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -11197,7 +11197,7 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vectorGetCellLinks()->GetLink(oldId); + vtkCellLinks::Link l = (static_cast (grid->GetCellLinks()))->GetLink(oldId); for (int i=0; iGetID()); double values[3] = { 0,0,0 }; vtkIdType npts = 0; - vtkIdType* pts = 0; + vtkIdType const *pts(nullptr); grid->GetCellPoints(vtkVolIds[ivol], npts, pts); for ( vtkIdType i = 0; i < npts; ++i ) { @@ -11559,7 +11559,7 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vectorfirst; //MESSAGE(" node " << oldId); - vtkCellLinks::Link l = grid->GetCellLinks()->GetLink(oldId); + vtkCellLinks::Link l = (static_cast< vtkCellLinks *>(grid->GetCellLinks()))->GetLink(oldId); for (int i = 0; i < l.ncells; i++) { int vtkId = l.cells[i]; @@ -12011,7 +12011,7 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius, //MESSAGE("volume to check, vtkId " << vtkId << " smdsId " << meshDS->FromVtkToSmds(vtkId)); bool volInside = false; vtkIdType npts = 0; - vtkIdType* pts = 0; + vtkIdType const *pts(nullptr); grid->GetCellPoints(vtkId, npts, pts); for (int i=0; iSetNumberOfComponents( 1 ); aCellLocationsArray->SetNumberOfTuples( 1 ); aCells->InitTraversal(); - for( vtkIdType idType = 0, *pts, npts; aCells->GetNextCell( npts, pts ); idType++ ) + vtkIdType const *pts(nullptr); + for( vtkIdType idType = 0, npts; aCells->GetNextCell( npts, pts ); idType++ ) aCellLocationsArray->SetValue( idType, aCells->GetTraversalLocation( npts ) ); aGrid->SetCells( aCellTypesArray, aCellLocationsArray, aCells ); aCellLocationsArray->Delete(); @@ -894,7 +895,8 @@ void SMESHGUI_BoundingBox::createPreview( double minX, double maxX, double minY, aCellLocationsArray->SetNumberOfComponents( 1 ); aCellLocationsArray->SetNumberOfTuples( 12 ); aCells->InitTraversal(); - for( vtkIdType idType = 0, *pts, npts; aCells->GetNextCell( npts, pts ); idType++ ) + vtkIdType const *pts(nullptr); + for( vtkIdType idType = 0, npts; aCells->GetNextCell( npts, pts ); idType++ ) aCellLocationsArray->SetValue( idType, aCells->GetTraversalLocation( npts ) ); aGrid->SetCells( aCellTypesArray, aCellLocationsArray, aCells ); aCellLocationsArray->Delete(); diff --git a/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx b/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx index 97e458740..2d5478177 100644 --- a/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx @@ -222,7 +222,8 @@ void SMESHGUI_MeshEditPreview::SetData (const SMESH::MeshPreviewStruct& previewD aCellLocationsArray->SetNumberOfTuples( aNbCells ); 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 ) ); myGrid->SetCells( aCellTypesArray, aCellLocationsArray, aConnectivity ); diff --git a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx index 2c05deae7..569c81868 100644 --- a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx @@ -1344,7 +1344,8 @@ vtkUnstructuredGrid* SMESHGUI_MeshPatternDlg::getGrid() aCellLocationsArray->SetNumberOfTuples(aNbCells); 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)); aGrid->SetPoints(aPoints); diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx index bac4604c2..415bc013a 100644 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx @@ -1509,7 +1509,8 @@ void SMESHGUI_CuttingOfQuadsDlg::displayPreview() aCellLocationsArray->SetNumberOfTuples(aNbCells); 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)); aGrid->SetPoints(aPoints); diff --git a/src/SMESHUtils/CMakeLists.txt b/src/SMESHUtils/CMakeLists.txt index 0adf75ebf..d9d5aca6e 100644 --- a/src/SMESHUtils/CMakeLists.txt +++ b/src/SMESHUtils/CMakeLists.txt @@ -22,7 +22,6 @@ INCLUDE_DIRECTORIES( ${KERNEL_INCLUDE_DIRS} ${OpenCASCADE_INCLUDE_DIR} - ${VTK_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/src/SMDS ) diff --git a/src/SMESH_I/CMakeLists.txt b/src/SMESH_I/CMakeLists.txt index 9bb707929..a68453fc4 100644 --- a/src/SMESH_I/CMakeLists.txt +++ b/src/SMESH_I/CMakeLists.txt @@ -24,7 +24,6 @@ INCLUDE_DIRECTORIES( ${OpenCASCADE_INCLUDE_DIR} ${HDF5_INCLUDE_DIRS} ${MEDFILE_INCLUDE_DIRS} - ${VTK_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${KERNEL_INCLUDE_DIRS} ${GUI_INCLUDE_DIRS} @@ -75,6 +74,7 @@ SET(_link_LIBRARIES ${OpenCASCADE_ModelingAlgorithms_LIBRARIES} ${GEOM_GEOMClient} ${GEOM_SalomeIDLGEOM} + VTK::IOLegacy SalomeIDLSMESH SMESHimpl SMDS diff --git a/src/SMESH_SWIG_WITHIHM/CMakeLists.txt b/src/SMESH_SWIG_WITHIHM/CMakeLists.txt index 5374bf712..153f400e0 100644 --- a/src/SMESH_SWIG_WITHIHM/CMakeLists.txt +++ b/src/SMESH_SWIG_WITHIHM/CMakeLists.txt @@ -25,7 +25,6 @@ INCLUDE_DIRECTORIES( ${QT_INCLUDES} ${PYTHON_INCLUDE_DIRS} ${OpenCASCADE_INCLUDE_DIR} - ${VTK_INCLUDE_DIRS} ${OGL_INCLUDE_DIRS} ${KERNEL_INCLUDE_DIRS} ${GUI_INCLUDE_DIRS} @@ -56,7 +55,6 @@ SET(_link_LIBRARIES ${GUI_CAM} ${GUI_suit} ${GUI_qtx} - ${GUI_SalomeApp} ${GUI_std} ${GUI_Event} SMESH diff --git a/src/StdMeshers/CMakeLists.txt b/src/StdMeshers/CMakeLists.txt index df1d95243..d48e12038 100644 --- a/src/StdMeshers/CMakeLists.txt +++ b/src/StdMeshers/CMakeLists.txt @@ -27,7 +27,6 @@ ENDIF(SALOME_SMESH_USE_TBB) INCLUDE_DIRECTORIES( ${OpenCASCADE_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} - ${VTK_INCLUDE_DIRS} ${KERNEL_INCLUDE_DIRS} ${GEOM_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/src/SMESHUtils diff --git a/src/StdMeshersGUI/CMakeLists.txt b/src/StdMeshersGUI/CMakeLists.txt index 4393778db..9d55a0883 100644 --- a/src/StdMeshersGUI/CMakeLists.txt +++ b/src/StdMeshersGUI/CMakeLists.txt @@ -23,7 +23,6 @@ INCLUDE(UseQtExt) # additional include directories INCLUDE_DIRECTORIES( ${QT_INCLUDES} - ${VTK_INCLUDE_DIRS} ${OpenCASCADE_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS} ${KERNEL_INCLUDE_DIRS} @@ -56,7 +55,6 @@ ADD_DEFINITIONS( # libraries to link to SET(_link_LIBRARIES - ${GUI_SalomeApp} ${OpenCASCADE_FoundationClasses_LIBRARIES} ${OpenCASCADE_ModelingAlgorithms_LIBRARIES} ${QWT_LIBRARY} diff --git a/src/StdMeshers_I/CMakeLists.txt b/src/StdMeshers_I/CMakeLists.txt index 4b1c390ba..1e6152fde 100644 --- a/src/StdMeshers_I/CMakeLists.txt +++ b/src/StdMeshers_I/CMakeLists.txt @@ -26,7 +26,6 @@ INCLUDE_DIRECTORIES( ${GEOM_INCLUDE_DIRS} ${MEDFILE_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} - ${VTK_INCLUDE_DIRS} ${OMNIORB_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/src/SMESHImpl ${PROJECT_SOURCE_DIR}/src/SMESH diff --git a/src/Tools/padder/meshjob/impl/CMakeLists.txt b/src/Tools/padder/meshjob/impl/CMakeLists.txt index 499a30e02..0becd9885 100644 --- a/src/Tools/padder/meshjob/impl/CMakeLists.txt +++ b/src/Tools/padder/meshjob/impl/CMakeLists.txt @@ -22,7 +22,6 @@ INCLUDE_DIRECTORIES( ${KERNEL_INCLUDE_DIRS} ${GEOM_INCLUDE_DIRS} - ${VTK_INCLUDE_DIRS} ${OpenCASCADE_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${OMNIORB_INCLUDE_DIR}