Commit b3f28844 authored by Kenneth Moreland's avatar Kenneth Moreland Committed by Kitware Robot
Browse files

Merge topic 'pointtransform-symbols' into release-1.8

d3de36f4

 Remove inline from PointTransform methods to be exported

Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Nicole Marsaglia's avatarNicole Marsaglia <marsaglia1@llnl.gov>
Merge-request: !2763
parents cc577154 d3de36f4
......@@ -105,7 +105,7 @@ VTKM_CONT FieldToColors::FieldToColors(const vtkm::cont::ColorTable& table)
}
//-----------------------------------------------------------------------------
inline VTKM_CONT void FieldToColors::SetNumberOfSamplingPoints(vtkm::Int32 count)
VTKM_CONT void FieldToColors::SetNumberOfSamplingPoints(vtkm::Int32 count)
{
if (this->SampleCount != count && count > 0)
{
......
......@@ -25,13 +25,13 @@ VTKM_CONT PointTransform::PointTransform()
}
//-----------------------------------------------------------------------------
inline VTKM_CONT void PointTransform::SetChangeCoordinateSystem(bool flag)
VTKM_CONT void PointTransform::SetChangeCoordinateSystem(bool flag)
{
this->ChangeCoordinateSystem = flag;
}
//-----------------------------------------------------------------------------
inline VTKM_CONT bool PointTransform::GetChangeCoordinateSystem() const
VTKM_CONT bool PointTransform::GetChangeCoordinateSystem() const
{
return this->ChangeCoordinateSystem;
}
......
......@@ -102,10 +102,11 @@ void TestPointTransformTranslation(const vtkm::cont::DataSet& ds, const vtkm::Ve
filter.SetOutputFieldName("translation");
filter.SetTranslation(trans);
VTKM_TEST_ASSERT(filter.GetChangeCoordinateSystem() == true);
vtkm::cont::DataSet result = filter.Execute(ds);
ValidatePointTransform(
ds.GetCoordinateSystem(), "translation", result, Transform3DTranslate(trans));
ds.GetCoordinateSystem(), "translation", result, vtkm::Transform3DTranslate(trans));
}
void TestPointTransformScale(const vtkm::cont::DataSet& ds, const vtkm::Vec3f& scale)
......@@ -114,9 +115,10 @@ void TestPointTransformScale(const vtkm::cont::DataSet& ds, const vtkm::Vec3f& s
filter.SetOutputFieldName("scale");
filter.SetScale(scale);
filter.SetChangeCoordinateSystem(true);
vtkm::cont::DataSet result = filter.Execute(ds);
ValidatePointTransform(ds.GetCoordinateSystem(), "scale", result, Transform3DScale(scale));
ValidatePointTransform(ds.GetCoordinateSystem(), "scale", result, vtkm::Transform3DScale(scale));
}
void TestPointTransformRotation(const vtkm::cont::DataSet& ds,
......@@ -130,7 +132,19 @@ void TestPointTransformRotation(const vtkm::cont::DataSet& ds,
vtkm::cont::DataSet result = filter.Execute(ds);
ValidatePointTransform(
ds.GetCoordinateSystem(), "rotation", result, Transform3DRotate(angle, axis));
ds.GetCoordinateSystem(), "rotation", result, vtkm::Transform3DRotate(angle, axis));
}
void TestPointTransformGeneral(const vtkm::cont::DataSet& ds,
const vtkm::Matrix<vtkm::FloatDefault, 4, 4>& transform)
{
vtkm::filter::field_transform::PointTransform filter;
auto fieldName = filter.GetOutputFieldName();
filter.SetTransform(transform);
vtkm::cont::DataSet result = filter.Execute(ds);
ValidatePointTransform(ds.GetCoordinateSystem(), fieldName, result, transform);
}
}
......@@ -190,6 +204,14 @@ void TestPointTransform()
for (auto& angle : angles)
for (auto& axe : axes)
TestPointTransformRotation(ds, angle, axe);
//Test general
auto transform = vtkm::Transform3DTranslate(vtkm::Vec3f{ 1, 1, 1 });
transform =
vtkm::MatrixMultiply(transform, vtkm::Transform3DScale(static_cast<vtkm::FloatDefault>(1.5f)));
transform = vtkm::MatrixMultiply(transform,
vtkm::Transform3DRotateX(static_cast<vtkm::FloatDefault>(90.f)));
TestPointTransformGeneral(ds, transform);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment