vtk-m2/vtkm/cont/CellLocator.h
Kenneth Moreland 4650a1da96 Deprecate old methods from DynamicCellSet
The `DynamicCellSet` (and the related `DynamicCellSetBase`) are
deprecated and replaced with `UnknownCellSet` (and `UncertainCellSet`).
Thus, `UnknownCellSet` has some methods inherited from `DynamicCellSet`
but replaced with other functionality. These methods are now marked as
deprecated and their use is removed.
2022-01-05 08:18:17 -07:00

97 lines
2.6 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.
//============================================================================
#ifndef vtk_m_cont_CellLocator_h
#define vtk_m_cont_CellLocator_h
#include <vtkm/cont/vtkm_cont_export.h>
#include <vtkm/Deprecated.h>
#include <vtkm/Types.h>
#include <vtkm/cont/CoordinateSystem.h>
#include <vtkm/cont/ExecutionObjectBase.h>
#include <vtkm/cont/UnknownCellSet.h>
#include <vtkm/exec/CellLocator.h>
#ifdef VTKM_NO_DEPRECATED_VIRTUAL
#error "CellLocator with virtual methods is removed. Do not include CellLocator.h"
#endif
namespace vtkm
{
namespace cont
{
class VTKM_CONT_EXPORT VTKM_DEPRECATED(1.6,
"CellLocator with virtual methods no longer supported. Use "
"CellLocatorGeneral or CellLocatorChooser.") CellLocator
: public vtkm::cont::ExecutionObjectBase
{
VTKM_DEPRECATED_SUPPRESS_BEGIN
public:
virtual ~CellLocator();
const vtkm::cont::UnknownCellSet& GetCellSet() const { return this->CellSet; }
void SetCellSet(const vtkm::cont::UnknownCellSet& cellSet)
{
this->CellSet = cellSet;
this->SetModified();
}
const vtkm::cont::CoordinateSystem& GetCoordinates() const { return this->Coords; }
void SetCoordinates(const vtkm::cont::CoordinateSystem& coords)
{
this->Coords = coords;
this->SetModified();
}
void Update()
{
if (this->Modified)
{
this->Build();
this->Modified = false;
}
}
VTKM_CONT virtual const vtkm::exec::CellLocator* PrepareForExecution(
vtkm::cont::DeviceAdapterId device,
vtkm::cont::Token& token) const = 0;
VTKM_CONT
VTKM_DEPRECATED(1.6, "PrepareForExecution now requires a vtkm::cont::Token object.")
const vtkm::exec::CellLocator* PrepareForExecution(vtkm::cont::DeviceAdapterId device) const
{
vtkm::cont::Token token;
return this->PrepareForExecution(device, token);
}
protected:
void SetModified() { this->Modified = true; }
bool GetModified() const { return this->Modified; }
//This is going to need a TryExecute
VTKM_CONT virtual void Build() = 0;
private:
vtkm::cont::UnknownCellSet CellSet;
vtkm::cont::CoordinateSystem Coords;
bool Modified = true;
};
VTKM_DEPRECATED_SUPPRESS_END
} // namespace cont
} // namespace vtkm
#endif // vtk_m_cont_CellLocator_h