VTK  9.3.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 "vtkFiltersSMPModule.h" // For export macro
25 #include "vtkIdList.h" // For inline functions
26 #include "vtkMergePoints.h"
27 #include "vtkType.h" // For vtkIdType
28 
29 #include <atomic> // for std::atomic
30 
31 VTK_ABI_NAMESPACE_BEGIN
32 class vtkPointData;
33 
34 class VTKFILTERSSMP_EXPORT vtkSMPMergePoints : public vtkMergePoints
35 {
36 public:
38  static vtkSMPMergePoints* New();
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
44  void InitializeMerge();
45 
55  void Merge(vtkSMPMergePoints* locator, vtkIdType idx, vtkPointData* outPd, vtkPointData* inPd,
56  vtkIdList* idList);
57 
66  void FixSizeOfPointArray();
67 
71  vtkIdType GetMaxId() { return this->AtomicInsertionId - 1; }
72 
74 
78  {
79  if (!this->HashTable)
80  {
81  return 0;
82  }
83  vtkIdList* bucket = this->HashTable[idx];
84  return bucket ? bucket->GetNumberOfIds() : 0;
85  }
87 
91  vtkIdType GetNumberOfBuckets() VTK_FUTURE_CONST override { return this->NumberOfBuckets; }
92 
93 protected:
95  ~vtkSMPMergePoints() override;
96 
97  std::atomic<vtkIdType> AtomicInsertionId;
98 
99 private:
100  vtkSMPMergePoints(const vtkSMPMergePoints&) = delete;
101  void operator=(const vtkSMPMergePoints&) = delete;
102 };
103 
104 VTK_ABI_NAMESPACE_END
105 #endif // vtkSMPMergePoints_h
represent and manipulate point attribute data
Definition: vtkPointData.h:29
Class designed to help with merging of points in parallel.
int vtkIdType
Definition: vtkType.h:315
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:22
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:49
void PrintSelf(ostream &os, vtkIndent indent) override
Standard type and print methods.
std::atomic< vtkIdType > AtomicInsertionId
vtkIdType GetMaxId()
Returns the biggest id in the locator.