VTK  9.0.1
vtkSMPMergePoints.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSMPMergePoints.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
33 #ifndef vtkSMPMergePoints_h
34 #define vtkSMPMergePoints_h
35 
36 #include "vtkFiltersSMPModule.h" // For export macro
37 #include "vtkIdList.h" // For inline functions
38 #include "vtkMergePoints.h"
39 #include "vtkType.h" // For vtkIdType
40 
41 #include <atomic> // for std::atomic
42 
43 class vtkPointData;
44 
45 class VTKFILTERSSMP_EXPORT vtkSMPMergePoints : public vtkMergePoints
46 {
47 public:
49  static vtkSMPMergePoints* New();
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
55  void InitializeMerge();
56 
66  void Merge(vtkSMPMergePoints* locator, vtkIdType idx, vtkPointData* outPd, vtkPointData* inPd,
67  vtkIdList* idList);
68 
77  void FixSizeOfPointArray();
78 
82  vtkIdType GetMaxId() { return this->AtomicInsertionId - 1; }
83 
85 
89  {
90  if (!this->HashTable)
91  {
92  return 0;
93  }
94  vtkIdList* bucket = this->HashTable[idx];
95  return bucket ? bucket->GetNumberOfIds() : 0;
96  }
98 
102  vtkIdType GetNumberOfBuckets() override { return this->NumberOfBuckets; }
103 
104 protected:
106  ~vtkSMPMergePoints() override;
107 
108  std::atomic<vtkIdType> AtomicInsertionId;
109 
110 private:
111  vtkSMPMergePoints(const vtkSMPMergePoints&) = delete;
112  void operator=(const vtkSMPMergePoints&) = delete;
113 };
114 
115 #endif // vtkSMPMergePoints_h
represent and manipulate point attribute data
Definition: vtkPointData.h:31
vtkIdType GetNumberOfIds()
Return the number of id&#39;s in the list.
Definition: vtkIdList.h:57
Class designed to help with merging of points in parallel.
int vtkIdType
Definition: vtkType.h:338
vtkIdType GetNumberOfBuckets() override
Returns the number of bins.
a simple class to control print indentation
Definition: vtkIndent.h:33
merge exactly coincident points
list of point or cell ids
Definition: vtkIdList.h:30
vtkIdType GetNumberOfIdsInBucket(vtkIdType idx)
Returns the number of points in a bin.
static vtkMergePoints * New()
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.