VTK  9.7.1
vtkSMPMergePoints.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
21 #ifndef vtkSMPMergePoints_h
22 #define vtkSMPMergePoints_h
23 
24 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_7_0
25 #include "vtkFiltersSMPModule.h" // For export macro
26 #include "vtkIdList.h" // For inline functions
27 #include "vtkMergePoints.h"
28 #include "vtkType.h" // For vtkIdType
29 
30 #include <atomic> // for std::atomic
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkPointData;
34 
36  "Please use `vtkStaticPointLocator` instead.") VTKFILTERSSMP_EXPORT vtkSMPMergePoints
37  : public vtkMergePoints
38 {
39 public:
41  static vtkSMPMergePoints* New();
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
47  void InitializeMerge();
48 
58  void Merge(vtkSMPMergePoints* locator, vtkIdType idx, vtkPointData* outPd, vtkPointData* inPd,
59  vtkIdList* idList);
60 
69  void FixSizeOfPointArray();
70 
74  vtkIdType GetMaxId() { return this->AtomicInsertionId - 1; }
75 
77 
81  {
82  if (!this->HashTable)
83  {
84  return 0;
85  }
86  vtkIdList* bucket = this->HashTable[idx];
87  return bucket ? bucket->GetNumberOfIds() : 0;
88  }
90 
94  vtkIdType GetNumberOfBuckets() VTK_FUTURE_CONST override { return this->NumberOfBuckets; }
95 
96 protected:
98  ~vtkSMPMergePoints() override;
99 
100  std::atomic<vtkIdType> AtomicInsertionId;
101 
102 private:
103  vtkSMPMergePoints(const vtkSMPMergePoints&) = delete;
104  void operator=(const vtkSMPMergePoints&) = delete;
105 };
106 
107 VTK_ABI_NAMESPACE_END
108 #endif // vtkSMPMergePoints_h
represent and manipulate point attribute data
Definition: vtkPointData.h:30
Class designed to help with merging of points in parallel.
int vtkIdType
Definition: vtkType.h:363
vtkIdType GetNumberOfBuckets() VTK_FUTURE_CONST override
Returns the number of bins.
a simple class to control print indentation
Definition: vtkIndent.h:28
merge exactly coincident points
list of point or cell ids
Definition: vtkIdList.h:25
vtkIdType GetNumberOfIdsInBucket(vtkIdType idx)
Returns the number of points in a bin.
static vtkMergePoints * New()
vtkIdType GetNumberOfIds() const noexcept
Return the number of id's in the list.
Definition: vtkIdList.h:76
quickly locate points in 3-space
void PrintSelf(ostream &os, vtkIndent indent) override
Standard type and print methods.
#define VTK_DEPRECATED_IN_9_7_0(reason)
std::atomic< vtkIdType > AtomicInsertionId
vtkIdType GetMaxId()
Returns the biggest id in the locator.