VTK  9.3.20240419
vtkExtractCells.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 
56 #ifndef vtkExtractCells_h
57 #define vtkExtractCells_h
58 
59 #include "vtkFiltersCoreModule.h" // For export macro
60 #include "vtkSmartPointer.h" // For vtkSmartPointer
62 
63 VTK_ABI_NAMESPACE_BEGIN
64 class vtkIdList;
65 class vtkExtractCellsIdList;
66 
67 class VTKFILTERSCORE_EXPORT vtkExtractCells : public vtkUnstructuredGridAlgorithm
68 {
69 public:
71 
75  void PrintSelf(ostream& os, vtkIndent indent) override;
76  static vtkExtractCells* New();
78 
85 
91 
97 
99 
102  void SetCellIds(const vtkIdType* ptr, vtkIdType numValues);
103  void AddCellIds(const vtkIdType* ptr, vtkIdType numValues);
105 
107 
113  vtkSetMacro(ExtractAllCells, bool);
114  vtkGetMacro(ExtractAllCells, bool);
115  vtkBooleanMacro(ExtractAllCells, bool);
117 
119 
124  vtkSetMacro(AssumeSortedAndUniqueIds, bool);
125  vtkGetMacro(AssumeSortedAndUniqueIds, bool);
126  vtkBooleanMacro(AssumeSortedAndUniqueIds, bool);
128 
130 
135  vtkSetMacro(PassThroughCellIds, bool);
136  vtkGetMacro(PassThroughCellIds, bool);
137  vtkBooleanMacro(PassThroughCellIds, bool);
139 
141 
146  vtkSetMacro(OutputPointsPrecision, int);
147  vtkGetMacro(OutputPointsPrecision, int);
149 
151 
159  vtkSetClampMacro(BatchSize, unsigned int, 1, VTK_INT_MAX);
160  vtkGetMacro(BatchSize, unsigned int);
162 protected:
164  ~vtkExtractCells() override;
165 
168  bool Copy(vtkDataSet* input, vtkUnstructuredGrid* output);
169 
171  bool ExtractAllCells = false;
172  bool AssumeSortedAndUniqueIds = false;
173  bool PassThroughCellIds = true;
174  int OutputPointsPrecision = DEFAULT_PRECISION;
175  unsigned int BatchSize = 1000;
176 
177 private:
178  vtkExtractCells(const vtkExtractCells&) = delete;
179  void operator=(const vtkExtractCells&) = delete;
180 };
181 
182 VTK_ABI_NAMESPACE_END
183 #endif
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
subset a vtkDataSet to create a vtkUnstructuredGrid
void SetCellIds(const vtkIdType *ptr, vtkIdType numValues)
Another way to provide ids using a pointer to vtkIdType array.
void SetCellList(vtkIdList *l)
Set the list of cell IDs that the output vtkUnstructuredGrid will be composed of.
~vtkExtractCells() override
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for construction, type info, and printing.
vtkSmartPointer< vtkExtractCellsIdList > CellList
void AddCellList(vtkIdList *l)
Add the supplied list of cell IDs to those that will be included in the output vtkUnstructuredGrid.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void AddCellIds(const vtkIdType *ptr, vtkIdType numValues)
Another way to provide ids using a pointer to vtkIdType array.
static vtkExtractCells * New()
Standard methods for construction, type info, and printing.
void AddCellRange(vtkIdType from, vtkIdType to)
Add this range of cell IDs to those that will be included in the output vtkUnstructuredGrid.
bool Copy(vtkDataSet *input, vtkUnstructuredGrid *output)
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
list of point or cell ids
Definition: vtkIdList.h:133
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only unstructured grid as output.
dataset represents arbitrary combinations of all possible cell types
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
int vtkIdType
Definition: vtkType.h:315
#define VTK_INT_MAX
Definition: vtkType.h:144