vtk-m/vtkm/cont/CellLocatorUniformGrid.h
Kenneth Moreland ad0a53af71 Convert execution preparation to use tokens
Marked the old versions of PrepareFor* that do not use tokens as
deprecated and moved all of the code to use the new versions that
require a token. This makes the scope of the execution object more
explicit so that it will be kept while in use and can potentially be
reclaimed afterward.
2020-02-25 09:39:19 -07:00

49 lines
1.3 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 vtkm_cont_CellLocatorUniformGrid_h
#define vtkm_cont_CellLocatorUniformGrid_h
#include <vtkm/cont/CellLocator.h>
#include <vtkm/cont/VirtualObjectHandle.h>
namespace vtkm
{
namespace cont
{
class VTKM_CONT_EXPORT CellLocatorUniformGrid : public vtkm::cont::CellLocator
{
public:
VTKM_CONT CellLocatorUniformGrid();
VTKM_CONT ~CellLocatorUniformGrid() override;
VTKM_CONT const vtkm::exec::CellLocator* PrepareForExecution(
vtkm::cont::DeviceAdapterId device,
vtkm::cont::Token& token) const override;
protected:
VTKM_CONT void Build() override;
private:
vtkm::Id3 CellDims;
vtkm::Id3 PointDims;
vtkm::Vec3f Origin;
vtkm::Vec3f InvSpacing;
vtkm::Vec3f MaxPoint;
bool Is3D = true;
mutable vtkm::cont::VirtualObjectHandle<vtkm::exec::CellLocator> ExecutionObjectHandle;
};
}
} // vtkm::cont
#endif //vtkm_cont_CellLocatorUniformGrid_h