106#ifndef vtkVoronoiCore2D_h
107#define vtkVoronoiCore2D_h
117VTK_ABI_NAMESPACE_BEGIN
186 return (ptId >= 0 && this->Regions[ptId] >= 0);
195 return (!this->Regions || this->Regions[ptId] == this->Regions[neiId]);
203template <
class TCompositor,
class TClassifier>
221 this->LocalBatches.reserve(2048);
222 this->LocalSpokes.reserve(2048);
230template <
class TCompositor,
class TClassifier>
231using ThreadMapType = std::vector<vtkVoronoi2DLocalData<TCompositor, TClassifier>*>;
245template <
class TCompositor,
class TClassifier = vtkVoronoiClassifier2D>
267 vtkIdType maxClips,
bool validate,
double pruneTol, TCompositor* comp, TClassifier* cl);
305 bool validate,
double pruneTol, TCompositor* comp, TClassifier* c);
366 const double* Points;
370 double PaddedBounds[6];
376 double PruneTolerance;
380 int MaximumNumberOfPoints;
451 static std::unique_ptr<TopologicalMerge>
Execute(
521 maxPoints = (numPts > maxPoints ? numPts : maxPoints);
538 return (ptId >= 0 && this->Regions[ptId] >= 0);
547 return (!this->Regions || this->Regions[ptId] == this->Regions[neiId]);
552#include "vtkVoronoiCore2D.txx"
A fast, lightweight class for iterating over the bins of a 2D vtkStaticPointLocator2D.
represent and manipulate 3D points
Thread local storage for VTK objects.
quickly locate points in 2-space
int GetNumberOfPrunes()
Obtain information about the execution of the Voronoi algorithm.
static std::unique_ptr< vtkVoronoiCore2D< TCompositor, TClassifier > > Execute(vtkAlgorithm *filter, unsigned int batchSize, vtkStaticPointLocator2D *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.
TClassifier Classifier
This templated class is used to extend the API of this vtkVoronoiCore2D class, to implement the spoke...
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.
vtkVoronoiCore2D(vtkAlgorithm *filter, vtkVoronoiBatchManager &batcher, vtkStaticPointLocator2D *loc, vtkPoints *inPts, double padding, vtkIdType maxClips, bool validate, double pruneTol, TCompositor *comp, TClassifier *c)
Constructor.
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.
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
vtkAnnularBinIterator 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
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