VTK  9.3.1
vtkCellSizeFilter.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
29 #ifndef vtkCellSizeFilter_h
30 #define vtkCellSizeFilter_h
31 
32 #include "vtkFiltersVerdictModule.h" // For export macro
34 
35 VTK_ABI_NAMESPACE_BEGIN
36 class vtkDataSet;
37 class vtkDoubleArray;
38 class vtkIdList;
39 class vtkImageData;
40 class vtkPointSet;
41 
42 class VTKFILTERSVERDICT_EXPORT vtkCellSizeFilter : public vtkPassInputTypeAlgorithm
43 {
44 public:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47  static vtkCellSizeFilter* New();
48 
50 
55  vtkSetMacro(ComputeVertexCount, bool);
56  vtkGetMacro(ComputeVertexCount, bool);
57  vtkBooleanMacro(ComputeVertexCount, bool);
59 
61 
66  vtkSetMacro(ComputeLength, bool);
67  vtkGetMacro(ComputeLength, bool);
68  vtkBooleanMacro(ComputeLength, bool);
70 
72 
77  vtkSetMacro(ComputeArea, bool);
78  vtkGetMacro(ComputeArea, bool);
79  vtkBooleanMacro(ComputeArea, bool);
81 
83 
88  vtkSetMacro(ComputeVolume, bool);
89  vtkGetMacro(ComputeVolume, bool);
90  vtkBooleanMacro(ComputeVolume, bool);
92 
94 
98  vtkSetMacro(ComputeSum, bool);
99  vtkGetMacro(ComputeSum, bool);
100  vtkBooleanMacro(ComputeSum, bool);
102 
104 
108  vtkSetStringMacro(VertexCountArrayName);
109  vtkGetStringMacro(VertexCountArrayName);
110  vtkSetStringMacro(LengthArrayName);
111  vtkGetStringMacro(LengthArrayName);
112  vtkSetStringMacro(AreaArrayName);
113  vtkGetStringMacro(AreaArrayName);
114  vtkSetStringMacro(VolumeArrayName);
115  vtkGetStringMacro(VolumeArrayName);
117 
118 protected:
120  ~vtkCellSizeFilter() override;
121 
122  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
123  vtkInformationVector* outputVector) override;
124  bool ComputeDataSet(vtkDataSet* input, vtkDataSet* output, double sum[4]);
125 
126  void IntegrateImageData(vtkImageData* input, vtkImageData* output, double sum[4]);
127  void ExecuteBlock(vtkDataSet* input, vtkDataSet* output, double sum[4]);
128 
130 
134  double IntegratePolyLine(vtkDataSet* input, vtkIdList* cellPtIds);
135  double IntegratePolygon(vtkPointSet* input, vtkIdList* cellPtIds);
136  double IntegrateTriangleStrip(vtkPointSet* input, vtkIdList* cellPtIds);
137  double IntegratePixel(vtkDataSet* input, vtkIdList* cellPtIds);
138  double IntegrateVoxel(vtkDataSet* input, vtkIdList* cellPtIds);
139  double IntegrateGeneral1DCell(vtkDataSet* input, vtkIdList* cellPtIds);
140  double IntegrateGeneral2DCell(vtkPointSet* input, vtkIdList* cellPtIds);
141  double IntegrateGeneral3DCell(vtkPointSet* input, vtkIdList* cellPtIds);
143 
145 
148  void AddSumFieldData(vtkDataObject*, double sum[4]);
150 
152 
155  virtual void ComputeGlobalSum(double sum[4]) { (void)sum; }
157 
158 private:
159  vtkCellSizeFilter(const vtkCellSizeFilter&) = delete;
160  void operator=(const vtkCellSizeFilter&) = delete;
161 
162  bool ComputeVertexCount;
163  bool ComputeLength;
164  bool ComputeArea;
165  bool ComputeVolume;
166  bool ComputeSum;
167 
168  char* VertexCountArrayName;
169  char* LengthArrayName;
170  char* AreaArrayName;
171  char* VolumeArrayName;
172 };
173 
174 VTK_ABI_NAMESPACE_END
175 #endif
Computes cell sizes.
Superclass for algorithms that produce output of the same type as input.
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:52
concrete class for storing a set of points
Definition: vtkPointSet.h:58
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
list of point or cell ids
Definition: vtkIdList.h:22
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.
general representation of visualization data
Definition: vtkDataObject.h:54
virtual void ComputeGlobalSum(double sum[4])
Method to compute the global sum information.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
static vtkPassInputTypeAlgorithm * New()