VTK-m  2.3
Classes | Public Member Functions | Private Attributes | List of all members
vtkm::exec::CellLocatorUniformGrid Class Reference

Structure for locating cells. More...

#include <CellLocatorUniformGrid.h>

Classes

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

Public Member Functions

 CellLocatorUniformGrid (const vtkm::Id3 cellDims, const vtkm::Vec3f origin, const vtkm::Vec3f invSpacing, const vtkm::Vec3f maxPoint)
 
bool IsInside (const vtkm::Vec3f &point) const
 
vtkm::ErrorCode FindCell (const vtkm::Vec3f &point, vtkm::Id &cellId, vtkm::Vec3f &parametric, LastCell &lastCell) const
 Locate the cell containing the provided point. More...
 
vtkm::ErrorCode FindCell (const vtkm::Vec3f &point, vtkm::Id &cellId, vtkm::Vec3f &parametric) const
 Locate the cell containing the provided point. More...
 

Private Attributes

vtkm::Id3 CellDims
 
vtkm::Id3 MaxCellIds
 
vtkm::Vec3f Origin
 
vtkm::Vec3f InvSpacing
 
vtkm::Vec3f MaxPoint
 

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 vtkm::cont::CellLocatorUniformGrid when passed to a worklet.

Constructor & Destructor Documentation

◆ CellLocatorUniformGrid()

vtkm::exec::CellLocatorUniformGrid::CellLocatorUniformGrid ( const vtkm::Id3  cellDims,
const vtkm::Vec3f  origin,
const vtkm::Vec3f  invSpacing,
const vtkm::Vec3f  maxPoint 
)
inline

Member Function Documentation

◆ FindCell() [1/2]

vtkm::ErrorCode vtkm::exec::CellLocatorUniformGrid::FindCell ( const vtkm::Vec3f point,
vtkm::Id cellId,
vtkm::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 vtkm::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 vtkm::ErrorCode::Success if a cell is found. If a cell is not found, vtkm::ErrorCode::CellNotFound is returned and cellId is set to -1.

◆ FindCell() [2/2]

vtkm::ErrorCode vtkm::exec::CellLocatorUniformGrid::FindCell ( const vtkm::Vec3f point,
vtkm::Id cellId,
vtkm::Vec3f 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 vtkm::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 vtkm::ErrorCode::Success if a cell is found. If a cell is not found, vtkm::ErrorCode::CellNotFound is returned and cellId is set to -1.

◆ IsInside()

bool vtkm::exec::CellLocatorUniformGrid::IsInside ( const vtkm::Vec3f point) const
inline

Member Data Documentation

◆ CellDims

vtkm::Id3 vtkm::exec::CellLocatorUniformGrid::CellDims
private

◆ InvSpacing

vtkm::Vec3f vtkm::exec::CellLocatorUniformGrid::InvSpacing
private

◆ MaxCellIds

vtkm::Id3 vtkm::exec::CellLocatorUniformGrid::MaxCellIds
private

◆ MaxPoint

vtkm::Vec3f vtkm::exec::CellLocatorUniformGrid::MaxPoint
private

◆ Origin

vtkm::Vec3f vtkm::exec::CellLocatorUniformGrid::Origin
private

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