VTK  9.7.1
vtkGenerateIds.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
27 #ifndef vtkGenerateIds_h
28 #define vtkGenerateIds_h
29 
30 #include "vtkFiltersCoreModule.h" // For export macro
32 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
33 
34 #include <string>
35 
36 VTK_ABI_NAMESPACE_BEGIN
37 class vtkCellData;
38 class vtkPointData;
39 class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkGenerateIds : public vtkPassInputTypeAlgorithm
40 {
41 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
49  static vtkGenerateIds* New();
50 
52 
58  vtkSetMacro(PointIds, bool);
59  vtkGetMacro(PointIds, bool);
60  vtkBooleanMacro(PointIds, bool);
62 
64 
70  vtkSetMacro(CellIds, bool);
71  vtkGetMacro(CellIds, bool);
72  vtkBooleanMacro(CellIds, bool);
74 
76 
81  vtkSetMacro(FieldData, bool);
82  vtkGetMacro(FieldData, bool);
83  vtkBooleanMacro(FieldData, bool);
85 
87 
93  vtkSetMacro(PointIdsArrayName, std::string);
94  vtkGetMacro(PointIdsArrayName, std::string);
96 
98 
102  vtkSetMacro(CellIdsArrayName, std::string);
103  vtkGetMacro(CellIdsArrayName, std::string);
105 
106 protected:
107  vtkGenerateIds() = default;
108  ~vtkGenerateIds() override = default;
109 
111  int FillInputPortInformation(int port, vtkInformation* info) override;
112 
113 private:
114  vtkGenerateIds(const vtkGenerateIds&) = delete;
115  void operator=(const vtkGenerateIds&) = delete;
116 
120  void GeneratePointIds(vtkPointData* outputPD, vtkIdType numPts);
121 
125  void GenerateCellIds(vtkCellData* outputCD, vtkIdType numCells);
126 
127  bool PointIds = true;
128  bool CellIds = true;
129  bool FieldData = false;
130  std::string PointIdsArrayName = "vtkPointIds";
131  std::string CellIdsArrayName = "vtkCellIds";
132 };
133 
134 VTK_ABI_NAMESPACE_END
135 #endif
represent and manipulate point attribute data
Definition: vtkPointData.h:30
Superclass for algorithms that produce output of the same type as input.
Store vtkAlgorithm input/output information.
represent and manipulate cell attribute data
Definition: vtkCellData.h:31
int vtkIdType
Definition: vtkType.h:363
generate scalars or field data from point and cell ids
a simple class to control print indentation
Definition: vtkIndent.h:28
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.
Store zero or more vtkInformation instances.
#define VTK_MARSHALAUTO
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
static vtkPassInputTypeAlgorithm * New()