diff --git a/Applications/ParaView/ParaViewFilters.xml b/Applications/ParaView/ParaViewFilters.xml index c33b8fa71f142b4f078003dfcb975ea83f058f1b..a27bc25d086243745224aa20427e67f65fa3336a 100644 --- a/Applications/ParaView/ParaViewFilters.xml +++ b/Applications/ParaView/ParaViewFilters.xml @@ -183,7 +183,6 @@ - @@ -203,7 +202,6 @@ - @@ -217,6 +215,7 @@ + diff --git a/Applications/ParaView/Testing/XML/CMakeLists.txt b/Applications/ParaView/Testing/XML/CMakeLists.txt index 1d49aff05938dbdc17bf9ee70cc4cf7c6da4f349..c193d3147515165df3bbc1149242db17af037b14 100644 --- a/Applications/ParaView/Testing/XML/CMakeLists.txt +++ b/Applications/ParaView/Testing/XML/CMakeLists.txt @@ -292,6 +292,7 @@ list(APPEND TESTS_WITH_BASELINES ${CMAKE_CURRENT_SOURCE_DIR}/ReadXMLPolyDataFileSeries.xml ${CMAKE_CURRENT_SOURCE_DIR}/RectilinearFractal.xml ${CMAKE_CURRENT_SOURCE_DIR}/RepresentationSelector.xml + ${CMAKE_CURRENT_SOURCE_DIR}/ResampleWithDataset.xml ${CMAKE_CURRENT_SOURCE_DIR}/RescaleToTemporal.xml ${CMAKE_CURRENT_SOURCE_DIR}/RotateCamera90.xml # ${CMAKE_CURRENT_SOURCE_DIR}/SaveAnimationGeometry.xml diff --git a/Applications/ParaView/Testing/XML/CustomSourceProbe.xml b/Applications/ParaView/Testing/XML/CustomSourceProbe.xml index 1ae4b9dcabac48b6bb3028a62b270296e1d5f6cf..bde0d96a6a18dbd109d717fb32f86d87398a26ea 100644 --- a/Applications/ParaView/Testing/XML/CustomSourceProbe.xml +++ b/Applications/ParaView/Testing/XML/CustomSourceProbe.xml @@ -17,7 +17,7 @@ - + diff --git a/Applications/ParaView/Testing/XML/ResampleWithDataset.xml b/Applications/ParaView/Testing/XML/ResampleWithDataset.xml new file mode 100644 index 0000000000000000000000000000000000000000..45e038ea88cbf512e8ad60ac8078b3fafd9547c5 --- /dev/null +++ b/Applications/ParaView/Testing/XML/ResampleWithDataset.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ParaViewCore/ServerManager/Default/Testing/Python/CMakeLists.txt b/ParaViewCore/ServerManager/Default/Testing/Python/CMakeLists.txt index b081f8f70f77a990a2a3dfc29c69f751697c6dc1..6aae33fc92aa3862fd5a44182c43c3ddf34ccdcf 100644 --- a/ParaViewCore/ServerManager/Default/Testing/Python/CMakeLists.txt +++ b/ParaViewCore/ServerManager/Default/Testing/Python/CMakeLists.txt @@ -44,6 +44,7 @@ set(PY_TESTS ColorAttributeTypeBackwardsCompatibility.py,NO_VALID RepresentationTypeHint.py,NO_VALID PythonProgrammableFilterParameters.py,NO_VALID + ProxyBackwardsCompatibilityTest.py,NO_VALID ) include(FindPythonModules) diff --git a/ParaViewCore/ServerManager/Default/Testing/Python/ProxyBackwardsCompatibilityTest.py b/ParaViewCore/ServerManager/Default/Testing/Python/ProxyBackwardsCompatibilityTest.py new file mode 100644 index 0000000000000000000000000000000000000000..3b9a0555deb923a469c1555d9353e0c8bbcf4c48 --- /dev/null +++ b/ParaViewCore/ServerManager/Default/Testing/Python/ProxyBackwardsCompatibilityTest.py @@ -0,0 +1,19 @@ +from paraview.simple import * +import paraview + +sourceDs = Wavelet() +inputDs = Sphere() + +# Test 'Resample With Dataset` proxies +p1 = ResampleWithDataset(Input=inputDs, Source=sourceDs) +print "Proxy Name before:", p1.GetXMLName() +assert p1.GetXMLName() == "ResampleWithDataset", "The default proxy name must be ResampleWithDataset" + +print "" +print "Setting compatibility version to 5.0..." +paraview.compatibility.major = 5 +paraview.compatibility.minor = 0 + +p2 = paraview.simple.ResampleWithDataset(Input=inputDs, Source=sourceDs) +print "Proxy Name for compatibility version 5.0:", p2.GetXMLName() +assert p2.GetXMLName() == "Probe", "The default proxy name must be Probe" diff --git a/ParaViewCore/ServerManager/SMApplication/Resources/filters.xml b/ParaViewCore/ServerManager/SMApplication/Resources/filters.xml index 1b1c866721182f37d244a7b785077a6863968345..20cb808eaf21221a631873bef1d2acedf4522278 100644 --- a/ParaViewCore/ServerManager/SMApplication/Resources/filters.xml +++ b/ParaViewCore/ServerManager/SMApplication/Resources/filters.xml @@ -8164,7 +8164,7 @@ source. @@ -8179,7 +8179,13 @@ source. on in which Input cell each Source point is. If an array of the same name exists both in Input's point and cell data, only the one from the point data is - probed. + probed. This is the implementation of the + 'Resample With Dataset' filter available in ParaView + version 5.1 and earlier. + + This has been replaced by 'Resample With Dataset'. Please consider + using that instead. + @@ -14744,5 +14750,42 @@ source. + + + + This filter takes two inputs - Input and Source, and samples the + point and cell values of Input on to the point locations of Source. + The output has the same structure as Source but its point data + have the resampled values from Input." + + + + + + + + + + + This property specifies the dataset from which to obtain + probe values. The data attributes come from this dataset. + + + + + + + + + + + This property specifies the dataset whose geometry will + be used in determining positions to probe. The mesh comes from this + dataset. + + + diff --git a/Testing/Data/Baseline/ResampleWithDataset.png.md5 b/Testing/Data/Baseline/ResampleWithDataset.png.md5 new file mode 100644 index 0000000000000000000000000000000000000000..acccc613e55bbf6c987fea386b318eb7dd6838e3 --- /dev/null +++ b/Testing/Data/Baseline/ResampleWithDataset.png.md5 @@ -0,0 +1 @@ +34ce8abfa56faf7049ed12a3779d4818 diff --git a/Wrapping/Python/paraview/_backwardscompatibilityhelper.py b/Wrapping/Python/paraview/_backwardscompatibilityhelper.py index 0feefe2b7140c96a9d1416615964334048deb3b4..a263ad15664c1c9367ea68a9e6a40db1cbb4c530 100644 --- a/Wrapping/Python/paraview/_backwardscompatibilityhelper.py +++ b/Wrapping/Python/paraview/_backwardscompatibilityhelper.py @@ -115,3 +115,11 @@ def getattr(proxy, pname): 'Cube Axes and related properties are now obsolete. Please '\ 'remove them from your script.') raise Continue() + +def GetProxy(module, key): + version = paraview.compatibility.GetVersion() + if version < 5.2: + if key == "ResampleWithDataset": + return module.__dict__["LegacyResampleWithDataset"]() + + return module.__dict__[key]() diff --git a/Wrapping/Python/paraview/simple.py b/Wrapping/Python/paraview/simple.py index bf5d35b28cc649fafe49282999b90ae19cfa3339..c1579214bf472525e61470577c41cb726f0ec45b 100644 --- a/Wrapping/Python/paraview/simple.py +++ b/Wrapping/Python/paraview/simple.py @@ -37,6 +37,7 @@ A simple example:: import paraview import servermanager +import paraview._backwardscompatibilityhelper # Bring OutputPort in our namespace. from servermanager import OutputPort @@ -1605,7 +1606,7 @@ def _create_func(key, module, skipRegisteration=False): # Instantiate the actual object from the given module. - px = module.__dict__[key]() + px = paraview._backwardscompatibilityhelper.GetProxy(module, key) # preinitialize the proxy. controller.PreInitializeProxy(px)