Viskores  1.0
ScatterIdentity.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 #ifndef viskores_worklet_ScatterIdentity_h
19 #define viskores_worklet_ScatterIdentity_h
20 
24 
25 namespace viskores
26 {
27 namespace worklet
28 {
29 
38 struct ScatterIdentity : internal::ScatterBase
39 {
43  {
44  return OutputToInputMapType(inputRange);
45  }
48  {
49  return this->GetOutputToInputMap(inputRange[0] * inputRange[1] * inputRange[2]);
50  }
51 
55  {
56  return VisitArrayType(0, inputRange);
57  }
60  {
61  return this->GetVisitArray(inputRange[0] * inputRange[1] * inputRange[2]);
62  }
63 
64  template <typename RangeType>
65  VISKORES_CONT RangeType GetOutputRange(RangeType inputRange) const
66  {
67  return inputRange;
68  }
69 };
70 }
71 } // namespace viskores::worklet
72 
73 #endif //viskores_worklet_ScatterIdentity_h
viskores::worklet::ScatterIdentity::GetVisitArray
VisitArrayType GetVisitArray(viskores::Id3 inputRange) const
Definition: ScatterIdentity.h:59
viskores::worklet::ScatterIdentity::GetOutputRange
RangeType GetOutputRange(RangeType inputRange) const
Definition: ScatterIdentity.h:65
ScatterBase.h
ArrayHandleConstant.h
viskores::Id
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
ArrayHandleIndex.h
viskores::worklet::ScatterIdentity::GetOutputToInputMap
OutputToInputMapType GetOutputToInputMap(viskores::Id3 inputRange) const
Definition: ScatterIdentity.h:47
viskores::worklet::ScatterIdentity::OutputToInputMapType
viskores::cont::ArrayHandleIndex OutputToInputMapType
Definition: ScatterIdentity.h:40
viskores::cont::ArrayHandleConstant
An array handle with a constant value.
Definition: ArrayHandleConstant.h:78
viskores::worklet::ScatterIdentity
A scatter that maps input directly to output.
Definition: ScatterIdentity.h:38
viskores::worklet::ScatterIdentity::VisitArrayType
viskores::cont::ArrayHandleConstant< viskores::IdComponent > VisitArrayType
Definition: ScatterIdentity.h:52
viskores::worklet::ScatterIdentity::GetOutputToInputMap
OutputToInputMapType GetOutputToInputMap(viskores::Id inputRange) const
Definition: ScatterIdentity.h:42
viskores::Vec< viskores::Id, 3 >
viskores::cont::ArrayHandleIndex
An implicit array handle containing the its own indices.
Definition: ArrayHandleIndex.h:64
viskores::worklet::ScatterIdentity::GetVisitArray
VisitArrayType GetVisitArray(viskores::Id inputRange) const
Definition: ScatterIdentity.h:54