VTK  9.1.0
vtkBivariateLinearTableThreshold.h
Go to the documentation of this file.
1/*=========================================================================
2
3Program: Visualization Toolkit
4Module: vtkBivariateLinearTableThreshold.h
5
6Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7All rights reserved.
8See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10This software is distributed WITHOUT ANY WARRANTY; without even
11the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15/*-------------------------------------------------------------------------
16 Copyright 2009 Sandia Corporation.
17 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18 the U.S. Government retains certain rights in this software.
19-------------------------------------------------------------------------*/
40#ifndef vtkBivariateLinearTableThreshold_h
41#define vtkBivariateLinearTableThreshold_h
42
43#include "vtkFiltersStatisticsModule.h" // For export macro
44#include "vtkSmartPointer.h" //Required for smart pointer internal ivars
45#include "vtkTableAlgorithm.h"
46
48class vtkDoubleArray;
49class vtkIdTypeArray;
50class vtkTable;
51
52class VTKFILTERSSTATISTICS_EXPORT vtkBivariateLinearTableThreshold : public vtkTableAlgorithm
53{
54public:
57 void PrintSelf(ostream& os, vtkIndent indent) override;
58
60
64 vtkSetMacro(Inclusive, int);
65 vtkGetMacro(Inclusive, int);
67
72
77
82
87
91 vtkIdTypeArray* GetSelectedRowIds(int selection = 0);
92
94 {
95 OUTPUT_ROW_IDS = 0,
96 OUTPUT_ROW_DATA
97 };
99 {
100 BLT_ABOVE = 0,
103 BLT_BETWEEN
104 };
105
110
114 void AddLineEquation(double* p1, double* p2);
115
119 void AddLineEquation(double* p, double slope);
120
124 void AddLineEquation(double a, double b, double c);
125
130
132
138 vtkGetMacro(LinearThresholdType, int);
139 vtkSetMacro(LinearThresholdType, int);
141 {
142 this->SetLinearThresholdType(vtkBivariateLinearTableThreshold::BLT_ABOVE);
143 }
145 {
146 this->SetLinearThresholdType(vtkBivariateLinearTableThreshold::BLT_BELOW);
147 }
149 {
150 this->SetLinearThresholdType(vtkBivariateLinearTableThreshold::BLT_NEAR);
151 }
153 {
154 this->SetLinearThresholdType(vtkBivariateLinearTableThreshold::BLT_BETWEEN);
155 }
157
159
164 vtkSetVector2Macro(ColumnRanges, double);
165 vtkGetVector2Macro(ColumnRanges, double);
167
169
172 vtkSetMacro(DistanceThreshold, double);
173 vtkGetMacro(DistanceThreshold, double);
175
177
184 vtkSetMacro(UseNormalizedDistance, vtkTypeBool);
185 vtkGetMacro(UseNormalizedDistance, vtkTypeBool);
186 vtkBooleanMacro(UseNormalizedDistance, vtkTypeBool);
188
192 static void ComputeImplicitLineFunction(double* p1, double* p2, double* abc);
193
197 static void ComputeImplicitLineFunction(double* p, double slope, double* abc);
198
199protected:
202
203 double ColumnRanges[2];
209
211 class Internals;
212 Internals* Implementation;
213
215
218
222 virtual int ApplyThreshold(vtkTable* tableToThreshold, vtkIdTypeArray* acceptedIds);
223
225
228 int ThresholdAbove(double x, double y);
229
233 int ThresholdBelow(double x, double y);
234
238 int ThresholdNear(double x, double y);
239
243 int ThresholdBetween(double x, double y);
245
246private:
248 void operator=(const vtkBivariateLinearTableThreshold&) = delete;
249};
250
251#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.
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.
vtkIdTypeArray * GetSelectedRowIds(int selection=0)
Get the output as a table of row ids.
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.
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.
static vtkBivariateLinearTableThreshold * New()
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:113
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:172
@ component
Definition: vtkX3D.h:181
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332