106 #ifndef vtkVoronoiCore2D_h
107 #define vtkVoronoiCore2D_h
117 VTK_ABI_NAMESPACE_BEGIN
186 return (ptId >= 0 && this->Regions[ptId] >= 0);
195 return (!this->Regions || this->Regions[ptId] == this->Regions[neiId]);
203 template <
class TCompositor,
class TClassifier>
221 this->LocalBatches.reserve(2048);
222 this->LocalSpokes.reserve(2048);
230 template <
class TCompositor,
class TClassifier>
231 using ThreadMapType = std::vector<vtkVoronoi2DLocalData<TCompositor, TClassifier>*>;
245 template <
class TCompositor,
class TClassifier = vtkVoronoiClassifier2D>
265 static std::unique_ptr<vtkVoronoiCore2D<TCompositor, TClassifier>>
Execute(
vtkAlgorithm* filter,
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]);
551 VTK_ABI_NAMESPACE_END
552 #include "vtkVoronoiCore2D.txx"
int GetMaximumNumberOfPoints()
Obtain information about the execution of the Voronoi algorithm.
vtkMergeTuples2DType MergeTuples
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.
void operator()(vtkIdType threadId, vtkIdType endThreadId)
std::vector< vtkIdType > vtkBatchIdsType
Keep track of batches of generating points.
void Initialize(vtkIdType numPts, vtkEmptyVoronoi2DCompositor *)
Prepare to accumulate compositing information: specify the total number of generating points to be pr...
std::vector< vtkVoronoiMergeTuple2D > vtkMergeTuples2DType
vtkVoronoiCore2D< TCompositor, TClassifier > * VC
bool IsInsideRegion(vtkIdType ptId)
void Initialize(vtkVoronoiClassifier2D *c)
vtkIdType GetNumberOfPoints()
bool IsInsideRegion(vtkIdType ptId)
vtkVoronoiBatchManager Batcher
Controls processing of batches of generating points.
TCompositor Compositor
The compositor enables this vtkVoronoiCore2D templated class to be used in different applications...
vtkVoronoiSpokesType LocalSpokes
const vtkVoronoiSpoke * AddAdjacencyInformation(vtkVoronoiTile &tile, vtkVoronoiWheelsType &wheels, vtkVoronoiSpokesType &spokes, int &numSpokes, int &maxPoints)
========================================================================= The templated, core Voronoi class.
void Initialize(vtkEmptyVoronoi2DCompositor *)
Implementation note about the compositor.
bool IsSameRegion(vtkIdType ptId, vtkIdType neiId)
vtkVoronoiCore2D(vtkAlgorithm *filter, vtkVoronoiBatchManager &batcher, vtkStaticPointLocator2D *loc, vtkPoints *inPts, double padding, vtkIdType maxClips, bool validate, double pruneTol, TCompositor *comp, TClassifier *c)
Constructor.
int GetNumberOfPrunes()
Obtain information about the execution of the Voronoi algorithm.
Functor class used to topologically merge (nearly) coincident points.
vtkVoronoiAdjacencyGraph Graph
This is used to create the spokes and wheels adjacency graph used to validate the tessellation and pr...
void operator()(vtkIdType batchId, vtkIdType endBatchId)
Core vtkSMPTools methods to process tiles in parallel, and produce thread local output data...
std::vector< vtkIdType > vtkVoronoiWheelsType
std::vector< vtkIdType > vtkMergeMapType
When merging points, the merge map is a vector that maps global tile/hull vertex ids (which contain d...
The convex polygon tile class proper.
vtkIdType GetNumberOfMergedPoints()
Methods related to merging coincident points.
Superclass for all sources, filters, and sinks in VTK.
Typedefs and classes in support of the adjacency graph.
vtkBatchIdsType LocalBatches
The following thread local data is used to process and keep track of information on a per-thread basi...
void operator()(vtkIdType threadId, vtkIdType endThreadId)
vtkIdType GetNumberOfPoints()
Convenience methods to retrieve the number of input points, and the raw double* points array...
const vtkVoronoiSpoke * AddAdjacencyInformation(vtkVoronoiTile &tile, vtkVoronoiWheelsType &wheels, vtkVoronoiSpokesType &spokes, int &numSpokes, int &maxPoints)
vtkIdType GetGeneratorPointId()
Obtain information about the generated tile.
vtkEmptyVoronoi2DClassifier(const int *regions)
void Initialize()
Core vtkSMPTools methods to process tiles in parallel, and produce thread local output data...
ThreadMapType< TCompositor, TClassifier > ThreadMap
vtkAnnularBinIterator BIter
The adjacency graph, a collection of wheels and spokes, is a topological construct that connects Voro...
vtkEmptyVoronoi2DClassifier()
void Initialize(vtkEmptyVoronoi2DClassifier *c)
vtkVoronoiCore2D< TCompositor, TClassifier > * VC
vtkVoronoi2DLocalData< TCompositor, TClassifier > * GetThreadData(int threadNum)
Access the local thread data produced by execution of the filter.
Thread local data may be needed.
static std::unique_ptr< TopologicalMerge > Execute(vtkVoronoiCore2D< TCompositor, TClassifier > *vc)
vtkVoronoiClassifier2D(const int *regions)
void Reduce()
Core vtkSMPTools methods to process tiles in parallel, and produce thread local output data...
vtkAlgorithm * Filter
Used for controlling filter abort and accessing filter information.
TCompositor::LocalData Compositor
Represent an array of vtkDist2Tuples.
TClassifier Classifier
This templated class is used to extend the API of this vtkVoronoiCore2D class, to implement the spoke...
void AddData(vtkVoronoiTile &, int numSpokes, const vtkVoronoiSpoke *)
std::vector< vtkVoronoiSpoke > vtkVoronoiSpokesType
The vtkVoronoiWheelsType vector is used to keep track of the number of spokes (and equivalently...
int GetNumberOfThreads()
Access the local thread data produced by execution of the filter.
Class to manage batches of points.
bool IsSameRegion(vtkIdType ptId, vtkIdType neiId)
These are convenience/demonstration classes for configuring the templated 2D Voronoi classes...
const double * GetPoints()
Produce the global adjacency graph / wheels and spokes data structure.
TopologicalMerge(vtkVoronoiCore2D< TCompositor, TClassifier > *vc)
std::vector< vtkVoronoi2DLocalData< TCompositor, TClassifier > * > ThreadMapType
The thread map keeps track of the thread local data across all computing threads. ...
static void Execute(vtkVoronoiCore2D< TCompositor, TClassifier > *vc)
represent and manipulate 3D points
ProduceWheelsAndSpokes(vtkVoronoiCore2D< TCompositor, TClassifier > *vc)
A fast, lightweight class for iterating over the bins of a 2D vtkStaticPointLocator2D.
quickly locate points in 2-space
vtkVoronoiAdjacencyGraph & GetAdjacencyGraph()
Obtain the adjacency graph (wheel & spokes data structure).