VTK-m  2.0
ScatterIdentity.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_worklet_ScatterIdentity_h
11 #define vtk_m_worklet_ScatterIdentity_h
12 
16 
17 namespace vtkm
18 {
19 namespace worklet
20 {
21 
30 struct ScatterIdentity : internal::ScatterBase
31 {
33  VTKM_CONT
35  {
36  return OutputToInputMapType(inputRange);
37  }
38  VTKM_CONT
40  {
41  return this->GetOutputToInputMap(inputRange[0] * inputRange[1] * inputRange[2]);
42  }
43 
45  VTKM_CONT
46  VisitArrayType GetVisitArray(vtkm::Id inputRange) const { return VisitArrayType(0, inputRange); }
47  VTKM_CONT
49  {
50  return this->GetVisitArray(inputRange[0] * inputRange[1] * inputRange[2]);
51  }
52 
53  template <typename RangeType>
54  VTKM_CONT RangeType GetOutputRange(RangeType inputRange) const
55  {
56  return inputRange;
57  }
58 };
59 }
60 } // namespace vtkm::worklet
61 
62 #endif //vtk_m_worklet_ScatterIdentity_h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
ScatterBase.h
vtkm::worklet::ScatterIdentity::GetVisitArray
VTKM_CONT VisitArrayType GetVisitArray(vtkm::Id inputRange) const
Definition: ScatterIdentity.h:46
ArrayHandleConstant.h
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::worklet::ScatterIdentity::VisitArrayType
vtkm::cont::ArrayHandleConstant< vtkm::IdComponent > VisitArrayType
Definition: ScatterIdentity.h:44
vtkm::worklet::ScatterIdentity::OutputToInputMapType
vtkm::cont::ArrayHandleIndex OutputToInputMapType
Definition: ScatterIdentity.h:32
ArrayHandleIndex.h
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::cont::ArrayHandleConstant
An array handle with a constant value.
Definition: ArrayHandleConstant.h:63
vtkm::Vec< vtkm::Id, 3 >
vtkm::worklet::ScatterIdentity::GetOutputRange
VTKM_CONT RangeType GetOutputRange(RangeType inputRange) const
Definition: ScatterIdentity.h:54
vtkm::worklet::ScatterIdentity
A scatter that maps input directly to output.
Definition: ScatterIdentity.h:30
vtkm::worklet::ScatterIdentity::GetOutputToInputMap
VTKM_CONT OutputToInputMapType GetOutputToInputMap(vtkm::Id3 inputRange) const
Definition: ScatterIdentity.h:39
vtkm::worklet::ScatterIdentity::GetOutputToInputMap
VTKM_CONT OutputToInputMapType GetOutputToInputMap(vtkm::Id inputRange) const
Definition: ScatterIdentity.h:34
vtkm::worklet::ScatterIdentity::GetVisitArray
VTKM_CONT VisitArrayType GetVisitArray(vtkm::Id3 inputRange) const
Definition: ScatterIdentity.h:48
vtkm::cont::ArrayHandleIndex
An implicit array handle containing the its own indices.
Definition: ArrayHandleIndex.h:54