VTK  9.7.20260928
vtkUnstructuredGridToCellGrid.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
37#ifndef vtkUnstructuredGridToCellGrid_h
38#define vtkUnstructuredGridToCellGrid_h
39
41
42#include "vtkCellGrid.h" // for API + ivars
43#include "vtkFiltersCellGridModule.h" // For export macro
44#include "vtkNew.h" // for ivar
45#include "vtkStringToken.h" // for API + ivars
46#include "vtkUnstructuredGridFieldAnnotations.h" // for API + ivars
47
48#include <map>
49#include <unordered_map>
50#include <unordered_set>
51#include <vector>
52
53VTK_ABI_NAMESPACE_BEGIN
54
55class vtkDataArray;
59
60class VTKFILTERSCELLGRID_EXPORT vtkUnstructuredGridToCellGrid
62{
63public:
66 void PrintSelf(ostream& os, vtkIndent indent) override;
67
68 virtual void Reset();
70 int inputCellType, vtkStringToken preferredOutputType, int priority);
71
78 {
79 public:
82
83 bool Initialize() override;
84 bool Finalize() override;
85
91
94
105 struct Claim
106 {
107 Claim() = default;
108 Claim(const Claim&) = default;
109 Claim& operator=(const Claim&) = default;
110 Claim(vtkIdType numberOfCells, int priority, vtkStringToken cellType)
111 : NumberOfCells(numberOfCells)
112 , CellTypePriority(priority)
113 , CellType(cellType)
114 {
115 }
116
120 };
121
123 int Phase{ 0 };
127 vtkCellGrid* Output{ nullptr };
129 unsigned int FlatIndex{ 0 };
133 std::map<int, Claim> CellTypeMap;
135 std::unordered_map<vtkStringToken, vtkIdType> OutputAllocations;
136
139
142
145
148
149 protected:
150 TranscribeQuery() = default;
151 ~TranscribeQuery() override = default;
152
153 private:
154 TranscribeQuery(const TranscribeQuery&) = delete;
155 void operator=(const TranscribeQuery&) = delete;
156 };
157
158protected:
160 ~vtkUnstructuredGridToCellGrid() override = default;
161
162 int FillInputPortInformation(int port, vtkInformation* info) override;
163
165 vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* ouInfo) override;
166
170
173
175
176private:
178 void operator=(const vtkUnstructuredGridToCellGrid&) = delete;
179};
180
181VTK_ABI_NAMESPACE_END
182#endif // vtkUnstructuredGridToCellGrid_h
183// VTK-HeaderTest-Exclude: vtkUnstructuredGridToCellGrid.h
vtkCellGridQuery()=default
Visualization data composed of cells of arbitrary type.
Definition vtkCellGrid.h:49
represent and manipulate attribute data in a dataset
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Allocate and hold a VTK object.
Definition vtkNew.h:168
Composite dataset that groups datasets as a collection.
Represent a string by its integer hash.
An internal query object for transcribing cells from input to output.
vtkUnstructuredGrid * Input
The input dataset whose cells should be transcribed.
unsigned int FlatIndex
The flat index of the current Input and Output data objects inside the collection.
bool Finalize() override
Override this if your query-result state requires finalization.
vtkNew< vtkUnstructuredGridFieldAnnotations > Annotations
Container for field annotations capture from the input unstructured grid.
bool SumOutputCounts()
Sum counts of all input cell types that generate the same output cell type.
void AddCellAttributes(vtkDataSetAttributes *attributes)
For each point- or cell-data array from the Input, create an output cell-attribute.
vtkDataArray * Coordinates
The input point-coordinates (3-component) array, which is copied to the output.
int Phase
The phase of the query: 0 → claiming input cells; 1 → transcribing claimed cells.
std::map< int, Claim > CellTypeMap
A map from input cell type to counts and the output cell type (if any).
bool Initialize() override
Override this if your query-result state requires initialization.
vtkUnstructuredGridFieldAnnotations::FieldGlom FieldGlom
Gloms of multiple field names that represent vectors or tensors.
vtkUnstructuredGridFieldAnnotations::BlockAttributesKey BlockAttributesKey
A key for indexing fields defined on a partitioned dataset collection entry.
std::unordered_map< vtkStringToken, vtkIdType > OutputAllocations
A map from output cell type-token to output count.
vtkUnstructuredGridFieldAnnotations::BlockAttributesValue BlockAttributesValue
Configuration hints for a partitioned dataset collection entry.
virtual void AddPreferredOutputType(int inputCellType, vtkStringToken preferredOutputType, int priority)
void AddAnnotatedAttributes(vtkPartitionedDataSetCollection *input)
Look for IOSS (or other) annotations that aggregate arrays and add cell-attributes for them (marking ...
~vtkUnstructuredGridToCellGrid() override=default
virtual bool ProcessUnstructuredGrid(vtkUnstructuredGrid *input, vtkCellGrid *output)
Transcribe a single unstructured grid from the input collection.
int RequestData(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *ouInfo) override
Methods for subclasses to override to handle different pipeline requests.
static vtkUnstructuredGridToCellGrid * New()
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
dataset represents arbitrary combinations of all possible cell types
Configuration hints for a partitioned dataset collection entry.
Gloms of multiple field names that represent vectors or tensors.
Claim(vtkIdType numberOfCells, int priority, vtkStringToken cellType)
#define vtkDataArray
int vtkIdType
Definition vtkType.h:363