41#ifndef vtkCellGridToUnstructuredGrid_h
42#define vtkCellGridToUnstructuredGrid_h
46#include "vtkFiltersCellGridModule.h"
52#include <unordered_map>
55VTK_ABI_NAMESPACE_BEGIN
171 constexpr int maxShift = 8 *
static_cast<int>(
sizeof(
vtkIdType)) - 2;
172 unsigned shift =
static_cast<unsigned>(
174 return static_cast<vtkIdType>(1) << shift;
262 void operator=(
const Query&) =
delete;
A function defined over the physical domain of a vtkCellGrid.
vtkCellGridQuery()=default
A query corresponding to this algorithm.
vtkIdType TotalConnectivityIds
std::unordered_map< vtkCellAttribute *, vtkDataArray * > AttributeMap
vtkNew< vtkIdTypeArray > SampleToPoint
The output point each sample was merged into.
ConnectivityWeightType ConnectivityWeights
The reciprocal of every entry in ConnectivityCount.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
std::unordered_map< vtkStringToken, OutputAllocation > OutputAllocations
A map used to allocate space for the unstructured-grid's vtkCellArray.
const OutputAllocations & GetOutputAllocations() const
vtkCellGrid * GetInput() const
Get the request's input cell-grid.
vtkNew< vtkIdTypeArray > CellArrayOffsets
Storage handed to the output vtkCellArray, written by index.
vtkIdType GetSubdivisionCount() const
Return the number of subdivisions along each parametric axis.
bool IsAborted()
Return true if the user has asked the filter to stop.
~Query() override=default
ConnectivityCountType ConnectivityCount
The number of samples merged into each output point.
bool IsAnotherPassRequired() override
Force one pass per PassType through this query.
vtkIdTypeArray * GetSampleToPoint()
Map a sample index to the output point the sample was merged into.
vtkUnstructuredGrid * Output
OutputAllocations & GetOutputAllocations()
Return the data structure used in the CountOutputs pass.
double PointMergeTolerance
The relative distance within which samples merge (see SetPointMergeTolerance()).
friend class vtkCellGridToUnstructuredGrid
OutputAllocations OutputOffsets
Map output cell-typename to input cell-typename to count (offset after the AllocateOutputs pass has r...
vtkDataArray * GetOutputArray(vtkCellAttribute *inputAttribute)
Return an output attribute (or null).
vtkNew< vtkIdTypeArray > CellArrayConnectivity
std::vector< float > ConnectivityWeightType
The reciprocal of the number of samples merged into each output point.
void StartPass() override
Mark the start of a pass through each cell type.
bool Finalize() override
Override this if your query-result state requires finalization.
vtkUnstructuredGrid * GetOutput() const
Get the request's output cell-grid.
vtkCellGridToUnstructuredGrid * Algorithm
The algorithm running this query, used only to poll for an abort.
std::vector< std::atomic< int > > ConnectivityCountType
How many samples were merged into each output point.
PassType
Passes performed by the query.
@ CountOutputs
Responders should insert into GetOutputAllocations().
@ GeneratePointData
Responders should populate point-data.
@ GenerateSamples
Responders should write sample coordinates and their source cell + parameters.
@ GenerateConnectivity
Responders should write output point-ids, connectivity, and cell types.
bool Initialize() override
Override this if your query-result state requires initialization.
vtkNew< vtkDoubleArray > SampleCoordinates
One candidate output point per sample, before coincident ones merge.
vtkDoubleArray * GetSampleCoordinates()
Return the array holding one candidate output point per sample.
ConnectivityWeightType & GetConnectivityWeights()
void MergeSamplesIntoPoints()
Merge coincident samples and allocate the output points they became.
int SubdivisionLevel
How many times each cell is halved per axis (see SetSubdivisionLevel()).
vtkIdType TotalCells
Totals over every cell type, accumulated with the offsets below.
virtual void SetSubdivisionLevel(int level)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual double GetPointMergeTolerance() const
virtual int GetSubdivisionLevel() const
virtual void SetPointMergeTolerance(double tolerance)
static vtkCellGridToUnstructuredGrid * New()
~vtkCellGridToUnstructuredGrid() override=default
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
int RequestData(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *ouInfo) override
This is called by the superclass.
vtkCellGridToUnstructuredGrid()=default
Visualization data composed of cells of arbitrary type.
dynamic, self-adjusting array of double
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Allocate and hold a VTK object.
vtkUnstructuredGridAlgorithm()
dataset represents arbitrary combinations of all possible cell types
A placeholder for space to be occupied in a vtkCellArray.
vtkIdType NumberOfSamples
How many samples the responder will take of its cells and sides.
vtkIdType NumberOfConnectivityIds
The number of point-ids this type contributes to the output connectivity, not counting the per-cell o...
int CellType
A cell type representative of the output.
vtkIdType SampleOffset
Where this type's share of the output begins.