2018-06-14 16:23:22 +00:00
|
|
|
//============================================================================
|
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
2019-04-15 23:24:21 +00:00
|
|
|
//
|
2018-06-14 16:23:22 +00:00
|
|
|
// This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
// PURPOSE. See the above copyright notice for more information.
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
#ifndef vtk_m_filter_PointTransform_h
|
|
|
|
#define vtk_m_filter_PointTransform_h
|
|
|
|
|
|
|
|
#include <vtkm/filter/FilterField.h>
|
|
|
|
#include <vtkm/worklet/PointTransform.h>
|
|
|
|
|
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace filter
|
|
|
|
{
|
|
|
|
/// \brief
|
|
|
|
///
|
|
|
|
/// Generate scalar field from a dataset.
|
2019-08-22 20:46:52 +00:00
|
|
|
class PointTransform : public vtkm::filter::FilterField<PointTransform>
|
2018-06-14 16:23:22 +00:00
|
|
|
{
|
|
|
|
public:
|
2019-12-05 17:55:57 +00:00
|
|
|
using SupportedTypes = vtkm::TypeListFieldVec3;
|
2019-08-02 02:03:04 +00:00
|
|
|
|
2018-06-14 16:23:22 +00:00
|
|
|
VTKM_CONT
|
|
|
|
PointTransform();
|
|
|
|
|
2019-08-22 20:46:52 +00:00
|
|
|
void SetTranslation(const vtkm::FloatDefault& tx,
|
|
|
|
const vtkm::FloatDefault& ty,
|
|
|
|
const vtkm::FloatDefault& tz);
|
2018-06-14 16:23:22 +00:00
|
|
|
|
2019-08-22 20:46:52 +00:00
|
|
|
void SetTranslation(const vtkm::Vec3f& v);
|
2018-06-14 16:23:22 +00:00
|
|
|
|
2019-08-22 20:46:52 +00:00
|
|
|
void SetRotation(const vtkm::FloatDefault& angleDegrees, const vtkm::Vec3f& axis);
|
2018-06-14 16:23:22 +00:00
|
|
|
|
2019-08-22 20:46:52 +00:00
|
|
|
void SetRotation(const vtkm::FloatDefault& angleDegrees,
|
|
|
|
const vtkm::FloatDefault& rx,
|
|
|
|
const vtkm::FloatDefault& ry,
|
|
|
|
const vtkm::FloatDefault& rz);
|
2018-06-14 16:23:22 +00:00
|
|
|
|
2019-08-22 20:46:52 +00:00
|
|
|
void SetRotationX(const vtkm::FloatDefault& angleDegrees);
|
2018-06-14 16:23:22 +00:00
|
|
|
|
2019-08-22 20:46:52 +00:00
|
|
|
void SetRotationY(const vtkm::FloatDefault& angleDegrees);
|
2018-06-14 16:23:22 +00:00
|
|
|
|
2019-08-22 20:46:52 +00:00
|
|
|
void SetRotationZ(const vtkm::FloatDefault& angleDegrees);
|
2018-06-14 16:23:22 +00:00
|
|
|
|
2019-08-22 20:46:52 +00:00
|
|
|
void SetScale(const vtkm::FloatDefault& s);
|
2018-06-14 16:23:22 +00:00
|
|
|
|
2019-08-22 20:46:52 +00:00
|
|
|
void SetScale(const vtkm::FloatDefault& sx,
|
|
|
|
const vtkm::FloatDefault& sy,
|
|
|
|
const vtkm::FloatDefault& sz);
|
|
|
|
|
|
|
|
void SetScale(const vtkm::Vec3f& v);
|
|
|
|
|
|
|
|
void SetTransform(const vtkm::Matrix<vtkm::FloatDefault, 4, 4>& mtx);
|
|
|
|
|
|
|
|
void SetChangeCoordinateSystem(bool flag);
|
|
|
|
bool GetChangeCoordinateSystem() const;
|
2018-06-14 16:23:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2018-08-30 15:53:18 +00:00
|
|
|
template <typename T, typename StorageType, typename DerivedPolicy>
|
2018-06-14 16:23:22 +00:00
|
|
|
VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input,
|
|
|
|
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
|
|
|
const vtkm::filter::FieldMetadata& fieldMeta,
|
2018-08-30 15:53:18 +00:00
|
|
|
vtkm::filter::PolicyBase<DerivedPolicy> policy);
|
2018-06-14 16:23:22 +00:00
|
|
|
|
|
|
|
private:
|
2019-08-22 20:46:52 +00:00
|
|
|
vtkm::worklet::PointTransform<vtkm::FloatDefault> Worklet;
|
|
|
|
bool ChangeCoordinateSystem;
|
2018-06-14 16:23:22 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
} // namespace vtkm::filter
|
|
|
|
|
2019-08-22 20:46:52 +00:00
|
|
|
#ifndef vtk_m_filter_PointTransform_hxx
|
2018-06-14 16:23:22 +00:00
|
|
|
#include <vtkm/filter/PointTransform.hxx>
|
2019-08-22 20:46:52 +00:00
|
|
|
#endif
|
2018-06-14 16:23:22 +00:00
|
|
|
|
|
|
|
#endif // vtk_m_filter_PointTransform_h
|