VTK  9.7.1
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 
27 #ifndef vtkExtractCells_h
28 #define vtkExtractCells_h
29 
30 #include "vtkFiltersCoreModule.h" // For export macro
31 #include "vtkSmartPointer.h" // For vtkSmartPointer
33 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
34 
35 VTK_ABI_NAMESPACE_BEGIN
36 class vtkIdList;
37 class vtkExtractCellsIdList;
38 
39 class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkExtractCells : public vtkUnstructuredGridAlgorithm
40 {
41 public:
43 
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48  static vtkExtractCells* New();
50 
56  void SetCellList(vtkIdList* l);
57 
62  void AddCellList(vtkIdList* l);
63 
68  void AddCellRange(vtkIdType from, vtkIdType to);
69 
71 
74  void SetCellIds(const vtkIdType* ptr, vtkIdType numValues);
75  void AddCellIds(const vtkIdType* ptr, vtkIdType numValues);
77 
79 
85  vtkSetMacro(ExtractAllCells, bool);
86  vtkGetMacro(ExtractAllCells, bool);
87  vtkBooleanMacro(ExtractAllCells, bool);
89 
91 
96  vtkSetMacro(AssumeSortedAndUniqueIds, bool);
97  vtkGetMacro(AssumeSortedAndUniqueIds, bool);
98  vtkBooleanMacro(AssumeSortedAndUniqueIds, bool);
100 
102 
107  vtkSetMacro(PassThroughCellIds, bool);
108  vtkGetMacro(PassThroughCellIds, bool);
109  vtkBooleanMacro(PassThroughCellIds, bool);
111 
113 
118  vtkSetMacro(OutputPointsPrecision, int);
119  vtkGetMacro(OutputPointsPrecision, int);
121 
123 
131  vtkSetClampMacro(BatchSize, unsigned int, 1, VTK_INT_MAX);
132  vtkGetMacro(BatchSize, unsigned int);
134 protected:
135  vtkExtractCells();
136  ~vtkExtractCells() override;
137 
139  int FillInputPortInformation(int port, vtkInformation* info) override;
140  bool Copy(vtkDataSet* input, vtkUnstructuredGrid* output);
141 
143  bool ExtractAllCells = false;
144  bool AssumeSortedAndUniqueIds = false;
145  bool PassThroughCellIds = true;
146  int OutputPointsPrecision = DEFAULT_PRECISION;
147  unsigned int BatchSize = 1000;
148 
149 private:
150  vtkExtractCells(const vtkExtractCells&) = delete;
151  void operator=(const vtkExtractCells&) = delete;
152 };
153 
154 VTK_ABI_NAMESPACE_END
155 #endif
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
#define VTK_INT_MAX
Definition: vtkType.h:192
static vtkUnstructuredGridAlgorithm * New()
vtkSmartPointer< vtkExtractCellsIdList > CellList
int vtkIdType
Definition: vtkType.h:363
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.
a simple class to control print indentation
Definition: vtkIndent.h:28
list of point or cell ids
Definition: vtkIdList.h:25
dataset represents arbitrary combinations of all possible cell types
Superclass for algorithms that produce only unstructured grid as output.
Store zero or more vtkInformation instances.
#define VTK_MARSHALAUTO
subset a vtkDataSet to create a vtkUnstructuredGrid