mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
Add useful Get functions to Fields and Coordinates
Avoid having to call 'GetData()' to query 'NumberOfValues'/'NumberOfPoints'.
This commit is contained in:
parent
6b462cc99f
commit
7b072b1593
@ -60,6 +60,9 @@ public:
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> origin = vtkm::Vec<vtkm::FloatDefault, 3>(0.0f, 0.0f, 0.0f),
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> spacing = vtkm::Vec<vtkm::FloatDefault, 3>(1.0f, 1.0f, 1.0f));
|
||||
|
||||
VTKM_CONT
|
||||
vtkm::Id GetNumberOfPoints() const { return this->GetNumberOfValues(); }
|
||||
|
||||
VTKM_CONT
|
||||
vtkm::cont::ArrayHandleVirtualCoordinates GetData() const;
|
||||
|
||||
@ -80,7 +83,15 @@ public:
|
||||
}
|
||||
|
||||
VTKM_CONT
|
||||
const vtkm::cont::ArrayHandle<vtkm::Range>& GetRange() const
|
||||
vtkm::Vec<vtkm::Range, 3> GetRange() const
|
||||
{
|
||||
vtkm::Vec<vtkm::Range, 3> range;
|
||||
this->GetRange(&range[0]);
|
||||
return range;
|
||||
}
|
||||
|
||||
VTKM_CONT
|
||||
vtkm::cont::ArrayHandle<vtkm::Range> GetRangeAsArrayHandle() const
|
||||
{
|
||||
return this->Superclass::GetRange(CoordinatesTypeList());
|
||||
}
|
||||
|
@ -128,6 +128,7 @@ public:
|
||||
const vtkm::cont::VariantArrayHandle& GetData() const;
|
||||
vtkm::cont::VariantArrayHandle& GetData();
|
||||
|
||||
VTKM_CONT vtkm::Id GetNumberOfValues() const { return this->Data.GetNumberOfValues(); }
|
||||
|
||||
template <typename TypeList>
|
||||
VTKM_CONT void GetRange(vtkm::Range* range, TypeList) const
|
||||
|
Loading…
Reference in New Issue
Block a user