VTK  9.7.1
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
35 #ifndef vtkUnstructuredGridToCellGrid_h
36 #define vtkUnstructuredGridToCellGrid_h
37 
39 
40 #include "vtkCellGrid.h" // for API + ivars
41 #include "vtkFiltersCellGridModule.h" // For export macro
42 #include "vtkNew.h" // for ivar
43 #include "vtkStringToken.h" // for API + ivars
44 #include "vtkUnstructuredGridFieldAnnotations.h" // for API + ivars
45 
46 #include <map>
47 #include <unordered_map>
48 #include <unordered_set>
49 #include <vector>
50 
51 VTK_ABI_NAMESPACE_BEGIN
52 
53 class vtkDataArray;
57 
58 class VTKFILTERSCELLGRID_EXPORT vtkUnstructuredGridToCellGrid
60 {
61 public:
64  void PrintSelf(ostream& os, vtkIndent indent) override;
65 
66  virtual void Reset();
67  virtual void AddPreferredOutputType(
68  int inputCellType, vtkStringToken preferredOutputType, int priority);
69 
76  {
77  public:
79  static TranscribeQuery* New();
80 
81  bool Initialize() override;
82  bool Finalize() override;
83 
88  bool SumOutputCounts();
89 
91  void AddCellAttributes(vtkDataSetAttributes* attributes);
92 
103  struct Claim
104  {
105  Claim() = default;
106  Claim(const Claim&) = default;
107  Claim& operator=(const Claim&) = default;
108  Claim(vtkIdType numberOfCells, int priority, vtkStringToken cellType)
109  : NumberOfCells(numberOfCells)
110  , CellTypePriority(priority)
111  , CellType(cellType)
112  {
113  }
114 
115  vtkIdType NumberOfCells{ 0 };
116  int CellTypePriority{ 0 };
118  };
119 
121  int Phase{ 0 };
123  vtkUnstructuredGrid* Input{ nullptr };
125  vtkCellGrid* Output{ nullptr };
127  unsigned int FlatIndex{ 0 };
129  vtkDataArray* Coordinates{ nullptr };
131  std::map<int, Claim> CellTypeMap;
133  std::unordered_map<vtkStringToken, vtkIdType> OutputAllocations;
134 
137 
140 
143 
146 
147  protected:
148  TranscribeQuery() = default;
149  ~TranscribeQuery() override = default;
150 
151  private:
152  TranscribeQuery(const TranscribeQuery&) = delete;
153  void operator=(const TranscribeQuery&) = delete;
154  };
155 
156 protected:
158  ~vtkUnstructuredGridToCellGrid() override = default;
159 
160  int FillInputPortInformation(int port, vtkInformation* info) override;
161 
162  int RequestData(
163  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* ouInfo) override;
164 
167  void AddAnnotatedAttributes(vtkPartitionedDataSetCollection* input);
168 
170  virtual bool ProcessUnstructuredGrid(vtkUnstructuredGrid* input, vtkCellGrid* output);
171 
173 
174 private:
176  void operator=(const vtkUnstructuredGridToCellGrid&) = delete;
177 };
178 
179 VTK_ABI_NAMESPACE_END
180 #endif // vtkUnstructuredGridToCellGrid_h
181 // VTK-HeaderTest-Exclude: vtkUnstructuredGridToCellGrid.h
A claim on input vtkCell types registered by an output vtkCellMetadata subclass.
Perform an operation on cells in a vtkCellMetadata instance.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkNew< vtkUnstructuredGridFieldAnnotations > Annotations
Container for field annotations capture from the input unstructured grid.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Methods for subclasses to override to handle different pipeline requests.
void ProcessUnstructuredGrid(vtkDataSet *input, vtkUnstructuredGrid *output, double constant[3], int mirrorDir[3], int mirrorSymmetricTensorDir[6], int mirrorTensorDir[9], bool copyInput, bool reflectAllInputArrays, vtkAlgorithm *algorithm)
Generate the reflection of the input dataset as an unstructured grid.
int vtkIdType
Definition: vtkType.h:363
Gloms of multiple field names that represent vectors or tensors.
Visualization data composed of cells of arbitrary type.
Definition: vtkCellGrid.h:48
Configuration hints for a partitioned dataset collection entry.
std::unordered_map< vtkStringToken, vtkIdType > OutputAllocations
A map from output cell type-token to output count.
a simple class to control print indentation
Definition: vtkIndent.h:28
dataset represents arbitrary combinations of all possible cell types
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
Superclass for algorithms that produce vtkPartitionedDataSetCollectionAlgorithm.
represent and manipulate attribute data in a dataset
Represent a string by its integer hash.
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
Create a cell-grid that approximates a collection of vtkUnstructuredGrids.
std::map< int, Claim > CellTypeMap
A map from input cell type to counts and the output cell type (if any).
An internal query object for transcribing cells from input to output.
Composite dataset that groups datasets as a collection.
Claim(vtkIdType numberOfCells, int priority, vtkStringToken cellType)