From 048762b237a834b3c3d43cc72f83eadebf156e75 Mon Sep 17 00:00:00 2001 From: Pascal Obry Date: Fri, 31 Jan 2020 11:56:07 +0100 Subject: [PATCH] Port Smesh to ParaView 5.8. --- bin/smesh_setenv.py | 2 +- 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 | 6 ++-- src/OBJECT/SMESH_DeviceActor.cxx | 9 +++-- src/OBJECT/SMESH_Object.cxx | 3 +- src/PluginUtils/CMakeLists.txt | 5 +-- src/SMDS/CMakeLists.txt | 3 +- src/SMDS/SMDS_Downward.cxx | 40 +++++++++++------------ src/SMDS/SMDS_MeshCell.cxx | 15 ++++++--- src/SMDS/SMDS_MeshVolume.cxx | 22 +++++++------ src/SMDS/SMDS_UnstructuredGrid.cxx | 24 +++++++------- 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 | 6 ++-- src/SMESHGUI/CMakeLists.txt | 4 ++- 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 | 1 - src/SMESH_SWIG_WITHIHM/CMakeLists.txt | 5 +-- src/StdMeshers/CMakeLists.txt | 1 - src/StdMeshersGUI/CMakeLists.txt | 2 -- src/StdMeshers_I/CMakeLists.txt | 1 - 33 files changed, 99 insertions(+), 91 deletions(-) diff --git a/bin/smesh_setenv.py b/bin/smesh_setenv.py index 6826ab0ce..a0b757685 100644 --- a/bin/smesh_setenv.py +++ b/bin/smesh_setenv.py @@ -51,7 +51,7 @@ def set_env(args): for resource_file in [i for i in os.listdir(resource_dir) \ if osp.isfile(os.path.join(resource_dir, i))]: # look for resource file (XML) to extract valid plugin name - if resource_file.lower() == f'{plugin_lname}.xml': + if resource_file.lower() == '{plugin_lname}.xml': try: # get plugin name from 'resources' attribute of 'meshers-group' xml node # as name extracted from environment variable can be in wrong case 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..f3e2f4490 100644 --- a/src/OBJECT/CMakeLists.txt +++ b/src/OBJECT/CMakeLists.txt @@ -17,6 +17,8 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +find_package(ParaView REQUIRED) + # --- options --- # additional include directories INCLUDE_DIRECTORIES( @@ -26,7 +28,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,10 +51,8 @@ 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} @@ -63,6 +62,7 @@ SET(_link_LIBRARIES SMESHClient SMDS SMESHControls + ParaView::pqApplicationComponents ) 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..8c3999cc5 100644 --- a/src/PluginUtils/CMakeLists.txt +++ b/src/PluginUtils/CMakeLists.txt @@ -17,6 +17,8 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +find_package(ParaView REQUIRED) + # --- options --- # additional include directories INCLUDE_DIRECTORIES( @@ -52,10 +54,9 @@ SET(_link_LIBRARIES ${QT_MT_LIBS} ${GUI_SalomeObject} ${GUI_suit} - ${GUI_LightApp} - ${GUI_SalomeApp} SalomeIDLSMESH SMESH + ParaView::pqApplicationComponents ) # --- headers --- diff --git a/src/SMDS/CMakeLists.txt b/src/SMDS/CMakeLists.txt index 867e0b2df..2bc0f54b2 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,9 @@ ADD_DEFINITIONS( # libraries to link to SET(_link_LIBRARIES - ${VTK_LIBRARIES} ${KERNEL_SALOMELocalTrace} ${KERNEL_OpUtil} + VTK::CommonCore ) # --- 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..d684a5638 100644 --- a/src/SMDS/SMDS_MeshVolume.cxx +++ b/src/SMDS/SMDS_MeshVolume.cxx @@ -82,8 +82,10 @@ bool SMDS_MeshVolume::ChangeNodes(const std::vector& nodes return false; vtkIdType nFaces = 0; - vtkIdType* ptIds = 0; - getGrid()->GetFaceStream( GetVtkID(), nFaces, ptIds ); + vtkIdType *ptIds; + vtkIdType const *tmp(nullptr); + getGrid()->GetFaceStream( GetVtkID(), nFaces, tmp ); + std::copy(tmp, tmp+nFaces, ptIds); // stream size and nb faces should not change @@ -120,7 +122,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 +141,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 +159,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 +170,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 +189,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 +229,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 +251,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 +273,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..1ebbc9b72 100644 --- a/src/SMDS/SMDS_UnstructuredGrid.cxx +++ b/src/SMDS/SMDS_UnstructuredGrid.cxx @@ -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->CellLocations->GetValue( i+1 ) - this->CellLocations->GetValue( i ); vtkCellArray *newConnectivity = vtkCellArray::New(); newConnectivity->Initialize(); @@ -360,9 +360,9 @@ 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 = this->CellLocations->GetValue( iOld ); vtkIdType nbpts; - vtkIdType *oldPtsCell = 0; + vtkIdType const *oldPtsCell(nullptr); this->Connectivity->GetCell( oldLoc, nbpts, oldPtsCell ); if ((vtkIdType) pointsCell.size() < nbpts ) pointsCell.resize( nbpts ); @@ -976,8 +976,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); + std::copy(tmp, tmp+npts, pts); for (int i = 0; i < npts; i++) { if (localClonedNodeIds.count(pts[i])) @@ -1020,7 +1022,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 +1041,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. 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 b7c6ef24a..dc5a40118 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -11186,7 +11186,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 ) { @@ -11548,7 +11548,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]; @@ -12000,7 +12000,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..35fb4abf1 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} diff --git a/src/SMESH_SWIG_WITHIHM/CMakeLists.txt b/src/SMESH_SWIG_WITHIHM/CMakeLists.txt index 5374bf712..54c7e6fdf 100644 --- a/src/SMESH_SWIG_WITHIHM/CMakeLists.txt +++ b/src/SMESH_SWIG_WITHIHM/CMakeLists.txt @@ -17,6 +17,8 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +find_package(ParaView REQUIRED) + INCLUDE(${SWIG_USE_FILE}) # --- options --- @@ -25,7 +27,6 @@ INCLUDE_DIRECTORIES( ${QT_INCLUDES} ${PYTHON_INCLUDE_DIRS} ${OpenCASCADE_INCLUDE_DIR} - ${VTK_INCLUDE_DIRS} ${OGL_INCLUDE_DIRS} ${KERNEL_INCLUDE_DIRS} ${GUI_INCLUDE_DIRS} @@ -56,10 +57,10 @@ SET(_link_LIBRARIES ${GUI_CAM} ${GUI_suit} ${GUI_qtx} - ${GUI_SalomeApp} ${GUI_std} ${GUI_Event} SMESH + ParaView::pqApplicationComponents ) # --- headers --- diff --git a/src/StdMeshers/CMakeLists.txt b/src/StdMeshers/CMakeLists.txt index dfad28a86..090e5dcbf 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 0b8834730..ddc4406f2 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 ceed790b4..9baf0c38d 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 -- 2.39.2