19 #ifndef vtkVoronoiCore_h
20 #define vtkVoronoiCore_h
31 VTK_ABI_NAMESPACE_BEGIN
74 , Classification(classification)
107 , LocalSpokes(nullptr)
116 this->NumSpokes = numSpokes = (this->Wheels[
id + 1] - this->Wheels[id]);
118 ((size_t)this->Wheels[
id] < this->Spokes.size() ? &(this->Spokes[this->Wheels[id]])
146 int& numRegionBoundaryFaces,
int& numForwardFaces);
193 : X{ x[0], x[1], x[2] }
229 std::array<vtkIdType, 4>
Ids;
243 : Ids{ p0, p1, p2, ptId }
245 std::sort(this->Ids.data(), this->Ids.data() + this->Ids.size());
267 std::array<vtkIdType, 3>
Ids;
281 : Ids{ p0, p1, ptId }
283 std::sort(this->Ids.data(), this->Ids.data() + this->Ids.size());
361 , BatchSize(batchSize)
363 this->NumBatches =
static_cast<vtkIdType>(ceil(static_cast<double>(num) / batchSize));
370 endId = (endId > this->Num ? this->Num : endId);
371 return (endId - startId);
406 this->CheckAbortInterval = std::min((end - start) / 10 + 1, (
vtkIdType)1000);
411 if (this->Filter && this->IsFirst && !(
id % this->CheckAbortInterval))
425 std::uniform_int_distribution<int>
Dist;
436 std::uniform_real_distribution<double>
Dist;
439 this->Dist.param(
typename decltype(this->Dist)::param_type(0.0, 1.0));
466 double cosphi = 1 - 2 * sequence.
Next();
467 double sinphi = sqrt(1 - cosphi * cosphi);
468 double rho = radius * pow(sequence.
Next(), 0.33333333);
469 double R = rho * sinphi;
471 xOut[0] = xIn[0] + R * cos(theta);
472 xOut[1] = xIn[1] + R * sin(theta);
473 xOut[2] = xIn[2] + rho * cosphi;
485 double R = radius * sequence.
Next();
487 xOut[0] = xIn[0] + R * cos(theta);
488 xOut[1] = xIn[1] + R * sin(theta);
501 double R = radius * sequence.
Next();
503 xOut[0] = xIn[0] + R * cos(theta);
505 xOut[2] = xIn[2] + R * sin(theta);
517 double R = radius * sequence.
Next();
520 xOut[1] = xIn[1] + R * cos(theta);
521 xOut[2] = xIn[2] + R * sin(theta);
537 int iMax = (std::fabs(vecIn[0]) > std::fabs(vecIn[1]) ? 0 : 1);
538 iMax = (std::fabs(vecIn[iMax]) > std::fabs(vecIn[2]) ? iMax : 2);
539 perp[(iMax + 1) % 3] = 1.0;
540 perp[(iMax + 2) % 3] = 0.0;
541 perp[iMax] = -(vecIn[(iMax + 1) % 3] / vecIn[iMax]);
552 double x = radius * cos(t);
553 double y = radius * sin(t);
556 vecOut[0] = vecIn[0] + x * perp[0] + y * cross[0];
557 vecOut[1] = vecIn[1] + x * perp[1] + y * cross[1];
558 vecOut[2] = vecIn[2] + x * perp[2] + y * cross[2];
563 VTK_ABI_NAMESPACE_END
564 #include "vtkVoronoiCore.txx"
unsigned char Classification
Threaded perform validity checking.
virtual void SetNumberOfTuples(vtkIdType numTuples)
Set the number of tuples (a component group) in the array.
bool operator<(const vtkVoronoiTopoCoord2D &tuple) const
Operator< used to support a subsequent sort operation of the n-tuples (used for uniquely identifying ...
vtkIdType GetNumberOfWheels()
std::vector< vtkIdType > vtkBatchIdsType
Keep track of batches of generating points.
Convenience class to check and interrupt processing aborts during threaded processing.
vtkVoronoiTopoCoord2D(vtkIdType p0, vtkIdType p1, vtkIdType ptId)
Define with the N+1 point generators: the N generators producing the hull vertex, plus the current po...
std::vector< vtkVoronoiMergeTuple2D > vtkMergeTuples2DType
std::uniform_real_distribution< double > Dist
vtkVoronoiHullVertex(const double x[3])
vtkVoronoiSpokesType & Spokes
vtkVoronoiAbortCheck(vtkIdType start, vtkIdType end, vtkAlgorithm *filter)
vtkVoronoiTopoCoord2D()
Various flavors of constructors.
std::array< vtkIdType, 4 > Ids
Points defining a topological coord tuple / Delaunay simplex.
vtkVoronoiSpoke * Initialize(vtkIdType id, int &numSpokes)
vtkVoronoiSpokesType & GetSpokes()
vtkVoronoiSpokesType Spokes
static void JoggleNormal(double vecIn[3], double vecOut[3], double theta, vtkVoronoiRandom01Range &sequence)
vtkVoronoiTopoCoord3D()
Various flavors of constructors.
vtkVoronoiWheelsType & Wheels
std::vector< vtkVoronoiTopoCoord2D > vtkVoronoiTopoCoords2DType
vtkVoronoiAdjacencyGraph & Graph
static constexpr double Pi()
A mathematical constant.
Merge tuples contain an additional point id, which is the global id of a tile/hull point...
vtkIdType GetNumberOfBatches() const
vtkVoronoiTileVertex(double x, double y)
vtkVoronoiTopoCoord2D(const vtkVoronoiTopoCoord2D &tt)
Copy constructor assumes that tuple ids are already sorted.
vtkVoronoiHullVertex(double x, double y, double z)
vtkVoronoiRandom01Range()
Define hull/tile vertex types.
void DeepCopy(vtkAbstractArray *aa) override
Deep copy of 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...
std::vector< vtkVoronoiTileVertex > vtkVoronoiTileVertexType
std::vector< vtkVoronoiTopoCoord3D > vtkVoronoiTopoCoords3DType
vtkVoronoiSpoke * LocalSpokes
vtkVoronoiSpokesType::iterator vtkVoronoiSpokesIterator
void operator()(vtkIdType wheelId, vtkIdType endWheelId)
vtkVoronoiTopoCoord3D(const vtkVoronoiTopoCoord3D &tt)
Copy constructor assumes that tuple ids are already sorted.
vtkVoronoiTopoCoord3D(vtkIdType p0, vtkIdType p1, vtkIdType p2, vtkIdType ptId)
Define with the N+1 point generators: the N generators producing the hull vertex, plus the current po...
vtkVoronoiBatchManager(vtkIdType num, vtkIdType batchSize)
Superclass for all sources, filters, and sinks in VTK.
std::vector< vtkIdType > vtkVoronoiCellConnType
Convenience type for representing cell connectivity during compositing.
vtkIdType GetBatchItemRange(vtkIdType batchNum, vtkIdType &startId, vtkIdType &endId) const
bool IsSpoke(vtkIdType pt0, vtkIdType pt1)
std::uniform_int_distribution< int > Dist
bool operator()(vtkIdType id)
Typedefs and classes in support of the adjacency graph.
vtkVoronoiWheelsType Wheels
std::vector< vtkVoronoiHullVertex > vtkVoronoiHullVertexType
A topological coordinate of dimension N are the N+1 ids of neighboring N+1 Voronoi generator points w...
abstract superclass for arrays of numeric data
static void JoggleXZ(double xIn[3], double xOut[3], double radius, vtkVoronoiRandom01Range &sequence)
vtkSMPThreadLocal< vtkIdType > ThreadNumInvalid
void Initialize(vtkIdType numWheels, vtkIdType numSpokes)
static void JoggleXYZ(double xIn[3], double xOut[3], double radius, vtkVoronoiRandom01Range &sequence)
bool CheckAbort()
Checks to see if this filter should abort.
The adjacency graph, a collection of wheels and spokes, is a topological construct that connects Voro...
static void JoggleYZ(double xIn[3], double xOut[3], double radius, vtkVoronoiRandom01Range &sequence)
static void JoggleXY(double xIn[3], double xOut[3], double radius, vtkVoronoiRandom01Range &sequence)
vtkIdType GetNumberOfTuples() const
Get the number of complete tuples (a component group) in the array.
vtkSmartPointer< vtkIntArray > ConvertRegionLabels(vtkDataArray *inScalars)
static float Normalize(float v[3])
Normalize (in place) a 3-vector.
ClipIntersectionStatus
Classes, structs, and typedefs in support of Voronoi processing.
bool Validate()
Return true if the graph meets the conditions necessary to form a valid Voronoi tessellation.
vtkIdType GetNumberOfSpokes()
static void Cross(VectorT1 &&a, VectorT2 &&b, VectorT3 &c)
Cross product of two 3-vectors.
bool operator!=(const vtkVoronoiMergeTuple3D &mt) const
std::vector< vtkVoronoiMergeTuple3D > vtkMergeTuples3DType
vtkSpokeClassification
Classification for Voronoi spokes (and associated faces).
vtkVoronoiTileVertex(const double x[2])
std::vector< vtkVoronoiSpoke > vtkVoronoiSpokesType
The vtkVoronoiWheelsType vector is used to keep track of the number of spokes (and equivalently...
vtkVoronoiWheel(vtkVoronoiWheelsType &wheels, vtkVoronoiSpokesType &spokes)
static void CountFaces(const vtkVoronoiSpoke *spokes, int numSpokes, int &numDomainBoundaryFaces, int &numRegionBoundaryFaces, int &numForwardFaces)
vtkVoronoiWheelsType & GetWheels()
Class to manage batches of points.
std::array< vtkIdType, 3 > Ids
Points defining a topological coord tuple / Delaunay simplex.
vtkIdType GetWheelOffset(vtkIdType ptId)
vtkVoronoiSpoke(vtkIdType neiId, unsigned char classification)
std::vector< vtkIdType > vtkMergeTupleOffsets
Global tile/hull vertices, with duplicates, that are assigned a global id (if point merging is perfor...
bool operator!=(const vtkVoronoiMergeTuple2D &mt) const
vtkIdType CheckAbortInterval
ValidateAdjacencyGraph(vtkVoronoiAdjacencyGraph &graph)
bool operator<(const vtkVoronoiTopoCoord3D &tuple) const
Operator< used to support a subsequent sort operation of the n-tuples (used for uniquely identifying ...
virtual bool GetAbortOutput()
Set/Get an internal variable used to communicate between the algorithm and executive.