VTK-m  2.0
CellLocatorBase.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_CellLocatorBase_h
11 #define vtk_m_cont_internal_CellLocatorBase_h
12 
13 #include <vtkm/cont/vtkm_cont_export.h>
14 
15 #include <vtkm/Types.h>
19 
20 namespace vtkm
21 {
22 namespace cont
23 {
24 namespace internal
25 {
26 
33 template <typename Derived>
34 class VTKM_ALWAYS_EXPORT CellLocatorBase : public vtkm::cont::ExecutionObjectBase
35 {
38  mutable bool Modified = true;
39 
40 public:
41  const vtkm::cont::UnknownCellSet& GetCellSet() const { return this->CellSet; }
42 
43  void SetCellSet(const vtkm::cont::UnknownCellSet& cellSet)
44  {
45  this->CellSet = cellSet;
46  this->SetModified();
47  }
48 
49  const vtkm::cont::CoordinateSystem& GetCoordinates() const { return this->Coords; }
50 
51  void SetCoordinates(const vtkm::cont::CoordinateSystem& coords)
52  {
53  this->Coords = coords;
54  this->SetModified();
55  }
56 
57  void Update() const
58  {
59  if (this->Modified)
60  {
61  static_cast<Derived*>(const_cast<CellLocatorBase*>(this))->Build();
62  this->Modified = false;
63  }
64  }
65 
66 protected:
67  void SetModified() { this->Modified = true; }
68  bool GetModified() const { return this->Modified; }
69 };
70 
71 }
72 }
73 } // vtkm::cont::internal
74 
75 #endif //vtk_m_cont_internal_CellLocatorBase_h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
Types.h
UnknownCellSet.h
vtkm::cont::UnknownCellSet
A CellSet of an unknown type.
Definition: UnknownCellSet.h:48
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