vtk-m/vtkm/filter/FilterField.cxx
Kenneth Moreland 405643ddbb Rename NewFilter base classes to Filter
During the VTK-m 1.8 and 1.9 development, the filter infrastructure was
overhauled. Part of this created a completely new set of base classes. To
avoid confusion with the original filter base classes and ease transition,
the new filter base classes were named `NewFilter*`. Eventually after all
filters were transitioned, the old filter base classes were deprecated.

With the release of VTK-m 2.0, the old filter base classes are removed. The
"new" filter base classes are no longer new. Thus, they have been renamed
simply `Filter` (and `FilterField`).
2022-12-01 13:07:56 -07:00

47 lines
1.6 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.
//============================================================================
#include <vtkm/filter/FilterField.h>
namespace vtkm
{
namespace filter
{
vtkm::cont::DataSet FilterField::CreateResultField(const vtkm::cont::DataSet& inDataSet,
const vtkm::cont::Field& resultField) const
{
vtkm::cont::DataSet outDataSet = this->CreateResult(inDataSet);
outDataSet.AddField(resultField);
VTKM_ASSERT(!resultField.GetName().empty());
VTKM_ASSERT(outDataSet.HasField(resultField.GetName(), resultField.GetAssociation()));
return outDataSet;
}
void FilterField::ResizeIfNeeded(size_t index_st)
{
if (this->ActiveFieldNames.size() <= index_st)
{
auto oldSize = this->ActiveFieldNames.size();
this->ActiveFieldNames.resize(index_st + 1);
this->ActiveFieldAssociation.resize(index_st + 1);
this->UseCoordinateSystemAsField.resize(index_st + 1);
this->ActiveCoordinateSystemIndices.resize(index_st + 1);
for (std::size_t i = oldSize; i <= index_st; ++i)
{
this->ActiveFieldAssociation[i] = cont::Field::Association::Any;
this->UseCoordinateSystemAsField[i] = false;
this->ActiveCoordinateSystemIndices[i] = 0;
}
}
}
} // namespace filter
} // namespace vtkm