VTK  9.3.0
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 
36 #ifndef vtkExtractCells_h
37 #define vtkExtractCells_h
38 
39 #include "vtkFiltersCoreModule.h" // For export macro
40 #include "vtkSmartPointer.h" // For vtkSmartPointer
42 
43 VTK_ABI_NAMESPACE_BEGIN
44 class vtkIdList;
45 class vtkExtractCellsIdList;
46 
47 class VTKFILTERSCORE_EXPORT vtkExtractCells : public vtkUnstructuredGridAlgorithm
48 {
49 public:
51 
55  void PrintSelf(ostream& os, vtkIndent indent) override;
56  static vtkExtractCells* New();
58 
65 
71 
77 
79 
82  void SetCellIds(const vtkIdType* ptr, vtkIdType numValues);
83  void AddCellIds(const vtkIdType* ptr, vtkIdType numValues);
85 
87 
93  vtkSetMacro(ExtractAllCells, bool);
94  vtkGetMacro(ExtractAllCells, bool);
95  vtkBooleanMacro(ExtractAllCells, bool);
97 
99 
104  vtkSetMacro(AssumeSortedAndUniqueIds, bool);
105  vtkGetMacro(AssumeSortedAndUniqueIds, bool);
106  vtkBooleanMacro(AssumeSortedAndUniqueIds, bool);
108 
110 
115  vtkSetMacro(PassThroughCellIds, bool);
116  vtkGetMacro(PassThroughCellIds, bool);
117  vtkBooleanMacro(PassThroughCellIds, bool);
119 
121 
126  vtkSetMacro(OutputPointsPrecision, int);
127  vtkGetMacro(OutputPointsPrecision, int);
129 
131 
139  vtkSetClampMacro(BatchSize, unsigned int, 1, VTK_INT_MAX);
140  vtkGetMacro(BatchSize, unsigned int);
142 protected:
144  ~vtkExtractCells() override;
145 
148  bool Copy(vtkDataSet* input, vtkUnstructuredGrid* output);
149 
151  bool ExtractAllCells = false;
152  bool AssumeSortedAndUniqueIds = false;
153  bool PassThroughCellIds = true;
154  int OutputPointsPrecision = DEFAULT_PRECISION;
155  unsigned int BatchSize = 1000;
156 
157 private:
158  vtkExtractCells(const vtkExtractCells&) = delete;
159  void operator=(const vtkExtractCells&) = delete;
160 };
161 
162 VTK_ABI_NAMESPACE_END
163 #endif
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
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:32
a simple class to control print indentation
Definition: vtkIndent.h:38
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