106#ifndef vtkVoronoiCore2D_h
107#define vtkVoronoiCore2D_h
116VTK_ABI_NAMESPACE_BEGIN
185 return (ptId >= 0 && this->Regions[ptId] >= 0);
194 return (!this->Regions || this->Regions[ptId] == this->Regions[neiId]);
202template <
class TCompositor,
class TClassifier>
220 this->LocalBatches.reserve(2048);
221 this->LocalSpokes.reserve(2048);
229template <
class TCompositor,
class TClassifier>
230using ThreadMapType = std::vector<vtkVoronoi2DLocalData<TCompositor, TClassifier>*>;
244template <
class TCompositor,
class TClassifier = vtkVoronoiClassifier2D>
266 vtkIdType maxClips,
bool validate,
double pruneTol, TCompositor* comp, TClassifier* cl);
304 bool validate,
double pruneTol, TCompositor* comp, TClassifier* c);
365 const double* Points;
369 double PaddedBounds[6];
375 double PruneTolerance;
379 int MaximumNumberOfPoints;
450 static std::unique_ptr<TopologicalMerge>
Execute(
520 maxPoints = (numPts > maxPoints ? numPts : maxPoints);
537 return (ptId >= 0 && this->Regions[ptId] >= 0);
546 return (!this->Regions || this->Regions[ptId] == this->Regions[neiId]);
551#include "vtkVoronoiCore2D.txx"
abstract class to quickly locate points in 3-space
represent and manipulate 3D points
Thread local storage for VTK objects.
int GetNumberOfPrunes()
Obtain information about the execution of the Voronoi algorithm.
TClassifier Classifier
This templated class is used to extend the API of this vtkVoronoiCore2D class, to implement the spoke...
vtkVoronoiCore2D(vtkAlgorithm *filter, vtkVoronoiBatchManager &batcher, vtkAbstractPointLocator *loc, vtkPoints *inPts, double padding, vtkIdType maxClips, bool validate, double pruneTol, TCompositor *comp, TClassifier *c)
Constructor.
ThreadMapType< TCompositor, TClassifier > ThreadMap
vtkVoronoiAdjacencyGraph Graph
This is used to create the spokes and wheels adjacency graph used to validate the tessellation and pr...
int GetMaximumNumberOfPoints()
Obtain information about the execution of the Voronoi algorithm.
vtkVoronoiAdjacencyGraph & GetAdjacencyGraph()
Obtain the adjacency graph (wheel & spokes data structure).
TCompositor Compositor
The compositor enables this vtkVoronoiCore2D templated class to be used in different applications.
vtkVoronoi2DLocalData< TCompositor, TClassifier > * GetThreadData(int threadNum)
Access the local thread data produced by execution of the filter.
vtkIdType GetNumberOfPoints()
Convenience methods to retrieve the number of input points, and the raw double* points array.
const double * GetPoints()
void Reduce()
Core vtkSMPTools methods to process tiles in parallel, and produce thread local output data.
static std::unique_ptr< vtkVoronoiCore2D< TCompositor, TClassifier > > Execute(vtkAlgorithm *filter, unsigned int batchSize, vtkAbstractPointLocator *loc, vtkPoints *inPts, double padding, vtkIdType maxClips, bool validate, double pruneTol, TCompositor *comp, TClassifier *cl)
A factory method to conveniently instantiate and execute the algorithm.
int GetNumberOfThreads()
Access the local thread data produced by execution of the filter.
vtkAlgorithm * Filter
Used for controlling filter abort and accessing filter information.
void Initialize()
Core vtkSMPTools methods to process tiles in parallel, and produce thread local output data.
vtkVoronoiBatchManager Batcher
Controls processing of batches of generating points.
void operator()(vtkIdType batchId, vtkIdType endBatchId)
Core vtkSMPTools methods to process tiles in parallel, and produce thread local output data.
The convex polygon tile class proper.
vtkIdType GetNumberOfPoints()
vtkIdType GetGeneratorPointId()
Obtain information about the generated tile.
Represent an array of vtkDist2Tuples.
const vtkVoronoiSpoke * AddAdjacencyInformation(vtkVoronoiTile &tile, vtkVoronoiWheelsType &wheels, vtkVoronoiSpokesType &spokes, int &numSpokes, int &maxPoints)
vtkEmptyVoronoi2DClassifier()
bool IsSameRegion(vtkIdType ptId, vtkIdType neiId)
vtkEmptyVoronoi2DClassifier(const int *regions)
bool IsInsideRegion(vtkIdType ptId)
void Initialize(vtkEmptyVoronoi2DClassifier *c)
Thread local data may be needed.
void AddData(vtkVoronoiTile &, int numSpokes, const vtkVoronoiSpoke *)
void Initialize(vtkEmptyVoronoi2DCompositor *)
These are convenience/demonstration classes for configuring the templated 2D Voronoi classes.
void Initialize(vtkIdType numPts, vtkEmptyVoronoi2DCompositor *)
Prepare to accumulate compositing information: specify the total number of generating points to be pr...
The following thread local data is used to process and keep track of information on a per-thread basi...
vtkBatchIdsType LocalBatches
vtkVoronoiNeighborIterator< 2 > BIter
TCompositor::LocalData Compositor
vtkVoronoiSpokesType LocalSpokes
The adjacency graph, a collection of wheels and spokes, is a topological construct that connects Voro...
Class to manage batches of points.
bool IsInsideRegion(vtkIdType ptId)
bool IsSameRegion(vtkIdType ptId, vtkIdType neiId)
void Initialize(vtkVoronoiClassifier2D *c)
const vtkVoronoiSpoke * AddAdjacencyInformation(vtkVoronoiTile &tile, vtkVoronoiWheelsType &wheels, vtkVoronoiSpokesType &spokes, int &numSpokes, int &maxPoints)
vtkVoronoiClassifier2D(const int *regions)
ProduceWheelsAndSpokes(vtkVoronoiCore2D< TCompositor, TClassifier > *vc)
static void Execute(vtkVoronoiCore2D< TCompositor, TClassifier > *vc)
vtkVoronoiCore2D< TCompositor, TClassifier > * VC
void operator()(vtkIdType threadId, vtkIdType endThreadId)
vtkIdType GetNumberOfMergedPoints()
Methods related to merging coincident points.
static std::unique_ptr< TopologicalMerge > Execute(vtkVoronoiCore2D< TCompositor, TClassifier > *vc)
TopologicalMerge(vtkVoronoiCore2D< TCompositor, TClassifier > *vc)
vtkVoronoiCore2D< TCompositor, TClassifier > * VC
void operator()(vtkIdType threadId, vtkIdType endThreadId)
vtkMergeTuples2DType MergeTuples
Iterate over the neighbors of a Voronoi generator in spherical shells (the annuli of a 2D tile),...
Typedefs and classes in support of the adjacency graph.
std::vector< vtkVoronoi2DLocalData< TCompositor, TClassifier > * > ThreadMapType
The thread map keeps track of the thread local data across all computing threads.
std::vector< vtkIdType > vtkBatchIdsType
Keep track of batches of generating points.
std::vector< vtkIdType > vtkMergeMapType
When merging points, the merge map is a vector that maps global tile/hull vertex ids (which contain d...
std::vector< vtkIdType > vtkVoronoiWheelsType
std::vector< vtkVoronoiSpoke > vtkVoronoiSpokesType
The vtkVoronoiWheelsType vector is used to keep track of the number of spokes (and equivalently,...
std::vector< vtkVoronoiMergeTuple2D > vtkMergeTuples2DType