VTK-m  2.0
worklet/ExtractStructured.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_ExtractStructured_h
11 #define vtk_m_worklet_ExtractStructured_h
12 
13 #include <vtkm/RangeId3.h>
16 #include <vtkm/cont/ArrayHandle.h>
23 #include <vtkm/cont/CellSetList.h>
26 #include <vtkm/cont/Invoker.h>
30 
31 namespace vtkm
32 {
33 namespace worklet
34 {
35 
36 namespace extractstructured
37 {
38 namespace internal
39 {
40 
41 class SubArrayPermutePoints
42 {
43 public:
44  SubArrayPermutePoints() = default;
45 
46  SubArrayPermutePoints(vtkm::Id size,
47  vtkm::Id first,
48  vtkm::Id last,
49  vtkm::Id stride,
50  bool includeBoundary)
51  : MaxIdx(size - 1)
52  , First(first)
53  , Last(last)
54  , Stride(stride)
55  , IncludeBoundary(includeBoundary)
56  {
57  }
58 
60  vtkm::Id operator()(vtkm::Id idx) const
61  {
62  return (this->IncludeBoundary && (idx == this->MaxIdx)) ? (this->Last)
63  : (this->First + (idx * this->Stride));
64  }
65 
66 private:
67  vtkm::Id MaxIdx;
68  vtkm::Id First, Last;
69  vtkm::Id Stride;
70  bool IncludeBoundary;
71 };
72 
73 struct ExtractCopy : public vtkm::worklet::WorkletMapField
74 {
75  using ControlSignature = void(FieldIn, FieldOut, WholeArrayIn);
76 
77  explicit ExtractCopy(const vtkm::Id3& dim)
78  : XDim(dim[0])
79  , XYDim(dim[0] * dim[1])
80  {
81  }
83  inline vtkm::Id ToFlat(const vtkm::Id3& index) const
84  {
85  return index[0] + index[1] * this->XDim + index[2] * this->XYDim;
86  }
87 
88  template <typename ScalarType, typename WholeFieldIn>
89  VTKM_EXEC void operator()(vtkm::Id3& index,
90  ScalarType& output,
91  const WholeFieldIn& inputField) const
92  {
93  output = inputField.Get(this->ToFlat(index));
94  }
95 
96  vtkm::Id XDim;
97  vtkm::Id XYDim;
98 };
99 }
100 } // extractstructured::internal
101 
103 {
104 public:
107 
108 private:
109  using AxisIndexArrayPoints =
111  using PointIndexArray = vtkm::cont::
112  ArrayHandleCartesianProduct<AxisIndexArrayPoints, AxisIndexArrayPoints, AxisIndexArrayPoints>;
113 
115  using CellIndexArray = vtkm::cont::
116  ArrayHandleCartesianProduct<AxisIndexArrayCells, AxisIndexArrayCells, AxisIndexArrayCells>;
117 
119  vtkm::Id first,
120  vtkm::Id last,
121  vtkm::Id stride,
122  bool includeBoundary)
123  {
124  auto fnctr = extractstructured::internal::SubArrayPermutePoints(
125  count, first, last, stride, includeBoundary);
126  return vtkm::cont::make_ArrayHandleImplicit(fnctr, count);
127  }
128 
130  vtkm::Id start,
131  vtkm::Id stride)
132  {
133  return vtkm::cont::make_ArrayHandleCounting(start, stride, count);
134  }
135 
137  const vtkm::Id3& inputPointDims,
138  const vtkm::Id3& inputOffsets,
139  vtkm::IdComponent forcedDimensionality = 0)
140  {
141  // when the point dimension for a given axis is 1 we
142  // need to lower the dimensonality by 1. So a Plane
143  // in XZ space would have a dimensonality of 2.
144  // likewise the global offsets need to also
145  // be updated when this occurs
146  vtkm::IdComponent dimensionality = forcedDimensionality;
147  vtkm::Id3 dimensions = inputPointDims;
148  vtkm::Id3 offset = inputOffsets;
149  for (int i = 0; i < 3 && (forcedDimensionality == 0); ++i)
150  {
151  if (inputPointDims[i] > 1)
152  {
153  dimensions[dimensionality] = inputPointDims[i];
154  offset[dimensionality] = inputOffsets[i];
155  ++dimensionality;
156  }
157  }
158 
159  switch (dimensionality)
160  {
161  case 1:
162  {
164  outCs.SetPointDimensions(dimensions[0]);
165  outCs.SetGlobalPointIndexStart(offset[0]);
166  return outCs;
167  }
168  case 2:
169  {
171  outCs.SetPointDimensions(vtkm::Id2(dimensions[0], dimensions[1]));
172  outCs.SetGlobalPointIndexStart(vtkm::Id2(offset[0], offset[1]));
173  return outCs;
174  }
175  case 3:
176  {
178  outCs.SetPointDimensions(dimensions);
179  outCs.SetGlobalPointIndexStart(offset);
180  return outCs;
181  }
182  default:
183  return {};
184  }
185  }
186 
187 public:
189  const vtkm::RangeId3& voi,
190  const vtkm::Id3& sampleRate,
191  bool includeBoundary,
192  bool includeOffset)
193  {
194  vtkm::Id pdims = cellset.GetPointDimensions();
195  vtkm::Id offsets = cellset.GetGlobalPointIndexStart();
196  return this->Compute(1,
197  vtkm::Id3{ pdims, 1, 1 },
198  vtkm::Id3{ offsets, 0, 0 },
199  voi,
200  sampleRate,
201  includeBoundary,
202  includeOffset);
203  }
204 
206  const vtkm::RangeId3& voi,
207  const vtkm::Id3& sampleRate,
208  bool includeBoundary,
209  bool includeOffset)
210  {
211  vtkm::Id2 pdims = cellset.GetPointDimensions();
212  vtkm::Id2 offsets = cellset.GetGlobalPointIndexStart();
213  return this->Compute(2,
214  vtkm::Id3{ pdims[0], pdims[1], 1 },
215  vtkm::Id3{ offsets[0], offsets[1], 0 },
216  voi,
217  sampleRate,
218  includeBoundary,
219  includeOffset);
220  }
221 
223  const vtkm::RangeId3& voi,
224  const vtkm::Id3& sampleRate,
225  bool includeBoundary,
226  bool includeOffset)
227  {
228  vtkm::Id3 pdims = cellset.GetPointDimensions();
229  vtkm::Id3 offsets = cellset.GetGlobalPointIndexStart();
230  return this->Compute(3, pdims, offsets, voi, sampleRate, includeBoundary, includeOffset);
231  }
232 
233  UncertainCellSetStructured Compute(const int dimensionality,
234  const vtkm::Id3& ptdim,
235  const vtkm::Id3& offsets,
236  const vtkm::RangeId3& voi,
237  const vtkm::Id3& sampleRate,
238  bool includeBoundary,
239  bool includeOffset)
240  {
241  // Verify input parameters
242  vtkm::Id3 offset_vec(0, 0, 0);
243  vtkm::Id3 globalOffset(0, 0, 0);
244 
245  this->InputDimensions = ptdim;
246  this->InputDimensionality = dimensionality;
247  this->SampleRate = sampleRate;
248 
249  if (sampleRate[0] < 1 || sampleRate[1] < 1 || sampleRate[2] < 1)
250  {
251  throw vtkm::cont::ErrorBadValue("Bad sampling rate");
252  }
253  if (includeOffset)
254  {
255  vtkm::Id3 tmpDims = ptdim;
256  offset_vec = offsets;
257  for (int i = 0; i < dimensionality; ++i)
258  {
259  if (dimensionality > i)
260  {
261  if (offset_vec[i] >= voi[i].Min)
262  {
263  globalOffset[i] = offset_vec[i];
264  this->VOI[i].Min = offset_vec[i];
265  if (globalOffset[i] + ptdim[i] < voi[i].Max)
266  {
267  // Start from our GPIS (start point) up to the length of the
268  // dimensions (if that is within VOI)
269  this->VOI[i].Max = globalOffset[i] + ptdim[i];
270  }
271  else
272  {
273  // If it isn't within the voi we set our dimensions from the
274  // GPIS up to the VOI.
275  tmpDims[i] = voi[i].Max - globalOffset[i];
276  }
277  }
278  else if (offset_vec[i] < voi[i].Min)
279  {
280  if (offset_vec[i] + ptdim[i] < voi[i].Min)
281  {
282  // If we're out of bounds we set the dimensions to 0. This
283  // causes a return of UncertainCellSetStructured
284  tmpDims[i] = 0;
285  }
286  else
287  {
288  // If our GPIS is less than VOI min, but our dimensions
289  // include the VOI we go from the minimal value that we
290  // can up to how far has been specified.
291  globalOffset[i] = voi[i].Min;
292  this->VOI[i].Min = voi[i].Min;
293  if (globalOffset[i] + ptdim[i] < voi[i].Max)
294  {
295  this->VOI[i].Max = globalOffset[i] + ptdim[i];
296  }
297  else
298  {
299  tmpDims[i] = voi[i].Max - globalOffset[i];
300  }
301  }
302  }
303  }
304  }
305  this->OutputDimensions = vtkm::Id3(tmpDims[0], tmpDims[1], tmpDims[2]);
306  }
307 
308  this->VOI.X.Min = vtkm::Max(vtkm::Id(0), voi.X.Min);
309  this->VOI.X.Max = vtkm::Min(this->InputDimensions[0] + globalOffset[0], voi.X.Max);
310  this->VOI.Y.Min = vtkm::Max(vtkm::Id(0), voi.Y.Min);
311  this->VOI.Y.Max = vtkm::Min(this->InputDimensions[1] + globalOffset[1], voi.Y.Max);
312  this->VOI.Z.Min = vtkm::Max(vtkm::Id(0), voi.Z.Min);
313  this->VOI.Z.Max = vtkm::Min(this->InputDimensions[2] + globalOffset[2], voi.Z.Max);
314 
315  if (!this->VOI.IsNonEmpty())
316  {
317  vtkm::Id3 empty = { 0, 0, 0 };
318  return MakeCellSetStructured(empty, empty, dimensionality);
319  }
320  if (!includeOffset)
321  {
322  // compute output dimensions
323  this->OutputDimensions = vtkm::Id3(1, 1, 1);
324  vtkm::Id3 voiDims = this->VOI.Dimensions();
325  for (int i = 0; i < dimensionality; ++i)
326  {
327  this->OutputDimensions[i] = ((voiDims[i] + this->SampleRate[i] - 1) / this->SampleRate[i]) +
328  ((includeBoundary && ((voiDims[i] - 1) % this->SampleRate[i])) ? 1 : 0);
329  }
332  this->VOI.X.Min,
333  this->VOI.X.Max - 1,
334  this->SampleRate[0],
335  includeBoundary),
337  this->VOI.Y.Min,
338  this->VOI.Y.Max - 1,
339  this->SampleRate[1],
340  includeBoundary),
342  this->VOI.Z.Min,
343  this->VOI.Z.Max - 1,
344  this->SampleRate[2],
345  includeBoundary));
346 
348  MakeAxisIndexArrayCells(vtkm::Max(vtkm::Id(1), this->OutputDimensions[0] - 1),
349  this->VOI.X.Min,
350  this->SampleRate[0]),
351  MakeAxisIndexArrayCells(vtkm::Max(vtkm::Id(1), this->OutputDimensions[1] - 1),
352  this->VOI.Y.Min,
353  this->SampleRate[1]),
354  MakeAxisIndexArrayCells(vtkm::Max(vtkm::Id(1), this->OutputDimensions[2] - 1),
355  this->VOI.Z.Min,
356  this->SampleRate[2]));
357  }
358 
359  return MakeCellSetStructured(this->OutputDimensions, globalOffset);
360  }
361 
362 
363 private:
364  class CallRun
365  {
366  public:
368  const vtkm::RangeId3& voi,
369  const vtkm::Id3& sampleRate,
370  bool includeBoundary,
371  bool includeOffset,
373  : Worklet(worklet)
374  , VOI(&voi)
375  , SampleRate(&sampleRate)
376  , IncludeBoundary(includeBoundary)
377  , IncludeOffset(includeOffset)
378  , Output(&output)
379  {
380  }
381 
382  template <int N>
383  void operator()(const vtkm::cont::CellSetStructured<N>& cellset) const
384  {
385  *this->Output = this->Worklet->Run(
386  cellset, *this->VOI, *this->SampleRate, this->IncludeBoundary, this->IncludeOffset);
387  }
388 
389  template <typename CellSetType>
390  void operator()(const CellSetType&) const
391  {
392  throw vtkm::cont::ErrorBadType("ExtractStructured only works with structured datasets");
393  }
394 
395  private:
402  };
403 
404 public:
405  template <typename CellSetList>
407  const vtkm::RangeId3& voi,
408  const vtkm::Id3& sampleRate,
409  bool includeBoundary,
410  bool includeOffset)
411  {
413  CallRun cr(this, voi, sampleRate, includeBoundary, includeOffset, output);
414  vtkm::cont::CastAndCall(cellset, cr);
415  return output;
416  }
417 
419 
424 
425 
427  const UniformCoordinatesArrayHandle& coords) const
428  {
430  using CoordType = CoordsArray::ValueType;
431  using ValueType = CoordType::ComponentType;
432 
433  const auto& portal = coords.ReadPortal();
434  CoordType inOrigin = portal.GetOrigin();
435  CoordType inSpacing = portal.GetSpacing();
436 
437  CoordType outOrigin =
438  vtkm::make_Vec(inOrigin[0] + static_cast<ValueType>(this->VOI.X.Min) * inSpacing[0],
439  inOrigin[1] + static_cast<ValueType>(this->VOI.Y.Min) * inSpacing[1],
440  inOrigin[2] + static_cast<ValueType>(this->VOI.Z.Min) * inSpacing[2]);
441  CoordType outSpacing = inSpacing * static_cast<CoordType>(this->SampleRate);
442 
443  return { this->OutputDimensions, outOrigin, outSpacing };
444  }
445 
447  const RectilinearCoordinatesArrayHandle& coords) const
448  {
449  // For structured datasets, the cellsets are of different types based on
450  // its dimensionality, but the coordinates are always 3 dimensional.
451  // We can map the axis of the cellset to the coordinates by looking at the
452  // length of a coordinate axis array.
453  AxisIndexArrayPoints validIds[3] = { this->ValidPoints.GetFirstArray(),
454  this->ValidPoints.GetSecondArray(),
455  this->ValidPoints.GetThirdArray() };
456 
457  vtkm::cont::ArrayHandle<vtkm::FloatDefault> arrays[3] = { coords.GetFirstArray(),
458  coords.GetSecondArray(),
459  coords.GetThirdArray() };
460 
462  int dim = 0;
463  for (int i = 0; i < 3; ++i)
464  {
465  if (arrays[i].GetNumberOfValues() == 1)
466  {
467  xyzs[i].Allocate(1);
468  xyzs[i].WritePortal().Set(0, vtkm::cont::ArrayGetValue(0, arrays[i]));
469  }
470  else
471  {
473  xyzs[i]);
474  ++dim;
475  }
476  }
477  VTKM_ASSERT(dim == this->InputDimensionality);
478 
479  return vtkm::cont::make_ArrayHandleCartesianProduct(xyzs[0], xyzs[1], xyzs[2]);
480  }
481 
482 public:
483  template <typename T, typename Storage>
485  const vtkm::cont::ArrayHandle<T, Storage>& field) const
486  {
487  using namespace extractstructured::internal;
489  result.Allocate(this->ValidPoints.GetNumberOfValues());
490 
491  ExtractCopy worklet(this->InputDimensions);
492  vtkm::cont::Invoker invoke;
493  invoke(worklet, this->ValidPoints, result, field);
494 
495  return result;
496  }
497 
498  template <typename T, typename Storage>
500  const vtkm::cont::ArrayHandle<T, Storage>& field) const
501  {
502  using namespace extractstructured::internal;
504  result.Allocate(this->ValidCells.GetNumberOfValues());
505 
506  auto inputCellDimensions = this->InputDimensions - vtkm::Id3(1);
507  ExtractCopy worklet(inputCellDimensions);
508  vtkm::cont::Invoker invoke;
509  invoke(worklet, this->ValidCells, result, field);
510 
511  return result;
512  }
513 
514 private:
516  vtkm::Id3 SampleRate = { 1, 1, 1 };
517 
521 
524 };
525 }
526 } // namespace vtkm::worklet
527 
528 #endif // vtk_m_worklet_ExtractStructured_h
vtkm::cont::ArrayCopyDevice
VTKM_CONT void ArrayCopyDevice(const vtkm::cont::ArrayHandle< InValueType, InStorage > &source, vtkm::cont::ArrayHandle< OutValueType, OutStorage > &destination)
Does a deep copy from one array to another array.
Definition: ArrayCopyDevice.h:75
vtkm::worklet::ExtractStructured::ProcessCellField
vtkm::cont::ArrayHandle< T > ProcessCellField(const vtkm::cont::ArrayHandle< T, Storage > &field) const
Definition: worklet/ExtractStructured.h:499
vtkm::worklet::ExtractStructured::CallRun::Worklet
ExtractStructured * Worklet
Definition: worklet/ExtractStructured.h:396
vtkm::cont::ArrayHandle::GetNumberOfValues
VTKM_CONT vtkm::Id GetNumberOfValues() const
Returns the number of entries in the array.
Definition: ArrayHandle.h:448
vtkm::cont::ArrayHandle< vtkm::FloatDefault >
ArrayHandle.h
vtkm::RangeId3::X
vtkm::RangeId X
Definition: RangeId3.h:29
vtkm::worklet::ExtractStructured::MakeCellSetStructured
static UncertainCellSetStructured MakeCellSetStructured(const vtkm::Id3 &inputPointDims, const vtkm::Id3 &inputOffsets, vtkm::IdComponent forcedDimensionality=0)
Definition: worklet/ExtractStructured.h:136
VTKM_EXEC
#define VTKM_EXEC
Definition: ExportMacros.h:51
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::worklet::ExtractStructured::Run
UncertainCellSetStructured Run(const vtkm::cont::UncertainCellSet< CellSetList > &cellset, const vtkm::RangeId3 &voi, const vtkm::Id3 &sampleRate, bool includeBoundary, bool includeOffset)
Definition: worklet/ExtractStructured.h:406
vtkm::worklet::ExtractStructured::OutputDimensions
vtkm::Id3 OutputDimensions
Definition: worklet/ExtractStructured.h:520
WorkletMapField.h
VTKM_ASSERT
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
vtkm::cont::ArrayHandleCartesianProduct::GetThirdArray
VTKM_CONT ThirdHandleType GetThirdArray() const
Definition: ArrayHandleCartesianProduct.h:372
VTKM_EXEC_CONT
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
vtkm::cont::ArrayHandle::Allocate
VTKM_CONT void Allocate(vtkm::Id numberOfValues, vtkm::CopyFlag preserve, vtkm::cont::Token &token) const
Allocates an array large enough to hold the given number of values.
Definition: ArrayHandle.h:465
vtkm::worklet::ExtractStructured::Run
UncertainCellSetStructured Run(const vtkm::cont::CellSetStructured< 2 > &cellset, const vtkm::RangeId3 &voi, const vtkm::Id3 &sampleRate, bool includeBoundary, bool includeOffset)
Definition: worklet/ExtractStructured.h:205
vtkm::RangeId3::Y
vtkm::RangeId Y
Definition: RangeId3.h:30
vtkm::cont::make_ArrayHandleCounting
VTKM_CONT vtkm::cont::ArrayHandleCounting< CountingValueType > make_ArrayHandleCounting(CountingValueType start, CountingValueType step, vtkm::Id length)
A convenience function for creating an ArrayHandleCounting.
Definition: ArrayHandleCounting.h:151
vtkm::IdComponent
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
vtkm::cont::CellSetStructured
Definition: CastAndCall.h:32
vtkm::worklet::ExtractStructured::ValidPoints
PointIndexArray ValidPoints
Definition: worklet/ExtractStructured.h:522
ArrayHandleTransform.h
vtkm::cont::ArrayHandleCartesianProduct< AxisIndexArrayPoints, AxisIndexArrayPoints, AxisIndexArrayPoints >
vtkm::cont::UncertainCellSet
A CellSet of an uncertain type.
Definition: UncertainCellSet.h:38
vtkm::worklet::ExtractStructured::MakeAxisIndexArrayCells
static AxisIndexArrayCells MakeAxisIndexArrayCells(vtkm::Id count, vtkm::Id start, vtkm::Id stride)
Definition: worklet/ExtractStructured.h:129
CellSetList.h
vtkm::cont::make_ArrayHandleImplicit
VTKM_CONT vtkm::cont::ArrayHandleImplicit< FunctorType > make_ArrayHandleImplicit(FunctorType functor, vtkm::Id length)
make_ArrayHandleImplicit is convenience function to generate an ArrayHandleImplicit.
Definition: ArrayHandleImplicit.h:198
vtkm::RangeId::Max
vtkm::Id Max
Definition: RangeId.h:31
vtkm::cont::ArrayGetValue
VTKM_CONT T ArrayGetValue(vtkm::Id id, const vtkm::cont::ArrayHandle< T, S > &data)
Obtain a small set of values from an ArrayHandle with minimal device transfers.
Definition: ArrayGetValues.h:264
Invoker.h
vtkm::worklet::ExtractStructured::Compute
UncertainCellSetStructured Compute(const int dimensionality, const vtkm::Id3 &ptdim, const vtkm::Id3 &offsets, const vtkm::RangeId3 &voi, const vtkm::Id3 &sampleRate, bool includeBoundary, bool includeOffset)
Definition: worklet/ExtractStructured.h:233
vtkm::cont::ErrorBadType
This class is thrown when VTK-m encounters data of a type that is incompatible with the current opera...
Definition: ErrorBadType.h:25
UncertainCellSet.h
vtkm::cont::CastAndCall
void CastAndCall(const DynamicObject &dynamicObject, Functor &&f, Args &&... args)
A Generic interface to CastAndCall.
Definition: CastAndCall.h:47
CoordinateSystem.h
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::worklet::ExtractStructured::CallRun::VOI
const vtkm::RangeId3 * VOI
Definition: worklet/ExtractStructured.h:397
vtkm::worklet::ExtractStructured::CallRun::CallRun
CallRun(ExtractStructured *worklet, const vtkm::RangeId3 &voi, const vtkm::Id3 &sampleRate, bool includeBoundary, bool includeOffset, UncertainCellSetStructured &output)
Definition: worklet/ExtractStructured.h:367
ArrayHandleUniformPointCoordinates.h
UnknownArrayHandle.h
vtkm::RangeId3::Z
vtkm::RangeId Z
Definition: RangeId3.h:31
ArrayCopyDevice.h
ArrayHandlePermutation.h
vtkm::cont::ArrayHandleCounting< vtkm::Id >
vtkm::worklet::ExtractStructured::Run
UncertainCellSetStructured Run(const vtkm::cont::CellSetStructured< 1 > &cellset, const vtkm::RangeId3 &voi, const vtkm::Id3 &sampleRate, bool includeBoundary, bool includeOffset)
Definition: worklet/ExtractStructured.h:188
vtkm::RangeId::Min
vtkm::Id Min
Definition: RangeId.h:30
vtkm::cont::Invoker
Allows launching any worklet without a dispatcher.
Definition: Invoker.h:41
vtkm::worklet::ExtractStructured::InputDimensionality
int InputDimensionality
Definition: worklet/ExtractStructured.h:518
vtkm::worklet::ExtractStructured::SampleRate
vtkm::Id3 SampleRate
Definition: worklet/ExtractStructured.h:516
vtkm::worklet::ExtractStructured::CallRun::SampleRate
const vtkm::Id3 * SampleRate
Definition: worklet/ExtractStructured.h:398
vtkm::worklet::ExtractStructured::VOI
vtkm::RangeId3 VOI
Definition: worklet/ExtractStructured.h:515
vtkm::cont::ArrayHandleCartesianProduct::GetSecondArray
VTKM_CONT SecondHandleType GetSecondArray() const
Definition: ArrayHandleCartesianProduct.h:368
vtkm::worklet::ExtractStructured::MakeAxisIndexArrayPoints
static AxisIndexArrayPoints MakeAxisIndexArrayPoints(vtkm::Id count, vtkm::Id first, vtkm::Id last, vtkm::Id stride, bool includeBoundary)
Definition: worklet/ExtractStructured.h:118
vtkm::worklet::ExtractStructured::ValidCells
CellIndexArray ValidCells
Definition: worklet/ExtractStructured.h:523
ArrayHandleCartesianProduct.h
vtkm::cont::ArrayHandle::WritePortal
VTKM_CONT WritePortalType WritePortal() const
Get an array portal that can be used in the control environment.
Definition: ArrayHandle.h:435
vtkm::worklet::ExtractStructured::CallRun::operator()
void operator()(const CellSetType &) const
Definition: worklet/ExtractStructured.h:390
vtkm::worklet::ExtractStructured
Definition: worklet/ExtractStructured.h:102
vtkm::make_Vec
constexpr VTKM_EXEC_CONT vtkm::Vec< T, vtkm::IdComponent(sizeof...(Ts)+1)> make_Vec(T value0, Ts &&... args)
Initializes and returns a Vec containing all the arguments.
Definition: Types.h:1212
ArrayGetValues.h
vtkm::RangeId3::IsNonEmpty
VTKM_EXEC_CONT bool IsNonEmpty() const
Determine if the range is non-empty.
Definition: RangeId3.h:77
vtkm::Id3
vtkm::Vec< vtkm::Id, 3 > Id3
Id3 corresponds to a 3-dimensional index for 3d arrays.
Definition: Types.h:1003
vtkm::worklet::ExtractStructured::Run
UncertainCellSetStructured Run(const vtkm::cont::CellSetStructured< 3 > &cellset, const vtkm::RangeId3 &voi, const vtkm::Id3 &sampleRate, bool includeBoundary, bool includeOffset)
Definition: worklet/ExtractStructured.h:222
vtkm::cont::ArrayHandleCartesianProduct::GetFirstArray
VTKM_CONT FirstHandleType GetFirstArray() const
Definition: ArrayHandleCartesianProduct.h:364
vtkm::cont::make_ArrayHandlePermutation
VTKM_CONT vtkm::cont::ArrayHandlePermutation< IndexArrayHandleType, ValueArrayHandleType > make_ArrayHandlePermutation(IndexArrayHandleType indexArray, ValueArrayHandleType valueArray)
make_ArrayHandleTransform is convenience function to generate an ArrayHandleTransform.
Definition: ArrayHandlePermutation.h:279
vtkm::worklet::ExtractStructured::CallRun::IncludeOffset
bool IncludeOffset
Definition: worklet/ExtractStructured.h:400
vtkm::cont::CellSetStructured::GetPointDimensions
SchedulingRangeType GetPointDimensions() const
Definition: CellSetStructured.h:64
vtkm::Vec< vtkm::Id, 3 >
vtkm::cont::CellSetStructured::SetPointDimensions
void SetPointDimensions(SchedulingRangeType dimensions)
Definition: CellSetStructured.h:49
vtkm::worklet::ExtractStructured::MapCoordinatesRectilinear
RectilinearCoordinatesArrayHandle MapCoordinatesRectilinear(const RectilinearCoordinatesArrayHandle &coords) const
Definition: worklet/ExtractStructured.h:446
vtkm::worklet::ExtractStructured::InputDimensions
vtkm::Id3 InputDimensions
Definition: worklet/ExtractStructured.h:519
vtkm::cont::ErrorBadValue
This class is thrown when a VTKm function or method encounters an invalid value that inhibits progres...
Definition: ErrorBadValue.h:25
vtkm::cont::ArrayHandleUniformPointCoordinates
ArrayHandleUniformPointCoordinates is a specialization of ArrayHandle.
Definition: ArrayHandleUniformPointCoordinates.h:45
vtkm::worklet::ExtractStructured::MapCoordinatesUniform
UniformCoordinatesArrayHandle MapCoordinatesUniform(const UniformCoordinatesArrayHandle &coords) const
Definition: worklet/ExtractStructured.h:426
vtkm::cont::ArrayHandle::ReadPortal
VTKM_CONT ReadPortalType ReadPortal() const
Get an array portal that can be used in the control environment.
Definition: ArrayHandle.h:414
vtkm::worklet::ExtractStructured::CallRun::operator()
void operator()(const vtkm::cont::CellSetStructured< N > &cellset) const
Definition: worklet/ExtractStructured.h:383
vtkm::worklet::ExtractStructured::CallRun
Definition: worklet/ExtractStructured.h:364
ArrayHandleCounting.h
vtkm::worklet::ExtractStructured::CallRun::IncludeBoundary
bool IncludeBoundary
Definition: worklet/ExtractStructured.h:399
CellSetStructured.h
vtkm::RangeId3
Represent 3D integer range.
Definition: RangeId3.h:27
vtkm::worklet::ExtractStructured::ProcessPointField
vtkm::cont::ArrayHandle< T > ProcessPointField(const vtkm::cont::ArrayHandle< T, Storage > &field) const
Definition: worklet/ExtractStructured.h:484
ArrayHandleImplicit.h
RangeId3.h
vtkm::cont::CellSetStructured::SetGlobalPointIndexStart
void SetGlobalPointIndexStart(SchedulingRangeType start)
Definition: CellSetStructured.h:59
vtkm::cont::CellSetStructured::GetGlobalPointIndexStart
SchedulingRangeType GetGlobalPointIndexStart() const
Definition: CellSetStructured.h:78
vtkm::worklet::ExtractStructured::CallRun::Output
UncertainCellSetStructured * Output
Definition: worklet/ExtractStructured.h:401
vtkm::cont::make_ArrayHandleCartesianProduct
VTKM_CONT vtkm::cont::ArrayHandleCartesianProduct< FirstHandleType, SecondHandleType, ThirdHandleType > make_ArrayHandleCartesianProduct(const FirstHandleType &first, const SecondHandleType &second, const ThirdHandleType &third)
A convenience function for creating an ArrayHandleCartesianProduct.
Definition: ArrayHandleCartesianProduct.h:384
vtkm::cont::ArrayHandleImplicit
An ArrayHandle that computes values on the fly.
Definition: ArrayHandleImplicit.h:174
vtkm::worklet::WorkletMapField
Base class for worklets that do a simple mapping of field arrays.
Definition: WorkletMapField.h:38
vtkm::RangeId3::Dimensions
VTKM_EXEC_CONT vtkm::Id3 Dimensions() const
Definition: RangeId3.h:101