Viskores  1.0
Classes | Public Member Functions | Private Types | Static Private Member Functions | Private Attributes | List of all members
viskores::exec::CellLocatorRectilinearGrid Class Reference

Structure for locating cells. More...

#include <CellLocatorRectilinearGrid.h>

Classes

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

Public Member Functions

template<viskores::IdComponent dimensions>
 CellLocatorRectilinearGrid (const viskores::Id planeSize, const viskores::Id rowSize, const viskores::cont::CellSetStructured< dimensions > &cellSet, const RectilinearType &coords, viskores::cont::DeviceAdapterId device, viskores::cont::Token &token)
 
bool IsInside (const viskores::Vec3f &point) const
 
viskores::ErrorCode FindCell (const viskores::Vec3f &point, viskores::Id &cellId, viskores::Vec3f &parametric, LastCell &) const
 Locate the cell containing the provided point. More...
 
viskores::ErrorCode FindCell (const viskores::Vec3f &point, viskores::Id &cellId, viskores::Vec3f &parametric) const
 Locate the cell containing the provided point. More...
 

Private Types

using AxisHandle = viskores::cont::ArrayHandle< viskores::FloatDefault >
 
using RectilinearType = viskores::cont::ArrayHandleCartesianProduct< AxisHandle, AxisHandle, AxisHandle >
 
using AxisPortalType = typename AxisHandle::ReadPortalType
 
using RectilinearPortalType = typename RectilinearType::ReadPortalType
 

Static Private Member Functions

static viskores::Id3 && ToId3 (viskores::Id3 &&src)
 
static viskores::Id3 ToId3 (viskores::Id2 &&src)
 
static viskores::Id3 ToId3 (viskores::Id &&src)
 

Private Attributes

viskores::Id PlaneSize
 
viskores::Id RowSize
 
AxisPortalType AxisPortals [3]
 
viskores::Id3 PointDimensions
 
viskores::Vec3f MinPoint
 
viskores::Vec3f MaxPoint
 
viskores::Id Dimensions
 

Detailed Description

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::CellLocatorRectilinearGrid when passed to a worklet.

Member Typedef Documentation

◆ AxisHandle

◆ AxisPortalType

◆ RectilinearPortalType

◆ RectilinearType

Constructor & Destructor Documentation

◆ CellLocatorRectilinearGrid()

template<viskores::IdComponent dimensions>
viskores::exec::CellLocatorRectilinearGrid::CellLocatorRectilinearGrid ( const viskores::Id  planeSize,
const viskores::Id  rowSize,
const viskores::cont::CellSetStructured< dimensions > &  cellSet,
const RectilinearType coords,
viskores::cont::DeviceAdapterId  device,
viskores::cont::Token token 
)
inline

Member Function Documentation

◆ FindCell() [1/2]

viskores::ErrorCode viskores::exec::CellLocatorRectilinearGrid::FindCell ( const viskores::Vec3f point,
viskores::Id cellId,
viskores::Vec3f 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]

viskores::ErrorCode viskores::exec::CellLocatorRectilinearGrid::FindCell ( const viskores::Vec3f point,
viskores::Id cellId,
viskores::Vec3f parametric,
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.

◆ IsInside()

bool viskores::exec::CellLocatorRectilinearGrid::IsInside ( const viskores::Vec3f point) const
inline

◆ ToId3() [1/3]

static viskores::Id3 viskores::exec::CellLocatorRectilinearGrid::ToId3 ( viskores::Id &&  src)
inlinestaticprivate

◆ ToId3() [2/3]

static viskores::Id3 viskores::exec::CellLocatorRectilinearGrid::ToId3 ( viskores::Id2 &&  src)
inlinestaticprivate

◆ ToId3() [3/3]

static viskores::Id3&& viskores::exec::CellLocatorRectilinearGrid::ToId3 ( viskores::Id3 &&  src)
inlinestaticprivate

Member Data Documentation

◆ AxisPortals

AxisPortalType viskores::exec::CellLocatorRectilinearGrid::AxisPortals[3]
private

◆ Dimensions

viskores::Id viskores::exec::CellLocatorRectilinearGrid::Dimensions
private

◆ MaxPoint

viskores::Vec3f viskores::exec::CellLocatorRectilinearGrid::MaxPoint
private

◆ MinPoint

viskores::Vec3f viskores::exec::CellLocatorRectilinearGrid::MinPoint
private

◆ PlaneSize

viskores::Id viskores::exec::CellLocatorRectilinearGrid::PlaneSize
private

◆ PointDimensions

viskores::Id3 viskores::exec::CellLocatorRectilinearGrid::PointDimensions
private

◆ RowSize

viskores::Id viskores::exec::CellLocatorRectilinearGrid::RowSize
private

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