mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
Fixing Point Locator interface.
- Fixing the point locator interface to make it consistent with the CellLocator interface
This commit is contained in:
parent
cf15654112
commit
b56d1789b0
@ -54,6 +54,7 @@ set(headers
|
||||
CellLocator.h
|
||||
CellLocatorHelper.h
|
||||
CellLocatorTwoLevelUniformGrid.h
|
||||
CellLocatorUniformGrid.h
|
||||
CellSet.h
|
||||
CellSetExplicit.h
|
||||
CellSetListTag.h
|
||||
|
@ -34,8 +34,6 @@ namespace cont
|
||||
|
||||
class CellLocator : public vtkm::cont::ExecutionObjectBase
|
||||
{
|
||||
private:
|
||||
using HandleType = vtkm::cont::VirtualObjectHandle<vtkm::exec::CellLocator>;
|
||||
|
||||
public:
|
||||
CellLocator()
|
||||
@ -72,6 +70,8 @@ public:
|
||||
return PrepareForExecutionImpl(device).PrepareForExecution(device);
|
||||
}
|
||||
|
||||
using HandleType = vtkm::cont::VirtualObjectHandle<vtkm::exec::CellLocator>;
|
||||
|
||||
protected:
|
||||
void SetDirty() { Dirty = true; }
|
||||
|
||||
|
@ -37,11 +37,11 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
vtkm::cont::CoordinateSystem GetCoords() const { return coordinates; }
|
||||
vtkm::cont::CoordinateSystem GetCoordinates() const { return Coords; }
|
||||
|
||||
void SetCoords(const vtkm::cont::CoordinateSystem& coords)
|
||||
void SetCoordinates(const vtkm::cont::CoordinateSystem& coords)
|
||||
{
|
||||
coordinates = coords;
|
||||
Coords = coords;
|
||||
dirty = true;
|
||||
}
|
||||
|
||||
@ -57,15 +57,15 @@ public:
|
||||
template <typename DeviceAdapter>
|
||||
VTKM_CONT const vtkm::exec::PointLocator* PrepareForExecution(DeviceAdapter device) const
|
||||
{
|
||||
return PrepareForExecutionImp(device).PrepareForExecution(device);
|
||||
return PrepareForExecutionImpl(device).PrepareForExecution(device);
|
||||
}
|
||||
|
||||
using HandleType = vtkm::cont::VirtualObjectHandle<vtkm::exec::PointLocator>;
|
||||
VTKM_CONT virtual const HandleType PrepareForExecutionImp(
|
||||
VTKM_CONT virtual const HandleType PrepareForExecutionImpl(
|
||||
vtkm::cont::DeviceAdapterId deviceId) const = 0;
|
||||
|
||||
private:
|
||||
vtkm::cont::CoordinateSystem coordinates;
|
||||
vtkm::cont::CoordinateSystem Coords;
|
||||
|
||||
bool dirty;
|
||||
};
|
||||
|
@ -95,7 +95,7 @@ public:
|
||||
using Algorithm = vtkm::cont::DeviceAdapterAlgorithm<Device>;
|
||||
|
||||
// Save training data points.
|
||||
Algorithm::Copy(this->Self->GetCoords().GetData(), this->Self->coords);
|
||||
Algorithm::Copy(this->Self->GetCoordinates().GetData(), this->Self->coords);
|
||||
|
||||
// generate unique id for each input point
|
||||
vtkm::cont::ArrayHandleCounting<vtkm::Id> pointCounting(
|
||||
@ -159,7 +159,7 @@ public:
|
||||
};
|
||||
|
||||
VTKM_CONT
|
||||
const HandleType PrepareForExecutionImp(vtkm::cont::DeviceAdapterId deviceId) const override
|
||||
const HandleType PrepareForExecutionImpl(vtkm::cont::DeviceAdapterId deviceId) const override
|
||||
{
|
||||
const bool success =
|
||||
vtkm::cont::TryExecuteOnDevice(deviceId, PrepareForExecutionFunctor(), *this, ExecHandle);
|
||||
|
@ -129,8 +129,8 @@ public:
|
||||
// { 0.0f, 0.0f, 0.0f }, { 10.0f, 10.0f, 10.0f }, { 5, 5, 5 });
|
||||
vtkm::cont::PointLocatorUniformGrid locator(
|
||||
{ 0.0f, 0.0f, 0.0f }, { 10.0f, 10.0f, 10.0f }, { 5, 5, 5 });
|
||||
locator.SetCoords(coord);
|
||||
locator.Build();
|
||||
locator.SetCoordinates(coord);
|
||||
locator.Update();
|
||||
|
||||
///// randomly generate testing points/////
|
||||
std::vector<vtkm::Vec<vtkm::Float32, 3>> qcVec;
|
||||
|
@ -27,6 +27,7 @@ set(headers
|
||||
CellInside.h
|
||||
CellInterpolate.h
|
||||
CellLocator.h
|
||||
CellLocatorUniformGrid.h
|
||||
CellMeasure.h
|
||||
ColorTable.h
|
||||
ConnectivityExplicit.h
|
||||
|
Loading…
Reference in New Issue
Block a user