VTK  9.2.5
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 
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 
87 
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:
189 
191 
193  double Tolerance;
197 
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
an abstract base class for locators which find cells
Proxy object to connect input/output ports.
bin source cell data into input cells.
~vtkBinCellDataFilter() override
virtual void SetCellLocator(vtkAbstractCellLocator *cellLocator)
Set/Get a spatial locator for speeding the search process.
void SetSourceData(vtkDataObject *source)
Specify the data set whose cells will be counted.
void SetValue(int i, double value)
Methods to set / get bin values.
vtkAbstractCellLocator * CellLocator
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when each filter in the pipeline decides what portion of its inp...
vtkContourValues vtkBinValues
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for type and printing.
void SetSourceConnection(vtkAlgorithmOutput *algOutput)
Specify the data set whose cells will be counted.
double GetValue(int i)
Get the ith bin value.
vtkDataObject * GetSource()
Specify the data set whose cells will be counted.
static vtkBinCellDataFilter * New()
Construct object with initial range (VTK_DOUBLE_MIN, VTK_DOUBLE_MAX) and a single bin.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
void SetNumberOfBins(int numBins)
Set the number of bins to place into the list.
virtual void CreateDefaultLocator()
vtkIdType GetNumberOfBins()
Get the number of bins in the list of bin values, not counting the overflow bin.
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks for Information.
double * GetValues()
Get a pointer to an array of bin values.
void GenerateValues(int numBins, double range[2])
Generate numBins equally spaced bin values between specified range.
helper object to manage setting and generating contour values
int GetNumberOfContours()
Return the number of contours in the.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
void SetValue(int i, double value)
Set the ith contour value.
double GetValue(int i)
Get the ith contour value.
double * GetValues()
Return a pointer to a list of contour values.
general representation of visualization data
Superclass for algorithms that produce output of the same type as input.
a simple class to control print indentation
Definition: vtkIndent.h:119
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
@ value
Definition: vtkX3D.h:226
@ range
Definition: vtkX3D.h:244
int vtkTypeBool
Definition: vtkABI.h:69
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
int vtkIdType
Definition: vtkType.h:332