//============================================================================ // 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. // // Copyright 2017 National Technology & Engineering Solutions of Sandia, LLC (NTESS). // Copyright 2017 UT-Battelle, LLC. // Copyright 2017 Los Alamos National Security. // // Under the terms of Contract DE-NA0003525 with NTESS, // the U.S. Government retains certain rights in this software. // // Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National // Laboratory (LANL), the U.S. Government retains certain rights in // this software. //============================================================================ #ifndef vtk_m_filter_Streamline_h #define vtk_m_filter_Streamline_h #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 Streamline : public vtkm::filter::FilterDataSetWithField { public: VTKM_CONT Streamline(); VTKM_CONT void SetStepSize(vtkm::Float64 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, const DeviceAdapter& tag); //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, const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); private: vtkm::worklet::Streamline Worklet; vtkm::Float64 StepSize; vtkm::Id NumberOfSteps; vtkm::cont::ArrayHandle> Seeds; }; template <> class FilterTraits { public: struct TypeListTagStreamline : vtkm::ListTagBase, vtkm::Vec> { }; using InputFieldTypeList = TypeListTagStreamline; }; } } // namespace vtkm::filter #include #endif // vtk_m_filter_Streamline_h