VTK-m  2.0
Classes | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
vtkm::worklet::RemoveUnusedPoints Class Reference

A collection of worklets used to identify which points are used by at least one cell and then remove the points that are not used by any cells. More...

#include <RemoveUnusedPoints.h>

Classes

struct  GeneratePointMask
 A worklet that creates a mask of used points (the first step in removing unused points). More...
 
struct  MapPointFieldDeepFunctor
 
struct  TransformPointIndices
 A worklet that takes an array of point indices (taken from the connectivity of a CellSetExplicit) and an array that functions as a map from the original indices to new indices, creates a new array with the new mapped indices. More...
 

Public Member Functions

VTKM_CONT RemoveUnusedPoints ()=default
 
template<typename ShapeStorage , typename ConnectivityStorage , typename OffsetsStorage >
VTKM_CONT RemoveUnusedPoints (const vtkm::cont::CellSetExplicit< ShapeStorage, ConnectivityStorage, OffsetsStorage > &inCellSet)
 
VTKM_CONT void FindPointsStart ()
 Get this class ready for identifying the points used by cell sets. More...
 
template<typename ShapeStorage , typename ConnectivityStorage , typename OffsetsStorage >
VTKM_CONT void FindPoints (const vtkm::cont::CellSetExplicit< ShapeStorage, ConnectivityStorage, OffsetsStorage > &inCellSet)
 Analyze the given cell set to find all points that are used. More...
 
VTKM_CONT void FindPointsEnd ()
 Compile the information collected from calls to FindPointsInCellSet to ready this class for mapping cell sets and fields. More...
 
template<typename ShapeStorage , typename ConnectivityStorage , typename OffsetsStorage >
VTKM_CONT vtkm::cont::CellSetExplicit< ShapeStorage, VTKM_DEFAULT_CONNECTIVITY_STORAGE_TAG, OffsetsStorage > MapCellSet (const vtkm::cont::CellSetExplicit< ShapeStorage, ConnectivityStorage, OffsetsStorage > &inCellSet) const
 Map cell indices. More...
 
template<typename InArrayHandle >
VTKM_CONT vtkm::cont::ArrayHandlePermutation< vtkm::cont::ArrayHandle< vtkm::Id >, InArrayHandle > MapPointFieldShallow (const InArrayHandle &inArray) const
 Maps a point field from the original points to the new reduced points. More...
 
const vtkm::worklet::ScatterCountingGetPointScatter () const
 
template<typename InT , typename InS , typename OutT , typename OutS >
VTKM_CONT void MapPointFieldDeep (const vtkm::cont::ArrayHandle< InT, InS > &inArray, vtkm::cont::ArrayHandle< OutT, OutS > &outArray) const
 Maps a point field from the original points to the new reduced points. More...
 
template<typename T , typename S >
VTKM_CONT vtkm::cont::ArrayHandle< T > MapPointFieldDeep (const vtkm::cont::ArrayHandle< T, S > &inArray) const
 Maps a point field from the original points to the new reduced points. More...
 
template<typename InValueTypes , typename InStorageTypes , typename OutArrayHandle >
VTKM_CONT void MapPointFieldDeep (const vtkm::cont::UncertainArrayHandle< InValueTypes, InStorageTypes > &inArray, OutArrayHandle &outArray) const
 Maps a point field from the original points to the new reduced points. More...
 
template<typename InValueTypes , typename InStorageTypes >
VTKM_CONT vtkm::cont::UncertainArrayHandle< InValueTypes, InStorageTypes > MapPointFieldDeep (const vtkm::cont::UncertainArrayHandle< InValueTypes, InStorageTypes > &inArray) const
 Maps a point field from the original points to the new reduced points. More...
 

Static Public Member Functions

template<typename ShapeStorage , typename ConnectivityStorage , typename OffsetsStorage , typename MapStorage >
static VTKM_CONT vtkm::cont::CellSetExplicit< ShapeStorage, VTKM_DEFAULT_CONNECTIVITY_STORAGE_TAG, OffsetsStorage > MapCellSet (const vtkm::cont::CellSetExplicit< ShapeStorage, ConnectivityStorage, OffsetsStorage > &inCellSet, const vtkm::cont::ArrayHandle< vtkm::Id, MapStorage > &inputToOutputPointMap, vtkm::Id numberOfPoints)
 Map cell indices. More...
 

Private Attributes

vtkm::cont::ArrayHandle< vtkm::IdComponentMaskArray
 
std::shared_ptr< vtkm::worklet::ScatterCountingPointScatter
 Manages how the original point indices map to the new point indices. More...
 

Detailed Description

A collection of worklets used to identify which points are used by at least one cell and then remove the points that are not used by any cells.

The class containing these worklets can be used to manage running these worklets, building new cell sets, and redefine field arrays.

Constructor & Destructor Documentation

◆ RemoveUnusedPoints() [1/2]

VTKM_CONT vtkm::worklet::RemoveUnusedPoints::RemoveUnusedPoints ( )
default

◆ RemoveUnusedPoints() [2/2]

template<typename ShapeStorage , typename ConnectivityStorage , typename OffsetsStorage >
VTKM_CONT vtkm::worklet::RemoveUnusedPoints::RemoveUnusedPoints ( const vtkm::cont::CellSetExplicit< ShapeStorage, ConnectivityStorage, OffsetsStorage > &  inCellSet)
inlineexplicit

Member Function Documentation

◆ FindPoints()

template<typename ShapeStorage , typename ConnectivityStorage , typename OffsetsStorage >
VTKM_CONT void vtkm::worklet::RemoveUnusedPoints::FindPoints ( const vtkm::cont::CellSetExplicit< ShapeStorage, ConnectivityStorage, OffsetsStorage > &  inCellSet)
inline

Analyze the given cell set to find all points that are used.

Unused points are those that are not found in any cell sets passed to this method.

◆ FindPointsEnd()

VTKM_CONT void vtkm::worklet::RemoveUnusedPoints::FindPointsEnd ( )
inline

Compile the information collected from calls to FindPointsInCellSet to ready this class for mapping cell sets and fields.

◆ FindPointsStart()

VTKM_CONT void vtkm::worklet::RemoveUnusedPoints::FindPointsStart ( )
inline

Get this class ready for identifying the points used by cell sets.

◆ GetPointScatter()

const vtkm::worklet::ScatterCounting& vtkm::worklet::RemoveUnusedPoints::GetPointScatter ( ) const
inline

◆ MapCellSet() [1/2]

template<typename ShapeStorage , typename ConnectivityStorage , typename OffsetsStorage >
VTKM_CONT vtkm::cont::CellSetExplicit<ShapeStorage, VTKM_DEFAULT_CONNECTIVITY_STORAGE_TAG, OffsetsStorage> vtkm::worklet::RemoveUnusedPoints::MapCellSet ( const vtkm::cont::CellSetExplicit< ShapeStorage, ConnectivityStorage, OffsetsStorage > &  inCellSet) const
inline

Map cell indices.

Given a cell set (typically the same one passed to the constructor) returns a new cell set with cell points transformed to use the indices of the new reduced point arrays.

◆ MapCellSet() [2/2]

template<typename ShapeStorage , typename ConnectivityStorage , typename OffsetsStorage , typename MapStorage >
static VTKM_CONT vtkm::cont::CellSetExplicit<ShapeStorage, VTKM_DEFAULT_CONNECTIVITY_STORAGE_TAG, OffsetsStorage> vtkm::worklet::RemoveUnusedPoints::MapCellSet ( const vtkm::cont::CellSetExplicit< ShapeStorage, ConnectivityStorage, OffsetsStorage > &  inCellSet,
const vtkm::cont::ArrayHandle< vtkm::Id, MapStorage > &  inputToOutputPointMap,
vtkm::Id  numberOfPoints 
)
inlinestatic

Map cell indices.

Given a cell set (typically the same one passed to the constructor) and an array that maps point indices from an old set of indices to a new set, returns a new cell set with cell points transformed to use the indices of the new reduced point arrays.

This helper method can be used by external items that do similar operations that remove points or otherwise rearange points in a cell set. If points were removed by calling FindPoints, then you should use the other form of MapCellSet.

◆ MapPointFieldDeep() [1/4]

template<typename InT , typename InS , typename OutT , typename OutS >
VTKM_CONT void vtkm::worklet::RemoveUnusedPoints::MapPointFieldDeep ( const vtkm::cont::ArrayHandle< InT, InS > &  inArray,
vtkm::cont::ArrayHandle< OutT, OutS > &  outArray 
) const
inline

Maps a point field from the original points to the new reduced points.

Given an array handle that holds the values for a point field of the original data set, returns a new array handle containing field values rearranged to the new indices of the reduced point set.

This version of point mapping performs a deep copy into the destination array provided.

◆ MapPointFieldDeep() [2/4]

template<typename T , typename S >
VTKM_CONT vtkm::cont::ArrayHandle<T> vtkm::worklet::RemoveUnusedPoints::MapPointFieldDeep ( const vtkm::cont::ArrayHandle< T, S > &  inArray) const
inline

Maps a point field from the original points to the new reduced points.

Given an array handle that holds the values for a point field of the original data set, returns a new array handle containing field values rearranged to the new indices of the reduced point set.

This version of point mapping performs a deep copy into the destination array provided.

◆ MapPointFieldDeep() [3/4]

template<typename InValueTypes , typename InStorageTypes >
VTKM_CONT vtkm::cont::UncertainArrayHandle<InValueTypes, InStorageTypes> vtkm::worklet::RemoveUnusedPoints::MapPointFieldDeep ( const vtkm::cont::UncertainArrayHandle< InValueTypes, InStorageTypes > &  inArray) const
inline

Maps a point field from the original points to the new reduced points.

Given an array handle that holds the values for a point field of the original data set, returns a new array handle containing field values rearranged to the new indices of the reduced point set.

This version of point mapping performs a deep copy into the destination array provided.

◆ MapPointFieldDeep() [4/4]

template<typename InValueTypes , typename InStorageTypes , typename OutArrayHandle >
VTKM_CONT void vtkm::worklet::RemoveUnusedPoints::MapPointFieldDeep ( const vtkm::cont::UncertainArrayHandle< InValueTypes, InStorageTypes > &  inArray,
OutArrayHandle &  outArray 
) const
inline

Maps a point field from the original points to the new reduced points.

Given an array handle that holds the values for a point field of the original data set, returns a new array handle containing field values rearranged to the new indices of the reduced point set.

This version of point mapping performs a deep copy into the destination array provided.

◆ MapPointFieldShallow()

template<typename InArrayHandle >
VTKM_CONT vtkm::cont::ArrayHandlePermutation<vtkm::cont::ArrayHandle<vtkm::Id>, InArrayHandle> vtkm::worklet::RemoveUnusedPoints::MapPointFieldShallow ( const InArrayHandle &  inArray) const
inline

Maps a point field from the original points to the new reduced points.

Given an array handle that holds the values for a point field of the original data set, returns a new array handle containing field values rearranged to the new indices of the reduced point set.

This version of point mapping performs a shallow copy by using a permutation array.

Member Data Documentation

◆ MaskArray

vtkm::cont::ArrayHandle<vtkm::IdComponent> vtkm::worklet::RemoveUnusedPoints::MaskArray
private

◆ PointScatter

std::shared_ptr<vtkm::worklet::ScatterCounting> vtkm::worklet::RemoveUnusedPoints::PointScatter
private

Manages how the original point indices map to the new point indices.


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