VTK  9.1.0
vtkCellSizeFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCellSizeFilter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
38 #ifndef vtkCellSizeFilter_h
39 #define vtkCellSizeFilter_h
40 
41 #include "vtkFiltersVerdictModule.h" // For export macro
43 
44 class vtkDataSet;
45 class vtkDoubleArray;
46 class vtkIdList;
47 class vtkImageData;
48 class vtkPointSet;
49 
50 class VTKFILTERSVERDICT_EXPORT vtkCellSizeFilter : public vtkPassInputTypeAlgorithm
51 {
52 public:
54  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
58 
63  vtkSetMacro(ComputeVertexCount, bool);
64  vtkGetMacro(ComputeVertexCount, bool);
65  vtkBooleanMacro(ComputeVertexCount, bool);
67 
69 
74  vtkSetMacro(ComputeLength, bool);
75  vtkGetMacro(ComputeLength, bool);
76  vtkBooleanMacro(ComputeLength, bool);
78 
80 
85  vtkSetMacro(ComputeArea, bool);
86  vtkGetMacro(ComputeArea, bool);
87  vtkBooleanMacro(ComputeArea, bool);
89 
91 
96  vtkSetMacro(ComputeVolume, bool);
97  vtkGetMacro(ComputeVolume, bool);
98  vtkBooleanMacro(ComputeVolume, bool);
100 
102 
106  vtkSetMacro(ComputeSum, bool);
107  vtkGetMacro(ComputeSum, bool);
108  vtkBooleanMacro(ComputeSum, bool);
110 
112 
116  vtkSetStringMacro(VertexCountArrayName);
117  vtkGetStringMacro(VertexCountArrayName);
118  vtkSetStringMacro(LengthArrayName);
119  vtkGetStringMacro(LengthArrayName);
120  vtkSetStringMacro(AreaArrayName);
121  vtkGetStringMacro(AreaArrayName);
122  vtkSetStringMacro(VolumeArrayName);
123  vtkGetStringMacro(VolumeArrayName);
125 
126 protected:
128  ~vtkCellSizeFilter() override;
129 
130  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
131  vtkInformationVector* outputVector) override;
132  bool ComputeDataSet(vtkDataSet* input, vtkDataSet* output, double sum[4]);
133 
134  void IntegrateImageData(vtkImageData* input, vtkImageData* output, double sum[4]);
135  void ExecuteBlock(vtkDataSet* input, vtkDataSet* output, double sum[4]);
136 
138 
142  double IntegratePolyLine(vtkDataSet* input, vtkIdList* cellPtIds);
143  double IntegratePolygon(vtkPointSet* input, vtkIdList* cellPtIds);
144  double IntegrateTriangleStrip(vtkPointSet* input, vtkIdList* cellPtIds);
145  double IntegratePixel(vtkDataSet* input, vtkIdList* cellPtIds);
146  double IntegrateVoxel(vtkDataSet* input, vtkIdList* cellPtIds);
147  double IntegrateGeneral1DCell(vtkDataSet* input, vtkIdList* cellPtIds);
148  double IntegrateGeneral2DCell(vtkPointSet* input, vtkIdList* cellPtIds);
149  double IntegrateGeneral3DCell(vtkPointSet* input, vtkIdList* cellPtIds);
151 
153 
156  void AddSumFieldData(vtkDataObject*, double sum[4]);
158 
160 
163  virtual void ComputeGlobalSum(double sum[4]) { (void)sum; }
165 
166 private:
167  vtkCellSizeFilter(const vtkCellSizeFilter&) = delete;
168  void operator=(const vtkCellSizeFilter&) = delete;
169 
170  bool ComputeVertexCount;
171  bool ComputeLength;
172  bool ComputeArea;
173  bool ComputeVolume;
174  bool ComputeSum;
175 
176  char* VertexCountArrayName;
177  char* LengthArrayName;
178  char* AreaArrayName;
179  char* VolumeArrayName;
180 };
181 
182 #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.
double IntegratePolygon(vtkPointSet *input, vtkIdList *cellPtIds)
Specify whether to sum the computed sizes and put the result in a field data array.
static vtkCellSizeFilter * New()
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
Definition: vtkDataObject.h:60
abstract class to specify dataset behavior
Definition: vtkDataSet.h:57
dynamic, self-adjusting array of double
list of point or cell ids
Definition: vtkIdList.h:31
topologically and geometrically regular array of data
Definition: vtkImageData.h:48
a simple class to control print indentation
Definition: vtkIndent.h:34
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:67