VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
28 
29 #include "vtkContourValues.h" // Needed for inline methods
30 
31 VTK_ABI_NAMESPACE_BEGIN
33 
34 class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkBinCellDataFilter : public vtkDataSetAlgorithm
35 {
36 public:
38 
43  static vtkBinCellDataFilter* New();
44 
46 
50  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
54 
57  void SetValue(int i, double value);
58  double GetValue(int i);
59  double* GetValues();
60  void GetValues(double* binValues);
61  void SetNumberOfBins(int numBins);
62  vtkIdType GetNumberOfBins();
63  void GenerateValues(int numBins, double range[2]);
64  void GenerateValues(int numBins, double rangeStart, double rangeEnd);
66 
68 
74  void SetSourceData(vtkDataObject* source);
75  vtkDataObject* GetSource();
77 
84  void SetSourceConnection(vtkAlgorithmOutput* algOutput);
85 
87 
97  vtkSetMacro(SpatialMatch, vtkTypeBool);
98  vtkGetMacro(SpatialMatch, vtkTypeBool);
99  vtkBooleanMacro(SpatialMatch, vtkTypeBool);
101 
103 
107  vtkSetMacro(StoreNumberOfNonzeroBins, bool);
108  vtkBooleanMacro(StoreNumberOfNonzeroBins, bool);
109  vtkGetMacro(StoreNumberOfNonzeroBins, bool);
111 
113 
118  vtkSetStringMacro(NumberOfNonzeroBinsArrayName);
119  vtkGetStringMacro(NumberOfNonzeroBinsArrayName);
121 
123 
128  vtkSetMacro(Tolerance, double);
129  vtkGetMacro(Tolerance, double);
131 
133 
138  vtkSetMacro(ComputeTolerance, bool);
139  vtkBooleanMacro(ComputeTolerance, bool);
140  vtkGetMacro(ComputeTolerance, bool);
142 
144 
147  vtkSetMacro(ArrayComponent, int);
148  vtkGetMacro(ArrayComponent, int);
150 
152  {
153  CELL_CENTROID = 0,
154  CELL_POINTS = 1,
155  };
156 
158 
163  vtkSetClampMacro(CellOverlapMethod, int, CELL_CENTROID, CELL_POINTS);
164  vtkGetMacro(CellOverlapMethod, int);
166 
168 
172  virtual void SetCellLocator(vtkAbstractCellLocator* cellLocator);
173  vtkGetObjectMacro(CellLocator, vtkAbstractCellLocator);
175 
176 protected:
178  ~vtkBinCellDataFilter() override;
179 
181 
183  double Tolerance;
187 
188  vtkBinValues* BinValues;
190  virtual void CreateDefaultLocator();
191 
195 
197 
198 private:
200  void operator=(const vtkBinCellDataFilter&) = delete;
201 };
202 
207 inline void vtkBinCellDataFilter::SetValue(int i, double value)
208 {
209  this->BinValues->SetValue(i, value);
210 }
211 
215 inline double vtkBinCellDataFilter::GetValue(int i)
216 {
217  return this->BinValues->GetValue(i);
218 }
219 
225 {
226  return this->BinValues->GetValues();
227 }
228 
234 inline void vtkBinCellDataFilter::GetValues(double* binValues)
235 {
236  this->BinValues->GetValues(binValues);
237 }
238 
245 {
246  this->BinValues->SetNumberOfContours(number);
247 }
248 
254 {
255  return this->BinValues->GetNumberOfContours();
256 }
257 
262 inline void vtkBinCellDataFilter::GenerateValues(int numBins, double range[2])
263 {
264  this->BinValues->GenerateValues(numBins, range);
265 }
266 
271 inline void vtkBinCellDataFilter::GenerateValues(int numBins, double rangeStart, double rangeEnd)
272 {
273  this->BinValues->GenerateValues(numBins, rangeStart, rangeEnd);
274 }
275 
276 VTK_ABI_NAMESPACE_END
277 #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:363
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.
#define VTK_MARSHALAUTO
Superclass for algorithms that produce output of the same type as input.
general representation of visualization data
Definition: vtkDataObject.h:55
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.