VTK  9.7.20261016
vtkVoronoiNeighborIterator< DIM > Struct Template Reference

#include <vtkVoronoiCore.h>

Detailed Description

template<int DIM>
struct vtkVoronoiNeighborIterator< DIM >

Iterate over the neighbors of a Voronoi generator in spherical shells (the annuli of a 2D tile), with any point locator, of dimension DIM (2 or 3).

BuildHull() (or BuildTile()) requests batches of points around a generator, nearest first, until it can prove that no point not yet returned can modify the hull. The first batch is the shell of vtkAbstractPointLocator::FindNPointsInShell(), which holds the nearest points, and the next ones are the shells of FindPointsInShell(), which grow geometrically, up to the circumflower. Next() can cull the shells with the petals of the Voronoi flower, spheres (x, y, z, r^2) in 3D, or circles (x, y, r^2) in 2D: the points outside of all of them are skipped. Used by both vtkVoronoiCore3D (DIM = 3) and vtkVoronoiCore2D (DIM = 2).

The petals have DIM + 1 components, which the locator expects when it is of dimension DIM: that of vtkStaticPointLocator is 3, that of vtkStaticPointLocator2D is 2, and that of vtkKdTreePointLocator is 2 if its points are in a plane of constant z and 3 otherwise. When the dimension of the locator is not DIM, the petals are not used (see IsLocatorSuited()).

Definition at line 589 of file vtkVoronoiCore.h.

Inheritance diagram for vtkVoronoiNeighborIterator< DIM >:
[legend]
Collaboration diagram for vtkVoronoiNeighborIterator< DIM >:
[legend]

Public Member Functions

void Initialize (vtkAbstractPointLocator *loc, int firstShellSize=0)
bool Begin (vtkIdType ptId, double x[3], vtkDist2TupleArray &results)
bool Next (double radius2, vtkDoubleArray *petals, vtkDist2TupleArray &results)
double GetMinD2 () const

Static Public Member Functions

static int GetLocatorDimension (vtkAbstractPointLocator *loc)
static bool IsLocatorSuited (vtkAbstractPointLocator *loc)

Public Attributes

vtkAbstractPointLocator * Locator = nullptr
int FirstShellSize = 16
vtkIdType PtId = -1
double X [3] = { 0.0, 0.0, 0.0 }
double MinD2 = 0.0
bool Done = false
bool UsePetals = true

Static Public Attributes

static constexpr double ShellGrowth2 = 2.0
static constexpr std::size_t MaxSortedShellSize = 128

Member Function Documentation

◆ GetLocatorDimension()

template<int DIM>
int vtkVoronoiNeighborIterator< DIM >::GetLocatorDimension ( vtkAbstractPointLocator * loc)
inlinestatic

Definition at line 613 of file vtkVoronoiCore.h.

◆ IsLocatorSuited()

template<int DIM>
bool vtkVoronoiNeighborIterator< DIM >::IsLocatorSuited ( vtkAbstractPointLocator * loc)
inlinestatic

Definition at line 633 of file vtkVoronoiCore.h.

◆ Initialize()

template<int DIM>
void vtkVoronoiNeighborIterator< DIM >::Initialize ( vtkAbstractPointLocator * loc,
int firstShellSize = 0 )
inline

Definition at line 642 of file vtkVoronoiCore.h.

◆ Begin()

template<int DIM>
bool vtkVoronoiNeighborIterator< DIM >::Begin ( vtkIdType ptId,
double x[3],
vtkDist2TupleArray & results )
inline

Definition at line 650 of file vtkVoronoiCore.h.

◆ Next()

template<int DIM>
bool vtkVoronoiNeighborIterator< DIM >::Next ( double radius2,
vtkDoubleArray * petals,
vtkDist2TupleArray & results )
inline

Definition at line 676 of file vtkVoronoiCore.h.

◆ GetMinD2()

template<int DIM>
double vtkVoronoiNeighborIterator< DIM >::GetMinD2 ( ) const
inline

Definition at line 694 of file vtkVoronoiCore.h.

Member Data Documentation

◆ ShellGrowth2

template<int DIM>
double vtkVoronoiNeighborIterator< DIM >::ShellGrowth2 = 2.0
staticconstexpr

Definition at line 595 of file vtkVoronoiCore.h.

◆ MaxSortedShellSize

template<int DIM>
std::size_t vtkVoronoiNeighborIterator< DIM >::MaxSortedShellSize = 128
staticconstexpr

Definition at line 601 of file vtkVoronoiCore.h.

◆ Locator

template<int DIM>
vtkAbstractPointLocator* vtkVoronoiNeighborIterator< DIM >::Locator = nullptr

Definition at line 603 of file vtkVoronoiCore.h.

◆ FirstShellSize

template<int DIM>
int vtkVoronoiNeighborIterator< DIM >::FirstShellSize = 16

Definition at line 604 of file vtkVoronoiCore.h.

◆ PtId

template<int DIM>
vtkIdType vtkVoronoiNeighborIterator< DIM >::PtId = -1

Definition at line 605 of file vtkVoronoiCore.h.

◆ X

template<int DIM>
double vtkVoronoiNeighborIterator< DIM >::X[3] = { 0.0, 0.0, 0.0 }

Definition at line 606 of file vtkVoronoiCore.h.

◆ MinD2

template<int DIM>
double vtkVoronoiNeighborIterator< DIM >::MinD2 = 0.0

Definition at line 607 of file vtkVoronoiCore.h.

◆ Done

template<int DIM>
bool vtkVoronoiNeighborIterator< DIM >::Done = false

Definition at line 608 of file vtkVoronoiCore.h.

◆ UsePetals

template<int DIM>
bool vtkVoronoiNeighborIterator< DIM >::UsePetals = true

Definition at line 609 of file vtkVoronoiCore.h.


The documentation for this struct was generated from the following file: