2018-06-05 03:04:38 +00:00
|
|
|
//============================================================================
|
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
2019-04-15 23:24:21 +00:00
|
|
|
//
|
2018-06-05 03:04:38 +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.
|
|
|
|
//============================================================================
|
|
|
|
|
2018-07-12 21:34:29 +00:00
|
|
|
#ifndef vtk_m_cont_CellLocatorBoundingIntervalHierarchy_h
|
|
|
|
#define vtk_m_cont_CellLocatorBoundingIntervalHierarchy_h
|
2018-06-05 03:04:38 +00:00
|
|
|
|
2019-01-30 21:42:37 +00:00
|
|
|
#include <vtkm/cont/vtkm_cont_export.h>
|
|
|
|
|
2018-06-05 03:04:38 +00:00
|
|
|
#include <vtkm/Types.h>
|
|
|
|
#include <vtkm/cont/ArrayHandle.h>
|
|
|
|
#include <vtkm/cont/ArrayHandleTransform.h>
|
|
|
|
#include <vtkm/cont/CellLocator.h>
|
2019-03-28 12:27:37 +00:00
|
|
|
#include <vtkm/cont/VirtualObjectHandle.h>
|
2018-11-07 22:32:19 +00:00
|
|
|
|
2018-06-29 04:26:29 +00:00
|
|
|
#include <vtkm/worklet/spatialstructure/BoundingIntervalHierarchy.h>
|
2018-06-05 03:04:38 +00:00
|
|
|
|
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace cont
|
|
|
|
{
|
2019-03-13 15:29:49 +00:00
|
|
|
|
2019-03-20 21:28:08 +00:00
|
|
|
class VTKM_CONT_EXPORT CellLocatorBoundingIntervalHierarchy : public vtkm::cont::CellLocator
|
2018-06-05 03:04:38 +00:00
|
|
|
{
|
2018-06-21 03:08:33 +00:00
|
|
|
public:
|
|
|
|
VTKM_CONT
|
2018-07-12 21:34:29 +00:00
|
|
|
CellLocatorBoundingIntervalHierarchy(vtkm::IdComponent numPlanes = 4,
|
|
|
|
vtkm::IdComponent maxLeafSize = 5)
|
2018-06-21 03:08:33 +00:00
|
|
|
: NumPlanes(numPlanes)
|
|
|
|
, MaxLeafSize(maxLeafSize)
|
2018-06-29 22:03:17 +00:00
|
|
|
, Nodes()
|
|
|
|
, ProcessedCellIds()
|
2018-06-21 03:08:33 +00:00
|
|
|
{
|
|
|
|
}
|
2019-03-15 19:14:09 +00:00
|
|
|
|
2019-03-20 23:38:50 +00:00
|
|
|
VTKM_CONT ~CellLocatorBoundingIntervalHierarchy() override;
|
|
|
|
|
2018-06-25 00:16:46 +00:00
|
|
|
VTKM_CONT
|
|
|
|
void SetNumberOfSplittingPlanes(vtkm::IdComponent numPlanes)
|
|
|
|
{
|
2019-03-28 12:27:37 +00:00
|
|
|
this->NumPlanes = numPlanes;
|
|
|
|
this->SetModified();
|
2018-06-25 00:16:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
VTKM_CONT
|
2019-03-28 12:27:37 +00:00
|
|
|
vtkm::IdComponent GetNumberOfSplittingPlanes() { return this->NumPlanes; }
|
2018-06-25 00:16:46 +00:00
|
|
|
|
|
|
|
VTKM_CONT
|
|
|
|
void SetMaxLeafSize(vtkm::IdComponent maxLeafSize)
|
|
|
|
{
|
2019-03-28 12:27:37 +00:00
|
|
|
this->MaxLeafSize = maxLeafSize;
|
|
|
|
this->SetModified();
|
2018-06-25 00:16:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
VTKM_CONT
|
2019-03-28 12:27:37 +00:00
|
|
|
vtkm::Id GetMaxLeafSize() { return this->MaxLeafSize; }
|
2018-06-25 00:16:46 +00:00
|
|
|
|
2018-06-21 03:08:33 +00:00
|
|
|
VTKM_CONT
|
2019-03-28 12:27:37 +00:00
|
|
|
const vtkm::exec::CellLocator* PrepareForExecution(
|
|
|
|
vtkm::cont::DeviceAdapterId device) const override;
|
2018-06-21 03:08:33 +00:00
|
|
|
|
2019-03-28 12:27:37 +00:00
|
|
|
protected:
|
2018-06-21 03:08:33 +00:00
|
|
|
VTKM_CONT
|
2019-03-28 12:27:37 +00:00
|
|
|
void Build() override;
|
2018-06-21 03:08:33 +00:00
|
|
|
|
|
|
|
private:
|
2018-06-05 03:04:38 +00:00
|
|
|
vtkm::IdComponent NumPlanes;
|
|
|
|
vtkm::IdComponent MaxLeafSize;
|
2018-07-12 21:34:29 +00:00
|
|
|
vtkm::cont::ArrayHandle<vtkm::exec::CellLocatorBoundingIntervalHierarchyNode> Nodes;
|
2019-03-28 12:27:37 +00:00
|
|
|
vtkm::cont::ArrayHandle<vtkm::Id> ProcessedCellIds;
|
|
|
|
|
|
|
|
mutable vtkm::cont::VirtualObjectHandle<vtkm::exec::CellLocator> ExecutionObjectHandle;
|
2018-06-05 03:04:38 +00:00
|
|
|
};
|
2018-06-25 00:16:46 +00:00
|
|
|
|
|
|
|
} // namespace cont
|
|
|
|
} // namespace vtkm
|
2018-06-05 03:04:38 +00:00
|
|
|
|
2018-07-12 21:34:29 +00:00
|
|
|
#endif // vtk_m_cont_CellLocatorBoundingIntervalHierarchy_h
|