10 #ifndef vtk_m_internal_ArrayPortalUniformPointCoordinates_h
11 #define vtk_m_internal_ArrayPortalUniformPointCoordinates_h
29 ArrayPortalUniformPointCoordinates()
38 ArrayPortalUniformPointCoordinates(
vtkm::Id3 dimensions, ValueType origin, ValueType spacing)
39 : Dimensions(dimensions)
40 , NumberOfValues(dimensions[0] * dimensions[1] * dimensions[2])
47 vtkm::Id GetNumberOfValues()
const {
return this->NumberOfValues; }
55 (index / this->Dimensions[0]) % this->Dimensions[1],
56 index / (this->Dimensions[0] * this->Dimensions[1])));
60 vtkm::Id3 GetRange3()
const {
return this->Dimensions; }
65 VTKM_ASSERT((index[0] >= 0) && (index[1] >= 0) && (index[2] >= 0));
66 VTKM_ASSERT((index[0] < this->Dimensions[0]) && (index[1] < this->Dimensions[1]) &&
67 (index[2] < this->Dimensions[2]));
68 return ValueType(this->Origin[0] + this->Spacing[0] *
static_cast<vtkm::FloatDefault>(index[0]),
75 const vtkm::Id3& GetDimensions()
const {
return this->Dimensions; }
78 const ValueType& GetOrigin()
const {
return this->Origin; }
81 const ValueType& GetSpacing()
const {
return this->Spacing; }
86 ValueType Origin = { 0.0f, 0.0f, 0.0f };
87 ValueType Spacing = { 0.0f, 0.0f, 0.0f };
92 #endif //vtk_m_internal_ArrayPortalUniformPointCoordinates_h