# 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()
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 Salome<MODULE>Config.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
# 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}
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(
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
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
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<vtkCellLinks *>(input->GetCellLinks());
if ( !links ) {
input->BuildLinks();
- links = input->GetCellLinks();
+ links = static_cast<vtkCellLinks *>(input->GetCellLinks());
}
if ( id1 < id2 )
std::swap( id1, id2 );
{
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 );
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();
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
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]];
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]]);
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]];
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]]);
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]];
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]]);
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]];
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]]);
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]];
#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]]);
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]];
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]]);
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
if ( cell->GetCellDimension() == 1 ) {
vtkIdType arcResult = -1;
if(myIsBuildArc) {
- arcResult = Build1DArc(cellId, input, output, pts, myMaxArcAngle);
+ arcResult = Build1DArc(cellId, input, output, const_cast<vtkIdType *>(pts), myMaxArcAngle);
newCellId = arcResult;
}
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<vtkIdType *>(pts), myMaxArcAngle);
+ newCellId = arcResult;
}
if(!myIsBuildArc || arcResult == -1) {
aCellType = VTK_POLY_LINE;