vtk-m/vtkm/filter/ZFPCompressor1D.hxx
Kenneth Moreland 0b84787f78 Deprecate DynamicCellSet and remove from code
The `DynamicCellSet` class is now marked as deprecated (as is the header
that contains it), and all non-deprecated code is moved to its
`UnknownCellSet` replacement.

Also added a deprecation warning for the VariantArrayHandle.h header
file and deleted a couple inappropriate uses of it.
2022-01-04 15:38:18 -07:00

61 lines
1.7 KiB
C++

//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//============================================================================
#ifndef vtk_m_filter_ZFPCompressor1D_hxx
#define vtk_m_filter_ZFPCompressor1D_hxx
#include <vtkm/cont/CellSetStructured.h>
#include <vtkm/cont/ErrorFilterExecution.h>
#include <vtkm/cont/UnknownCellSet.h>
namespace vtkm
{
namespace filter
{
namespace
{
bool IsCellSetStructured(const vtkm::cont::UnknownCellSet& cellset)
{
if (cellset.template IsType<vtkm::cont::CellSetStructured<1>>())
{
return true;
}
return false;
}
} // anonymous namespace
//-----------------------------------------------------------------------------
inline VTKM_CONT ZFPCompressor1D::ZFPCompressor1D()
: vtkm::filter::FilterField<ZFPCompressor1D>()
, rate(0)
{
}
//-----------------------------------------------------------------------------
template <typename T, typename StorageType, typename DerivedPolicy>
inline VTKM_CONT vtkm::cont::DataSet ZFPCompressor1D::DoExecute(
const vtkm::cont::DataSet&,
const vtkm::cont::ArrayHandle<T, StorageType>& field,
const vtkm::filter::FieldMetadata&,
const vtkm::filter::PolicyBase<DerivedPolicy>&)
{
auto compressed = compressor.Compress(field, rate, field.GetNumberOfValues());
vtkm::cont::DataSet dataset;
dataset.AddField(vtkm::cont::make_FieldPoint("compressed", compressed));
return dataset;
}
}
} // namespace vtkm::filter
#endif