vtk-m/vtkm/filter/StreamSurface.h

71 lines
2.3 KiB
C
Raw Normal View History

2019-08-19 14:20:32 +00:00
//============================================================================
// 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_StreamSurface_h
#define vtk_m_filter_StreamSurface_h
#include <vtkm/filter/FilterDataSetWithField.h>
#include <vtkm/worklet/ParticleAdvection.h>
2019-08-19 14:20:32 +00:00
#include <vtkm/worklet/StreamSurface.h>
#include <vtkm/worklet/particleadvection/GridEvaluators.h>
#include <vtkm/worklet/particleadvection/Stepper.h>
2019-08-19 14:20:32 +00:00
namespace vtkm
{
namespace filter
{
/// \brief generate streamlines from a vector field.
2019-08-19 14:20:32 +00:00
/// Takes as input a vector field and seed locations and generates the
/// paths taken by the seeds through the vector field.
class StreamSurface : public vtkm::filter::FilterDataSetWithField<StreamSurface>
2019-08-19 14:20:32 +00:00
{
public:
using SupportedTypes = vtkm::TypeListFieldVec3;
2019-08-19 14:20:32 +00:00
VTKM_CONT
StreamSurface();
VTKM_CONT
void SetStepSize(vtkm::FloatDefault s) { this->StepSize = s; }
VTKM_CONT
void SetNumberOfSteps(vtkm::Id n) { this->NumberOfSteps = n; }
VTKM_CONT
2020-08-26 12:59:51 +00:00
void SetSeeds(vtkm::cont::ArrayHandle<vtkm::Particle>& seeds) { this->Seeds = seeds; }
template <typename T, typename StorageType, typename DerivedPolicy>
VTKM_CONT vtkm::cont::DataSet DoExecute(
const vtkm::cont::DataSet& input,
const vtkm::cont::ArrayHandle<vtkm::Vec<T, 3>, StorageType>& field,
const vtkm::filter::FieldMetadata& fieldMeta,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
2019-08-19 14:20:32 +00:00
template <typename DerivedPolicy>
VTKM_CONT bool MapFieldOntoOutput(vtkm::cont::DataSet& result,
const vtkm::cont::Field& field,
vtkm::filter::PolicyBase<DerivedPolicy> policy);
2019-08-19 14:20:32 +00:00
private:
vtkm::Id NumberOfSteps;
2020-08-26 12:59:51 +00:00
vtkm::cont::ArrayHandle<vtkm::Particle> Seeds;
vtkm::FloatDefault StepSize;
2019-08-19 14:20:32 +00:00
vtkm::worklet::StreamSurface Worklet;
};
}
} // namespace vtkm::filter
#ifndef vtk_m_filter_StreamSurface_hxx
2019-08-19 14:20:32 +00:00
#include <vtkm/filter/StreamSurface.hxx>
#endif
2019-08-19 14:20:32 +00:00
#endif // vtk_m_filter_StreamSurface_h