FilterDataSet.h 2.84 KB
Newer Older
1 2 3 4 5 6 7 8
//============================================================================
//  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.
//
9
//  Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
10 11 12
//  Copyright 2014 UT-Battelle, LLC.
//  Copyright 2014 Los Alamos National Security.
//
13
//  Under the terms of Contract DE-NA0003525 with NTESS,
14 15 16 17 18 19 20 21 22 23
//  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

24
#include <vtkm/cont/CoordinateSystem.h>
25 26 27
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/DynamicCellSet.h>
#include <vtkm/cont/Field.h>
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
28
#include <vtkm/cont/MultiBlock.h>
29
#include <vtkm/cont/RuntimeDeviceTracker.h>
30

Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
31
#include <vtkm/filter/Filter.h>
32 33
#include <vtkm/filter/PolicyBase.h>

34 35 36 37
namespace vtkm
{
namespace filter
{
38

39
template <class Derived>
40
class FilterDataSet : public vtkm::filter::Filter<Derived>
41 42
{
public:
43
  VTKM_CONT
44
  FilterDataSet();
45

46 47 48
  VTKM_CONT
  ~FilterDataSet();

49
  VTKM_CONT
50
  void SetActiveCellSetIndex(vtkm::Id index) { this->CellSetIndex = index; }
51

52
  VTKM_CONT
53
  vtkm::Id GetActiveCellSetIndex() const { return this->CellSetIndex; }
54

55
  VTKM_CONT
56
  void SetActiveCoordinateSystem(vtkm::Id index) { this->CoordinateSystemIndex = index; }
57

58
  VTKM_CONT
59
  vtkm::Id GetActiveCoordinateSystemIndex() const { return this->CoordinateSystemIndex; }
60

61 62
  /// These are provided to satisfy the Filter API requirements.

63
  //From the field we can extract the association component
64 65 66 67 68
  // 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?
69
  template <typename DerivedPolicy>
70
  VTKM_CONT bool MapFieldOntoOutput(vtkm::cont::DataSet& result,
71
                                    const vtkm::cont::Field& field,
72
                                    const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
73

74
  template <typename DerivedPolicy>
75 76 77
  VTKM_CONT vtkm::cont::DataSet PrepareForExecution(
    const vtkm::cont::DataSet& input,
    const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
78

79
private:
80 81
  vtkm::Id CellSetIndex;
  vtkm::Id CoordinateSystemIndex;
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
82

83
  friend class vtkm::filter::Filter<Derived>;
84 85 86 87
};
}
} // namespace vtkm::filter

88
#include <vtkm/filter/FilterDataSet.hxx>
89

90
#endif // vtk_m_filter_DataSetFilter_h