VTK  9.7.20261104
vtkShellBinIterator.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
27#ifndef vtkShellBinIterator_h
28#define vtkShellBinIterator_h
29
30#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_8_0
31#include "vtkFiltersMeshingModule.h" // For export macro
32#include "vtkLocatorInterface.h" // for array of (pt,d**2) tuples
33#include "vtkSystemIncludes.h"
34
35VTK_ABI_NAMESPACE_BEGIN
36
38class vtkDoubleArray;
39struct InternalShellBinIterator;
40
41// A simple dispatch mechanism to internal, templated classes.
42VTK_WRAPEXCLUDE struct VTKFILTERSMESHING_EXPORT vtkShellBinIteratorDispatch
43{
45 InternalShellBinIterator* Iterator;
46
48 : LargeIds(false)
49 , Iterator(nullptr)
50 {
51 }
54 bool Begin(vtkIdType pid, double x[3], vtkDist2TupleArray& results);
55 bool Next(double radius2, vtkDoubleArray* spheres, vtkDist2TupleArray& results);
57 void GetBin(int IJK[3]);
58 double GetMinD2();
59}; // vtkShellBinIteratorDispatch
60
61// VTK class proper
63 "Use vtkStaticPointLocator::FindNPointsInShell() and FindPointsInShell() instead.")
64 VTKFILTERSMESHING_EXPORT vtkShellBinIterator
65{
66public:
71
78 : Dispatch(loc)
79 {
80 }
81
87 void Initialize(vtkStaticPointLocator* locator) { this->Dispatch.Initialize(locator); }
88
94 bool Begin(vtkIdType ptId, double x[3], vtkDist2TupleArray& results)
95 {
96 return this->Dispatch.Begin(ptId, x, results);
97 }
98
104 bool Next(double radius2, vtkDoubleArray* spheres, vtkDist2TupleArray& results)
105 {
106 return this->Dispatch.Next(radius2, spheres, results);
107 }
108
112 vtkIdType GetBinId() { return this->Dispatch.GetBinId(); }
113
117 void GetBin(int IJK[3]) { this->Dispatch.GetBin(IJK); }
118
123 double GetMinD2() { return this->Dispatch.GetMinD2(); }
124
125private:
126 // Used to dispatch to the internally instantiated templated classes.
128};
129
130VTK_ABI_NAMESPACE_END
131
132#endif
133// VTK-HeaderTest-Exclude: vtkShellBinIterator.h
dynamic, self-adjusting array of double
void Initialize(vtkStaticPointLocator *locator)
Initialize an iterator with the associated vtkStaticPointLocator over which to iterate.
vtkShellBinIterator(vtkStaticPointLocator *loc)
Construct the iterator with a vtkStaticPointLocator.
double GetMinD2()
Return the minimum distance of the current shell of bins to the initial starting point x[3].
vtkIdType GetBinId()
Return the current bin/bucket id of traversal.
void GetBin(int IJK[3])
Return the current bin/bucket index IJK of traversal.
bool Next(double radius2, vtkDoubleArray *spheres, vtkDist2TupleArray &results)
Move to the next bin, returning all points that are inside the sphere given by x[3] (specified in Beg...
vtkShellBinIterator()=default
Construct a default iterator.
bool Begin(vtkIdType ptId, double x[3], vtkDist2TupleArray &results)
Begin iterating over the bins, starting with point ptId at position x[3].
quickly locate points in 3-space
Represent an array of vtkDist2Tuples.
InternalShellBinIterator * Iterator
void Initialize(vtkStaticPointLocator *locator)
vtkShellBinIteratorDispatch(vtkStaticPointLocator *loc)
bool Next(double radius2, vtkDoubleArray *spheres, vtkDist2TupleArray &results)
bool Begin(vtkIdType pid, double x[3], vtkDist2TupleArray &results)
#define VTK_DEPRECATED_IN_9_8_0(reason)
int vtkIdType
Definition vtkType.h:363
#define VTK_WRAPEXCLUDE