VTK  9.3.20240327
vtkBivariateLinearTableThreshold.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2009 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
24 #ifndef vtkBivariateLinearTableThreshold_h
25 #define vtkBivariateLinearTableThreshold_h
26 
27 #include "vtkFiltersStatisticsModule.h" // For export macro
28 #include "vtkSmartPointer.h" //Required for smart pointer internal ivars
29 #include "vtkTableAlgorithm.h"
30 
31 VTK_ABI_NAMESPACE_BEGIN
33 class vtkDoubleArray;
34 class vtkIdTypeArray;
35 class vtkTable;
36 
37 class VTKFILTERSSTATISTICS_EXPORT vtkBivariateLinearTableThreshold : public vtkTableAlgorithm
38 {
39 public:
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
45 
49  vtkSetMacro(Inclusive, int);
50  vtkGetMacro(Inclusive, int);
52 
57 
62 
67 
72 
76  vtkIdTypeArray* GetSelectedRowIds(int selection = 0);
77 
79  {
80  OUTPUT_ROW_IDS = 0,
81  OUTPUT_ROW_DATA
82  };
84  {
85  BLT_ABOVE = 0,
88  BLT_BETWEEN
89  };
90 
94  void Initialize();
95 
99  void AddLineEquation(double* p1, double* p2);
100 
104  void AddLineEquation(double* p, double slope);
105 
109  void AddLineEquation(double a, double b, double c);
110 
115 
117 
123  vtkGetMacro(LinearThresholdType, int);
124  vtkSetMacro(LinearThresholdType, int);
126  {
127  this->SetLinearThresholdType(vtkBivariateLinearTableThreshold::BLT_ABOVE);
128  }
130  {
131  this->SetLinearThresholdType(vtkBivariateLinearTableThreshold::BLT_BELOW);
132  }
134  {
135  this->SetLinearThresholdType(vtkBivariateLinearTableThreshold::BLT_NEAR);
136  }
138  {
139  this->SetLinearThresholdType(vtkBivariateLinearTableThreshold::BLT_BETWEEN);
140  }
142 
144 
149  vtkSetVector2Macro(ColumnRanges, double);
150  vtkGetVector2Macro(ColumnRanges, double);
152 
154 
157  vtkSetMacro(DistanceThreshold, double);
158  vtkGetMacro(DistanceThreshold, double);
160 
162 
169  vtkSetMacro(UseNormalizedDistance, vtkTypeBool);
170  vtkGetMacro(UseNormalizedDistance, vtkTypeBool);
171  vtkBooleanMacro(UseNormalizedDistance, vtkTypeBool);
173 
177  static void ComputeImplicitLineFunction(double* p1, double* p2, double* abc);
178 
182  static void ComputeImplicitLineFunction(double* p, double slope, double* abc);
183 
184 protected:
187 
188  double ColumnRanges[2];
194 
196  class Internals;
197  Internals* Implementation;
198 
200 
203 
207  virtual int ApplyThreshold(vtkTable* tableToThreshold, vtkIdTypeArray* acceptedIds);
208 
210 
213  int ThresholdAbove(double x, double y);
214 
218  int ThresholdBelow(double x, double y);
219 
223  int ThresholdNear(double x, double y);
224 
228  int ThresholdBetween(double x, double y);
230 
231 private:
233  void operator=(const vtkBivariateLinearTableThreshold&) = delete;
234 };
235 
236 VTK_ABI_NAMESPACE_END
237 #endif
performs line-based thresholding for vtkTable data.
void GetColumnToThreshold(vtkIdType idx, vtkIdType &column, vtkIdType &component)
Return the column number from the input table for the idx'th added column.
void SetLinearThresholdTypeToBelow()
Set the threshold type.
static vtkBivariateLinearTableThreshold * New()
int ThresholdNear(double x, double y)
Determine if x,y is near ONE specified line (not all).
void SetLinearThresholdTypeToBetween()
Set the threshold type.
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
static void ComputeImplicitLineFunction(double *p, double slope, double *abc)
Convert the point-slope line formula to implicit form.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void Initialize()
Reset the columns to threshold, column ranges, etc.
vtkIdTypeArray * GetSelectedRowIds(int selection=0)
Get the output as a table of row ids.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int ThresholdBetween(double x, double y)
Determine if x,y is between ANY TWO of the specified lines.
void ClearLineEquations()
Reset the list of line equations.
void ClearColumnsToThreshold()
Reset the columns to be thresholded.
void AddColumnToThreshold(vtkIdType column, vtkIdType component)
Add a numeric column to the pair of columns to be thresholded.
int ThresholdAbove(double x, double y)
Determine if x,y is above all specified lines.
void AddLineEquation(double *p, double slope)
Add a line for thresholding in point-slope form.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkSmartPointer< vtkDoubleArray > LineEquations
virtual int ApplyThreshold(vtkTable *tableToThreshold, vtkIdTypeArray *acceptedIds)
Apply the current threshold to a vtkTable.
int ThresholdBelow(double x, double y)
Determine if x,y is below all specified lines.
void AddLineEquation(double a, double b, double c)
Add a line for thresholding in implicit form (ax + by + c = 0)
int GetNumberOfColumnsToThreshold()
Return how many columns have been added.
void SetLinearThresholdTypeToNear()
Set the threshold type.
void AddLineEquation(double *p1, double *p2)
Add a line for thresholding from two x,y points.
void SetLinearThresholdTypeToAbove()
Set the threshold type.
static void ComputeImplicitLineFunction(double *p1, double *p2, double *abc)
Convert the two-point line formula to implicit form.
maintain an ordered list of dataarray objects
dynamic, self-adjusting array of double
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only vtkTables as output.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:168
@ component
Definition: vtkX3D.h:175
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
int vtkTypeBool
Definition: vtkABI.h:64
int vtkIdType
Definition: vtkType.h:315