2018-06-22 20:21:07 +00:00
|
|
|
//============================================================================
|
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
2019-04-15 23:24:21 +00:00
|
|
|
//
|
2018-06-22 20:21:07 +00:00
|
|
|
// 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_cont_PointLocator_h
|
|
|
|
#define vtk_m_cont_PointLocator_h
|
|
|
|
|
2020-11-11 22:02:10 +00:00
|
|
|
#include <vtkm/Deprecated.h>
|
|
|
|
#include <vtkm/cont/vtkm_cont_export.h>
|
|
|
|
|
2018-06-22 20:21:07 +00:00
|
|
|
#include <vtkm/cont/CoordinateSystem.h>
|
|
|
|
#include <vtkm/cont/ExecutionObjectBase.h>
|
2018-11-07 22:32:19 +00:00
|
|
|
#include <vtkm/cont/VirtualObjectHandle.h>
|
2018-06-22 20:21:07 +00:00
|
|
|
#include <vtkm/exec/PointLocator.h>
|
|
|
|
|
2020-11-11 22:02:10 +00:00
|
|
|
#ifdef VTKM_NO_DEPRECATED_VIRTUAL
|
|
|
|
#error "PointLocator with virtual methods is removed. Do not include PointLocator.h"
|
|
|
|
#endif
|
|
|
|
|
2018-06-22 20:21:07 +00:00
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace cont
|
|
|
|
{
|
|
|
|
|
2020-11-11 22:02:10 +00:00
|
|
|
class VTKM_CONT_EXPORT VTKM_DEPRECATED(1.6, "PointLocator with virtual methods no longer supported")
|
|
|
|
PointLocator : public vtkm::cont::ExecutionObjectBase
|
2018-06-22 20:21:07 +00:00
|
|
|
{
|
2020-11-11 22:02:10 +00:00
|
|
|
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
|
|
|
|
2018-06-22 20:21:07 +00:00
|
|
|
public:
|
2019-04-24 20:06:38 +00:00
|
|
|
virtual ~PointLocator();
|
|
|
|
|
2018-06-22 20:21:07 +00:00
|
|
|
PointLocator()
|
2019-03-15 17:06:23 +00:00
|
|
|
: Modified(true)
|
2018-06-22 20:21:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-03-15 17:06:23 +00:00
|
|
|
vtkm::cont::CoordinateSystem GetCoordinates() const { return this->Coords; }
|
2018-06-22 20:21:07 +00:00
|
|
|
|
2018-08-29 21:19:31 +00:00
|
|
|
void SetCoordinates(const vtkm::cont::CoordinateSystem& coords)
|
2018-06-22 20:21:07 +00:00
|
|
|
{
|
2019-03-15 17:06:23 +00:00
|
|
|
this->Coords = coords;
|
|
|
|
this->SetModified();
|
2018-06-22 20:21:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Update()
|
|
|
|
{
|
2019-03-15 17:06:23 +00:00
|
|
|
if (this->Modified)
|
|
|
|
{
|
2018-06-22 20:21:07 +00:00
|
|
|
Build();
|
2019-03-15 17:06:23 +00:00
|
|
|
this->Modified = false;
|
|
|
|
}
|
2018-06-22 20:21:07 +00:00
|
|
|
}
|
|
|
|
|
2020-11-11 22:02:10 +00:00
|
|
|
VTKM_CONT virtual const vtkm::exec::PointLocator* PrepareForExecution(
|
|
|
|
vtkm::cont::DeviceAdapterId device,
|
|
|
|
vtkm::cont::Token& token) const = 0;
|
2020-01-21 20:18:03 +00:00
|
|
|
|
|
|
|
VTKM_CONT
|
|
|
|
VTKM_DEPRECATED(1.6, "PrepareForExecution now requires a vtkm::cont::Token object")
|
|
|
|
const vtkm::exec::PointLocator* PrepareForExecution(vtkm::cont::DeviceAdapterId device) const
|
|
|
|
{
|
|
|
|
vtkm::cont::Token token;
|
|
|
|
return this->PrepareForExecution(device, token);
|
2018-06-22 20:21:07 +00:00
|
|
|
}
|
|
|
|
|
2019-03-15 17:06:23 +00:00
|
|
|
protected:
|
|
|
|
void SetModified() { this->Modified = true; }
|
|
|
|
|
|
|
|
bool GetModified() const { return this->Modified; }
|
|
|
|
|
|
|
|
virtual void Build() = 0;
|
|
|
|
|
2018-06-22 20:21:07 +00:00
|
|
|
private:
|
2018-08-29 21:19:31 +00:00
|
|
|
vtkm::cont::CoordinateSystem Coords;
|
2019-03-15 17:06:23 +00:00
|
|
|
bool Modified;
|
2018-06-22 20:21:07 +00:00
|
|
|
};
|
2020-11-11 22:02:10 +00:00
|
|
|
VTKM_DEPRECATED_SUPPRESS_END
|
|
|
|
|
|
|
|
} // namespace vtkm::cont
|
|
|
|
} // namespace vtkm
|
|
|
|
|
2018-06-26 19:35:22 +00:00
|
|
|
#endif // vtk_m_cont_PointLocator_h
|