Viskores  1.0
Classes | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
viskores::exec::CellLocatorTwoLevel< CellStructureType > Class Template Reference

Structure for locating cells. More...

#include <CellLocatorTwoLevel.h>

Classes

struct  LastCell
 Structure capturing the location of a cell in the search structure. More...
 

Public Member Functions

template<typename CellSetType >
 CellLocatorTwoLevel (const viskores::internal::cl_uniform_bins::Grid &topLevelGrid, const viskores::cont::ArrayHandle< DimVec3 > &leafDimensions, const viskores::cont::ArrayHandle< viskores::Id > &leafStartIndex, const viskores::cont::ArrayHandle< viskores::Id > &cellStartIndex, const viskores::cont::ArrayHandle< viskores::Id > &cellCount, const viskores::cont::ArrayHandle< viskores::Id > &cellIds, const CellSetType &cellSet, const viskores::cont::CoordinateSystem &coords, viskores::cont::DeviceAdapterId device, viskores::cont::Token &token)
 
viskores::ErrorCode FindCell (const FloatVec3 &point, viskores::Id &cellId, FloatVec3 &parametric) const
 Locate the cell containing the provided point. More...
 
viskores::ErrorCode FindCell (const FloatVec3 &point, viskores::Id &cellId, FloatVec3 &parametric, LastCell &lastCell) const
 Locate the cell containing the provided point. More...
 

Private Types

using DimVec3 = viskores::internal::cl_uniform_bins::DimVec3
 
using FloatVec3 = viskores::internal::cl_uniform_bins::FloatVec3
 
template<typename T >
using ReadPortal = typename viskores::cont::ArrayHandle< T >::ReadPortalType
 
using CoordsPortalType = typename viskores::cont::CoordinateSystem::MultiplexerArrayType::ReadPortalType
 

Private Member Functions

viskores::ErrorCode PointInCell (const viskores::Vec3f &point, const viskores::Id &cid, viskores::Vec3f &parametric) const
 
viskores::ErrorCode PointInLeaf (const FloatVec3 &point, const viskores::Id &leafIdx, viskores::Id &cellId, FloatVec3 &parametric) const
 
viskores::ErrorCode FindCellImpl (const FloatVec3 &point, viskores::Id &cellId, FloatVec3 &parametric, LastCell &lastCell) const
 

Static Private Member Functions

template<typename CellShapeTag , typename CoordsType >
static viskores::ErrorCode PointInsideCell (FloatVec3 point, CellShapeTag cellShape, CoordsType cellPoints, FloatVec3 &parametricCoordinates, bool &inside)
 

Private Attributes

viskores::internal::cl_uniform_bins::Grid TopLevel
 
ReadPortal< DimVec3LeafDimensions
 
ReadPortal< viskores::IdLeafStartIndex
 
ReadPortal< viskores::IdCellStartIndex
 
ReadPortal< viskores::IdCellCount
 
ReadPortal< viskores::IdCellIds
 
CellStructureType CellSet
 
CoordsPortalType Coords
 

Detailed Description

template<typename CellStructureType>
class viskores::exec::CellLocatorTwoLevel< CellStructureType >

Structure for locating cells.

Use the FindCell() method to identify which cell contains a point in space. The FindCell() method optionally takes a LastCell object, which is a structure nested in this class. The LastCell object can help speed locating cells for successive finds at nearby points.

This class is provided by viskores::cont::CellLocatorTwoLevel when passed to a worklet.

Member Typedef Documentation

◆ CoordsPortalType

template<typename CellStructureType >
using viskores::exec::CellLocatorTwoLevel< CellStructureType >::CoordsPortalType = typename viskores::cont::CoordinateSystem::MultiplexerArrayType::ReadPortalType
private

◆ DimVec3

template<typename CellStructureType >
using viskores::exec::CellLocatorTwoLevel< CellStructureType >::DimVec3 = viskores::internal::cl_uniform_bins::DimVec3
private

◆ FloatVec3

template<typename CellStructureType >
using viskores::exec::CellLocatorTwoLevel< CellStructureType >::FloatVec3 = viskores::internal::cl_uniform_bins::FloatVec3
private

◆ ReadPortal

template<typename CellStructureType >
template<typename T >
using viskores::exec::CellLocatorTwoLevel< CellStructureType >::ReadPortal = typename viskores::cont::ArrayHandle<T>::ReadPortalType
private

Constructor & Destructor Documentation

◆ CellLocatorTwoLevel()

template<typename CellStructureType >
template<typename CellSetType >
viskores::exec::CellLocatorTwoLevel< CellStructureType >::CellLocatorTwoLevel ( const viskores::internal::cl_uniform_bins::Grid &  topLevelGrid,
const viskores::cont::ArrayHandle< DimVec3 > &  leafDimensions,
const viskores::cont::ArrayHandle< viskores::Id > &  leafStartIndex,
const viskores::cont::ArrayHandle< viskores::Id > &  cellStartIndex,
const viskores::cont::ArrayHandle< viskores::Id > &  cellCount,
const viskores::cont::ArrayHandle< viskores::Id > &  cellIds,
const CellSetType &  cellSet,
const viskores::cont::CoordinateSystem coords,
viskores::cont::DeviceAdapterId  device,
viskores::cont::Token token 
)
inline

Member Function Documentation

◆ FindCell() [1/2]

template<typename CellStructureType >
viskores::ErrorCode viskores::exec::CellLocatorTwoLevel< CellStructureType >::FindCell ( const FloatVec3 point,
viskores::Id cellId,
FloatVec3 parametric 
) const
inline

Locate the cell containing the provided point.

Given the point coordinate point, this method determines which cell contains that point. The identification of the cell is returned in the cellId reference parameter. The method also determines the cell's parametric coordinates to the point and returns that in the parametric reference parameter. This result can be used in functions like viskores::exec::CellInterpolate().

FindCell() takes an optional LastCell parameter. This parameter captures the location of the found cell and can be passed to the next call of FindCell(). If the subsequent FindCell() call is for a point that is in or near the same cell, the operation may go faster.

This method will return viskores::ErrorCode::Success if a cell is found. If a cell is not found, viskores::ErrorCode::CellNotFound is returned and cellId is set to -1.

◆ FindCell() [2/2]

template<typename CellStructureType >
viskores::ErrorCode viskores::exec::CellLocatorTwoLevel< CellStructureType >::FindCell ( const FloatVec3 point,
viskores::Id cellId,
FloatVec3 parametric,
LastCell lastCell 
) const
inline

Locate the cell containing the provided point.

Given the point coordinate point, this method determines which cell contains that point. The identification of the cell is returned in the cellId reference parameter. The method also determines the cell's parametric coordinates to the point and returns that in the parametric reference parameter. This result can be used in functions like viskores::exec::CellInterpolate().

FindCell() takes an optional LastCell parameter. This parameter captures the location of the found cell and can be passed to the next call of FindCell(). If the subsequent FindCell() call is for a point that is in or near the same cell, the operation may go faster.

This method will return viskores::ErrorCode::Success if a cell is found. If a cell is not found, viskores::ErrorCode::CellNotFound is returned and cellId is set to -1.

◆ FindCellImpl()

template<typename CellStructureType >
viskores::ErrorCode viskores::exec::CellLocatorTwoLevel< CellStructureType >::FindCellImpl ( const FloatVec3 point,
viskores::Id cellId,
FloatVec3 parametric,
LastCell lastCell 
) const
inlineprivate

◆ PointInCell()

template<typename CellStructureType >
viskores::ErrorCode viskores::exec::CellLocatorTwoLevel< CellStructureType >::PointInCell ( const viskores::Vec3f point,
const viskores::Id cid,
viskores::Vec3f parametric 
) const
inlineprivate

◆ PointInLeaf()

template<typename CellStructureType >
viskores::ErrorCode viskores::exec::CellLocatorTwoLevel< CellStructureType >::PointInLeaf ( const FloatVec3 point,
const viskores::Id leafIdx,
viskores::Id cellId,
FloatVec3 parametric 
) const
inlineprivate

◆ PointInsideCell()

template<typename CellStructureType >
template<typename CellShapeTag , typename CoordsType >
static viskores::ErrorCode viskores::exec::CellLocatorTwoLevel< CellStructureType >::PointInsideCell ( FloatVec3  point,
CellShapeTag  cellShape,
CoordsType  cellPoints,
FloatVec3 parametricCoordinates,
bool &  inside 
)
inlinestaticprivate

Member Data Documentation

◆ CellCount

template<typename CellStructureType >
ReadPortal<viskores::Id> viskores::exec::CellLocatorTwoLevel< CellStructureType >::CellCount
private

◆ CellIds

template<typename CellStructureType >
ReadPortal<viskores::Id> viskores::exec::CellLocatorTwoLevel< CellStructureType >::CellIds
private

◆ CellSet

template<typename CellStructureType >
CellStructureType viskores::exec::CellLocatorTwoLevel< CellStructureType >::CellSet
private

◆ CellStartIndex

template<typename CellStructureType >
ReadPortal<viskores::Id> viskores::exec::CellLocatorTwoLevel< CellStructureType >::CellStartIndex
private

◆ Coords

template<typename CellStructureType >
CoordsPortalType viskores::exec::CellLocatorTwoLevel< CellStructureType >::Coords
private

◆ LeafDimensions

template<typename CellStructureType >
ReadPortal<DimVec3> viskores::exec::CellLocatorTwoLevel< CellStructureType >::LeafDimensions
private

◆ LeafStartIndex

template<typename CellStructureType >
ReadPortal<viskores::Id> viskores::exec::CellLocatorTwoLevel< CellStructureType >::LeafStartIndex
private

◆ TopLevel

template<typename CellStructureType >
viskores::internal::cl_uniform_bins::Grid viskores::exec::CellLocatorTwoLevel< CellStructureType >::TopLevel
private

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