Remove unneeded methods from warpscalar and warpvector filters

This commit is contained in:
Robert Maynard 2019-06-03 13:33:31 -04:00
parent d4fffe3f2b
commit b80a3789f0
6 changed files with 10 additions and 102 deletions

@ -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);
}

@ -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

@ -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

@ -22,7 +22,7 @@ namespace filter
inline VTKM_CONT WarpVector::WarpVector(vtkm::FloatDefault scale)
: vtkm::filter::FilterField<WarpVector>()
, Worklet()
, VectorFieldName()
, VectorFieldName("normal")
, VectorFieldAssociation(vtkm::cont::Field::Association::ANY)
, Scale(scale)
{

@ -78,7 +78,7 @@ void CheckResult(const vtkm::filter::WarpScalar& filter, const vtkm::cont::DataS
vtkm::FloatDefault x =
static_cast<vtkm::FloatDefault>(i) / static_cast<vtkm::FloatDefault>(dim - 1);
vtkm::FloatDefault y = (x * x + z * z) / static_cast<vtkm::FloatDefault>(2.0);
vtkm::FloatDefault targetZ = filter.GetUseCoordinateSystemAsPrimaryField()
vtkm::FloatDefault targetZ = filter.GetUseCoordinateSystemAsField()
? z + static_cast<vtkm::FloatDefault>(2 * sfPortal.Get(j * dim + i))
: y + static_cast<vtkm::FloatDefault>(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);

@ -83,7 +83,7 @@ void CheckResult(const vtkm::filter::WarpVector& filter, const vtkm::cont::DataS
vtkm::FloatDefault x =
static_cast<vtkm::FloatDefault>(i) / static_cast<vtkm::FloatDefault>(dim - 1);
vtkm::FloatDefault y = (x * x + z * z) / static_cast<vtkm::FloatDefault>(2.0);
vtkm::FloatDefault targetZ = filter.GetUseCoordinateSystemAsPrimaryField()
vtkm::FloatDefault targetZ = filter.GetUseCoordinateSystemAsField()
? z + static_cast<vtkm::FloatDefault>(2 * 2)
: y + static_cast<vtkm::FloatDefault>(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);