Skip to content

Commit

Permalink
Update ComputationalGeometry.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
paveltomin authored Sep 20, 2024
1 parent 0c6bcef commit d2fc2a6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/coreComponents/mesh/utilities/ComputationalGeometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,15 @@ bool isPointInsidePolyhedron( arrayView2d< real64 const, nodes::REFERENCE_POSITI
return true;
}

/**
* @brief Check if a point is inside a polygon (2D version)
* @tparam POLYGON_TYPE type of @p polygon
* @tparam POINT_TYPE type of @p point
* @param[in] polygon array of ploygon nodes coordinates
* @param[in] n number of polygon nodes
* @param[in] point coordinates of the query point
* @return whether the point is inside
*/
template< typename POLYGON_TYPE, typename POINT_TYPE >
bool isPointInPolygon2d( POLYGON_TYPE const & polygon, integer n, POINT_TYPE const & point )

Check warning on line 446 in src/coreComponents/mesh/utilities/ComputationalGeometry.hpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/mesh/utilities/ComputationalGeometry.hpp#L446

Added line #L446 was not covered by tests
{
Expand All @@ -458,6 +467,15 @@ bool isPointInPolygon2d( POLYGON_TYPE const & polygon, integer n, POINT_TYPE con
return count % 2 == 1;

Check warning on line 467 in src/coreComponents/mesh/utilities/ComputationalGeometry.hpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/mesh/utilities/ComputationalGeometry.hpp#L467

Added line #L467 was not covered by tests
}

/**
* @brief Check if a point is inside a polygon (3D version)
* @tparam POLYGON_TYPE type of @p polygon
* @tparam POINT_TYPE type of @p point
* @param[in] polygon array of ploygon nodes coordinates
* @param[in] n number of polygon nodes
* @param[in] point coordinates of the query point
* @return whether the point is inside
*/
template< typename POLYGON_TYPE, typename POINT_TYPE >
bool isPointInPolygon3d( POLYGON_TYPE const & polygon, integer const n, POINT_TYPE const & point )

Check warning on line 480 in src/coreComponents/mesh/utilities/ComputationalGeometry.hpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/mesh/utilities/ComputationalGeometry.hpp#L480

Added line #L480 was not covered by tests
{
Expand Down

0 comments on commit d2fc2a6

Please sign in to comment.