From d2e0e15024ad9f74c2ba26f44e7f3cac3d0040e1 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Mon, 12 Sep 2022 07:44:34 +0200 Subject: [PATCH] Port for ParaView > 5.10. --- src/PVGUI/PVGUI_Module_actions.cxx | 2 +- src/Plugins/CMakeLists.txt | 2 +- .../vtkDifferenceTimestepsFilter.cxx | 4 ++-- .../vtkDifferenceTimestepsFilter.h | 2 +- .../plugin/GaussToCellModule/vtkGaussToCell.cxx | 2 +- .../MEDReader/plugin/MEDReaderIO/vtkExtractGroup.cxx | 5 +++-- .../plugin/MEDReaderIO/vtkGroupAsMultiBlock.cxx | 2 +- .../MEDReader/plugin/MEDReaderIO/vtkGroupsNames.cxx | 2 +- .../MEDReader/plugin/MEDReaderIO/vtkMEDReader.cxx | 7 ++++--- src/Plugins/MEDReader/plugin/Test/testMEDReader13.py | 2 +- src/Plugins/MEDReader/plugin/Test/testMEDReader2.py | 10 +++++----- src/Plugins/MEDReader/plugin/Test/testMEDReader3.py | 2 +- .../plugin/ParaMEDMEM2VTK/VTKParaMEDFieldClient.cxx | 6 +++--- .../plugin/SimpleModeModule/vtkSimpleMode.cxx | 2 +- .../plugin/StaticMeshModule/vtkStaticPlaneCutter.h | 1 + .../VoroGauss/plugin/VoroGaussModule/vtkVoroGauss.cxx | 6 +++--- 16 files changed, 30 insertions(+), 27 deletions(-) diff --git a/src/PVGUI/PVGUI_Module_actions.cxx b/src/PVGUI/PVGUI_Module_actions.cxx index 35d3fd0b..9231b3c2 100644 --- a/src/PVGUI/PVGUI_Module_actions.cxx +++ b/src/PVGUI/PVGUI_Module_actions.cxx @@ -245,7 +245,7 @@ void PVGUI_Module::pvCreateActions() anAction->setToolTip(tr("TOP_DELETE_ALL")); anAction->setStatusTip(tr("STB_DELETE_ALL")); registerAction(DeleteAllId, anAction); - new pqDeleteReaction(anAction, true); + new pqDeleteReaction(anAction, pqDeleteReaction::DeleteModes::ALL); // Setting diff --git a/src/Plugins/CMakeLists.txt b/src/Plugins/CMakeLists.txt index 9cfe8fe1..73d5bf8f 100644 --- a/src/Plugins/CMakeLists.txt +++ b/src/Plugins/CMakeLists.txt @@ -29,7 +29,7 @@ SET(_subdirs ArrayRenamer JSONReader DevelopedSurface - StaticMesh + #StaticMesh GaussToCell VoroGauss ) diff --git a/src/Plugins/DifferenceTimesteps/plugin/DifferenceTimestepsModule/vtkDifferenceTimestepsFilter.cxx b/src/Plugins/DifferenceTimesteps/plugin/DifferenceTimestepsModule/vtkDifferenceTimestepsFilter.cxx index 5d34caa4..4e212bc4 100644 --- a/src/Plugins/DifferenceTimesteps/plugin/DifferenceTimestepsModule/vtkDifferenceTimestepsFilter.cxx +++ b/src/Plugins/DifferenceTimesteps/plugin/DifferenceTimestepsModule/vtkDifferenceTimestepsFilter.cxx @@ -280,7 +280,7 @@ int vtkDifferenceTimestepsFilter::RequestUpdateExtent(vtkInformation* /*theReque } //-------------------------------------------------------------------------------------------------- -int vtkDifferenceTimestepsFilter::RequestData(vtkInformation* vtkNotUsed(theRequest), +/*int vtkDifferenceTimestepsFilter::RequestData(vtkInformation* vtkNotUsed(theRequest), vtkInformationVector** theInputVector, vtkInformationVector* theOutputVector) { // Get the information objects @@ -317,7 +317,7 @@ int vtkDifferenceTimestepsFilter::RequestData(vtkInformation* vtkNotUsed(theRequ } return 1; -} +}*/ //-------------------------------------------------------------------------------------------------- vtkDataObject* vtkDifferenceTimestepsFilter::DifferenceDataObject( diff --git a/src/Plugins/DifferenceTimesteps/plugin/DifferenceTimestepsModule/vtkDifferenceTimestepsFilter.h b/src/Plugins/DifferenceTimesteps/plugin/DifferenceTimestepsModule/vtkDifferenceTimestepsFilter.h index aae94766..6df18292 100644 --- a/src/Plugins/DifferenceTimesteps/plugin/DifferenceTimestepsModule/vtkDifferenceTimestepsFilter.h +++ b/src/Plugins/DifferenceTimesteps/plugin/DifferenceTimestepsModule/vtkDifferenceTimestepsFilter.h @@ -78,7 +78,7 @@ protected: int RequestUpdateExtent(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override; - int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override; + //int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override; // Description: // General computation differences routine for any type on input data. This diff --git a/src/Plugins/GaussToCell/plugin/GaussToCellModule/vtkGaussToCell.cxx b/src/Plugins/GaussToCell/plugin/GaussToCellModule/vtkGaussToCell.cxx index 9a3018df..2232ad95 100644 --- a/src/Plugins/GaussToCell/plugin/GaussToCellModule/vtkGaussToCell.cxx +++ b/src/Plugins/GaussToCell/plugin/GaussToCellModule/vtkGaussToCell.cxx @@ -61,7 +61,7 @@ #include "vtkWarpScalar.h" #include "vtkQuadratureSchemeDefinition.h" #include "vtkInformationQuadratureSchemeDefinitionVectorKey.h" -#include "vtkCompositeDataToUnstructuredGridFilter.h" +#include "vtkMergeBlocks.h" #include "vtkMultiBlockDataGroupFilter.h" #include "MEDCouplingMemArray.hxx" diff --git a/src/Plugins/MEDReader/plugin/MEDReaderIO/vtkExtractGroup.cxx b/src/Plugins/MEDReader/plugin/MEDReaderIO/vtkExtractGroup.cxx index c39dc03d..f917c0c6 100644 --- a/src/Plugins/MEDReader/plugin/MEDReaderIO/vtkExtractGroup.cxx +++ b/src/Plugins/MEDReader/plugin/MEDReaderIO/vtkExtractGroup.cxx @@ -61,7 +61,7 @@ #include "vtkDataObjectTreeIterator.h" #include "vtkThreshold.h" #include "vtkMultiBlockDataGroupFilter.h" -#include "vtkCompositeDataToUnstructuredGridFilter.h" +#include "vtkMergeBlocks.h" #include "vtkInformationDataObjectMetaDataKey.h" #include @@ -144,7 +144,8 @@ vtkDataSet *FilterFamilies(vtkSmartPointer& thres, //vtkDataSetAttributes *dscOut(output->GetCellData()),*dscOut2(output->GetPointData()); // todo: unused // double vMin(insideOut==0?1.:0.),vMax(insideOut==0?2.:1.); - thres->ThresholdBetween(vMin,vMax); + thres->SetUpperThreshold(vMax); + thres->SetLowerThreshold(vMin); // OK for the output // CellPointExtractor cpe2(input); diff --git a/src/Plugins/MEDReader/plugin/MEDReaderIO/vtkGroupAsMultiBlock.cxx b/src/Plugins/MEDReader/plugin/MEDReaderIO/vtkGroupAsMultiBlock.cxx index 54473db1..0caf2530 100644 --- a/src/Plugins/MEDReader/plugin/MEDReaderIO/vtkGroupAsMultiBlock.cxx +++ b/src/Plugins/MEDReader/plugin/MEDReaderIO/vtkGroupAsMultiBlock.cxx @@ -30,7 +30,7 @@ #include #include "vtkMutableDirectedGraph.h" #include "vtkInformationDataObjectMetaDataKey.h" -#include +#include #include #include #include diff --git a/src/Plugins/MEDReader/plugin/MEDReaderIO/vtkGroupsNames.cxx b/src/Plugins/MEDReader/plugin/MEDReaderIO/vtkGroupsNames.cxx index 1bed2b05..32a8dd04 100644 --- a/src/Plugins/MEDReader/plugin/MEDReaderIO/vtkGroupsNames.cxx +++ b/src/Plugins/MEDReader/plugin/MEDReaderIO/vtkGroupsNames.cxx @@ -30,7 +30,7 @@ #include #include "vtkMutableDirectedGraph.h" #include "vtkInformationDataObjectMetaDataKey.h" -#include +#include #include #include #include diff --git a/src/Plugins/MEDReader/plugin/MEDReaderIO/vtkMEDReader.cxx b/src/Plugins/MEDReader/plugin/MEDReaderIO/vtkMEDReader.cxx index 66db0a4c..2fba48c2 100644 --- a/src/Plugins/MEDReader/plugin/MEDReaderIO/vtkMEDReader.cxx +++ b/src/Plugins/MEDReader/plugin/MEDReaderIO/vtkMEDReader.cxx @@ -50,7 +50,7 @@ #ifdef MEDREADER_USE_MPI #include "vtkMultiProcessController.h" -#include "vtkPUnstructuredGridGhostCellsGenerator.h" +#include "vtkGhostCellsGenerator.h" #endif #include "MEDFileFieldRepresentationTree.hxx" @@ -346,13 +346,14 @@ int vtkMEDReader::RequestData(vtkInformation *request, vtkInformationVector ** / nbParts = vmpc->GetNumberOfProcesses(); if(this->Internal->GCGCP && nbParts>1) { - vtkSmartPointer gcg(vtkSmartPointer::New()); + vtkSmartPointer gcg(vtkSmartPointer::New()); { vtkDataSet *ret(RetrieveDataSetAtTime(reqTS,&ti)); gcg->SetInputData(ret); ret->Delete(); } - gcg->SetUseGlobalPointIds(true); + // To be checked + // gcg->SetUseGlobalPointIds(true); gcg->SetBuildIfRequired(false); gcg->Update(); output->SetBlock(0,gcg->GetOutput()); diff --git a/src/Plugins/MEDReader/plugin/Test/testMEDReader13.py b/src/Plugins/MEDReader/plugin/Test/testMEDReader13.py index aa2beb1d..0fbc7015 100644 --- a/src/Plugins/MEDReader/plugin/Test/testMEDReader13.py +++ b/src/Plugins/MEDReader/plugin/Test/testMEDReader13.py @@ -69,7 +69,7 @@ def test(baseline_file): #DataRepresentation2.SelectInputVectors = ['POINTS', 'fieldELNO_Vector'] DataRepresentation2.ScalarOpacityUnitDistance = 1.7746382108908556 DataRepresentation2.Texture = [] - DataRepresentation2.ExtractedBlockIndex = 1 + #DataRepresentation2.ExtractedBlockIndex = 1 #DataRepresentation2.RadiusRange = [6.666666740784422e-05, 1.9999333620071411] DataRepresentation2.ScaleFactor = 0.19998666953397334 diff --git a/src/Plugins/MEDReader/plugin/Test/testMEDReader2.py b/src/Plugins/MEDReader/plugin/Test/testMEDReader2.py index 887d7862..fd9ac499 100644 --- a/src/Plugins/MEDReader/plugin/Test/testMEDReader2.py +++ b/src/Plugins/MEDReader/plugin/Test/testMEDReader2.py @@ -62,11 +62,12 @@ def GenerateCase(): def test(baseline_file): fname = GenerateCase() ################### MED write is done -> Go to MEDReader - testMEDReader1=MEDReader(FileName=fname) + testMEDReader1=MEDReader(FileName=fname,registrationName='testMEDReader2.med') testMEDReader1.AllArrays=['TS0/mesh/ComSup0/ACellField@@][@@P0'] - testMEDReader2=MEDReader(FileName=fname) + testMEDReader2=MEDReader(FileName=fname,registrationName='testMEDReader2_bis.med') testMEDReader2.AllArrays=['TS0/mesh/ComSup1/mesh@@][@@P0'] GroupDatasets1=GroupDatasets(Input=[testMEDReader1,testMEDReader2]) + #GroupDatasets1.BlockNames = ['testMEDReader2.med', 'testMEDReader2_bis.med'] Clip1 = Clip(ClipType="Plane",Input=GroupDatasets1) Clip1.Scalars=['FamilyIdCell'] @@ -79,13 +80,12 @@ def test(baseline_file): DataRepresentation4.EdgeColor = [0.0, 0.0, 0.5000076295109483] DataRepresentation4.SelectionCellFieldDataArrayName = 'ACellField' DataRepresentation4.ScalarOpacityUnitDistance = 1.61104723630366 - DataRepresentation4.ExtractedBlockIndex = 2 + DataRepresentation4.BlockSelectors = ['/Root'] DataRepresentation4.ScaleFactor = 0.6000000000000001 DataRepresentation4.Visibility = 1 DataRepresentation4.Representation = 'Wireframe' - ExtractBlock1 = ExtractBlock(Input=Clip1) - ExtractBlock1.BlockIndices=[1, 2] + ExtractBlock1.Selectors = ['/Root/testMEDReader2med'] DataRepresentation5 = Show() DataRepresentation5.EdgeColor = [0.0, 0.0, 0.5000076295109483] diff --git a/src/Plugins/MEDReader/plugin/Test/testMEDReader3.py b/src/Plugins/MEDReader/plugin/Test/testMEDReader3.py index ce301ee7..b1bb65ca 100644 --- a/src/Plugins/MEDReader/plugin/Test/testMEDReader3.py +++ b/src/Plugins/MEDReader/plugin/Test/testMEDReader3.py @@ -110,7 +110,7 @@ def test(baseline_file): DataRepresentation2.SelectionPointFieldDataArrayName='ANodeField' DataRepresentation2.SelectionCellFieldDataArrayName='FamilyIdCell' DataRepresentation2.ScalarOpacityUnitDistance=1.4142135623730951 - DataRepresentation2.ExtractedBlockIndex=1 + #DataRepresentation2.ExtractedBlockIndex=1 DataRepresentation2.ScaleFactor=0.1 a1_ANodeField_PVLookupTable=GetLookupTableForArray("ANodeField",1,RGBPoints=[0.0,0.23,0.299,0.754,4.0,0.706,0.016,0.15],VectorMode='Magnitude',NanColor=[0.25,0.0,0.0], diff --git a/src/Plugins/ParaMEDCorba/plugin/ParaMEDMEM2VTK/VTKParaMEDFieldClient.cxx b/src/Plugins/ParaMEDCorba/plugin/ParaMEDMEM2VTK/VTKParaMEDFieldClient.cxx index 5a059c2b..beeaaa58 100644 --- a/src/Plugins/ParaMEDCorba/plugin/ParaMEDMEM2VTK/VTKParaMEDFieldClient.cxx +++ b/src/Plugins/ParaMEDCorba/plugin/ParaMEDMEM2VTK/VTKParaMEDFieldClient.cxx @@ -24,7 +24,7 @@ #include "vtkUnstructuredGrid.h" #include "vtkMultiBlockDataSet.h" #include "vtkMultiBlockDataGroupFilter.h" -#include "vtkCompositeDataToUnstructuredGridFilter.h" +#include "vtkMergeBlocks.h" std::vector ParaMEDMEM2VTK::FillMEDCouplingParaFieldDoubleInstanceFrom(SALOME_MED::ParaMEDCouplingFieldDoubleCorbaInterface_ptr fieldPtr, int begin, int end, vtkMultiBlockDataSet *ret) @@ -43,11 +43,11 @@ std::vector ParaMEDMEM2VTK::FillMEDCouplingParaFieldDoubleInstanceFrom(S part->Delete(); } tmp->Update(); - vtkCompositeDataToUnstructuredGridFilter *tmp2=vtkCompositeDataToUnstructuredGridFilter::New(); + vtkMergeBlocks *tmp2=vtkMergeBlocks::New(); tmp2->SetInputData(tmp->GetOutput()); tmp2->Update(); // - vtkUnstructuredGrid *ret3=tmp2->GetOutput(); + vtkUnstructuredGrid *ret3=static_cast(tmp2->GetOutput()); ret->SetBlock(0,ret3); // tmp->Delete(); diff --git a/src/Plugins/SimpleMode/plugin/SimpleModeModule/vtkSimpleMode.cxx b/src/Plugins/SimpleMode/plugin/SimpleModeModule/vtkSimpleMode.cxx index 57d0476d..a1ede347 100644 --- a/src/Plugins/SimpleMode/plugin/SimpleModeModule/vtkSimpleMode.cxx +++ b/src/Plugins/SimpleMode/plugin/SimpleModeModule/vtkSimpleMode.cxx @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/Plugins/StaticMesh/plugin/StaticMeshModule/vtkStaticPlaneCutter.h b/src/Plugins/StaticMesh/plugin/StaticMeshModule/vtkStaticPlaneCutter.h index 9f74eb8c..ba836c44 100644 --- a/src/Plugins/StaticMesh/plugin/StaticMeshModule/vtkStaticPlaneCutter.h +++ b/src/Plugins/StaticMesh/plugin/StaticMeshModule/vtkStaticPlaneCutter.h @@ -34,6 +34,7 @@ #include #include #include +#include #include diff --git a/src/Plugins/VoroGauss/plugin/VoroGaussModule/vtkVoroGauss.cxx b/src/Plugins/VoroGauss/plugin/VoroGaussModule/vtkVoroGauss.cxx index 53792181..f8cb9f84 100644 --- a/src/Plugins/VoroGauss/plugin/VoroGaussModule/vtkVoroGauss.cxx +++ b/src/Plugins/VoroGauss/plugin/VoroGaussModule/vtkVoroGauss.cxx @@ -61,7 +61,7 @@ #include "vtkWarpScalar.h" #include "vtkQuadratureSchemeDefinition.h" #include "vtkInformationQuadratureSchemeDefinitionVectorKey.h" -#include "vtkCompositeDataToUnstructuredGridFilter.h" +#include "vtkMergeBlocks.h" #include "vtkMultiBlockDataGroupFilter.h" #include "MEDCouplingMemArray.hxx" @@ -815,14 +815,14 @@ vtkSmartPointer ComputeVoroGauss(vtkUnstructuredGrid *usgIn if(res.empty()) throw INTERP_KERNEL::Exception("Dataset is empty !"); vtkSmartPointer mb(vtkSmartPointer::New()); - vtkSmartPointer cd(vtkSmartPointer::New()); + vtkSmartPointer cd(vtkSmartPointer::New()); for(std::vector< vtkSmartPointer >::const_iterator it=res.begin();it!=res.end();it++) mb->AddInputData(*it); cd->SetInputConnection(mb->GetOutputPort()); cd->SetMergePoints(0); cd->Update(); vtkSmartPointer ret; - ret=cd->GetOutput(); + ret=static_cast(cd->GetOutput()); return ret; } -- 2.39.2