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);
94 if ((lastCell.
CellId >= 0) && (lastCell.
CellId < this->CellSet.GetNumberOfElements()) &&
103 if ((lastCell.
BinIdx >= 0) && (lastCell.
BinIdx < this->CellIds.GetNumberOfValues()) &&
111 return this->FindCellImpl(point, cellId, parametric, lastCell);
114 VTKM_DEPRECATED(1.6,
"Locators are no longer pointers. Use . operator.")
116 VTKM_DEPRECATED(1.6,
"Locators are no longer pointers. Use . operator.")
122 if (point[0] < this->Origin[0] || point[0] > this->MaxPoint[0])
124 if (point[1] < this->Origin[1] || point[1] > this->MaxPoint[1])
126 if (point[2] < this->Origin[2] || point[2] > this->MaxPoint[2])
141 if (!this->IsInside(point))
151 temp = point - this->Origin;
152 temp = temp * this->InvSpacing;
155 logicalCell = vtkm::Min(
vtkm::Id3(temp), this->MaxCellIds);
158 (logicalCell[2] * this->CellDims[1] + logicalCell[1]) * this->CellDims[0] + logicalCell[0];
172 template <
typename Po
intsVecType>
187 template <
typename CellShapeTag,
typename CoordsType>
189 CellShapeTag cellShape,
190 CoordsType cellPoints,
194 auto bounds = this->ComputeCellBounds(cellPoints);
195 if (bounds.Contains(point))
198 cellPoints, point, cellShape, parametricCoordinates));
199 inside = vtkm::exec::CellInside(parametricCoordinates, cellShape);
215 auto binIds = this->CellIds.Get(binIdx);
237 auto indices = this->CellSet.GetIndices(cid);
241 auto status = this->PointInsideCell(point, this->CellSet.GetCellShape(cid), pts, pc, inside);
266 #endif //vtk_m_exec_CellLocatorUniformBins_h
A tag used to identify the point elements in a topology.
Definition: TopologyElementTag.h:34
ErrorCode
Definition: ErrorCode.h:19
#define VTKM_EXEC
Definition: ExportMacros.h:51
Groups connected points that have the same field value.
Definition: Atomic.h:19
VTKM_EXEC VecFromPortalPermute< IndexVecType, PortalType > make_VecFromPortalPermute(const IndexVecType *index, const PortalType &portal)
Definition: VecFromPortalPermute.h:166
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
Fancy array handle that groups values into vectors of different sizes.
Definition: ArrayHandleGroupVecVariable.h:255
typename StorageType::ReadPortalType ReadPortalType
Definition: ArrayHandle.h:294
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
Definition: CoordinateSystem.h:25
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
VTKM_EXEC_CONT void Include(const vtkm::Vec< T, 3 > &point)
Expand bounds to include a point.
Definition: Bounds.h:175
#define VTKM_CONT
Definition: ExportMacros.h:57
Represent an axis-aligned 3D bounds in space.
Definition: Bounds.h:29
Definition: DeviceAdapterTag.h:52
#define VTKM_RETURN_ON_ERROR(call)
Definition: ErrorCode.h:111
A tag used to identify the cell elements in a topology.
Definition: TopologyElementTag.h:24
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:92
#define VTKM_DEPRECATED(...)
Definition: Deprecated.h:145
static vtkm::IdComponent GetNumberOfComponents(const VecType &vec)
Number of components in the given vector.