VTK-m  2.1
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
vtkm::filter::entity_extraction::Threshold Class Reference

Extracts cells that satisfy a threshold criterion. More...

#include <Threshold.h>

Inheritance diagram for vtkm::filter::entity_extraction::Threshold:
vtkm::filter::Filter

Public Member Functions

void SetLowerThreshold (vtkm::Float64 value)
 Specifies the lower scalar value. More...
 
void SetUpperThreshold (vtkm::Float64 value)
 Specifies the upper scalar value. More...
 
vtkm::Float64 GetLowerThreshold () const
 Specifies the lower scalar value. More...
 
vtkm::Float64 GetUpperThreshold () const
 Specifies the upper scalar value. More...
 
void SetThresholdBelow (vtkm::Float64 value)
 Sets the threshold criterion to pass any value less than or equal to value. More...
 
void SetThresholdAbove (vtkm::Float64 value)
 Sets the threshold criterion to pass any value greater than or equal to value. More...
 
void SetThresholdBetween (vtkm::Float64 value1, vtkm::Float64 value2)
 Set the threshold criterion to pass any value between (inclusive) the given values. More...
 
void SetComponentToTest (vtkm::IdComponent component)
 Specifies that the threshold criteria should be applied to a specific vector component. More...
 
void SetComponentToTestToAny ()
 Specifies that the threshold criteria should be applied to a specific vector component. More...
 
void SetComponentToTestToAll ()
 Specifies that the threshold criteria should be applied to a specific vector component. More...
 
void SetAllInRange (bool value)
 Specify criteria for cells that have some points matching. More...
 
bool GetAllInRange () const
 Specify criteria for cells that have some points matching. More...
 
void SetInvert (bool value)
 Inverts the threshold result. More...
 
bool GetInvert () const
 Inverts the threshold result. More...
 
- Public Member Functions inherited from vtkm::filter::Filter
 Filter ()
 
virtual ~Filter ()
 
vtkm::cont::DataSet Execute (const vtkm::cont::DataSet &input)
 Executes the filter on the input and produces a result dataset. More...
 
vtkm::cont::PartitionedDataSet Execute (const vtkm::cont::PartitionedDataSet &input)
 Executes the filter on the input PartitionedDataSet and produces a result PartitionedDataSet. More...
 
void SetFieldsToPass (const vtkm::filter::FieldSelection &fieldsToPass)
 Specify which fields get passed from input to output. More...
 
void SetFieldsToPass (vtkm::filter::FieldSelection &&fieldsToPass)
 Specify which fields get passed from input to output. More...
 
void SetFieldsToPass (const vtkm::filter::FieldSelection &fieldsToPass, vtkm::filter::FieldSelection::Mode mode)
 
void SetFieldsToPass (std::initializer_list< std::string > fields, vtkm::filter::FieldSelection::Mode mode=vtkm::filter::FieldSelection::Mode::Select)
 Specify which fields get passed from input to output. More...
 
void SetFieldsToPass (std::initializer_list< std::pair< std::string, vtkm::cont::Field::Association >> fields, vtkm::filter::FieldSelection::Mode mode=vtkm::filter::FieldSelection::Mode::Select)
 Specify which fields get passed from input to output. More...
 
void SetFieldsToPass (const std::string &fieldname, vtkm::cont::Field::Association association, vtkm::filter::FieldSelection::Mode mode=vtkm::filter::FieldSelection::Mode::Select)
 Specify which fields get passed from input to output. More...
 
void SetFieldsToPass (const std::string &fieldname, vtkm::filter::FieldSelection::Mode mode)
 Specify which fields get passed from input to output. More...
 
const vtkm::filter::FieldSelectionGetFieldsToPass () const
 Specify which fields get passed from input to output. More...
 
vtkm::filter::FieldSelectionGetFieldsToPass ()
 Specify which fields get passed from input to output. More...
 
void SetPassCoordinateSystems (bool flag)
 Specify whether to always pass coordinate systems. More...
 
bool GetPassCoordinateSystems () const
 Specify whether to always pass coordinate systems. More...
 
void SetOutputFieldName (const std::string &name)
 Specifies the name of the output field generated. More...
 
const std::string & GetOutputFieldName () const
 Specifies the name of the output field generated. More...
 
void SetActiveField (const std::string &name, vtkm::cont::Field::Association association=vtkm::cont::Field::Association::Any)
 Specifies a field to operate on. More...
 
void SetActiveField (vtkm::IdComponent index, const std::string &name, vtkm::cont::Field::Association association=vtkm::cont::Field::Association::Any)
 Specifies a field to operate on. More...
 
const std::string & GetActiveFieldName (vtkm::IdComponent index=0) const
 Specifies a field to operate on. More...
 
vtkm::cont::Field::Association GetActiveFieldAssociation (vtkm::IdComponent index=0) const
 Specifies a field to operate on. More...
 
void SetActiveCoordinateSystem (vtkm::Id coord_idx)
 Specifies the coordinate system index to make active to use when processing the input vtkm::cont::DataSet. More...
 
void SetActiveCoordinateSystem (vtkm::IdComponent index, vtkm::Id coord_idx)
 Specifies the coordinate system index to make active to use when processing the input vtkm::cont::DataSet. More...
 
vtkm::Id GetActiveCoordinateSystemIndex (vtkm::IdComponent index=0) const
 Specifies the coordinate system index to make active to use when processing the input vtkm::cont::DataSet. More...
 
void SetUseCoordinateSystemAsField (bool val)
 Specifies whether to use point coordinates as the input field. More...
 
void SetUseCoordinateSystemAsField (vtkm::IdComponent index, bool val)
 Specifies whether to use point coordinates as the input field. More...
 
bool GetUseCoordinateSystemAsField (vtkm::IdComponent index=0) const
 Specifies whether to use point coordinates as the input field. More...
 
vtkm::IdComponent GetNumberOfActiveFields () const
 Return the number of active fields currently set. More...
 
virtual bool CanThread () const
 Returns whether the filter can execute on partitions in concurrent threads. More...
 
void SetThreadsPerCPU (vtkm::Id numThreads)
 
void SetThreadsPerGPU (vtkm::Id numThreads)
 
vtkm::Id GetThreadsPerCPU () const
 
vtkm::Id GetThreadsPerGPU () const
 
bool GetRunMultiThreadedFilter () const
 
void SetRunMultiThreadedFilter (bool val)
 
void SetInvoker (vtkm::cont::Invoker inv)
 Specify the vtkm::cont::Invoker to be used to execute worklets by this filter instance. More...
 

Private Types

enum  Component { Component::Any, Component::All, Component::Selected }
 

Private Member Functions

vtkm::cont::DataSet DoExecute (const vtkm::cont::DataSet &input) override
 

Private Attributes

double LowerValue = 0
 
double UpperValue = 0
 
Component ComponentMode = Component::Selected
 
vtkm::IdComponent SelectedComponent = 0
 
bool AllInRange = false
 
bool Invert = false
 

Additional Inherited Members

- Protected Member Functions inherited from vtkm::filter::Filter
vtkm::cont::DataSet CreateResult (const vtkm::cont::DataSet &inDataSet) const
 Create the output data set for DoExecute. More...
 
vtkm::cont::DataSet CreateResultField (const vtkm::cont::DataSet &inDataSet, const vtkm::cont::Field &resultField) const
 Create the output data set for DoExecute More...
 
vtkm::cont::DataSet CreateResultField (const vtkm::cont::DataSet &inDataSet, const std::string &resultFieldName, vtkm::cont::Field::Association resultFieldAssociation, const vtkm::cont::UnknownArrayHandle &resultFieldArray) const
 Create the output data set for DoExecute More...
 
vtkm::cont::DataSet CreateResultFieldPoint (const vtkm::cont::DataSet &inDataSet, const std::string &resultFieldName, const vtkm::cont::UnknownArrayHandle &resultFieldArray) const
 Create the output data set for DoExecute More...
 
vtkm::cont::DataSet CreateResultFieldCell (const vtkm::cont::DataSet &inDataSet, const std::string &resultFieldName, const vtkm::cont::UnknownArrayHandle &resultFieldArray) const
 Create the output data set for DoExecute More...
 
vtkm::cont::PartitionedDataSet CreateResult (const vtkm::cont::PartitionedDataSet &input, const vtkm::cont::PartitionedDataSet &resultPartitions) const
 Create the output data set for DoExecute. More...
 
template<typename FieldMapper >
vtkm::cont::PartitionedDataSet CreateResult (const vtkm::cont::PartitionedDataSet &input, const vtkm::cont::PartitionedDataSet &resultPartitions, FieldMapper &&fieldMapper) const
 Create the output data set for DoExecute. More...
 
template<typename FieldMapper >
vtkm::cont::DataSet CreateResult (const vtkm::cont::DataSet &inDataSet, const vtkm::cont::UnknownCellSet &resultCellSet, FieldMapper &&fieldMapper) const
 Create the output data set for DoExecute. More...
 
template<typename FieldMapper >
vtkm::cont::DataSet CreateResultCoordinateSystem (const vtkm::cont::DataSet &inDataSet, const vtkm::cont::UnknownCellSet &resultCellSet, const vtkm::cont::CoordinateSystem &resultCoordSystem, FieldMapper &&fieldMapper) const
 Create the output data set for DoExecute. More...
 
template<typename FieldMapper >
vtkm::cont::DataSet CreateResultCoordinateSystem (const vtkm::cont::DataSet &inDataSet, const vtkm::cont::UnknownCellSet &resultCellSet, const std::string &coordsName, const vtkm::cont::UnknownArrayHandle &coordsData, FieldMapper &&fieldMapper) const
 Create the output data set for DoExecute. More...
 
const vtkm::cont::FieldGetFieldFromDataSet (const vtkm::cont::DataSet &input) const
 Retrieve an input field from a vtkm::cont::DataSet object. More...
 
const vtkm::cont::FieldGetFieldFromDataSet (vtkm::IdComponent index, const vtkm::cont::DataSet &input) const
 Retrieve an input field from a vtkm::cont::DataSet object. More...
 
virtual vtkm::cont::PartitionedDataSet DoExecutePartitions (const vtkm::cont::PartitionedDataSet &inData)
 
template<typename Functor , typename... Args>
void CastAndCallScalarField (const vtkm::cont::UnknownArrayHandle &fieldArray, Functor &&functor, Args &&... args) const
 Convenience method to get the array from a filter's input scalar field. More...
 
template<typename Functor , typename... Args>
void CastAndCallScalarField (const vtkm::cont::Field &field, Functor &&functor, Args &&... args) const
 Convenience method to get the array from a filter's input scalar field. More...
 
template<vtkm::IdComponent VecSize, typename Functor , typename... Args>
void CastAndCallVecField (const vtkm::cont::UnknownArrayHandle &fieldArray, Functor &&functor, Args &&... args) const
 Convenience method to get the array from a filter's input vector field. More...
 
template<vtkm::IdComponent VecSize, typename Functor , typename... Args>
void CastAndCallVecField (const vtkm::cont::Field &field, Functor &&functor, Args &&... args) const
 Convenience method to get the array from a filter's input vector field. More...
 
template<typename Functor , typename... Args>
void CastAndCallVariableVecField (const vtkm::cont::UnknownArrayHandle &fieldArray, Functor &&functor, Args &&... args) const
 This method is like CastAndCallVecField except that it can be used for a field of unknown vector size (or scalars). More...
 
template<typename Functor , typename... Args>
void CastAndCallVariableVecField (const vtkm::cont::Field &field, Functor &&functor, Args &&... args) const
 This method is like CastAndCallVecField except that it can be used for a field of unknown vector size (or scalars). More...
 
- Protected Attributes inherited from vtkm::filter::Filter
vtkm::cont::Invoker Invoke
 

Detailed Description

Extracts cells that satisfy a threshold criterion.

Extracts all cells from any dataset type that satisfy a threshold criterion. The output of this filter stores its connectivity in a vtkm::cont::CellSetExplicit<> regardless of the input dataset type or which cells are passed.

You can threshold either on point or cell fields. If thresholding on point fields, you must specify whether a cell should be kept if some but not all of its incident points meet the criteria.

Although Threshold is primarily designed for scalar fields, there is support for thresholding on 1 or all of the components in a vector field. See the SetComponentToTest(), SetComponentToTestToAny(), and SetComponentToTestToAll() methods for more information.

Use SetActiveField() and related methods to set the field to threshold on.

Member Enumeration Documentation

◆ Component

Enumerator
Any 
All 
Selected 

Member Function Documentation

◆ DoExecute()

vtkm::cont::DataSet vtkm::filter::entity_extraction::Threshold::DoExecute ( const vtkm::cont::DataSet input)
overrideprivatevirtual

Implements vtkm::filter::Filter.

◆ GetAllInRange()

bool vtkm::filter::entity_extraction::Threshold::GetAllInRange ( ) const
inline

Specify criteria for cells that have some points matching.

When thresholding on a point field, each cell must consider the multiple values associated with all incident points. When this flag is false (the default), the cell is passed if any of the incident points matches the threshold criterion. When this flag is true, the cell is passed only if all the incident points match the threshold criterion.

◆ GetInvert()

bool vtkm::filter::entity_extraction::Threshold::GetInvert ( ) const
inline

Inverts the threshold result.

When set to true, the threshold result is inverted. That is, cells that would have been in the output with this option set to false (the default) are excluded while cells that would have been excluded from the output are included.

◆ GetLowerThreshold()

vtkm::Float64 vtkm::filter::entity_extraction::Threshold::GetLowerThreshold ( ) const
inline

Specifies the lower scalar value.

Any cells where the scalar field is less than this value are removed.

◆ GetUpperThreshold()

vtkm::Float64 vtkm::filter::entity_extraction::Threshold::GetUpperThreshold ( ) const
inline

Specifies the upper scalar value.

Any cells where the scalar field is more than this value are removed.

◆ SetAllInRange()

void vtkm::filter::entity_extraction::Threshold::SetAllInRange ( bool  value)
inline

Specify criteria for cells that have some points matching.

When thresholding on a point field, each cell must consider the multiple values associated with all incident points. When this flag is false (the default), the cell is passed if any of the incident points matches the threshold criterion. When this flag is true, the cell is passed only if all the incident points match the threshold criterion.

◆ SetComponentToTest()

void vtkm::filter::entity_extraction::Threshold::SetComponentToTest ( vtkm::IdComponent  component)
inline

Specifies that the threshold criteria should be applied to a specific vector component.

When thresholding on a vector field (which has more than one component per entry), the Threshold filter will by default compare the threshold criterion to the first component of the vector (component index 0). Use this method to change the component to test against.

◆ SetComponentToTestToAll()

void vtkm::filter::entity_extraction::Threshold::SetComponentToTestToAll ( )
inline

Specifies that the threshold criteria should be applied to a specific vector component.

This method sets that the threshold criteria should be applied to all the components of the input vector field and a cell will pass if all the components match.

◆ SetComponentToTestToAny()

void vtkm::filter::entity_extraction::Threshold::SetComponentToTestToAny ( )
inline

Specifies that the threshold criteria should be applied to a specific vector component.

This method sets that the threshold criteria should be applied to all the components of the input vector field and a cell will pass if any the components match.

◆ SetInvert()

void vtkm::filter::entity_extraction::Threshold::SetInvert ( bool  value)
inline

Inverts the threshold result.

When set to true, the threshold result is inverted. That is, cells that would have been in the output with this option set to false (the default) are excluded while cells that would have been excluded from the output are included.

◆ SetLowerThreshold()

void vtkm::filter::entity_extraction::Threshold::SetLowerThreshold ( vtkm::Float64  value)
inline

Specifies the lower scalar value.

Any cells where the scalar field is less than this value are removed.

◆ SetThresholdAbove()

void vtkm::filter::entity_extraction::Threshold::SetThresholdAbove ( vtkm::Float64  value)

Sets the threshold criterion to pass any value greater than or equal to value.

◆ SetThresholdBelow()

void vtkm::filter::entity_extraction::Threshold::SetThresholdBelow ( vtkm::Float64  value)

Sets the threshold criterion to pass any value less than or equal to value.

◆ SetThresholdBetween()

void vtkm::filter::entity_extraction::Threshold::SetThresholdBetween ( vtkm::Float64  value1,
vtkm::Float64  value2 
)

Set the threshold criterion to pass any value between (inclusive) the given values.

This method is equivalent to calling SetLowerThreshold(value1) and SetUpperThreshold(value2).

◆ SetUpperThreshold()

void vtkm::filter::entity_extraction::Threshold::SetUpperThreshold ( vtkm::Float64  value)
inline

Specifies the upper scalar value.

Any cells where the scalar field is more than this value are removed.

Member Data Documentation

◆ AllInRange

bool vtkm::filter::entity_extraction::Threshold::AllInRange = false
private

◆ ComponentMode

Component vtkm::filter::entity_extraction::Threshold::ComponentMode = Component::Selected
private

◆ Invert

bool vtkm::filter::entity_extraction::Threshold::Invert = false
private

◆ LowerValue

double vtkm::filter::entity_extraction::Threshold::LowerValue = 0
private

◆ SelectedComponent

vtkm::IdComponent vtkm::filter::entity_extraction::Threshold::SelectedComponent = 0
private

◆ UpperValue

double vtkm::filter::entity_extraction::Threshold::UpperValue = 0
private

The documentation for this class was generated from the following file: