diff --git a/benchmarking/BenchmarkFilters.cxx b/benchmarking/BenchmarkFilters.cxx index 909e9f9e8..f235b9427 100644 --- a/benchmarking/BenchmarkFilters.cxx +++ b/benchmarking/BenchmarkFilters.cxx @@ -432,7 +432,7 @@ class BenchmarkFilters BenchWarpScalar() : Filter(2.) { - this->Filter.SetUseCoordinateSystemAsPrimaryField(true); + this->Filter.SetUseCoordinateSystemAsField(true); this->Filter.SetNormalField(PointVectorsName, vtkm::cont::Field::Association::POINTS); this->Filter.SetScalarFactorField(PointScalarsName, vtkm::cont::Field::Association::POINTS); } diff --git a/vtkm/filter/WarpScalar.h b/vtkm/filter/WarpScalar.h index a17469865..8e8b3427e 100644 --- a/vtkm/filter/WarpScalar.h +++ b/vtkm/filter/WarpScalar.h @@ -32,52 +32,6 @@ public: VTKM_CONT WarpScalar(vtkm::FloatDefault scaleAmount); - //@{ - /// Choose the primary field to operate on. In the warp op A + B * - /// scaleAmount * scalarFactor, A is the primary field - VTKM_CONT - void SetPrimaryField( - const std::string& name, - vtkm::cont::Field::Association association = vtkm::cont::Field::Association::ANY) - { - this->SetActiveField(name, association); - } - //@} - - VTKM_CONT const std::string& GetPrimaryFieldName() const { return this->GetActiveFieldName(); } - - VTKM_CONT vtkm::cont::Field::Association GetPrimaryFieldAssociation() const - { - return this->GetActiveFieldAssociation(); - } - - //@{ - /// When set to true, filter uses a coordinate system as the primary field instead of the one selected - /// by name. Use SetPrimaryCoordinateSystem to select which coordinate system. - VTKM_CONT - void SetUseCoordinateSystemAsPrimaryField(bool flag) - { - this->SetUseCoordinateSystemAsField(flag); - } - VTKM_CONT - bool GetUseCoordinateSystemAsPrimaryField() const - { - return this->GetUseCoordinateSystemAsField(); - } - //@} - - //@{ - /// Select the coordinate system index to use as the primary field. This only has an effect when - /// UseCoordinateSystemAsPrimaryField is true. - VTKM_CONT - void SetPrimaryCoordinateSystem(vtkm::Id index) { this->SetActiveCoordinateSystem(index); } - VTKM_CONT - vtkm::Id GetPrimaryCoordinateSystemIndex() const - { - return this->GetActiveCoordinateSystemIndex(); - } - //@} - //@{ /// Choose the secondary field to operate on. In the warp op A + B * /// scaleAmount * scalarFactor, B is the secondary field diff --git a/vtkm/filter/WarpVector.h b/vtkm/filter/WarpVector.h index ca1a38ec5..2205aa09d 100644 --- a/vtkm/filter/WarpVector.h +++ b/vtkm/filter/WarpVector.h @@ -18,11 +18,11 @@ namespace vtkm { namespace filter { -/// \brief Modify points by moving points along a vector then timing +/// \brief Modify points by moving points along a vector multiplied by /// the scale factor /// /// A filter that modifies point coordinates by moving points along a vector -/// then timing a scale factor. It's a VTK-m version of the vtkWarpVector in VTK. +/// multiplied by a scale factor. It's a VTK-m version of the vtkWarpVector in VTK. /// Useful for showing flow profiles or mechanical deformation. /// This worklet does not modify the input points but generate new point /// coordinate instance that has been warped. @@ -32,52 +32,6 @@ public: VTKM_CONT WarpVector(vtkm::FloatDefault scale); - //@{ - /// Choose the primary field to operate on. In the warp op A + B *scale, A is - /// the primary field - VTKM_CONT - void SetPrimaryField( - const std::string& name, - vtkm::cont::Field::Association association = vtkm::cont::Field::Association::ANY) - { - this->SetActiveField(name, association); - } - //@} - - VTKM_CONT const std::string& GetPrimaryFieldName() const { return this->GetActiveFieldName(); } - - VTKM_CONT vtkm::cont::Field::Association GetPrimaryFieldAssociation() const - { - return this->GetActiveFieldAssociation(); - } - - //@{ - /// When set to true, filter uses a coordinate system as the primary field instead of the one selected - /// by name. Use SetPrimaryCoordinateSystem to select which coordinate system. - VTKM_CONT - void SetUseCoordinateSystemAsPrimaryField(bool flag) - { - this->SetUseCoordinateSystemAsField(flag); - } - VTKM_CONT - bool GetUseCoordinateSystemAsPrimaryField() const - { - return this->GetUseCoordinateSystemAsField(); - } - //@} - - //@{ - /// Select the coordinate system index to use as the primary field. This only has an effect when - /// UseCoordinateSystemAsPrimaryField is true. - VTKM_CONT - void SetPrimaryCoordinateSystem(vtkm::Id index) { this->SetActiveCoordinateSystem(index); } - VTKM_CONT - vtkm::Id GetPrimaryCoordinateSystemIndex() const - { - return this->GetActiveCoordinateSystemIndex(); - } - //@} - //@{ /// Choose the vector field to operate on. In the warp op A + B *scale, B is /// the vector field diff --git a/vtkm/filter/WarpVector.hxx b/vtkm/filter/WarpVector.hxx index 2b34de9ec..620f87240 100644 --- a/vtkm/filter/WarpVector.hxx +++ b/vtkm/filter/WarpVector.hxx @@ -22,7 +22,7 @@ namespace filter inline VTKM_CONT WarpVector::WarpVector(vtkm::FloatDefault scale) : vtkm::filter::FilterField() , Worklet() - , VectorFieldName() + , VectorFieldName("normal") , VectorFieldAssociation(vtkm::cont::Field::Association::ANY) , Scale(scale) { diff --git a/vtkm/filter/testing/UnitTestWarpScalarFilter.cxx b/vtkm/filter/testing/UnitTestWarpScalarFilter.cxx index 09a8ef6ee..19ac75414 100644 --- a/vtkm/filter/testing/UnitTestWarpScalarFilter.cxx +++ b/vtkm/filter/testing/UnitTestWarpScalarFilter.cxx @@ -78,7 +78,7 @@ void CheckResult(const vtkm::filter::WarpScalar& filter, const vtkm::cont::DataS vtkm::FloatDefault x = static_cast(i) / static_cast(dim - 1); vtkm::FloatDefault y = (x * x + z * z) / static_cast(2.0); - vtkm::FloatDefault targetZ = filter.GetUseCoordinateSystemAsPrimaryField() + vtkm::FloatDefault targetZ = filter.GetUseCoordinateSystemAsField() ? z + static_cast(2 * sfPortal.Get(j * dim + i)) : y + static_cast(2 * sfPortal.Get(j * dim + i)); auto point = outPortal.Get(j * dim + i); @@ -98,7 +98,7 @@ void TestWarpScalarFilter() { std::cout << " First field as coordinates" << std::endl; vtkm::filter::WarpScalar filter(scale); - filter.SetUseCoordinateSystemAsPrimaryField(true); + filter.SetUseCoordinateSystemAsField(true); filter.SetNormalField("normal"); filter.SetScalarFactorField("scalarfactor"); vtkm::cont::DataSet result = filter.Execute(ds); @@ -108,7 +108,7 @@ void TestWarpScalarFilter() { std::cout << " First field as a vector" << std::endl; vtkm::filter::WarpScalar filter(scale); - filter.SetPrimaryField("vec1"); + filter.SetActiveField("vec1"); filter.SetNormalField("normal"); filter.SetScalarFactorField("scalarfactor"); vtkm::cont::DataSet result = filter.Execute(ds); diff --git a/vtkm/filter/testing/UnitTestWarpVectorFilter.cxx b/vtkm/filter/testing/UnitTestWarpVectorFilter.cxx index c56a658e1..54404b53c 100644 --- a/vtkm/filter/testing/UnitTestWarpVectorFilter.cxx +++ b/vtkm/filter/testing/UnitTestWarpVectorFilter.cxx @@ -83,7 +83,7 @@ void CheckResult(const vtkm::filter::WarpVector& filter, const vtkm::cont::DataS vtkm::FloatDefault x = static_cast(i) / static_cast(dim - 1); vtkm::FloatDefault y = (x * x + z * z) / static_cast(2.0); - vtkm::FloatDefault targetZ = filter.GetUseCoordinateSystemAsPrimaryField() + vtkm::FloatDefault targetZ = filter.GetUseCoordinateSystemAsField() ? z + static_cast(2 * 2) : y + static_cast(2 * 2); auto point = outPortal.Get(j * dim + i); @@ -104,7 +104,7 @@ void TestWarpVectorFilter() { std::cout << " First field as coordinates" << std::endl; vtkm::filter::WarpVector filter(scale); - filter.SetUseCoordinateSystemAsPrimaryField(true); + filter.SetUseCoordinateSystemAsField(true); filter.SetVectorField("vec2"); vtkm::cont::DataSet result = filter.Execute(ds, PolicyWarpVector()); CheckResult(filter, result); @@ -113,7 +113,7 @@ void TestWarpVectorFilter() { std::cout << " First field as a vector" << std::endl; vtkm::filter::WarpVector filter(scale); - filter.SetPrimaryField("vec1"); + filter.SetActiveField("vec1"); filter.SetVectorField("vec2"); vtkm::cont::DataSet result = filter.Execute(ds, PolicyWarpVector()); CheckResult(filter, result);