VTK  9.5.20250911
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
33#include "vtkNew.h" //For vtkNew
35
36VTK_ABI_NAMESPACE_BEGIN
37class vtkDataSet;
38class vtkDoubleArray;
39class vtkIdList;
40class vtkImageData;
41class vtkPointSet;
42class vtkTetra;
43
44class VTKFILTERSVERDICT_EXPORT vtkCellSizeFilter : public vtkPassInputTypeAlgorithm
45{
46public:
48 void PrintSelf(ostream& os, vtkIndent indent) override;
50
52
57 vtkSetMacro(ComputeVertexCount, bool);
58 vtkGetMacro(ComputeVertexCount, bool);
59 vtkBooleanMacro(ComputeVertexCount, bool);
61
63
68 vtkSetMacro(ComputeLength, bool);
69 vtkGetMacro(ComputeLength, bool);
70 vtkBooleanMacro(ComputeLength, bool);
72
74
79 vtkSetMacro(ComputeArea, bool);
80 vtkGetMacro(ComputeArea, bool);
81 vtkBooleanMacro(ComputeArea, bool);
83
85
90 vtkSetMacro(ComputeVolume, bool);
91 vtkGetMacro(ComputeVolume, bool);
92 vtkBooleanMacro(ComputeVolume, bool);
94
96
100 vtkSetMacro(ComputeSum, bool);
101 vtkGetMacro(ComputeSum, bool);
102 vtkBooleanMacro(ComputeSum, bool);
104
106
110 vtkSetStringMacro(VertexCountArrayName);
111 vtkGetStringMacro(VertexCountArrayName);
112 vtkSetStringMacro(LengthArrayName);
113 vtkGetStringMacro(LengthArrayName);
114 vtkSetStringMacro(AreaArrayName);
115 vtkGetStringMacro(AreaArrayName);
116 vtkSetStringMacro(VolumeArrayName);
117 vtkGetStringMacro(VolumeArrayName);
119
120protected:
123
125 vtkInformationVector* outputVector) override;
126 bool ComputeDataSet(vtkDataSet* input, vtkDataSet* output, double sum[4]);
127
128 void IntegrateImageData(vtkImageData* input, vtkImageData* output, double sum[4]);
129 void ExecuteBlock(vtkDataSet* input, vtkDataSet* output, double sum[4]);
130
132
136 double IntegratePolyLine(vtkDataSet* input, vtkIdList* cellPtIds);
137 double IntegratePolygon(vtkPointSet* input, vtkIdList* cellPtIds);
138 double IntegrateTriangleStrip(vtkPointSet* input, vtkIdList* cellPtIds);
139 double IntegratePixel(vtkDataSet* input, vtkIdList* cellPtIds);
140 double IntegrateVoxel(vtkDataSet* input, vtkIdList* cellPtIds);
141 double IntegrateGeneral1DCell(vtkDataSet* input, vtkIdList* cellPtIds);
142 double IntegrateGeneral2DCell(vtkPointSet* input, vtkIdList* cellPtIds);
143 double IntegrateGeneral3DCell(vtkPointSet* input, vtkIdList* cellPtIds);
145
147
150 void AddSumFieldData(vtkDataObject*, double sum[4]);
152
154
157 virtual void ComputeGlobalSum(double sum[4]) { (void)sum; }
159
160private:
161 vtkCellSizeFilter(const vtkCellSizeFilter&) = delete;
162 void operator=(const vtkCellSizeFilter&) = delete;
163
164 bool ComputeVertexCount;
165 bool ComputeLength;
166 bool ComputeArea;
167 bool ComputeVolume;
168 bool ComputeSum;
169
170 char* VertexCountArrayName;
171 char* LengthArrayName;
172 char* AreaArrayName;
173 char* VolumeArrayName;
174 vtkNew<vtkTetra> LocalTetCell;
175};
176
177VTK_ABI_NAMESPACE_END
178#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:165
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.
Allocate and hold a VTK object.
Definition vtkNew.h:167
Superclass for algorithms that produce output of the same type as input.
concrete class for storing a set of points
Definition vtkPointSet.h:98
a 3D cell that represents a tetrahedron
Definition vtkTetra.h:113