VTK  9.2.6
vtkBinCellDataFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBinCellDataFilter.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 =========================================================================*/
33 #ifndef vtkBinCellDataFilter_h
34 #define vtkBinCellDataFilter_h
35 
36 #include "vtkDataSetAlgorithm.h"
37 #include "vtkDataSetAttributes.h" // needed for vtkDataSetAttributes::FieldList
38 #include "vtkFiltersCoreModule.h" // For export macro
39 
40 #include "vtkContourValues.h" // Needed for inline methods
41 
43 
44 class VTKFILTERSCORE_EXPORT vtkBinCellDataFilter : public vtkDataSetAlgorithm
45 {
46 public:
48 
53  static vtkBinCellDataFilter* New();
54 
56 
60  void PrintSelf(ostream& os, vtkIndent indent) override;
62 
64 
67  void SetValue(int i, double value);
68  double GetValue(int i);
69  double* GetValues();
70  void GetValues(double* binValues);
71  void SetNumberOfBins(int numBins);
72  vtkIdType GetNumberOfBins();
73  void GenerateValues(int numBins, double range[2]);
74  void GenerateValues(int numBins, double rangeStart, double rangeEnd);
76 
78 
84  void SetSourceData(vtkDataObject* source);
85  vtkDataObject* GetSource();
87 
94  void SetSourceConnection(vtkAlgorithmOutput* algOutput);
95 
97 
107  vtkSetMacro(SpatialMatch, vtkTypeBool);
108  vtkGetMacro(SpatialMatch, vtkTypeBool);
109  vtkBooleanMacro(SpatialMatch, vtkTypeBool);
111 
113 
117  vtkSetMacro(StoreNumberOfNonzeroBins, bool);
118  vtkBooleanMacro(StoreNumberOfNonzeroBins, bool);
119  vtkGetMacro(StoreNumberOfNonzeroBins, bool);
121 
123 
128  vtkSetStringMacro(NumberOfNonzeroBinsArrayName);
129  vtkGetStringMacro(NumberOfNonzeroBinsArrayName);
131 
133 
138  vtkSetMacro(Tolerance, double);
139  vtkGetMacro(Tolerance, double);
141 
143 
148  vtkSetMacro(ComputeTolerance, bool);
149  vtkBooleanMacro(ComputeTolerance, bool);
150  vtkGetMacro(ComputeTolerance, bool);
152 
154 
157  vtkSetMacro(ArrayComponent, int);
158  vtkGetMacro(ArrayComponent, int);
160 
162  {
163  CELL_CENTROID = 0,
164  CELL_POINTS = 1,
165  };
166 
168 
173  vtkSetClampMacro(CellOverlapMethod, int, CELL_CENTROID, CELL_POINTS);
174  vtkGetMacro(CellOverlapMethod, int);
176 
178 
182  virtual void SetCellLocator(vtkAbstractCellLocator* cellLocator);
183  vtkGetObjectMacro(CellLocator, vtkAbstractCellLocator);
185 
186 protected:
188  ~vtkBinCellDataFilter() override;
189 
191 
193  double Tolerance;
197 
198  vtkBinValues* BinValues;
200  virtual void CreateDefaultLocator();
201 
205 
207 
208 private:
210  void operator=(const vtkBinCellDataFilter&) = delete;
211 };
212 
217 inline void vtkBinCellDataFilter::SetValue(int i, double value)
218 {
219  this->BinValues->SetValue(i, value);
220 }
221 
225 inline double vtkBinCellDataFilter::GetValue(int i)
226 {
227  return this->BinValues->GetValue(i);
228 }
229 
235 {
236  return this->BinValues->GetValues();
237 }
238 
244 inline void vtkBinCellDataFilter::GetValues(double* binValues)
245 {
246  this->BinValues->GetValues(binValues);
247 }
248 
255 {
256  this->BinValues->SetNumberOfContours(number);
257 }
258 
264 {
265  return this->BinValues->GetNumberOfContours();
266 }
267 
272 inline void vtkBinCellDataFilter::GenerateValues(int numBins, double range[2])
273 {
274  this->BinValues->GenerateValues(numBins, range);
275 }
276 
281 inline void vtkBinCellDataFilter::GenerateValues(int numBins, double rangeStart, double rangeEnd)
282 {
283  this->BinValues->GenerateValues(numBins, rangeStart, rangeEnd);
284 }
285 
286 #endif
helper object to manage setting and generating contour values
Store vtkAlgorithm input/output information.
vtkAbstractCellLocator * CellLocator
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
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:332
double GetValue(int i)
Get the ith contour value.
Proxy object to connect input/output ports.
int vtkTypeBool
Definition: vtkABI.h:69
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:39
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:65
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.