Commit 5393745e authored by Haocheng LIU's avatar Haocheng LIU

Allow histogram filter to take custom types

By passing TypeList and StorageList into FieldRangeGlobalCompute,
upstream users(VTK) can pass custom types into the histogram filter.
parent 31260373
#Allow histogram filter to take custom types
By passing TypeList and StorageList type into FieldRangeGlobalCompute,
upstream users(VTK) can pass custom types into the histogram filter.
......@@ -232,14 +232,19 @@ template <typename DerivedPolicy>
inline VTKM_CONT void Histogram::PreExecute(const vtkm::cont::MultiBlock& input,
const vtkm::filter::PolicyBase<DerivedPolicy>&)
{
using TypeList = typename DerivedPolicy::FieldTypeList;
using StorageList = typename DerivedPolicy::FieldStorageList;
if (this->Range.IsNonEmpty())
{
this->ComputedRange = this->Range;
}
else
{
auto handle = vtkm::cont::FieldRangeGlobalCompute(
input, this->GetActiveFieldName(), this->GetActiveFieldAssociation());
auto handle = vtkm::cont::FieldRangeGlobalCompute(input,
this->GetActiveFieldName(),
this->GetActiveFieldAssociation(),
TypeList(),
StorageList());
if (handle.GetNumberOfValues() != 1)
{
throw vtkm::cont::ErrorFilterExecution("expecting scalar field.");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment