VTK  9.6.20260222
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
20
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
32VTK_ABI_NAMESPACE_BEGIN
33class vtkPointData;
34
36 "Please use `vtkStaticPointLocator` instead.") VTKFILTERSSMP_EXPORT vtkSMPMergePoints
37 : public vtkMergePoints
38{
39public:
42 void PrintSelf(ostream& os, vtkIndent indent) override;
43
48
58 void Merge(vtkSMPMergePoints* locator, vtkIdType idx, vtkPointData* outPd, vtkPointData* inPd,
59 vtkIdList* idList);
60
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 }
89
90
94 vtkIdType GetNumberOfBuckets() VTK_FUTURE_CONST override { return this->NumberOfBuckets; }
95
96protected:
99
100 std::atomic<vtkIdType> AtomicInsertionId;
101
102private:
103 vtkSMPMergePoints(const vtkSMPMergePoints&) = delete;
104 void operator=(const vtkSMPMergePoints&) = delete;
105};
106
107VTK_ABI_NAMESPACE_END
108#endif // vtkSMPMergePoints_h
list of point or cell ids
Definition vtkIdList.h:133
vtkIdType GetNumberOfIds() const noexcept
Return the number of id's in the list.
Definition vtkIdList.h:159
a simple class to control print indentation
Definition vtkIndent.h:108
vtkMergePoints()=default
represent and manipulate point attribute data
vtkIdList ** HashTable
~vtkSMPMergePoints() override
vtkIdType GetMaxId()
Returns the biggest id in the locator.
void FixSizeOfPointArray()
At the of the merge, this can be called to set the MaxId of the points array to the maximum id in the...
vtkIdType GetNumberOfIdsInBucket(vtkIdType idx)
Returns the number of points in a bin.
void InitializeMerge()
This should be called from 1 thread before any call to Merge.
std::atomic< vtkIdType > AtomicInsertionId
vtkIdType GetNumberOfBuckets() VTK_FUTURE_CONST override
Returns the number of bins.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard type and print methods.
static vtkSMPMergePoints * New()
void Merge(vtkSMPMergePoints *locator, vtkIdType idx, vtkPointData *outPd, vtkPointData *inPd, vtkIdList *idList)
Merge the points of one of the bins from the given locator to the same bin of the current locator.
#define VTK_DEPRECATED_IN_9_7_0(reason)
int vtkIdType
Definition vtkType.h:363