//============================================================================ // Copyright (c) Kitware, Inc. // All rights reserved. // See LICENSE.txt for details. // // 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_Pathline_h #define vtk_m_filter_Pathline_h #include #include #include #include namespace vtkm { namespace filter { /// \brief generate streamlines from a vector field. /// Takes as input a vector field and seed locations and generates the /// paths taken by the seeds through the vector field. class Pathline : public vtkm::filter::FilterDataSetWithField { public: VTKM_CONT Pathline(); VTKM_CONT void SetPreviousTime(vtkm::worklet::particleadvection::ScalarType t) { this->PreviousTime = t; } VTKM_CONT void SetNextTime(vtkm::worklet::particleadvection::ScalarType t) { this->NextTime = t; } VTKM_CONT void SetNextDataSet(const vtkm::cont::DataSet& ds) { this->NextDataSet = ds; } VTKM_CONT void SetStepSize(vtkm::worklet::particleadvection::ScalarType s) { this->StepSize = s; } VTKM_CONT void SetNumberOfSteps(vtkm::Id n) { this->NumberOfSteps = n; } VTKM_CONT void SetSeeds(vtkm::cont::ArrayHandle& seeds); template VTKM_CONT vtkm::cont::DataSet DoExecute( const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle, StorageType>& field, const vtkm::filter::FieldMetadata& fieldMeta, const vtkm::filter::PolicyBase& policy); //Map a new field onto the resulting dataset after running the filter //this call is only valid template VTKM_CONT bool DoMapField(vtkm::cont::DataSet& result, const vtkm::cont::ArrayHandle& input, const vtkm::filter::FieldMetadata& fieldMeta, vtkm::filter::PolicyBase policy); private: vtkm::worklet::Streamline Worklet; vtkm::worklet::particleadvection::ScalarType StepSize; vtkm::worklet::particleadvection::ScalarType PreviousTime; vtkm::worklet::particleadvection::ScalarType NextTime; vtkm::cont::DataSet NextDataSet; vtkm::Id NumberOfSteps; vtkm::cont::ArrayHandle Seeds; }; template <> class FilterTraits { public: struct TypeListTagPathline : vtkm::ListTagBase { }; using InputFieldTypeList = TypeListTagPathline; }; } } // namespace vtkm::filter #include #endif // vtk_m_filter_Pathline_h