From c1378217edce647cb0a0bbf856d9de5f77003782 Mon Sep 17 00:00:00 2001 From: Pascal Obry Date: Tue, 28 Jan 2020 13:51:32 +0100 Subject: [PATCH] Porting to ParaView 5.8 --- CMakeLists.txt | 14 +++--- SalomeGUIConfig.cmake.in | 2 +- src/LightApp/CMakeLists.txt | 1 - src/PVViewer/CMakeLists.txt | 6 +-- src/PVViewer/PVViewer_Behaviors.cxx | 3 -- src/SALOME_PY/CMakeLists.txt | 3 -- .../SALOME_PYQT_GUI/CMakeLists.txt | 4 -- .../SALOME_PYQT_GUILight/CMakeLists.txt | 5 -- src/SALOME_PYQT/SalomePyQt/CMakeLists.txt | 4 -- src/SALOME_SWIG/CMakeLists.txt | 3 -- src/SVTK/CMakeLists.txt | 6 ++- src/SalomeApp/CMakeLists.txt | 3 -- src/VTKViewer/CMakeLists.txt | 17 ++++++- src/VTKViewer/VTKViewer_ConvexTool.cxx | 6 ++- .../VTKViewer_ExtractUnstructuredGrid.cxx | 10 ++-- src/VTKViewer/VTKViewer_GeometryFilter.cxx | 46 ++++++++++--------- src/VTKViewer/VTKViewer_GeometryFilter.h | 2 +- src/VTKViewer/VTKViewer_OpenGLRenderer.cxx | 4 ++ src/VTKViewer/VTKViewer_PolyDataMapper.cxx | 4 +- 19 files changed, 71 insertions(+), 72 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9575399f7..f796010c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,10 +199,9 @@ IF(SALOME_USE_VTKVIEWER) # Required components are listed in the FindSalomeVTK.cmake file: FIND_PACKAGE(SalomeVTK) SALOME_LOG_OPTIONAL_PACKAGE(VTK SALOME_USE_VTKVIEWER) - IF(${VTK_RENDERING_BACKEND} STREQUAL "OpenGL2") - ADD_DEFINITIONS("-DVTK_OPENGL2") - SET(SALOME_GUI_USE_OPENGL2 TRUE) - ENDIF() + # VSR: TODO: since ParaView 5.8 the following is not needed, as OPENGL2 is hardcoded: to be removed (everywhere) + ADD_DEFINITIONS("-DVTK_OPENGL2") + SET(SALOME_GUI_USE_OPENGL2 TRUE) ELSE() ADD_DEFINITIONS("-DDISABLE_VTKVIEWER") ENDIF() @@ -433,20 +432,21 @@ SET(PYQT_ROOT_DIR "${PYQT5_ROOT_DIR}") SET(OPENCASCADE_ROOT_DIR "${OPENCASCADE_ROOT_DIR}") SET(OPENGL_ROOT_DIR "${OPENGL_ROOT_DIR}") +SET(PARAVIEW_ROOT_DIR "${PARAVIEW_ROOT_DIR}") SET(VTK_ROOT_DIR "${VTK_ROOT_DIR}") SET(QWT_ROOT_DIR "${QWT_ROOT_DIR}") SET(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include") # Build variables that will be expanded when configuring SalomeConfig.cmake: -SALOME_CONFIGURE_PREPARE(OpenCASCADE OpenGL Qt5 PyQt5 Qwt SIP VTK) +SALOME_CONFIGURE_PREPARE(OpenCASCADE OpenGL Qt5 PyQt5 Qwt SIP ParaView VTK) CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}" PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX KERNEL_ROOT_DIR SIP_ROOT_DIR QT_ROOT_DIR PYQT_ROOT_DIR OPENCASCADE_ROOT_DIR - OPENGL_ROOT_DIR VTK_ROOT_DIR QWT_ROOT_DIR) + OPENGL_ROOT_DIR PARAVIEW_ROOT_DIR VTK_ROOT_DIR QWT_ROOT_DIR) # - in the install tree (VSR 16/08/2013: TEMPORARILY COMMENT THIS - TO REMOVE?): # Get the relative path of the include directory so @@ -457,7 +457,7 @@ CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in # INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}" # PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX # KERNEL_ROOT_DIR SIP_ROOT_DIR QT_ROOT_DIR PYQT_ROOT_DIR OPENCASCADE_ROOT_DIR -# OPENGL_ROOT_DIR VTK_ROOT_DIR QWT_ROOT_DIR) +# OPENGL_ROOT_DIR PARAVIEW_ROOT_DIR VTK_ROOT_DIR QWT_ROOT_DIR) WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake VERSION ${${PROJECT_NAME_UC}_VERSION} diff --git a/SalomeGUIConfig.cmake.in b/SalomeGUIConfig.cmake.in index 08492ef2f..57f2ac0dd 100644 --- a/SalomeGUIConfig.cmake.in +++ b/SalomeGUIConfig.cmake.in @@ -118,7 +118,7 @@ SET_AND_CHECK(OPENCASCADE_ROOT_DIR_EXP "@PACKAGE_OPENCASCADE_ROOT_DIR@") IF(SALOME_USE_GLVIEWER) SET_AND_CHECK(OPENGL_ROOT_DIR_EXP "@PACKAGE_OPENGL_ROOT_DIR@") ENDIF() -IF(SALOME_USE_VTKVIEWER) +IF(SALOME_USE_VTKVIEWER) SET_AND_CHECK(VTK_ROOT_DIR_EXP "@PACKAGE_VTK_ROOT_DIR@") ENDIF() IF(SALOME_USE_PLOT2DVIEWER) diff --git a/src/LightApp/CMakeLists.txt b/src/LightApp/CMakeLists.txt index 374d05796..3e76e2cf2 100644 --- a/src/LightApp/CMakeLists.txt +++ b/src/LightApp/CMakeLists.txt @@ -66,7 +66,6 @@ IF(SALOME_USE_PLOT2DVIEWER) ENDIF() ENDIF() IF(SALOME_USE_VTKVIEWER) - INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/VTKViewer) IF(SALOME_USE_SALOMEOBJECT) INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/SVTK) diff --git a/src/PVViewer/CMakeLists.txt b/src/PVViewer/CMakeLists.txt index 47a5ab625..826256626 100644 --- a/src/PVViewer/CMakeLists.txt +++ b/src/PVViewer/CMakeLists.txt @@ -40,10 +40,8 @@ SET(_link_LIBRARIES ${KERNEL_OpUtil} suit PVServerService - pqApplicationComponents - #vtkRenderingFreeTypeOpenGL - vtkRenderingFreeType - vtkInteractionStyle + ParaView::pqApplicationComponents + ParaView::pqPython ) # --- headers --- diff --git a/src/PVViewer/PVViewer_Behaviors.cxx b/src/PVViewer/PVViewer_Behaviors.cxx index 21d3bf9d8..425456be2 100644 --- a/src/PVViewer/PVViewer_Behaviors.cxx +++ b/src/PVViewer/PVViewer_Behaviors.cxx @@ -72,9 +72,6 @@ void PVViewer_Behaviors::instanciateMinimalBehaviors(QMainWindow * desk) // Register standard types of view-frame actions. pgm->addInterface(new pqStandardViewFrameActionsImplementation(pgm)); - // Load plugins distributed with application. - pqApplicationCore::instance()->loadDistributedPlugins(); - new pqPipelineContextMenuBehavior(this); new pqDefaultViewBehavior(this); // shows a 3D view as soon as a server connection is made new pqAlwaysConnectedBehavior(this); // client always connected to a server diff --git a/src/SALOME_PY/CMakeLists.txt b/src/SALOME_PY/CMakeLists.txt index f4208aba0..9a3805e35 100644 --- a/src/SALOME_PY/CMakeLists.txt +++ b/src/SALOME_PY/CMakeLists.txt @@ -17,8 +17,6 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -INCLUDE(${VTK_USE_FILE}) - # --- options --- # additional include directories @@ -49,7 +47,6 @@ SET(_link_LIBRARIES ${PYTHON_LIBRARIES} ${QT_LIBRARIES} ${OPENGL_LIBRARIES} - ${VTK_LIBRARIES} LightApp ) diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/CMakeLists.txt b/src/SALOME_PYQT/SALOME_PYQT_GUI/CMakeLists.txt index bc037c4e4..30840f76f 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI/CMakeLists.txt +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI/CMakeLists.txt @@ -18,9 +18,6 @@ # INCLUDE(UseQtExt) -IF(SALOME_USE_VTKVIEWER) - INCLUDE(${VTK_USE_FILE}) -ENDIF() # --- options --- @@ -55,7 +52,6 @@ ADD_DEFINITIONS( # libraries to link to SET(_link_LIBRARIES ${PYTHON_LIBRARIES} - ${VTK_LIBRARIES} ${OPENGL_LIBRARIES} ${PLATFORM_LIBS} ${OMNIORB_LIBRARIES} diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/CMakeLists.txt b/src/SALOME_PYQT/SALOME_PYQT_GUILight/CMakeLists.txt index a261ed70d..07e8847cd 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/CMakeLists.txt +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/CMakeLists.txt @@ -20,10 +20,6 @@ INCLUDE(UseQtExt) INCLUDE(UsePyQt) -IF(SALOME_USE_VTKVIEWER) - INCLUDE(${VTK_USE_FILE}) -ENDIF() - # --- options --- # additional include directories @@ -61,7 +57,6 @@ ADD_DEFINITIONS( # libraries to link to SET(_link_LIBRARIES ${PYTHON_LIBRARIES} - ${VTK_LIBRARIES} ${OPENGL_LIBRARIES} LightApp ) diff --git a/src/SALOME_PYQT/SalomePyQt/CMakeLists.txt b/src/SALOME_PYQT/SalomePyQt/CMakeLists.txt index d6795254d..31106317c 100644 --- a/src/SALOME_PYQT/SalomePyQt/CMakeLists.txt +++ b/src/SALOME_PYQT/SalomePyQt/CMakeLists.txt @@ -19,9 +19,6 @@ INCLUDE(UseQtExt) INCLUDE(UsePyQt) -IF(SALOME_USE_VTKVIEWER) - INCLUDE(${VTK_USE_FILE}) -ENDIF() # --- options --- @@ -87,7 +84,6 @@ ADD_DEFINITIONS( # libraries to link to SET(_link_LIBRARIES ${PYTHON_LIBRARIES} - ${VTK_LIBRARIES} ${OPENGL_LIBRARIES} ${QWT_LIBRARY} SalomePyQtGUILight diff --git a/src/SALOME_SWIG/CMakeLists.txt b/src/SALOME_SWIG/CMakeLists.txt index 7fc57f493..b94fd6f9c 100644 --- a/src/SALOME_SWIG/CMakeLists.txt +++ b/src/SALOME_SWIG/CMakeLists.txt @@ -18,9 +18,6 @@ # INCLUDE(${SWIG_USE_FILE}) -IF(SALOME_USE_VTKVIEWER) - INCLUDE(${VTK_USE_FILE}) -ENDIF() # --- options --- diff --git a/src/SVTK/CMakeLists.txt b/src/SVTK/CMakeLists.txt index 1e8e16ee4..aa122905c 100644 --- a/src/SVTK/CMakeLists.txt +++ b/src/SVTK/CMakeLists.txt @@ -18,7 +18,6 @@ # INCLUDE(UseQtExt) -INCLUDE(${VTK_USE_FILE}) # --- options --- @@ -44,10 +43,13 @@ ADD_DEFINITIONS(${QT_DEFINITIONS} ${OpenCASCADE_DEFINITIONS} ${BOOST_DEFINITIONS SET(_link_LIBRARIES ${QT_LIBRARIES} ${OPENGL_LIBRARIES} - ${VTK_LIBRARIES} ${OpenCASCADE_FoundationClasses_LIBRARIES} ${OpenCASCADE_Visualization_LIBRARIES} ${KERNEL_OpUtil} qtx suit ViewerTools SalomeObject SalomePrs VTKViewer OpenGLUtils + VTK::RenderingAnnotation + VTK::ImagingCore + VTK::CommonSystem + VTK::IOExportGL2PS ) # --- headers --- diff --git a/src/SalomeApp/CMakeLists.txt b/src/SalomeApp/CMakeLists.txt index c3cceb8e7..15868f989 100644 --- a/src/SalomeApp/CMakeLists.txt +++ b/src/SalomeApp/CMakeLists.txt @@ -23,9 +23,6 @@ IF(SALOME_BUILD_TESTS) ENDIF() INCLUDE(UseQtExt) -IF(SALOME_USE_VTKVIEWER) - INCLUDE(${VTK_USE_FILE}) -ENDIF() # --- options --- diff --git a/src/VTKViewer/CMakeLists.txt b/src/VTKViewer/CMakeLists.txt index bc807d9c3..ff8c8fb7a 100644 --- a/src/VTKViewer/CMakeLists.txt +++ b/src/VTKViewer/CMakeLists.txt @@ -17,7 +17,6 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -INCLUDE(${VTK_USE_FILE}) INCLUDE(UseQtExt) # --- options --- @@ -35,7 +34,21 @@ INCLUDE_DIRECTORIES( ADD_DEFINITIONS(${OpenCASCADE_DEFINITIONS} ${QT_DEFINITIONS}) # libraries to link to -SET(_link_LIBRARIES ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${VTK_LIBRARIES} ${OpenCASCADE_FoundationClasses_LIBRARIES} qtx suit ${KERNEL_SALOMELocalTrace}) +SET(_link_LIBRARIES + ${QT_LIBRARIES} + ${OPENGL_LIBRARIES} + VTK::FiltersGeometry + VTK::FiltersParallel + VTK::RenderingLOD + VTK::RenderingFreeType + VTK::RenderingOpenGL2 + VTK::IOImage + VTK::IOXML + ${OpenCASCADE_FoundationClasses_LIBRARIES} + qtx + suit + ${KERNEL_SALOMELocalTrace} + ) # --- headers --- diff --git a/src/VTKViewer/VTKViewer_ConvexTool.cxx b/src/VTKViewer/VTKViewer_ConvexTool.cxx index e561aa591..41a3b3b39 100644 --- a/src/VTKViewer/VTKViewer_ConvexTool.cxx +++ b/src/VTKViewer/VTKViewer_ConvexTool.cxx @@ -107,7 +107,9 @@ VTKViewer_Triangulator myPoints->Modified(); // the VTK bug vtkIdType aNumPts; - theInput->GetCellPoints(theCellId, aNumPts, myPointIds); + vtkIdType const *tmp(nullptr); + theInput->GetCellPoints(theCellId, aNumPts, tmp); + std::copy(tmp,tmp+aNumPts,myPointIds); if ( aNumPts > 0 ) { double anAbsoluteCoord[3]; myPoints->SetNumberOfPoints(aNumPts); @@ -668,7 +670,7 @@ VTKViewer_OrderedTriangulator if ( theFaceId < 0 || theFaceId >= aNumCells ) return NULL; - vtkIdType *aCells = myBoundaryTris->GetPointer(); + vtkIdType *aCells = myBoundaryTris->GetData()->GetPointer(0); // Each triangle has three points plus number of points vtkIdType *aCellPtr = aCells + 4*theFaceId; diff --git a/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx b/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx index 428eaf73f..46fed3a1b 100644 --- a/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx +++ b/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx @@ -324,8 +324,8 @@ inline int InsertCell(vtkUnstructuredGrid *theInput, theFaceLocations->InsertNextValue(theFaces->GetMaxId() + 1); // insert cell connectivity and faces stream - vtkIdType nfaces = 0; - vtkIdType* face = 0; + vtkIdType nfaces = 0; + const vtkIdType* face = 0; vtkIdType realnpts; theInput->GetFaceStream(theCellId, nfaces, face); vtkUnstructuredGrid::DecomposeAPolyhedronCell( @@ -494,7 +494,8 @@ int VTKViewer_ExtractUnstructuredGrid::RequestData(vtkInformation *vtkNotUsed(re aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples(newNbElems); aConnectivity->InitTraversal(); - for(vtkIdType i = 0, *pts, npts; aConnectivity->GetNextCell(npts,pts); i++){ + vtkIdType const *pts(nullptr); + for(vtkIdType i = 0, npts; aConnectivity->GetNextCell(npts,pts); i++){ aCellLocationsArray->SetValue(i,aConnectivity->GetTraversalLocation(npts)); } #if VTK_XVERSION > 50700 @@ -595,7 +596,8 @@ int VTKViewer_ExtractUnstructuredGrid::RequestData(vtkInformation *vtkNotUsed(re aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples( newNbElems ); aConnectivity->InitTraversal(); - for(vtkIdType i = 0, *pts, npts; aConnectivity->GetNextCell(npts,pts); i++){ + vtkIdType const *pts(nullptr); + for(vtkIdType i = 0, npts; aConnectivity->GetNextCell(npts,pts); i++){ aCellLocationsArray->SetValue(i,aConnectivity->GetTraversalLocation(npts)); } #if VTK_XVERSION > 50700 diff --git a/src/VTKViewer/VTKViewer_GeometryFilter.cxx b/src/VTKViewer/VTKViewer_GeometryFilter.cxx index 69c148015..52dd0afcd 100644 --- a/src/VTKViewer/VTKViewer_GeometryFilter.cxx +++ b/src/VTKViewer/VTKViewer_GeometryFilter.cxx @@ -118,10 +118,10 @@ VTKViewer_GeometryFilter static inline bool toShowEdge( vtkIdType id1, vtkIdType id2, vtkIdType cellId, vtkUnstructuredGrid* input ) { // return true if the given cell is the 1st among cells including the edge - vtkCellLinks * links = input->GetCellLinks(); + vtkCellLinks * links = static_cast(input->GetCellLinks()); if ( !links ) { input->BuildLinks(); - links = input->GetCellLinks(); + links = static_cast(input->GetCellLinks()); } if ( id1 < id2 ) std::swap( id1, id2 ); @@ -134,7 +134,9 @@ static inline bool toShowEdge( vtkIdType id1, vtkIdType id2, vtkIdType cellId, v { if ( cells[iCell] == cellId ) return true; - input->GetCellPoints( cells[iCell], npts, cellPts ); + vtkIdType const *tmp(nullptr); + input->GetCellPoints( cells[iCell], npts, tmp ); + std::copy(tmp, tmp+npts, cellPts); for ( vtkIdType i = 0; i < npts && !found; ++i ) found = ( cellPts[i] == id2 ); iCell += ( !found ); @@ -193,7 +195,7 @@ VTKViewer_GeometryFilter int i; int allVisible; vtkIdType npts = 0; - vtkIdType *pts = 0; + vtkIdType const *pts = 0; vtkPoints *p = input->GetPoints(); vtkIdType numCells=input->GetNumberOfCells(); vtkPointData *pd = input->GetPointData(); @@ -214,7 +216,7 @@ VTKViewer_GeometryFilter char *cellVis; vtkIdType newCellId; - int faceId, *faceVerts, *edgeVerts, numFacePts; + int faceId, numFacePts; double *x; vtkIdType PixelConvert[4]; // Change the type from int to vtkIdType in order to avoid compilation errors while using VTK @@ -447,7 +449,7 @@ VTKViewer_GeometryFilter aCellType = VTK_LINE; for ( int edgeID = 0; edgeID < 6; ++edgeID ) { - edgeVerts = vtkTetra::GetEdgeArray( edgeID ); + const int *edgeVerts = vtkTetra::GetEdgeArray( edgeID ); if ( toShowEdge( pts[edgeVerts[0]], pts[edgeVerts[1]], cellId, input )) { aNewPts[0] = pts[edgeVerts[0]]; @@ -473,7 +475,7 @@ VTKViewer_GeometryFilter for (faceId = 0; faceId < 4; faceId++) { faceIds->Reset(); - faceVerts = vtkTetra::GetFaceArray(faceId); + const int *faceVerts = vtkTetra::GetFaceArray(faceId); faceIds->InsertNextId(pts[faceVerts[0]]); faceIds->InsertNextId(pts[faceVerts[1]]); faceIds->InsertNextId(pts[faceVerts[2]]); @@ -504,7 +506,7 @@ VTKViewer_GeometryFilter aCellType = VTK_LINE; for ( int edgeID = 0; edgeID < 12; ++edgeID ) { - edgeVerts = vtkVoxel::GetEdgeArray( edgeID ); + const int *edgeVerts = vtkVoxel::GetEdgeArray( edgeID ); if ( toShowEdge( pts[edgeVerts[0]], pts[edgeVerts[1]], cellId, input )) { aNewPts[0] = pts[edgeVerts[0]]; @@ -528,7 +530,7 @@ VTKViewer_GeometryFilter for (faceId = 0; faceId < 6; faceId++) { faceIds->Reset(); - faceVerts = vtkVoxel::GetFaceArray(faceId); + const int *faceVerts = vtkVoxel::GetFaceArray(faceId); faceIds->InsertNextId(pts[faceVerts[0]]); faceIds->InsertNextId(pts[faceVerts[1]]); faceIds->InsertNextId(pts[faceVerts[2]]); @@ -562,7 +564,7 @@ VTKViewer_GeometryFilter aCellType = VTK_LINE; for ( int edgeID = 0; edgeID < 12; ++edgeID ) { - edgeVerts = vtkHexahedron::GetEdgeArray( edgeID ); + const int *edgeVerts = vtkHexahedron::GetEdgeArray( edgeID ); if ( toShowEdge( pts[edgeVerts[0]], pts[edgeVerts[1]], cellId, input )) { aNewPts[0] = pts[edgeVerts[0]]; @@ -588,7 +590,7 @@ VTKViewer_GeometryFilter for (faceId = 0; faceId < 6; faceId++) { faceIds->Reset(); - faceVerts = vtkHexahedron::GetFaceArray(faceId); + const int *faceVerts = vtkHexahedron::GetFaceArray(faceId); faceIds->InsertNextId(pts[faceVerts[0]]); faceIds->InsertNextId(pts[faceVerts[1]]); faceIds->InsertNextId(pts[faceVerts[2]]); @@ -620,7 +622,7 @@ VTKViewer_GeometryFilter aCellType = VTK_LINE; for ( int edgeID = 0; edgeID < 9; ++edgeID ) { - edgeVerts = vtkWedge::GetEdgeArray( edgeID ); + const int *edgeVerts = vtkWedge::GetEdgeArray( edgeID ); if ( toShowEdge( pts[edgeVerts[0]], pts[edgeVerts[1]], cellId, input )) { aNewPts[0] = pts[edgeVerts[0]]; @@ -644,7 +646,7 @@ VTKViewer_GeometryFilter for (faceId = 0; faceId < 5; faceId++) { faceIds->Reset(); - faceVerts = vtkWedge::GetFaceArray(faceId); + const int *faceVerts = vtkWedge::GetFaceArray(faceId); faceIds->InsertNextId(pts[faceVerts[0]]); faceIds->InsertNextId(pts[faceVerts[1]]); faceIds->InsertNextId(pts[faceVerts[2]]); @@ -683,7 +685,7 @@ VTKViewer_GeometryFilter aCellType = VTK_LINE; for ( int edgeID = 0; edgeID < 18; ++edgeID ) { - edgeVerts = vtkHexagonalPrism::GetEdgeArray( edgeID ); + const int *edgeVerts = vtkHexagonalPrism::GetEdgeArray( edgeID ); if ( toShowEdge( pts[edgeVerts[0]], pts[edgeVerts[1]], cellId, input )) { aNewPts[0] = pts[edgeVerts[0]]; @@ -706,7 +708,7 @@ VTKViewer_GeometryFilter #endif for (faceId = 0; faceId < 8; faceId++) { - faceVerts = vtkHexagonalPrism::GetFaceArray(faceId); + const int *faceVerts = vtkHexagonalPrism::GetFaceArray(faceId); faceIds->Reset(); faceIds->InsertNextId(pts[faceVerts[0]]); faceIds->InsertNextId(pts[faceVerts[1]]); @@ -748,7 +750,7 @@ VTKViewer_GeometryFilter aCellType = VTK_LINE; for ( int edgeID = 0; edgeID < 8; ++edgeID ) { - edgeVerts = vtkPyramid::GetEdgeArray( edgeID ); + const int *edgeVerts = vtkPyramid::GetEdgeArray( edgeID ); if ( toShowEdge( pts[edgeVerts[0]], pts[edgeVerts[1]], cellId, input )) { aNewPts[0] = pts[edgeVerts[0]]; @@ -772,7 +774,7 @@ VTKViewer_GeometryFilter for (faceId = 0; faceId < 5; faceId++) { faceIds->Reset(); - faceVerts = vtkPyramid::GetFaceArray(faceId); + const int *faceVerts = vtkPyramid::GetFaceArray(faceId); faceIds->InsertNextId(pts[faceVerts[0]]); faceIds->InsertNextId(pts[faceVerts[1]]); faceIds->InsertNextId(pts[faceVerts[2]]); @@ -809,7 +811,7 @@ VTKViewer_GeometryFilter case VTK_POLYHEDRON: { vtkIdType nFaces = 0; - vtkIdType* ptIds = 0; + const vtkIdType* ptIds = 0; int idp = 0; input->GetFaceStream(cellId, nFaces, ptIds); #ifdef SHOW_COINCIDING_3D_PAL21924 @@ -891,7 +893,7 @@ VTKViewer_GeometryFilter if ( cell->GetCellDimension() == 1 ) { vtkIdType arcResult = -1; if(myIsBuildArc) { - arcResult = Build1DArc(cellId, input, output, pts, myMaxArcAngle); + arcResult = Build1DArc(cellId, input, output, const_cast(pts), myMaxArcAngle); newCellId = arcResult; } @@ -993,10 +995,10 @@ VTKViewer_GeometryFilter switch(aCellType) { case VTK_QUADRATIC_EDGE: { - vtkIdType arcResult =-1; + vtkIdType arcResult = -1; if(myIsBuildArc) { - arcResult = Build1DArc(cellId, input, output, pts,myMaxArcAngle); - newCellId = arcResult; + arcResult = Build1DArc(cellId, input, output, const_cast(pts), myMaxArcAngle); + newCellId = arcResult; } if(!myIsBuildArc || arcResult == -1) { aCellType = VTK_POLY_LINE; diff --git a/src/VTKViewer/VTKViewer_GeometryFilter.h b/src/VTKViewer/VTKViewer_GeometryFilter.h index 776b76f3b..3220f301a 100644 --- a/src/VTKViewer/VTKViewer_GeometryFilter.h +++ b/src/VTKViewer/VTKViewer_GeometryFilter.h @@ -148,7 +148,7 @@ private: int myIsWireframeMode; int myAppendCoincident3D; - double myMaxArcAngle; // define max angle for mesh 2D quadratic element in the degrees + double myMaxArcAngle; // define max angle for mesh 2D quadratic element in the degrees bool myIsBuildArc; // flag for representation 2D quadratic element as arked polygon }; diff --git a/src/VTKViewer/VTKViewer_OpenGLRenderer.cxx b/src/VTKViewer/VTKViewer_OpenGLRenderer.cxx index 885e73a6c..71c5fcf99 100644 --- a/src/VTKViewer/VTKViewer_OpenGLRenderer.cxx +++ b/src/VTKViewer/VTKViewer_OpenGLRenderer.cxx @@ -20,6 +20,10 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// to compile, otherwise we get: +// #error gl.h included before glew.h +#include + #include "VTKViewer_OpenGLRenderer.h" #include "VTKViewer_Texture.h" diff --git a/src/VTKViewer/VTKViewer_PolyDataMapper.cxx b/src/VTKViewer/VTKViewer_PolyDataMapper.cxx index 959948f68..b59d4714e 100644 --- a/src/VTKViewer/VTKViewer_PolyDataMapper.cxx +++ b/src/VTKViewer/VTKViewer_PolyDataMapper.cxx @@ -41,6 +41,8 @@ #include #include #include +#include +#include #include @@ -747,7 +749,7 @@ namespace VTK vtkDataArray* theDiamArray, double theBallScale ) { - vtkIdType* ptIds = theCells->GetPointer(); + vtkIdType* ptIds = theCells->GetData()->GetPointer(0); vtkIdType* endPtIds = ptIds + theCells->GetNumberOfConnectivityEntries(); bool mapBalls = false; -- 2.39.2