2016-01-19 14:59:31 +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.
|
|
|
|
//
|
2017-09-20 21:33:44 +00:00
|
|
|
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
|
2016-01-19 14:59:31 +00:00
|
|
|
// Copyright 2014 UT-Battelle, LLC.
|
|
|
|
// Copyright 2014 Los Alamos National Security.
|
|
|
|
//
|
2017-09-20 21:33:44 +00:00
|
|
|
// Under the terms of Contract DE-NA0003525 with NTESS,
|
2016-01-19 14:59:31 +00:00
|
|
|
// 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_DataSetFilter_h
|
|
|
|
#define vtk_m_filter_DataSetFilter_h
|
|
|
|
|
2017-05-18 14:51:24 +00:00
|
|
|
#include <vtkm/cont/CoordinateSystem.h>
|
2016-01-19 14:59:31 +00:00
|
|
|
#include <vtkm/cont/DataSet.h>
|
|
|
|
#include <vtkm/cont/DynamicCellSet.h>
|
|
|
|
#include <vtkm/cont/Field.h>
|
2018-03-02 20:49:07 +00:00
|
|
|
#include <vtkm/cont/MultiBlock.h>
|
2017-02-22 20:33:52 +00:00
|
|
|
#include <vtkm/cont/RuntimeDeviceTracker.h>
|
2016-01-19 14:59:31 +00:00
|
|
|
|
2018-03-02 20:49:07 +00:00
|
|
|
#include <vtkm/filter/Filter.h>
|
2016-01-19 14:59:31 +00:00
|
|
|
#include <vtkm/filter/PolicyBase.h>
|
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace filter
|
|
|
|
{
|
2016-01-19 14:59:31 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
template <class Derived>
|
2018-03-31 22:33:32 +00:00
|
|
|
class FilterDataSet : public vtkm::filter::Filter<Derived>
|
2016-01-19 14:59:31 +00:00
|
|
|
{
|
|
|
|
public:
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_CONT
|
2016-05-05 18:42:46 +00:00
|
|
|
FilterDataSet();
|
2016-01-19 14:59:31 +00:00
|
|
|
|
2017-02-23 16:54:41 +00:00
|
|
|
VTKM_CONT
|
|
|
|
~FilterDataSet();
|
|
|
|
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_CONT
|
2017-09-12 16:49:57 +00:00
|
|
|
void SetActiveCellSetIndex(vtkm::Id index) { this->CellSetIndex = index; }
|
2016-01-19 14:59:31 +00:00
|
|
|
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_CONT
|
2017-05-18 14:29:41 +00:00
|
|
|
vtkm::Id GetActiveCellSetIndex() const { return this->CellSetIndex; }
|
2016-01-19 14:59:31 +00:00
|
|
|
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_CONT
|
2017-05-18 14:29:41 +00:00
|
|
|
void SetActiveCoordinateSystem(vtkm::Id index) { this->CoordinateSystemIndex = index; }
|
2016-01-19 14:59:31 +00:00
|
|
|
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_CONT
|
2017-05-18 14:29:41 +00:00
|
|
|
vtkm::Id GetActiveCoordinateSystemIndex() const { return this->CoordinateSystemIndex; }
|
2016-01-19 14:59:31 +00:00
|
|
|
|
2018-03-31 22:50:12 +00:00
|
|
|
/// These are provided to satisfy the Filter API requirements.
|
|
|
|
|
2016-01-19 14:59:31 +00:00
|
|
|
//From the field we can extract the association component
|
2018-05-18 20:10:15 +00:00
|
|
|
// Association::ANY -> unable to map
|
|
|
|
// Association::WHOLE_MESH -> (I think this is points)
|
|
|
|
// Association::POINTS -> map using point mapping
|
|
|
|
// Association::CELL_SET -> how do we map this?
|
|
|
|
// Association::LOGICAL_DIM -> unable to map?
|
2017-05-18 14:29:41 +00:00
|
|
|
template <typename DerivedPolicy>
|
2018-04-02 21:58:21 +00:00
|
|
|
VTKM_CONT bool MapFieldOntoOutput(vtkm::cont::DataSet& result,
|
2017-05-26 17:53:28 +00:00
|
|
|
const vtkm::cont::Field& field,
|
2017-05-18 14:29:41 +00:00
|
|
|
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
2016-01-19 14:59:31 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
template <typename DerivedPolicy>
|
2018-04-02 21:58:21 +00:00
|
|
|
VTKM_CONT vtkm::cont::DataSet PrepareForExecution(
|
|
|
|
const vtkm::cont::DataSet& input,
|
|
|
|
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
2016-01-19 14:59:31 +00:00
|
|
|
|
2018-04-09 19:07:32 +00:00
|
|
|
private:
|
2016-01-19 14:59:31 +00:00
|
|
|
vtkm::Id CellSetIndex;
|
|
|
|
vtkm::Id CoordinateSystemIndex;
|
2018-03-02 20:49:07 +00:00
|
|
|
|
2018-03-31 22:33:32 +00:00
|
|
|
friend class vtkm::filter::Filter<Derived>;
|
2016-01-19 14:59:31 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
} // namespace vtkm::filter
|
|
|
|
|
2016-05-05 18:42:46 +00:00
|
|
|
#include <vtkm/filter/FilterDataSet.hxx>
|
2016-01-19 14:59:31 +00:00
|
|
|
|
2016-04-07 21:09:11 +00:00
|
|
|
#endif // vtk_m_filter_DataSetFilter_h
|