Go to the documentation of this file.
10 #ifndef vtk_m_exec_CellLocatorUniformBins_h
11 #define vtk_m_exec_CellLocatorUniformBins_h
29 template <
typename CellStructureType>
36 typename vtkm::cont::CoordinateSystem::MultiplexerArrayType::ReadPortalType;
45 template <
typename CellSetType>
53 const CellSetType& cellSet,
60 , InvSpacing(invSpacing)
61 , MaxCellIds(maxCellIds)
62 , CellIds(cellIds.PrepareForInput(device, token))
63 , CellSet(cellSet.PrepareForInput(device,
67 , Coords(coords.GetDataAsMultiplexer().PrepareForInput(device, token))
83 return this->FindCellImpl(point, cellId, parametric, lastCell);
92 vtkm::Id binIdx = this->FindBinIdx(point);
102 else if (binIdx == lastCell.
BinIdx && this->LastCellValid(lastCell))
106 if (this->PointInCell(point, lastCell.
CellId, pc))
113 else if (this->PointInBin(point, lastCell.
BinIdx, cellId, pc, lastCell.
CellId))
123 return this->FindCellImpl(point, cellId, parametric, lastCell, binIdx);
126 VTKM_DEPRECATED(1.6,
"Locators are no longer pointers. Use . operator.")
128 VTKM_DEPRECATED(1.6,
"Locators are no longer pointers. Use . operator.")
134 if (!this->IsInside(point))
138 temp = point - this->Origin;
139 temp = temp * this->InvSpacing;
145 (logicalCell[2] * this->CellDims[1] + logicalCell[1]) * this->CellDims[0] + logicalCell[0];
152 return lastCell.
BinIdx >= 0 && lastCell.
BinIdx < this->CellIds.GetNumberOfValues() &&
153 lastCell.
CellId >= 0 && lastCell.
CellId < this->CellSet.GetNumberOfElements();
158 if (point[0] < this->Origin[0] || point[0] > this->MaxPoint[0])
160 if (point[1] < this->Origin[1] || point[1] > this->MaxPoint[1])
162 if (point[2] < this->Origin[2] || point[2] > this->MaxPoint[2])
181 binIdx = this->FindBinIdx(point);
194 if (this->PointInBin(point, binIdx, cellId, pc))
205 template <
typename Po
intsVecType>
220 template <
typename CellShapeTag,
typename CoordsType>
222 CellShapeTag cellShape,
223 CoordsType cellPoints,
227 auto bounds = this->ComputeCellBounds(cellPoints);
228 if (bounds.Contains(point))
231 cellPoints, point, cellShape, parametricCoordinates));
232 inside = vtkm::exec::CellInside(parametricCoordinates, cellShape);
247 const vtkm::Id& skipCellId = -1)
const
249 auto binIds = this->CellIds.Get(binIdx);
255 if (cid != skipCellId && this->PointInCell(point, cid, pc))
269 auto indices = this->CellSet.GetIndices(cid);
273 auto status = this->PointInsideCell(point, this->CellSet.GetCellShape(cid), pts, pc, inside);
298 #endif //vtk_m_exec_CellLocatorUniformBins_h
A tag used to identify the point elements in a topology.
Definition: TopologyElementTag.h:34
ErrorCode
Identifies whether an operation was successful or what type of error it had.
Definition: ErrorCode.h:28
#define VTKM_EXEC
Definition: ExportMacros.h:51
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
Fancy array handle that groups values into vectors of different sizes.
Definition: ArrayHandleGroupVecVariable.h:271
@ Success
A successful operation.
typename StorageType::ReadPortalType ReadPortalType
The type of portal used when accessing data in a read-only mode.
Definition: ArrayHandle.h:312
Manages a coordinate system for a DataSet.
Definition: CoordinateSystem.h:30
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
static constexpr vtkm::IdComponent GetNumberOfComponents(const T &)
Returns the number of components in the given vector.
Definition: VecTraits.h:94
VecFromPortalPermute< IndexVecType, PortalType > make_VecFromPortalPermute(const IndexVecType *index, const PortalType &portal)
Definition: VecFromPortalPermute.h:166
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
Represent an axis-aligned 3D bounds in space.
Definition: Bounds.h:29
@ CellNotFound
A cell matching some given criteria could not be found.
An object used to specify a device.
Definition: DeviceAdapterTag.h:58
#define VTKM_RETURN_ON_ERROR(call)
Definition: ErrorCode.h:202
A tag used to identify the cell elements in a topology.
Definition: TopologyElementTag.h:24
void Include(const vtkm::Vec< T, 3 > &point)
Expand bounds to include a point.
Definition: Bounds.h:186
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:89
#define VTKM_DEPRECATED(...)
Definition: Deprecated.h:145