vtk-m/vtkm/cont/PointLocator.h
Abhishek Yenpure afd0409189 Merge topic 'code_sprint_locator_fixes'
9b56d41fe Fixing Rectilinear Grid Cell Locator
10e9d47dc Removing std::out print statement from test
34c7b57d8 Merge branch 'code_sprint_locator_fixes' of gitlab.kitware.com:ayenpure/vtk-m into code_sprint_locator_fixes
62ee1a2c8 Updates to the Cell Locators
7eb0de5b7 Merge branch 'code_sprint_locator_fixes' of gitlab.kitware.com:ayenpure/vtk-m into code_sprint_locator_fixes
866b0798d Resolving type warnings
c062f2e26 Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into code_sprint_locator_fixes
797c83891 Adding default constructor and removing wrong comment
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1395
2019-01-09 16:23:17 -05:00

76 lines
2.1 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.
//
// Copyright 2017 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2018 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtk_m_cont_PointLocator_h
#define vtk_m_cont_PointLocator_h
#include <vtkm/cont/CoordinateSystem.h>
#include <vtkm/cont/ExecutionObjectBase.h>
#include <vtkm/cont/VirtualObjectHandle.h>
#include <vtkm/exec/PointLocator.h>
namespace vtkm
{
namespace cont
{
class PointLocator : public vtkm::cont::ExecutionObjectBase
{
public:
PointLocator()
: dirty(true)
{
}
vtkm::cont::CoordinateSystem GetCoordinates() const { return Coords; }
void SetCoordinates(const vtkm::cont::CoordinateSystem& coords)
{
Coords = coords;
dirty = true;
}
virtual void Build() = 0;
void Update()
{
if (dirty)
Build();
dirty = false;
}
template <typename DeviceAdapter>
VTKM_CONT const vtkm::exec::PointLocator* PrepareForExecution(DeviceAdapter device) const
{
return PrepareForExecutionImpl(device).PrepareForExecution(device);
}
using HandleType = vtkm::cont::VirtualObjectHandle<vtkm::exec::PointLocator>;
VTKM_CONT virtual const HandleType PrepareForExecutionImpl(
vtkm::cont::DeviceAdapterId deviceId) const = 0;
private:
vtkm::cont::CoordinateSystem Coords;
bool dirty;
};
}
}
#endif // vtk_m_cont_PointLocator_h