/usr/include/vtk-7.1/vtkThreshold.h is in libvtk7-dev 7.1.1+dfsg1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkThreshold.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkThreshold
* @brief extracts cells where scalar value in cell satisfies threshold criterion
*
* vtkThreshold is a filter that extracts cells from any dataset type that
* satisfy a threshold criterion. A cell satisfies the criterion if the
* scalar value of (every or any) point satisfies the criterion. The
* criterion can take three forms: 1) greater than a particular value; 2)
* less than a particular value; or 3) between two values. The output of this
* filter is an unstructured grid.
*
* Note that scalar values are available from the point and cell attribute
* data. By default, point data is used to obtain scalars, but you can
* control this behavior. See the AttributeMode ivar below.
*
* By default only the first scalar value is used in the decision. Use the ComponentMode
* and SelectedComponent ivars to control this behavior.
*
* @sa
* vtkThresholdPoints vtkThresholdTextureCoords
*/
#ifndef vtkThreshold_h
#define vtkThreshold_h
#include "vtkFiltersCoreModule.h" // For export macro
#include "vtkUnstructuredGridAlgorithm.h"
#define VTK_ATTRIBUTE_MODE_DEFAULT 0
#define VTK_ATTRIBUTE_MODE_USE_POINT_DATA 1
#define VTK_ATTRIBUTE_MODE_USE_CELL_DATA 2
// order / values are important because of the SetClampMacro
#define VTK_COMPONENT_MODE_USE_SELECTED 0
#define VTK_COMPONENT_MODE_USE_ALL 1
#define VTK_COMPONENT_MODE_USE_ANY 2
class vtkDataArray;
class vtkIdList;
class VTKFILTERSCORE_EXPORT vtkThreshold : public vtkUnstructuredGridAlgorithm
{
public:
static vtkThreshold *New();
vtkTypeMacro(vtkThreshold,vtkUnstructuredGridAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
/**
* Criterion is cells whose scalars are less or equal to lower threshold.
*/
void ThresholdByLower(double lower);
/**
* Criterion is cells whose scalars are greater or equal to upper threshold.
*/
void ThresholdByUpper(double upper);
/**
* Criterion is cells whose scalars are between lower and upper thresholds
* (inclusive of the end values).
*/
void ThresholdBetween(double lower, double upper);
//@{
/**
* Get the Upper and Lower thresholds.
*/
vtkGetMacro(UpperThreshold,double);
vtkGetMacro(LowerThreshold,double);
//@}
//@{
/**
* Control how the filter works with scalar point data and cell attribute
* data. By default (AttributeModeToDefault), the filter will use point
* data, and if no point data is available, then cell data is
* used. Alternatively you can explicitly set the filter to use point data
* (AttributeModeToUsePointData) or cell data (AttributeModeToUseCellData).
*/
vtkSetMacro(AttributeMode,int);
vtkGetMacro(AttributeMode,int);
void SetAttributeModeToDefault()
{this->SetAttributeMode(VTK_ATTRIBUTE_MODE_DEFAULT);};
void SetAttributeModeToUsePointData()
{this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_POINT_DATA);};
void SetAttributeModeToUseCellData()
{this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_CELL_DATA);};
const char *GetAttributeModeAsString();
//@}
//@{
/**
* Control how the decision of in / out is made with multi-component data.
* The choices are to use the selected component (specified in the
* SelectedComponent ivar), or to look at all components. When looking at
* all components, the evaluation can pass if all the components satisfy
* the rule (UseAll) or if any satisfy is (UseAny). The default value is
* UseSelected.
*/
vtkSetClampMacro(ComponentMode,int,
VTK_COMPONENT_MODE_USE_SELECTED,
VTK_COMPONENT_MODE_USE_ANY);
vtkGetMacro(ComponentMode,int);
void SetComponentModeToUseSelected()
{this->SetComponentMode(VTK_COMPONENT_MODE_USE_SELECTED);};
void SetComponentModeToUseAll()
{this->SetComponentMode(VTK_COMPONENT_MODE_USE_ALL);};
void SetComponentModeToUseAny()
{this->SetComponentMode(VTK_COMPONENT_MODE_USE_ANY);};
const char *GetComponentModeAsString();
//@}
//@{
/**
* When the component mode is UseSelected, this ivar indicated the selected
* component. The default value is 0.
*/
vtkSetClampMacro(SelectedComponent,int,0,VTK_INT_MAX);
vtkGetMacro(SelectedComponent,int);
//@}
//@{
/**
* If using scalars from point data, all scalars for all points in a cell
* must satisfy the threshold criterion if AllScalars is set. Otherwise,
* just a single scalar value satisfying the threshold criterion enables
* will extract the cell.
*/
vtkSetMacro(AllScalars,int);
vtkGetMacro(AllScalars,int);
vtkBooleanMacro(AllScalars,int);
//@}
//@{
/**
* If this is on (default is off), we will use the continuous interval
* [minimum cell scalar, maxmimum cell scalar] to intersect the threshold bound
* , rather than the set of discrete scalar values from the vertices
* *WARNING*: For higher order cells, the scalar range of the cell is
* not the same as the vertex scalar interval used here, so the
* result will not be accurate.
*/
vtkSetMacro(UseContinuousCellRange,int);
vtkGetMacro(UseContinuousCellRange,int);
vtkBooleanMacro(UseContinuousCellRange,int);
//@}
//@{
/**
* Set the data type of the output points (See the data types defined in
* vtkType.h). The default data type is float.
* These methods are deprecated. Please use the SetOutputPointsPrecision()
* and GetOutputPointsPrecision() methods instead.
*/
void SetPointsDataTypeToDouble() { this->SetPointsDataType( VTK_DOUBLE ); }
void SetPointsDataTypeToFloat() { this->SetPointsDataType( VTK_FLOAT ); }
void SetPointsDataType(int type);
int GetPointsDataType();
//@}
//@{
/**
* Set/get the desired precision for the output types. See the documentation
* for the vtkAlgorithm::DesiredOutputPrecision enum for an explanation of
* the available precision settings.
*/
void SetOutputPointsPrecision(int precision);
int GetOutputPointsPrecision() const;
//@}
protected:
vtkThreshold();
~vtkThreshold() VTK_OVERRIDE;
// Usual data generation method
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
int AllScalars;
double LowerThreshold;
double UpperThreshold;
int AttributeMode;
int ComponentMode;
int SelectedComponent;
int OutputPointsPrecision;
int UseContinuousCellRange;
int (vtkThreshold::*ThresholdFunction)(double s);
int Lower(double s) {return ( s <= this->LowerThreshold ? 1 : 0 );};
int Upper(double s) {return ( s >= this->UpperThreshold ? 1 : 0 );};
int Between(double s) {return ( s >= this->LowerThreshold ?
( s <= this->UpperThreshold ? 1 : 0 ) : 0 );};
int EvaluateComponents( vtkDataArray *scalars, vtkIdType id );
int EvaluateCell( vtkDataArray *scalars, vtkIdList* cellPts, int numCellPts );
int EvaluateCell( vtkDataArray *scalars, int c, vtkIdList* cellPts, int numCellPts );
private:
vtkThreshold(const vtkThreshold&) VTK_DELETE_FUNCTION;
void operator=(const vtkThreshold&) VTK_DELETE_FUNCTION;
};
#endif
|