From 7aaeae800273114ed6d285dd4142b8a405b5c945 Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Tue, 14 May 2024 17:56:06 +0200 Subject: [PATCH] Update src/coordinates.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jianxiang Wang (王健翔) --- src/coordinates.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/coordinates.h b/src/coordinates.h index 804ae36c60af7..9e433c45fe68c 100644 --- a/src/coordinates.h +++ b/src/coordinates.h @@ -793,7 +793,25 @@ direction direction_from( const coords::coord_point +template, int> = 0> +std::vector < coords::coord_point < Point, Origin, Scale, LhsInBounds && RhsInBounds >> + line_to( const coords::coord_point &loc1, + const coords::coord_point &loc2, + const int t = 0 ) +{ + std::vector raw_result = line_to( loc1.raw(), loc2.raw(), t ); + std::vector < coords::coord_point < Point, Origin, Scale, LhsInBounds &&RhsInBounds >> result; + std::transform( raw_result.begin(), raw_result.end(), std::back_inserter( result ), + []( const Point & p ) { + return coords::coord_point < Point, Origin, Scale, LhsInBounds && + RhsInBounds >::make_unchecked( p ); + } ); + return result; +} + +template, int> = 0> std::vector < coords::coord_point < Point, Origin, Scale, LhsInBounds &&RhsInBounds >> line_to( const coords::coord_point &loc1, const coords::coord_point &loc2, int t = 0, int t2 = 0 )