//============================================================================ // Copyright (c) Kitware, Inc. // All rights reserved. // See LICENSE.txt for details. // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notice for more information. //============================================================================ #ifndef vtk_m_exec_CellInside_h #define vtk_m_exec_CellInside_h #include #include #include namespace vtkm { namespace exec { template static inline VTKM_EXEC bool CellInside(const vtkm::Vec& pcoords, CellShapeTag) { using VtkcTagType = typename vtkm::internal::CellShapeTagVtkmToVtkc::Type; return lcl::cellInside(VtkcTagType{}, pcoords); } template static inline VTKM_EXEC bool CellInside(const vtkm::Vec&, vtkm::CellShapeTagEmpty) { return false; } template static inline VTKM_EXEC bool CellInside(const vtkm::Vec& pcoords, vtkm::CellShapeTagPolyLine) { return pcoords[0] >= T(0) && pcoords[0] <= T(1); } /// Checks if the parametric coordinates `pcoords` are on the inside for the /// specified cell type. /// template static inline VTKM_EXEC bool CellInside(const vtkm::Vec& pcoords, vtkm::CellShapeTagGeneric shape) { bool result = false; switch (shape.Id) { vtkmGenericCellShapeMacro(result = CellInside(pcoords, CellShapeTag())); default: break; } return result; } } } // vtkm::exec #endif // vtk_m_exec_CellInside_h