Skip to content

Modify VariantAH::AsVirtual to cast to new ValueType if needed.

Allison Vacanti requested to merge allisonvacanti/vtk-m:Variant_As into master

E.g:

    ArrayHandle<Float64> doubleArray;
    VariantArrayHandle varHandle{doubleArray};
    ArrayHandleVirtual<Float32> floatView = varHandle.AsVirtual<Float32>();

If there is a loss in range and/or precision, a warning is logged. If the ValueTypes are Vecs with mismatched widths, an ErrorBadType is thrown. Internally, an ArrayHandleCast is used between the VariantArrayHandle's stored array and the ArrayHandleVirtual.

Merge request reports