2019-03-29 17:28:27 +00:00
|
|
|
//============================================================================
|
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
2019-04-15 23:24:21 +00:00
|
|
|
//
|
2019-03-29 17:28:27 +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_CellLocatorGeneral_h
|
|
|
|
#define vtk_m_cont_CellLocatorGeneral_h
|
|
|
|
|
2020-09-22 15:32:01 +00:00
|
|
|
#include <vtkm/cont/CellLocatorRectilinearGrid.h>
|
|
|
|
#include <vtkm/cont/CellLocatorTwoLevel.h>
|
|
|
|
#include <vtkm/cont/CellLocatorUniformGrid.h>
|
|
|
|
|
|
|
|
#include <vtkm/exec/CellLocatorMultiplexer.h>
|
|
|
|
|
|
|
|
#include <vtkm/cont/internal/Variant.h>
|
2019-03-29 17:28:27 +00:00
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace cont
|
|
|
|
{
|
|
|
|
|
2020-09-22 15:32:01 +00:00
|
|
|
class VTKM_CONT_EXPORT CellLocatorGeneral
|
|
|
|
: public vtkm::cont::internal::CellLocatorBase<CellLocatorGeneral>
|
2019-03-29 17:28:27 +00:00
|
|
|
{
|
2020-09-22 15:32:01 +00:00
|
|
|
using Superclass = vtkm::cont::internal::CellLocatorBase<CellLocatorGeneral>;
|
2019-03-29 17:28:27 +00:00
|
|
|
|
2020-09-22 15:32:01 +00:00
|
|
|
public:
|
|
|
|
using ContLocatorList = vtkm::List<vtkm::cont::CellLocatorUniformGrid,
|
|
|
|
vtkm::cont::CellLocatorRectilinearGrid,
|
|
|
|
vtkm::cont::CellLocatorTwoLevel>;
|
2019-03-29 17:28:27 +00:00
|
|
|
|
2020-09-22 15:32:01 +00:00
|
|
|
using ExecLocatorList =
|
|
|
|
vtkm::List<vtkm::cont::internal::ExecutionObjectType<vtkm::cont::CellLocatorUniformGrid>,
|
|
|
|
vtkm::cont::internal::ExecutionObjectType<vtkm::cont::CellLocatorRectilinearGrid>,
|
|
|
|
vtkm::cont::internal::ExecutionObjectType<vtkm::cont::CellLocatorTwoLevel>>;
|
2019-03-29 17:28:27 +00:00
|
|
|
|
2020-09-22 15:32:01 +00:00
|
|
|
using ExecObjType = vtkm::ListApply<ExecLocatorList, vtkm::exec::CellLocatorMultiplexer>;
|
2019-03-29 17:28:27 +00:00
|
|
|
|
2020-09-22 15:32:01 +00:00
|
|
|
VTKM_CONT ExecObjType PrepareForExecution(vtkm::cont::DeviceAdapterId device,
|
|
|
|
vtkm::cont::Token& token) const;
|
2019-03-29 17:28:27 +00:00
|
|
|
|
2020-09-22 15:32:01 +00:00
|
|
|
private:
|
|
|
|
vtkm::cont::internal::ListAsVariant<ContLocatorList> LocatorImpl;
|
2019-03-29 17:28:27 +00:00
|
|
|
|
2020-09-22 15:32:01 +00:00
|
|
|
friend Superclass;
|
|
|
|
VTKM_CONT void Build();
|
2019-03-29 17:28:27 +00:00
|
|
|
|
2020-09-22 15:32:01 +00:00
|
|
|
struct PrepareFunctor;
|
2019-03-29 17:28:27 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
} // vtkm::cont
|
|
|
|
|
|
|
|
#endif // vtk_m_cont_CellLocatorGeneral_h
|