VTK  9.3.1
vtkBinCellDataFilter.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
21 #ifndef vtkBinCellDataFilter_h
22 #define vtkBinCellDataFilter_h
23 
24 #include "vtkDataSetAlgorithm.h"
25 #include "vtkDataSetAttributes.h" // needed for vtkDataSetAttributes::FieldList
26 #include "vtkFiltersCoreModule.h" // For export macro
27 
28 #include "vtkContourValues.h" // Needed for inline methods
29 
30 VTK_ABI_NAMESPACE_BEGIN
32 
33 class VTKFILTERSCORE_EXPORT vtkBinCellDataFilter : public vtkDataSetAlgorithm
34 {
35 public:
37 
42  static vtkBinCellDataFilter* New();
43 
45 
49  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
53 
56  void SetValue(int i, double value);
57  double GetValue(int i);
58  double* GetValues();
59  void GetValues(double* binValues);
60  void SetNumberOfBins(int numBins);
61  vtkIdType GetNumberOfBins();
62  void GenerateValues(int numBins, double range[2]);
63  void GenerateValues(int numBins, double rangeStart, double rangeEnd);
65 
67 
73  void SetSourceData(vtkDataObject* source);
74  vtkDataObject* GetSource();
76 
83  void SetSourceConnection(vtkAlgorithmOutput* algOutput);
84 
86 
96  vtkSetMacro(SpatialMatch, vtkTypeBool);
97  vtkGetMacro(SpatialMatch, vtkTypeBool);
98  vtkBooleanMacro(SpatialMatch, vtkTypeBool);
100 
102 
106  vtkSetMacro(StoreNumberOfNonzeroBins, bool);
107  vtkBooleanMacro(StoreNumberOfNonzeroBins, bool);
108  vtkGetMacro(StoreNumberOfNonzeroBins, bool);
110 
112 
117  vtkSetStringMacro(NumberOfNonzeroBinsArrayName);
118  vtkGetStringMacro(NumberOfNonzeroBinsArrayName);
120 
122 
127  vtkSetMacro(Tolerance, double);
128  vtkGetMacro(Tolerance, double);
130 
132 
137  vtkSetMacro(ComputeTolerance, bool);
138  vtkBooleanMacro(ComputeTolerance, bool);
139  vtkGetMacro(ComputeTolerance, bool);
141 
143 
146  vtkSetMacro(ArrayComponent, int);
147  vtkGetMacro(ArrayComponent, int);
149 
151  {
152  CELL_CENTROID = 0,
153  CELL_POINTS = 1,
154  };
155 
157 
162  vtkSetClampMacro(CellOverlapMethod, int, CELL_CENTROID, CELL_POINTS);
163  vtkGetMacro(CellOverlapMethod, int);
165 
167 
171  virtual void SetCellLocator(vtkAbstractCellLocator* cellLocator);
172  vtkGetObjectMacro(CellLocator, vtkAbstractCellLocator);
174 
175 protected:
177  ~vtkBinCellDataFilter() override;
178 
180 
182  double Tolerance;
186 
187  vtkBinValues* BinValues;
189  virtual void CreateDefaultLocator();
190 
194 
196 
197 private:
199  void operator=(const vtkBinCellDataFilter&) = delete;
200 };
201 
206 inline void vtkBinCellDataFilter::SetValue(int i, double value)
207 {
208  this->BinValues->SetValue(i, value);
209 }
210 
214 inline double vtkBinCellDataFilter::GetValue(int i)
215 {
216  return this->BinValues->GetValue(i);
217 }
218 
224 {
225  return this->BinValues->GetValues();
226 }
227 
233 inline void vtkBinCellDataFilter::GetValues(double* binValues)
234 {
235  this->BinValues->GetValues(binValues);
236 }
237 
244 {
245  this->BinValues->SetNumberOfContours(number);
246 }
247 
253 {
254  return this->BinValues->GetNumberOfContours();
255 }
256 
261 inline void vtkBinCellDataFilter::GenerateValues(int numBins, double range[2])
262 {
263  this->BinValues->GenerateValues(numBins, range);
264 }
265 
270 inline void vtkBinCellDataFilter::GenerateValues(int numBins, double rangeStart, double rangeEnd)
271 {
272  this->BinValues->GenerateValues(numBins, rangeStart, rangeEnd);
273 }
274 
275 VTK_ABI_NAMESPACE_END
276 #endif
helper object to manage setting and generating contour values
Store vtkAlgorithm input/output information.
vtkAbstractCellLocator * CellLocator
an abstract base class for locators which find cells
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
int vtkIdType
Definition: vtkType.h:315
double GetValue(int i)
Get the ith contour value.
Proxy object to connect input/output ports.
int vtkTypeBool
Definition: vtkABI.h:64
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double * GetValues()
Return a pointer to a list of contour values.
bin source cell data into input cells.
double * GetValues()
Get a pointer to an array of bin values.
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkContourValues vtkBinValues
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
double GetValue(int i)
Get the ith bin value.
vtkIdType GetNumberOfBins()
Get the number of bins in the list of bin values, not counting the overflow bin.
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when each filter in the pipeline decides what portion of its inp...
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks for Information.
void GenerateValues(int numBins, double range[2])
Generate numBins equally spaced bin values between specified range.
void SetValue(int i, double value)
Methods to set / get bin values.
Store zero or more vtkInformation instances.
int GetNumberOfContours()
Return the number of contours in the.
Superclass for algorithms that produce output of the same type as input.
general representation of visualization data
Definition: vtkDataObject.h:54
static vtkDataSetAlgorithm * New()
void SetNumberOfBins(int numBins)
Set the number of bins to place into the list.
void SetValue(int i, double value)
Set the ith contour value.
void SetNumberOfContours(int number)
Set the number of contours to place into the list.