VTK-m  2.0
PointLocatorBase.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_cont_internal_PointLocatorBase_h
11 #define vtk_m_cont_internal_PointLocatorBase_h
12 
13 #include <vtkm/cont/vtkm_cont_export.h>
14 
15 #include <vtkm/Types.h>
18 
19 namespace vtkm
20 {
21 namespace cont
22 {
23 namespace internal
24 {
25 
32 template <typename Derived>
33 class VTKM_ALWAYS_EXPORT PointLocatorBase : public vtkm::cont::ExecutionObjectBase
34 {
35 public:
36  vtkm::cont::CoordinateSystem GetCoordinates() const { return this->Coords; }
37  void SetCoordinates(const vtkm::cont::CoordinateSystem& coords)
38  {
39  this->Coords = coords;
40  this->SetModified();
41  }
42 
43  void Update()
44  {
45  if (this->Modified)
46  {
47  static_cast<Derived*>(const_cast<PointLocatorBase*>(this))->Build();
48  this->Modified = false;
49  }
50  }
51 
52 protected:
53  void SetModified() { this->Modified = true; }
54  bool GetModified() const { return this->Modified; }
55 
56 private:
58  mutable bool Modified = true;
59 };
60 
61 } // vtkm::cont::internal
62 } // vtkm::cont
63 } // vtkm
64 
65 #endif // vtk_m_cont_internal_PointLocatorBase_h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
Types.h
CoordinateSystem.h
vtkm::cont::CoordinateSystem
Definition: CoordinateSystem.h:25
vtkm::cont::ExecutionObjectBase
Base ExecutionObjectBase for execution objects to inherit from so that you can use an arbitrary objec...
Definition: ExecutionObjectBase.h:31
VTKM_ALWAYS_EXPORT
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:92
ExecutionObjectBase.h