Viskores  1.0
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
viskores::filter::Filter Class Referenceabstract

Base class for all filters. More...

#include <Filter.h>

Inheritance diagram for viskores::filter::Filter:
viskores::filter::clean_grid::CleanGrid viskores::filter::connected_components::CellSetConnectivity viskores::filter::connected_components::ImageConnectivity viskores::filter::contour::AbstractContour viskores::filter::contour::ClipWithField viskores::filter::contour::ClipWithImplicitFunction viskores::filter::contour::MIRFilter viskores::filter::density_estimate::ContinuousScatterPlot viskores::filter::density_estimate::Entropy viskores::filter::density_estimate::Histogram viskores::filter::density_estimate::NDEntropy viskores::filter::density_estimate::NDHistogram viskores::filter::density_estimate::ParticleDensityBase viskores::filter::density_estimate::Statistics viskores::filter::entity_extraction::ExternalFaces viskores::filter::entity_extraction::ExtractGeometry viskores::filter::entity_extraction::ExtractPoints viskores::filter::entity_extraction::ExtractStructured viskores::filter::entity_extraction::GhostCellRemove viskores::filter::entity_extraction::Mask viskores::filter::entity_extraction::MaskPoints viskores::filter::entity_extraction::Threshold viskores::filter::entity_extraction::ThresholdPoints viskores::filter::field_conversion::CellAverage viskores::filter::field_conversion::PointAverage viskores::filter::field_transform::CompositeVectors viskores::filter::field_transform::CylindricalCoordinateTransform viskores::filter::field_transform::FieldToColors viskores::filter::field_transform::GenerateIds viskores::filter::field_transform::LogValues viskores::filter::field_transform::PointElevation viskores::filter::field_transform::PointTransform viskores::filter::field_transform::SphericalCoordinateTransform viskores::filter::field_transform::Warp viskores::filter::FilterField viskores::filter::flow::FilterParticleAdvection viskores::filter::flow::Lagrangian viskores::filter::flow::LagrangianStructures viskores::filter::flow::StreamSurface viskores::filter::geometry_refinement::ConvertToPointCloud viskores::filter::geometry_refinement::Shrink viskores::filter::geometry_refinement::SplitSharpEdges viskores::filter::geometry_refinement::Tetrahedralize viskores::filter::geometry_refinement::Triangulate viskores::filter::geometry_refinement::Tube viskores::filter::geometry_refinement::VertexClustering viskores::filter::image_processing::ComputeMoments viskores::filter::image_processing::ImageDifference viskores::filter::image_processing::ImageMedian viskores::filter::mesh_info::CellMeasures viskores::filter::mesh_info::GhostCellClassify viskores::filter::mesh_info::MeshQuality viskores::filter::mesh_info::MeshQualityArea viskores::filter::mesh_info::MeshQualityAspectGamma viskores::filter::mesh_info::MeshQualityAspectRatio viskores::filter::mesh_info::MeshQualityCondition viskores::filter::mesh_info::MeshQualityDiagonalRatio viskores::filter::mesh_info::MeshQualityDimension viskores::filter::mesh_info::MeshQualityJacobian viskores::filter::mesh_info::MeshQualityMaxAngle viskores::filter::mesh_info::MeshQualityMaxDiagonal viskores::filter::mesh_info::MeshQualityMinAngle viskores::filter::mesh_info::MeshQualityMinDiagonal viskores::filter::mesh_info::MeshQualityOddy viskores::filter::mesh_info::MeshQualityRelativeSizeSquared viskores::filter::mesh_info::MeshQualityScaledJacobian viskores::filter::mesh_info::MeshQualityShape viskores::filter::mesh_info::MeshQualityShapeAndSize viskores::filter::mesh_info::MeshQualityShear viskores::filter::mesh_info::MeshQualitySkew viskores::filter::mesh_info::MeshQualityStretch viskores::filter::mesh_info::MeshQualityTaper viskores::filter::mesh_info::MeshQualityVolume viskores::filter::mesh_info::MeshQualityWarpage viskores::filter::multi_block::AmrArrays viskores::filter::multi_block::MergeDataSets viskores::filter::resampling::HistSampling viskores::filter::resampling::Probe viskores::filter::scalar_topology::ContourTreeAugmented viskores::filter::scalar_topology::ContourTreeMesh2D viskores::filter::scalar_topology::ContourTreeMesh3D viskores::filter::scalar_topology::ContourTreeUniformDistributed viskores::filter::scalar_topology::DistributedBranchDecompositionFilter viskores::filter::scalar_topology::ExtractTopVolumeContoursFilter viskores::filter::scalar_topology::SelectTopVolumeBranchesFilter viskores::filter::uncertainty::ContourUncertainUniform viskores::filter::uncertainty::ContourUncertainUniformMonteCarlo viskores::filter::vector_analysis::CrossProduct viskores::filter::vector_analysis::DotProduct viskores::filter::vector_analysis::Gradient viskores::filter::vector_analysis::SurfaceNormals viskores::filter::vector_analysis::VectorMagnitude viskores::filter::zfp::ZFPCompressor1D viskores::filter::zfp::ZFPCompressor2D viskores::filter::zfp::ZFPCompressor3D viskores::filter::zfp::ZFPDecompressor1D viskores::filter::zfp::ZFPDecompressor2D viskores::filter::zfp::ZFPDecompressor3D

Classes

struct  ScalarToVec
 

Public Member Functions

 Filter ()
 
virtual ~Filter ()
 
viskores::cont::DataSet Execute (const viskores::cont::DataSet &input)
 Executes the filter on the input and produces a result dataset. More...
 
viskores::cont::PartitionedDataSet Execute (const viskores::cont::PartitionedDataSet &input)
 Executes the filter on the input PartitionedDataSet and produces a result PartitionedDataSet. More...
 
void SetFieldsToPass (const viskores::filter::FieldSelection &fieldsToPass)
 Specify which fields get passed from input to output. More...
 
void SetFieldsToPass (viskores::filter::FieldSelection &&fieldsToPass)
 Specify which fields get passed from input to output. More...
 
void SetFieldsToPass (const viskores::filter::FieldSelection &fieldsToPass, viskores::filter::FieldSelection::Mode mode)
 
void SetFieldsToPass (std::initializer_list< std::string > fields, viskores::filter::FieldSelection::Mode mode=viskores::filter::FieldSelection::Mode::Select)
 Specify which fields get passed from input to output. More...
 
void SetFieldsToPass (std::initializer_list< std::pair< std::string, viskores::cont::Field::Association >> fields, viskores::filter::FieldSelection::Mode mode=viskores::filter::FieldSelection::Mode::Select)
 Specify which fields get passed from input to output. More...
 
void SetFieldsToPass (const std::string &fieldname, viskores::cont::Field::Association association, viskores::filter::FieldSelection::Mode mode=viskores::filter::FieldSelection::Mode::Select)
 Specify which fields get passed from input to output. More...
 
void SetFieldsToPass (const std::string &fieldname, viskores::filter::FieldSelection::Mode mode)
 Specify which fields get passed from input to output. More...
 
const viskores::filter::FieldSelectionGetFieldsToPass () const
 Specify which fields get passed from input to output. More...
 
viskores::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, viskores::cont::Field::Association association=viskores::cont::Field::Association::Any)
 Specifies a field to operate on. More...
 
void SetActiveField (viskores::IdComponent index, const std::string &name, viskores::cont::Field::Association association=viskores::cont::Field::Association::Any)
 Specifies a field to operate on. More...
 
const std::string & GetActiveFieldName (viskores::IdComponent index=0) const
 Specifies a field to operate on. More...
 
viskores::cont::Field::Association GetActiveFieldAssociation (viskores::IdComponent index=0) const
 Specifies a field to operate on. More...
 
void SetActiveCoordinateSystem (viskores::Id coord_idx)
 Specifies the coordinate system index to make active to use when processing the input viskores::cont::DataSet. More...
 
void SetActiveCoordinateSystem (viskores::IdComponent index, viskores::Id coord_idx)
 Specifies the coordinate system index to make active to use when processing the input viskores::cont::DataSet. More...
 
viskores::Id GetActiveCoordinateSystemIndex (viskores::IdComponent index=0) const
 Specifies the coordinate system index to make active to use when processing the input viskores::cont::DataSet. More...
 
void SetUseCoordinateSystemAsField (bool val)
 Specifies whether to use point coordinates as the input field. More...
 
void SetUseCoordinateSystemAsField (viskores::IdComponent index, bool val)
 Specifies whether to use point coordinates as the input field. More...
 
bool GetUseCoordinateSystemAsField (viskores::IdComponent index=0) const
 Specifies whether to use point coordinates as the input field. More...
 
viskores::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 (viskores::Id numThreads)
 
void SetThreadsPerGPU (viskores::Id numThreads)
 
viskores::Id GetThreadsPerCPU () const
 
viskores::Id GetThreadsPerGPU () const
 
bool GetRunMultiThreadedFilter () const
 
void SetRunMultiThreadedFilter (bool val)
 
void SetInvoker (viskores::cont::Invoker inv)
 Specify the viskores::cont::Invoker to be used to execute worklets by this filter instance. More...
 

Protected Member Functions

viskores::cont::DataSet CreateResult (const viskores::cont::DataSet &inDataSet) const
 Create the output data set for DoExecute. More...
 
viskores::cont::DataSet CreateResultField (const viskores::cont::DataSet &inDataSet, const viskores::cont::Field &resultField) const
 Create the output data set for DoExecute More...
 
viskores::cont::DataSet CreateResultField (const viskores::cont::DataSet &inDataSet, const std::string &resultFieldName, viskores::cont::Field::Association resultFieldAssociation, const viskores::cont::UnknownArrayHandle &resultFieldArray) const
 Create the output data set for DoExecute More...
 
viskores::cont::DataSet CreateResultFieldPoint (const viskores::cont::DataSet &inDataSet, const std::string &resultFieldName, const viskores::cont::UnknownArrayHandle &resultFieldArray) const
 Create the output data set for DoExecute More...
 
viskores::cont::DataSet CreateResultFieldCell (const viskores::cont::DataSet &inDataSet, const std::string &resultFieldName, const viskores::cont::UnknownArrayHandle &resultFieldArray) const
 Create the output data set for DoExecute More...
 
viskores::cont::PartitionedDataSet CreateResult (const viskores::cont::PartitionedDataSet &input, const viskores::cont::PartitionedDataSet &resultPartitions) const
 Create the output data set for DoExecute. More...
 
template<typename FieldMapper >
viskores::cont::PartitionedDataSet CreateResult (const viskores::cont::PartitionedDataSet &input, const viskores::cont::PartitionedDataSet &resultPartitions, FieldMapper &&fieldMapper) const
 Create the output data set for DoExecute. More...
 
template<typename FieldMapper >
viskores::cont::DataSet CreateResult (const viskores::cont::DataSet &inDataSet, const viskores::cont::UnknownCellSet &resultCellSet, FieldMapper &&fieldMapper) const
 Create the output data set for DoExecute. More...
 
template<typename FieldMapper >
viskores::cont::DataSet CreateResultCoordinateSystem (const viskores::cont::DataSet &inDataSet, const viskores::cont::UnknownCellSet &resultCellSet, const viskores::cont::CoordinateSystem &resultCoordSystem, FieldMapper &&fieldMapper) const
 Create the output data set for DoExecute. More...
 
template<typename FieldMapper >
viskores::cont::DataSet CreateResultCoordinateSystem (const viskores::cont::DataSet &inDataSet, const viskores::cont::UnknownCellSet &resultCellSet, const std::string &coordsName, const viskores::cont::UnknownArrayHandle &coordsData, FieldMapper &&fieldMapper) const
 Create the output data set for DoExecute. More...
 
const viskores::cont::FieldGetFieldFromDataSet (const viskores::cont::DataSet &input) const
 Retrieve an input field from a viskores::cont::DataSet object. More...
 
const viskores::cont::FieldGetFieldFromDataSet (viskores::IdComponent index, const viskores::cont::DataSet &input) const
 Retrieve an input field from a viskores::cont::DataSet object. More...
 
virtual viskores::cont::DataSet DoExecute (const viskores::cont::DataSet &inData)=0
 
virtual viskores::cont::PartitionedDataSet DoExecutePartitions (const viskores::cont::PartitionedDataSet &inData)
 
template<typename Functor , typename... Args>
void CastAndCallScalarField (const viskores::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 viskores::cont::Field &field, Functor &&functor, Args &&... args) const
 Convenience method to get the array from a filter's input scalar field. More...
 
template<viskores::IdComponent VecSize, typename Functor , typename... Args>
void CastAndCallVecField (const viskores::cont::UnknownArrayHandle &fieldArray, Functor &&functor, Args &&... args) const
 Convenience method to get the array from a filter's input vector field. More...
 
template<viskores::IdComponent VecSize, typename Functor , typename... Args>
void CastAndCallVecField (const viskores::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 viskores::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 viskores::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

viskores::cont::Invoker Invoke
 

Private Member Functions

template<typename FieldMapper >
void MapFieldsOntoOutput (const viskores::cont::DataSet &input, const viskores::filter::FieldSelection &fieldSelection, viskores::cont::DataSet &output, FieldMapper &&fieldMapper) const
 
template<typename FieldMapper >
void MapFieldsOntoOutput (const viskores::cont::PartitionedDataSet &input, const viskores::filter::FieldSelection &fieldSelection, viskores::cont::PartitionedDataSet &output, FieldMapper &&fieldMapper) const
 
virtual viskores::Id DetermineNumberOfThreads (const viskores::cont::PartitionedDataSet &input)
 
void ResizeIfNeeded (size_t index_st)
 

Private Attributes

viskores::filter::FieldSelection FieldsToPass = viskores::filter::FieldSelection::Mode::All
 
bool PassCoordinateSystems = true
 
bool RunFilterWithMultipleThreads = false
 
viskores::Id NumThreadsPerCPU = 4
 
viskores::Id NumThreadsPerGPU = 8
 
std::string OutputFieldName
 
std::vector< std::string > ActiveFieldNames
 
std::vector< viskores::cont::Field::AssociationActiveFieldAssociation
 
std::vector< bool > UseCoordinateSystemAsField
 
std::vector< viskores::IdActiveCoordinateSystemIndices
 

Detailed Description

Base class for all filters.

This is the base class for all filters. To add a new filter, one can subclass this and implement relevant methods.

FilterUsage Usage

To execute a filter, one typically calls the auto result = filter.Execute(input). Typical usage is as follows:

// create the concrete subclass (e.g. Contour).
// select fields to map to the output, if different from default which is to map all input
// fields.
contour.SetFieldsToPass({"var1", "var2"});
// execute the filter on viskores::cont::DataSet.
auto outputDS = contour.Execute(dsInput);
// or, execute on a viskores::cont::PartitionedDataSet
auto outputMB = contour.Execute(mbInput);

Execute methods take in the input DataSet or PartitionedDataSet to process and return the result. The type of the result is same as the input type, thus Execute(DataSet&) returns a DataSet while Execute(PartitionedDataSet&) returns a PartitionedDataSet.

Execute simply calls the pure virtual function DoExecute(DataSet&) which is the main extension point of the Filter interface. Filter developer needs to override DoExecute(DataSet) to implement the business logic of filtering operations on a single DataSet.

The default implementation of Execute(PartitionedDataSet&) is merely provided for convenience. Internally, it calls DoExecutePartitions(PartitionedDataSet) to iterate DataSets of a PartitionedDataSet and pass each individual DataSets to DoExecute(DataSet&), possibly in a multi-threaded setting. Developer of DoExecute(DataSet&) needs to indicate the thread-safeness of DoExecute(DataSet&) by overriding the CanThread() virtual method which by default returns true.

In the case that filtering on a PartitionedDataSet can not be simply implemented as a for-each loop on the component DataSets, filter implementor needs to override the DoExecutePartitions(PartitionedDataSet&). See the implementation of FilterParticleAdvection::Execute(PartitionedDataSet&) for an example.

Creating results and mapping fields

For subclasses that map input fields into output fields, the implementation of its DoExecute(DataSet&) should create the DataSet to be returned with a call to Filter::CreateResult or a similar method (such as Filter::CreateResultField).

VISKORES_CONT DataSet SomeFilter::DoExecute(const viskores::cont::DataSet& input)
{
outCellSet = ... // Generation of the new CellSet
// Mapper is a callable object (function object, lambda, etc.) that takes an input Field
// and maps it to an output Field and then add the output Field to the output DataSet
auto mapper = [](auto& outputDs, const auto& inputField) {
auto outputField = ... // Business logic for mapping input field to output field
output.AddField(outputField);
};
// This passes coordinate systems directly from input to output. If the points of
// the cell set change at all, they will have to be mapped by hand.
return this->CreateResult(input, outCellSet, mapper);
}

In addition to creating a new DataSet filled with the proper cell structure and coordinate systems, CreateResult iterates through each FieldToPass in the input DataSet and calls the FieldMapper to map the input Field to output Field. For simple filters that just pass on input fields to the output DataSet without any computation, an overload of CreateResult(const viskores::cont::DataSet& input) is also provided as a convenience that uses the default mapper which trivially adds input Field to output DataSet (via a shallow copy).

FilterThreadSafety CanThread

By default, the implementation of DoExecute(DataSet&) should model a pure function, i.e. it does not have any mutable shared state. This makes it thread-safe by default and allows the default implementation of DoExecutePartitions(PartitionedDataSet&) to be simply a parallel for-each, thus facilitates multi-threaded execution without any lock.

Many legacy (Viskores 1.x) filter implementations needed to store states between the mesh generation phase and field mapping phase of filter execution, for example, parameters for field interpolation. The shared mutable states were mostly stored as mutable data members of the filter class (either in terms of ArrayHandle or some kind of Worket). The new filter interface, by combining the two phases into a single call to DoExecute(DataSet&), we have eliminated most of the cases that require such shared mutable states. New implementations of filters that require passing information between these two phases can now use local variables within the DoExecute(DataSet&). For example:

```cpp struct SharedState; // shared states between mesh generation and field mapping. VISKORES_CONT DataSet ThreadSafeFilter::DoExecute(const viskores::cont::DataSet& input) { // Mutable states that was a data member of the filter is now a local variable. // Each invocation of Execute(DataSet) in the multi-threaded execution of // Execute(PartitionedDataSet&) will have a copy of states on each thread's stack // thus making it thread-safe. SharedStates states;

viskores::cont::CellSetExplicit<> cellSet; cellSet = ... // Generation of the new DataSet and store interpolation parameters in states

// Lambda capture of states, effectively passing the shared states to the Mapper. auto mapper = [&states](auto& outputDs, const auto& inputField) { auto outputField = ... // Use states for mapping input field to output field output.AddField(outputField); }; this->CreateOutput(input, cellSet, mapper);

return output; } ```

In the rare cases that filter implementation can not be made thread-safe, the implementation needs to override the CanThread() virtual method to return false. The default Execute(PartitionedDataSet&) implementation will fallback to a serial for loop execution.

FilterThreadScheduling DoExecute

The default multi-threaded execution of Execute(PartitionedDataSet&) uses a simple FIFO queue of DataSet and pool of worker threads. Implementation of Filter subclass can override the DoExecutePartitions(PartitionedDataSet) virtual method to provide implementation specific scheduling policy. The default number of worker threads in the pool are determined by the DetermineNumberOfThreads() virtual method using several backend dependent heuristic. Implementations of Filter subclass can also override DetermineNumberOfThreads() to provide implementation specific heuristic.

Constructor & Destructor Documentation

◆ Filter()

viskores::filter::Filter::Filter ( )

◆ ~Filter()

virtual viskores::filter::Filter::~Filter ( )
virtual

Member Function Documentation

◆ CanThread()

virtual bool viskores::filter::Filter::CanThread ( ) const
virtual

Returns whether the filter can execute on partitions in concurrent threads.

If a derived class's implementation of DoExecute cannot run on multiple threads, then the derived class should override this method to return false.

Reimplemented in viskores::filter::scalar_topology::ContourTreeUniformDistributed, viskores::filter::scalar_topology::ContourTreeAugmented, viskores::filter::entity_extraction::ExternalFaces, viskores::filter::flow::FilterParticleAdvection, viskores::filter::flow::LagrangianStructures, and viskores::filter::flow::Lagrangian.

◆ CastAndCallScalarField() [1/2]

template<typename Functor , typename... Args>
void viskores::filter::Filter::CastAndCallScalarField ( const viskores::cont::Field field,
Functor &&  functor,
Args &&...  args 
) const
inlineprotected

Convenience method to get the array from a filter's input scalar field.

A field filter typically gets its input fields using the internal GetFieldFromDataSet. To use this field in a worklet, it eventually needs to be converted to an viskores::cont::ArrayHandle. If the input field is limited to be a scalar field, then this method provides a convenient way to determine the correct array type. Like other CastAndCall methods, it takes as input a viskores::cont::Field (or viskores::cont::UnknownArrayHandle) and a function/functor to call with the appropriate viskores::cont::ArrayHandle type.

◆ CastAndCallScalarField() [2/2]

template<typename Functor , typename... Args>
void viskores::filter::Filter::CastAndCallScalarField ( const viskores::cont::UnknownArrayHandle fieldArray,
Functor &&  functor,
Args &&...  args 
) const
inlineprotected

Convenience method to get the array from a filter's input scalar field.

A field filter typically gets its input fields using the internal GetFieldFromDataSet. To use this field in a worklet, it eventually needs to be converted to an viskores::cont::ArrayHandle. If the input field is limited to be a scalar field, then this method provides a convenient way to determine the correct array type. Like other CastAndCall methods, it takes as input a viskores::cont::Field (or viskores::cont::UnknownArrayHandle) and a function/functor to call with the appropriate viskores::cont::ArrayHandle type.

◆ CastAndCallVariableVecField() [1/2]

template<typename Functor , typename... Args>
void viskores::filter::Filter::CastAndCallVariableVecField ( const viskores::cont::Field field,
Functor &&  functor,
Args &&...  args 
) const
inlineprotected

This method is like CastAndCallVecField except that it can be used for a field of unknown vector size (or scalars).

This method will call the given functor with an viskores::cont::ArrayHandleRecombineVec.

Note that there are limitations with using viskores::cont::ArrayHandleRecombineVec within a worklet. Because the size of the vectors are not known at compile time, you cannot just create an intermediate viskores::Vec of the correct size. Typically, you must allocate the output array (for example, with viskores::cont::ArrayHandleRuntimeVec), and the worklet must iterate over the components and store them in the prealocated output.

◆ CastAndCallVariableVecField() [2/2]

template<typename Functor , typename... Args>
void viskores::filter::Filter::CastAndCallVariableVecField ( const viskores::cont::UnknownArrayHandle fieldArray,
Functor &&  functor,
Args &&...  args 
) const
inlineprotected

This method is like CastAndCallVecField except that it can be used for a field of unknown vector size (or scalars).

This method will call the given functor with an viskores::cont::ArrayHandleRecombineVec.

Note that there are limitations with using viskores::cont::ArrayHandleRecombineVec within a worklet. Because the size of the vectors are not known at compile time, you cannot just create an intermediate viskores::Vec of the correct size. Typically, you must allocate the output array (for example, with viskores::cont::ArrayHandleRuntimeVec), and the worklet must iterate over the components and store them in the prealocated output.

◆ CastAndCallVecField() [1/2]

template<viskores::IdComponent VecSize, typename Functor , typename... Args>
void viskores::filter::Filter::CastAndCallVecField ( const viskores::cont::Field field,
Functor &&  functor,
Args &&...  args 
) const
inlineprotected

Convenience method to get the array from a filter's input vector field.

A field filter typically gets its input fields using the internal GetFieldFromDataSet. To use this field in a worklet, it eventually needs to be converted to an viskores::cont::ArrayHandle. If the input field is limited to be a vector field with vectors of a specific size, then this method provides a convenient way to determine the correct array type. Like other CastAndCall methods, it takes as input a viskores::cont::Field (or viskores::cont::UnknownArrayHandle) and a function/functor to call with the appropriate viskores::cont::ArrayHandle type. You also have to provide the vector size as the first template argument. For example CastAndCallVecField<3>(field, functor);.

◆ CastAndCallVecField() [2/2]

template<viskores::IdComponent VecSize, typename Functor , typename... Args>
void viskores::filter::Filter::CastAndCallVecField ( const viskores::cont::UnknownArrayHandle fieldArray,
Functor &&  functor,
Args &&...  args 
) const
inlineprotected

Convenience method to get the array from a filter's input vector field.

A field filter typically gets its input fields using the internal GetFieldFromDataSet. To use this field in a worklet, it eventually needs to be converted to an viskores::cont::ArrayHandle. If the input field is limited to be a vector field with vectors of a specific size, then this method provides a convenient way to determine the correct array type. Like other CastAndCall methods, it takes as input a viskores::cont::Field (or viskores::cont::UnknownArrayHandle) and a function/functor to call with the appropriate viskores::cont::ArrayHandle type. You also have to provide the vector size as the first template argument. For example CastAndCallVecField<3>(field, functor);.

◆ CreateResult() [1/4]

viskores::cont::DataSet viskores::filter::Filter::CreateResult ( const viskores::cont::DataSet inDataSet) const
protected

Create the output data set for DoExecute.

This form of CreateResult will create an output data set with the same cell structure and coordinate system as the input and pass all fields (as requested by the Filter state).

Parameters
[in]inDataSetThe input data set being modified (usually the one passed into DoExecute). The returned DataSet is filled with the cell set, coordinate system, and fields of inDataSet (as selected by the FieldsToPass state of the filter).

◆ CreateResult() [2/4]

template<typename FieldMapper >
viskores::cont::DataSet viskores::filter::Filter::CreateResult ( const viskores::cont::DataSet inDataSet,
const viskores::cont::UnknownCellSet resultCellSet,
FieldMapper &&  fieldMapper 
) const
inlineprotected

Create the output data set for DoExecute.

This form of CreateResult will create an output data set with the given CellSet. You must also provide a field mapper function, which is a function that takes the output DataSet being created and a Field from the input and then applies any necessary transformations to the field array and adds it to the DataSet.

Parameters
[in]inDataSetThe input data set being modified (usually the one passed into DoExecute). The returned DataSet is filled with fields of inDataSet (as selected by the FieldsToPass state of the filter).
[in]resultCellSetThe CellSet of the output will be set to this.
[in]fieldMapperA function or functor that takes a DataSet as its first argument and a Field as its second argument. The DataSet is the data being created and will eventually be returned by CreateResult. The Field comes from inDataSet. The function should map the Field to match resultCellSet and then add the resulting field to the DataSet. If the mapping is not possible, then the function should do nothing.

◆ CreateResult() [3/4]

viskores::cont::PartitionedDataSet viskores::filter::Filter::CreateResult ( const viskores::cont::PartitionedDataSet input,
const viskores::cont::PartitionedDataSet resultPartitions 
) const
protected

Create the output data set for DoExecute.

This form of CreateResult will create an output PartitionedDataSet with the same partitions and pass all PartitionedDataSet fields (as requested by the Filter state).

Parameters
[in]inputThe input data set being modified (usually the one passed into DoExecute).
[in]resultPartitionsThe output data created by the filter. Fields from the input are passed onto the return result partition as requested by the Filter state.

◆ CreateResult() [4/4]

template<typename FieldMapper >
viskores::cont::PartitionedDataSet viskores::filter::Filter::CreateResult ( const viskores::cont::PartitionedDataSet input,
const viskores::cont::PartitionedDataSet resultPartitions,
FieldMapper &&  fieldMapper 
) const
inlineprotected

Create the output data set for DoExecute.

This form of CreateResult will create an output PartitionedDataSet with the same partitions and pass all PartitionedDataSet fields (as requested by the Filter state).

Parameters
[in]inputThe input data set being modified (usually the one passed into DoExecute).
[in]resultPartitionsThe output data created by the filter. Fields from the input are passed onto the return result partition as requested by the Filter state.
[in]fieldMapperA function or functor that takes a PartitionedDataSet as its first argument and a Field as its second argument. The PartitionedDataSet is the data being created and will eventually be returned by CreateResult. The Field comes from input.

◆ CreateResultCoordinateSystem() [1/2]

template<typename FieldMapper >
viskores::cont::DataSet viskores::filter::Filter::CreateResultCoordinateSystem ( const viskores::cont::DataSet inDataSet,
const viskores::cont::UnknownCellSet resultCellSet,
const std::string &  coordsName,
const viskores::cont::UnknownArrayHandle coordsData,
FieldMapper &&  fieldMapper 
) const
inlineprotected

Create the output data set for DoExecute.

This form of CreateResult will create an output data set with the given CellSet and CoordinateSystem. You must also provide a field mapper function, which is a function that takes the output DataSet being created and a Field from the input and then applies any necessary transformations to the field array and adds it to the DataSet.

Parameters
[in]inDataSetThe input data set being modified (usually the one passed into DoExecute). The returned DataSet is filled with fields of inDataSet (as selected by the FieldsToPass state of the filter).
[in]resultCellSetThe CellSet of the output will be set to this.
[in]coordsNameThe name of the coordinate system to be added to the output.
[in]coordsDataThe array containing the coordinates of the points.
[in]fieldMapperA function or functor that takes a DataSet as its first argument and a Field as its second argument. The DataSet is the data being created and will eventually be returned by CreateResult. The Field comes from inDataSet. The function should map the Field to match resultCellSet and then add the resulting field to the DataSet. If the mapping is not possible, then the function should do nothing.

◆ CreateResultCoordinateSystem() [2/2]

template<typename FieldMapper >
viskores::cont::DataSet viskores::filter::Filter::CreateResultCoordinateSystem ( const viskores::cont::DataSet inDataSet,
const viskores::cont::UnknownCellSet resultCellSet,
const viskores::cont::CoordinateSystem resultCoordSystem,
FieldMapper &&  fieldMapper 
) const
inlineprotected

Create the output data set for DoExecute.

This form of CreateResult will create an output data set with the given CellSet and CoordinateSystem. You must also provide a field mapper function, which is a function that takes the output DataSet being created and a Field from the input and then applies any necessary transformations to the field array and adds it to the DataSet.

Parameters
[in]inDataSetThe input data set being modified (usually the one passed into DoExecute). The returned DataSet is filled with fields of inDataSet (as selected by the FieldsToPass state of the filter).
[in]resultCellSetThe CellSet of the output will be set to this.
[in]resultCoordSystemThis CoordinateSystem will be added to the output.
[in]fieldMapperA function or functor that takes a DataSet as its first argument and a Field as its second argument. The DataSet is the data being created and will eventually be returned by CreateResult. The Field comes from inDataSet. The function should map the Field to match resultCellSet and then add the resulting field to the DataSet. If the mapping is not possible, then the function should do nothing.

◆ CreateResultField() [1/2]

viskores::cont::DataSet viskores::filter::Filter::CreateResultField ( const viskores::cont::DataSet inDataSet,
const std::string &  resultFieldName,
viskores::cont::Field::Association  resultFieldAssociation,
const viskores::cont::UnknownArrayHandle resultFieldArray 
) const
inlineprotected

Create the output data set for DoExecute

This form of CreateResult will create an output data set with the same cell structure and coordinate system as the input and pass all fields (as requested by the Filter state). Additionally, it will add a field matching the provided specifications to the result.

Parameters
[in]inDataSetThe input data set being modified (usually the one passed into DoExecute). The returned DataSet is filled with fields of inDataSet (as selected by the FieldsToPass state of the filter).
[in]resultFieldNameThe name of the field added to the returned DataSet.
[in]resultFieldAssociationThe association of the field (e.g. point or cell) added to the returned DataSet.
[in]resultFieldArrayAn array containing the data for the field added to the returned DataSet.

◆ CreateResultField() [2/2]

viskores::cont::DataSet viskores::filter::Filter::CreateResultField ( const viskores::cont::DataSet inDataSet,
const viskores::cont::Field resultField 
) const
protected

Create the output data set for DoExecute

This form of CreateResult will create an output data set with the same cell structure and coordinate system as the input and pass all fields (as requested by the Filter state). Additionally, it will add the provided field to the result.

Parameters
[in]inDataSetThe input data set being modified (usually the one passed into DoExecute). The returned DataSet is filled with fields of inDataSet (as selected by the FieldsToPass state of the filter).
[in]resultFieldA Field that is added to the returned DataSet.

◆ CreateResultFieldCell()

viskores::cont::DataSet viskores::filter::Filter::CreateResultFieldCell ( const viskores::cont::DataSet inDataSet,
const std::string &  resultFieldName,
const viskores::cont::UnknownArrayHandle resultFieldArray 
) const
inlineprotected

Create the output data set for DoExecute

This form of CreateResult will create an output data set with the same cell structure and coordinate system as the input and pass all fields (as requested by the Filter state). Additionally, it will add a cell field matching the provided specifications to the result.

Parameters
[in]inDataSetThe input data set being modified (usually the one passed into DoExecute). The returned DataSet is filled with fields of inDataSet (as selected by the FieldsToPass state of the filter).
[in]resultFieldNameThe name of the field added to the returned DataSet.
[in]resultFieldArrayAn array containing the data for the field added to the returned DataSet.

◆ CreateResultFieldPoint()

viskores::cont::DataSet viskores::filter::Filter::CreateResultFieldPoint ( const viskores::cont::DataSet inDataSet,
const std::string &  resultFieldName,
const viskores::cont::UnknownArrayHandle resultFieldArray 
) const
inlineprotected

Create the output data set for DoExecute

This form of CreateResult will create an output data set with the same cell structure and coordinate system as the input and pass all fields (as requested by the Filter state). Additionally, it will add a point field matching the provided specifications to the result.

Parameters
[in]inDataSetThe input data set being modified (usually the one passed into DoExecute). The returned DataSet is filled with fields of inDataSet (as selected by the FieldsToPass state of the filter).
[in]resultFieldNameThe name of the field added to the returned DataSet.
[in]resultFieldArrayAn array containing the data for the field added to the returned DataSet.

◆ DetermineNumberOfThreads()

virtual viskores::Id viskores::filter::Filter::DetermineNumberOfThreads ( const viskores::cont::PartitionedDataSet input)
privatevirtual

◆ DoExecute()

virtual viskores::cont::DataSet viskores::filter::Filter::DoExecute ( const viskores::cont::DataSet inData)
protectedpure virtual

Implemented in viskores::filter::contour::AbstractContour, viskores::filter::contour::Contour, viskores::filter::contour::ContourFlyingEdges, viskores::filter::contour::ContourMarchingCells, viskores::filter::image_processing::ImageDifference, viskores::filter::vector_analysis::SurfaceNormals, viskores::filter::vector_analysis::Gradient, viskores::filter::multi_block::MergeDataSets, viskores::filter::scalar_topology::ContourTreeUniformDistributed, viskores::filter::field_transform::PointTransform, viskores::filter::field_transform::FieldToColors, viskores::filter::scalar_topology::ContourTreeAugmented, viskores::filter::field_transform::Warp, viskores::filter::entity_extraction::ExtractStructured, viskores::filter::vector_analysis::DotProduct, viskores::filter::vector_analysis::CrossProduct, viskores::filter::uncertainty::ContourUncertainUniform, viskores::filter::mesh_info::MeshQuality, viskores::filter::entity_extraction::Threshold, viskores::filter::mesh_info::CellMeasures, viskores::filter::entity_extraction::ExtractGeometry, viskores::filter::scalar_topology::ContourTreeMesh3D, viskores::filter::entity_extraction::GhostCellRemove, viskores::filter::resampling::HistSampling, viskores::filter::field_transform::GenerateIds, viskores::filter::field_transform::LogValues, viskores::filter::scalar_topology::ContourTreeMesh2D, viskores::filter::entity_extraction::ExtractPoints, viskores::filter::density_estimate::Histogram, viskores::filter::field_transform::PointElevation, viskores::filter::uncertainty::ContourUncertainUniformMonteCarlo, viskores::filter::contour::MIRFilter, viskores::filter::density_estimate::Statistics, viskores::filter::geometry_refinement::VertexClustering, viskores::filter::resampling::Probe, viskores::filter::entity_extraction::ExternalFaces, viskores::filter::density_estimate::ParticleDensityNearestGridPoint, viskores::filter::geometry_refinement::ConvertToPointCloud, viskores::filter::density_estimate::ParticleDensityCloudInCell, viskores::filter::geometry_refinement::SplitSharpEdges, viskores::filter::mesh_info::MeshQualityScaledJacobian, viskores::filter::contour::ClipWithImplicitFunction, viskores::filter::density_estimate::ContinuousScatterPlot, viskores::filter::contour::ClipWithField, viskores::filter::mesh_info::MeshQualityRelativeSizeSquared, viskores::filter::entity_extraction::ThresholdPoints, viskores::filter::mesh_info::MeshQualityWarpage, viskores::filter::density_estimate::NDHistogram, viskores::filter::field_transform::CompositeVectors, viskores::filter::mesh_info::MeshQualityArea, viskores::filter::mesh_info::MeshQualityVolume, viskores::filter::mesh_info::MeshQualityShape, viskores::filter::mesh_info::MeshQualityShapeAndSize, viskores::filter::mesh_info::MeshQualitySkew, viskores::filter::mesh_info::MeshQualityTaper, viskores::filter::geometry_refinement::Tube, viskores::filter::mesh_info::MeshQualityMaxAngle, viskores::filter::mesh_info::MeshQualityMinAngle, viskores::filter::mesh_info::MeshQualityStretch, viskores::filter::contour::Slice, viskores::filter::geometry_refinement::Shrink, viskores::filter::mesh_info::MeshQualityAspectGamma, viskores::filter::mesh_info::MeshQualityAspectRatio, viskores::filter::mesh_info::MeshQualityShear, viskores::filter::mesh_info::MeshQualityCondition, viskores::filter::mesh_info::MeshQualityDiagonalRatio, viskores::filter::mesh_info::MeshQualityOddy, viskores::filter::contour::SliceMultiple, viskores::filter::entity_extraction::Mask, viskores::filter::field_transform::CylindricalCoordinateTransform, viskores::filter::field_transform::SphericalCoordinateTransform, viskores::filter::connected_components::ImageConnectivity, viskores::filter::density_estimate::Entropy, viskores::filter::entity_extraction::MaskPoints, viskores::filter::image_processing::ImageMedian, viskores::filter::mesh_info::MeshQualityDimension, viskores::filter::mesh_info::MeshQualityJacobian, viskores::filter::mesh_info::MeshQualityMaxDiagonal, viskores::filter::mesh_info::MeshQualityMinDiagonal, viskores::filter::connected_components::CellSetConnectivity, viskores::filter::zfp::ZFPCompressor2D, viskores::filter::zfp::ZFPCompressor3D, viskores::filter::zfp::ZFPDecompressor1D, viskores::filter::zfp::ZFPDecompressor2D, viskores::filter::zfp::ZFPDecompressor3D, viskores::filter::field_conversion::CellAverage, viskores::filter::field_conversion::PointAverage, viskores::filter::vector_analysis::VectorMagnitude, viskores::filter::geometry_refinement::Tetrahedralize, viskores::filter::geometry_refinement::Triangulate, viskores::filter::image_processing::ComputeMoments, viskores::filter::density_estimate::NDEntropy, viskores::filter::zfp::ZFPCompressor1D, viskores::filter::flow::FilterParticleAdvection, viskores::filter::flow::LagrangianStructures, viskores::filter::flow::Lagrangian, viskores::filter::clean_grid::CleanGrid, viskores::filter::flow::StreamSurface, viskores::filter::mesh_info::GhostCellClassify, viskores::filter::scalar_topology::ExtractTopVolumeContoursFilter, viskores::filter::scalar_topology::SelectTopVolumeBranchesFilter, viskores::filter::scalar_topology::DistributedBranchDecompositionFilter, and viskores::filter::multi_block::AmrArrays.

◆ DoExecutePartitions()

virtual viskores::cont::PartitionedDataSet viskores::filter::Filter::DoExecutePartitions ( const viskores::cont::PartitionedDataSet inData)
protectedvirtual

◆ Execute() [1/2]

viskores::cont::DataSet viskores::filter::Filter::Execute ( const viskores::cont::DataSet input)

Executes the filter on the input and produces a result dataset.

On success, this the dataset produced. On error, viskores::cont::ErrorExecution will be thrown.

◆ Execute() [2/2]

viskores::cont::PartitionedDataSet viskores::filter::Filter::Execute ( const viskores::cont::PartitionedDataSet input)

Executes the filter on the input PartitionedDataSet and produces a result PartitionedDataSet.

On success, this the dataset produced. On error, viskores::cont::ErrorExecution will be thrown.

◆ GetActiveCoordinateSystemIndex()

viskores::Id viskores::filter::Filter::GetActiveCoordinateSystemIndex ( viskores::IdComponent  index = 0) const
inline

Specifies the coordinate system index to make active to use when processing the input viskores::cont::DataSet.

This is used primarily by the Filter to select the coordinate system to use as a field when UseCoordinateSystemAsField is true.

◆ GetActiveFieldAssociation()

viskores::cont::Field::Association viskores::filter::Filter::GetActiveFieldAssociation ( viskores::IdComponent  index = 0) const
inline

Specifies a field to operate on.

The number of input fields (or whether the filter operates on input fields at all) is specific to each particular filter.

◆ GetActiveFieldName()

const std::string& viskores::filter::Filter::GetActiveFieldName ( viskores::IdComponent  index = 0) const
inline

Specifies a field to operate on.

The number of input fields (or whether the filter operates on input fields at all) is specific to each particular filter.

◆ GetFieldFromDataSet() [1/2]

const viskores::cont::Field& viskores::filter::Filter::GetFieldFromDataSet ( const viskores::cont::DataSet input) const
inlineprotected

Retrieve an input field from a viskores::cont::DataSet object.

When a filter operates on fields, it should use this method to get the input fields that the use has selected with SetActiveField() and related methods.

◆ GetFieldFromDataSet() [2/2]

const viskores::cont::Field& viskores::filter::Filter::GetFieldFromDataSet ( viskores::IdComponent  index,
const viskores::cont::DataSet input 
) const
inlineprotected

Retrieve an input field from a viskores::cont::DataSet object.

When a filter operates on fields, it should use this method to get the input fields that the use has selected with SetActiveField() and related methods.

◆ GetFieldsToPass() [1/2]

viskores::filter::FieldSelection& viskores::filter::Filter::GetFieldsToPass ( )
inline

Specify which fields get passed from input to output.

After a filter successfully executes and returns a new data set, fields are mapped from input to output. Depending on what operation the filter does, this could be a simple shallow copy of an array, or it could be a computed operation. You can control which fields are passed (and equivalently which are not) with this parameter.

By default, all fields are passed during execution.

◆ GetFieldsToPass() [2/2]

const viskores::filter::FieldSelection& viskores::filter::Filter::GetFieldsToPass ( ) const
inline

Specify which fields get passed from input to output.

After a filter successfully executes and returns a new data set, fields are mapped from input to output. Depending on what operation the filter does, this could be a simple shallow copy of an array, or it could be a computed operation. You can control which fields are passed (and equivalently which are not) with this parameter.

By default, all fields are passed during execution.

◆ GetNumberOfActiveFields()

viskores::IdComponent viskores::filter::Filter::GetNumberOfActiveFields ( ) const
inline

Return the number of active fields currently set.

The general interface to Filter allows a user to set an arbitrary number of active fields (indexed 0 and on). This method returns the number of active fields that are set. Note that the filter implementation is free to ignore any active fields it does not support. Also note that an active field can be set to be either a named field or a coordinate system.

◆ GetOutputFieldName()

const std::string& viskores::filter::Filter::GetOutputFieldName ( ) const
inline

Specifies the name of the output field generated.

Not all filters create an output field.

◆ GetPassCoordinateSystems()

bool viskores::filter::Filter::GetPassCoordinateSystems ( ) const
inline

Specify whether to always pass coordinate systems.

viskores::cont::CoordinateSystems in a DataSet are really just point fields marked as being a coordinate system. Thus, a coordinate system is passed if and only if the associated field is passed.

By default, the filter will pass all fields associated with a coordinate system regardless of the FieldsToPass marks the field as passing. If this option is set to false, then coordinate systems will only be passed if it is marked so by FieldsToPass.

◆ GetRunMultiThreadedFilter()

bool viskores::filter::Filter::GetRunMultiThreadedFilter ( ) const
inline

◆ GetThreadsPerCPU()

viskores::Id viskores::filter::Filter::GetThreadsPerCPU ( ) const
inline

◆ GetThreadsPerGPU()

viskores::Id viskores::filter::Filter::GetThreadsPerGPU ( ) const
inline

◆ GetUseCoordinateSystemAsField()

bool viskores::filter::Filter::GetUseCoordinateSystemAsField ( viskores::IdComponent  index = 0) const
inline

Specifies whether to use point coordinates as the input field.

When true, the values for the active field are ignored and the active coordinate system is used instead.

◆ MapFieldsOntoOutput() [1/2]

template<typename FieldMapper >
void viskores::filter::Filter::MapFieldsOntoOutput ( const viskores::cont::DataSet input,
const viskores::filter::FieldSelection fieldSelection,
viskores::cont::DataSet output,
FieldMapper &&  fieldMapper 
) const
inlineprivate

◆ MapFieldsOntoOutput() [2/2]

template<typename FieldMapper >
void viskores::filter::Filter::MapFieldsOntoOutput ( const viskores::cont::PartitionedDataSet input,
const viskores::filter::FieldSelection fieldSelection,
viskores::cont::PartitionedDataSet output,
FieldMapper &&  fieldMapper 
) const
inlineprivate

◆ ResizeIfNeeded()

void viskores::filter::Filter::ResizeIfNeeded ( size_t  index_st)
private

◆ SetActiveCoordinateSystem() [1/2]

void viskores::filter::Filter::SetActiveCoordinateSystem ( viskores::Id  coord_idx)
inline

Specifies the coordinate system index to make active to use when processing the input viskores::cont::DataSet.

This is used primarily by the Filter to select the coordinate system to use as a field when UseCoordinateSystemAsField is true.

◆ SetActiveCoordinateSystem() [2/2]

void viskores::filter::Filter::SetActiveCoordinateSystem ( viskores::IdComponent  index,
viskores::Id  coord_idx 
)
inline

Specifies the coordinate system index to make active to use when processing the input viskores::cont::DataSet.

This is used primarily by the Filter to select the coordinate system to use as a field when UseCoordinateSystemAsField is true.

◆ SetActiveField() [1/2]

void viskores::filter::Filter::SetActiveField ( const std::string &  name,
viskores::cont::Field::Association  association = viskores::cont::Field::Association::Any 
)
inline

Specifies a field to operate on.

The number of input fields (or whether the filter operates on input fields at all) is specific to each particular filter.

◆ SetActiveField() [2/2]

void viskores::filter::Filter::SetActiveField ( viskores::IdComponent  index,
const std::string &  name,
viskores::cont::Field::Association  association = viskores::cont::Field::Association::Any 
)
inline

Specifies a field to operate on.

The number of input fields (or whether the filter operates on input fields at all) is specific to each particular filter.

◆ SetFieldsToPass() [1/7]

void viskores::filter::Filter::SetFieldsToPass ( const std::string &  fieldname,
viskores::cont::Field::Association  association,
viskores::filter::FieldSelection::Mode  mode = viskores::filter::FieldSelection::Mode::Select 
)

Specify which fields get passed from input to output.

After a filter successfully executes and returns a new data set, fields are mapped from input to output. Depending on what operation the filter does, this could be a simple shallow copy of an array, or it could be a computed operation. You can control which fields are passed (and equivalently which are not) with this parameter.

By default, all fields are passed during execution.

◆ SetFieldsToPass() [2/7]

void viskores::filter::Filter::SetFieldsToPass ( const std::string &  fieldname,
viskores::filter::FieldSelection::Mode  mode 
)
inline

Specify which fields get passed from input to output.

After a filter successfully executes and returns a new data set, fields are mapped from input to output. Depending on what operation the filter does, this could be a simple shallow copy of an array, or it could be a computed operation. You can control which fields are passed (and equivalently which are not) with this parameter.

By default, all fields are passed during execution.

◆ SetFieldsToPass() [3/7]

void viskores::filter::Filter::SetFieldsToPass ( const viskores::filter::FieldSelection fieldsToPass)

Specify which fields get passed from input to output.

After a filter successfully executes and returns a new data set, fields are mapped from input to output. Depending on what operation the filter does, this could be a simple shallow copy of an array, or it could be a computed operation. You can control which fields are passed (and equivalently which are not) with this parameter.

By default, all fields are passed during execution.

◆ SetFieldsToPass() [4/7]

void viskores::filter::Filter::SetFieldsToPass ( const viskores::filter::FieldSelection fieldsToPass,
viskores::filter::FieldSelection::Mode  mode 
)

◆ SetFieldsToPass() [5/7]

void viskores::filter::Filter::SetFieldsToPass ( std::initializer_list< std::pair< std::string, viskores::cont::Field::Association >>  fields,
viskores::filter::FieldSelection::Mode  mode = viskores::filter::FieldSelection::Mode::Select 
)

Specify which fields get passed from input to output.

After a filter successfully executes and returns a new data set, fields are mapped from input to output. Depending on what operation the filter does, this could be a simple shallow copy of an array, or it could be a computed operation. You can control which fields are passed (and equivalently which are not) with this parameter.

By default, all fields are passed during execution.

◆ SetFieldsToPass() [6/7]

void viskores::filter::Filter::SetFieldsToPass ( std::initializer_list< std::string >  fields,
viskores::filter::FieldSelection::Mode  mode = viskores::filter::FieldSelection::Mode::Select 
)

Specify which fields get passed from input to output.

After a filter successfully executes and returns a new data set, fields are mapped from input to output. Depending on what operation the filter does, this could be a simple shallow copy of an array, or it could be a computed operation. You can control which fields are passed (and equivalently which are not) with this parameter.

By default, all fields are passed during execution.

◆ SetFieldsToPass() [7/7]

void viskores::filter::Filter::SetFieldsToPass ( viskores::filter::FieldSelection &&  fieldsToPass)

Specify which fields get passed from input to output.

After a filter successfully executes and returns a new data set, fields are mapped from input to output. Depending on what operation the filter does, this could be a simple shallow copy of an array, or it could be a computed operation. You can control which fields are passed (and equivalently which are not) with this parameter.

By default, all fields are passed during execution.

◆ SetInvoker()

void viskores::filter::Filter::SetInvoker ( viskores::cont::Invoker  inv)
inline

Specify the viskores::cont::Invoker to be used to execute worklets by this filter instance.

Overriding the default allows callers to control which device adapters a filter uses.

◆ SetOutputFieldName()

void viskores::filter::Filter::SetOutputFieldName ( const std::string &  name)
inline

Specifies the name of the output field generated.

Not all filters create an output field.

◆ SetPassCoordinateSystems()

void viskores::filter::Filter::SetPassCoordinateSystems ( bool  flag)
inline

Specify whether to always pass coordinate systems.

viskores::cont::CoordinateSystems in a DataSet are really just point fields marked as being a coordinate system. Thus, a coordinate system is passed if and only if the associated field is passed.

By default, the filter will pass all fields associated with a coordinate system regardless of the FieldsToPass marks the field as passing. If this option is set to false, then coordinate systems will only be passed if it is marked so by FieldsToPass.

◆ SetRunMultiThreadedFilter()

void viskores::filter::Filter::SetRunMultiThreadedFilter ( bool  val)
inline

◆ SetThreadsPerCPU()

void viskores::filter::Filter::SetThreadsPerCPU ( viskores::Id  numThreads)
inline

◆ SetThreadsPerGPU()

void viskores::filter::Filter::SetThreadsPerGPU ( viskores::Id  numThreads)
inline

◆ SetUseCoordinateSystemAsField() [1/2]

void viskores::filter::Filter::SetUseCoordinateSystemAsField ( bool  val)
inline

Specifies whether to use point coordinates as the input field.

When true, the values for the active field are ignored and the active coordinate system is used instead.

◆ SetUseCoordinateSystemAsField() [2/2]

void viskores::filter::Filter::SetUseCoordinateSystemAsField ( viskores::IdComponent  index,
bool  val 
)
inline

Specifies whether to use point coordinates as the input field.

When true, the values for the active field are ignored and the active coordinate system is used instead.

Member Data Documentation

◆ ActiveCoordinateSystemIndices

std::vector<viskores::Id> viskores::filter::Filter::ActiveCoordinateSystemIndices
private

◆ ActiveFieldAssociation

std::vector<viskores::cont::Field::Association> viskores::filter::Filter::ActiveFieldAssociation
private

◆ ActiveFieldNames

std::vector<std::string> viskores::filter::Filter::ActiveFieldNames
private

◆ FieldsToPass

viskores::filter::FieldSelection viskores::filter::Filter::FieldsToPass = viskores::filter::FieldSelection::Mode::All
private

◆ Invoke

viskores::cont::Invoker viskores::filter::Filter::Invoke
protected

◆ NumThreadsPerCPU

viskores::Id viskores::filter::Filter::NumThreadsPerCPU = 4
private

◆ NumThreadsPerGPU

viskores::Id viskores::filter::Filter::NumThreadsPerGPU = 8
private

◆ OutputFieldName

std::string viskores::filter::Filter::OutputFieldName
private

◆ PassCoordinateSystems

bool viskores::filter::Filter::PassCoordinateSystems = true
private

◆ RunFilterWithMultipleThreads

bool viskores::filter::Filter::RunFilterWithMultipleThreads = false
private

◆ UseCoordinateSystemAsField

std::vector<bool> viskores::filter::Filter::UseCoordinateSystemAsField
private

The documentation for this class was generated from the following file:
viskores::cont::DataSet
Contains and manages the geometric data structures that Viskores operates on.
Definition: DataSet.h:66
viskores::filter::Filter::CreateResult
viskores::cont::DataSet CreateResult(const viskores::cont::DataSet &inDataSet) const
Create the output data set for DoExecute.
viskores::filter::Filter::Execute
viskores::cont::DataSet Execute(const viskores::cont::DataSet &input)
Executes the filter on the input and produces a result dataset.
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores::cont::PartitionedDataSet
Comprises a set of viskores::cont::DataSet objects.
Definition: PartitionedDataSet.h:34
viskores::filter::Filter::SetFieldsToPass
void SetFieldsToPass(const viskores::filter::FieldSelection &fieldsToPass)
Specify which fields get passed from input to output.
viskores::cont::UnknownCellSet
A CellSet of an unknown type.
Definition: UnknownCellSet.h:56
viskores::filter::contour::Contour
Generate contours or isosurfaces from a region of space.
Definition: Contour.h:43