VTK  9.7.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
33 #include "vtkNew.h" //For vtkNew
35 
36 VTK_ABI_NAMESPACE_BEGIN
37 class vtkDataSet;
38 class vtkDoubleArray;
39 class vtkIdList;
40 class vtkImageData;
41 class vtkPointSet;
42 class vtkTetra;
43 
44 class VTKFILTERSVERDICT_EXPORT vtkCellSizeFilter : public vtkPassInputTypeAlgorithm
45 {
46 public:
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49  static vtkCellSizeFilter* New();
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 
120 protected:
122  ~vtkCellSizeFilter() override;
123 
124  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
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 
160 private:
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 
177 VTK_ABI_NAMESPACE_END
178 #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:56
concrete class for storing a set of points
Definition: vtkPointSet.h:58
dynamic, self-adjusting array of double
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:33
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
list of point or cell ids
Definition: vtkIdList.h:25
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:55
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()