VTK  9.3.20240420
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
35VTK_ABI_NAMESPACE_BEGIN
36class vtkDataSet;
37class vtkDoubleArray;
38class vtkIdList;
39class vtkImageData;
40class vtkPointSet;
41
42class VTKFILTERSVERDICT_EXPORT vtkCellSizeFilter : public vtkPassInputTypeAlgorithm
43{
44public:
46 void PrintSelf(ostream& os, vtkIndent indent) override;
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
118protected:
121
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
158private:
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
174VTK_ABI_NAMESPACE_END
175#endif
Computes cell sizes.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkCellSizeFilter * New()
double IntegratePolygon(vtkPointSet *input, vtkIdList *cellPtIds)
Specify whether to sum the computed sizes and put the result in a field data array.
double IntegrateTriangleStrip(vtkPointSet *input, vtkIdList *cellPtIds)
Specify whether to sum the computed sizes and put the result in a field data array.
double IntegrateVoxel(vtkDataSet *input, vtkIdList *cellPtIds)
Specify whether to sum the computed sizes and put the result in a field data array.
double IntegrateGeneral1DCell(vtkDataSet *input, vtkIdList *cellPtIds)
Specify whether to sum the computed sizes and put the result in a field data array.
void IntegrateImageData(vtkImageData *input, vtkImageData *output, double sum[4])
double IntegratePixel(vtkDataSet *input, vtkIdList *cellPtIds)
Specify whether to sum the computed sizes and put the result in a field data array.
~vtkCellSizeFilter() override
double IntegrateGeneral2DCell(vtkPointSet *input, vtkIdList *cellPtIds)
Specify whether to sum the computed sizes and put the result in a field data array.
double IntegratePolyLine(vtkDataSet *input, vtkIdList *cellPtIds)
Specify whether to sum the computed sizes and put the result in a field data array.
void ExecuteBlock(vtkDataSet *input, vtkDataSet *output, double sum[4])
bool ComputeDataSet(vtkDataSet *input, vtkDataSet *output, double sum[4])
void AddSumFieldData(vtkDataObject *, double sum[4])
Method to add the computed sum to the field data of the data object.
virtual void ComputeGlobalSum(double sum[4])
Method to compute the global sum information.
double IntegrateGeneral3DCell(vtkPointSet *input, vtkIdList *cellPtIds)
Specify whether to sum the computed sizes and put the result in a field data array.
general representation of visualization data
abstract class to specify dataset behavior
Definition vtkDataSet.h:166
dynamic, self-adjusting array of double
list of point or cell ids
Definition vtkIdList.h:133
topologically and geometrically regular array of data
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 output of the same type as input.
concrete class for storing a set of points
Definition vtkPointSet.h:98