@@ -384,11 +384,11 @@ using Segment_ = base::SegVec<typ::IsSegment,T>;
384
384
template <typename T>
385
385
using OSegment_ = base::SegVec<typ::IsOSeg,T>;
386
386
387
- // / \todo 20250127: remove the first one and replace with `PointPair_`
388
- template <typename T>
389
- using PointPair1_ = std::pair<Point2d_<T>,Point2d_<T>>;
387
+
390
388
template <typename T1,typename T2>
391
389
using PointPair2_ = std::pair<Point2d_<T1>,Point2d_<T2>>;
390
+ template <typename T>
391
+ using PointPair_ = std::pair<Point2d_<T>,Point2d_<T>>;
392
392
393
393
template <typename T>
394
394
using CPolyline_ = base::PolylineBase<typ::IsClosed,T>;
@@ -1281,7 +1281,7 @@ shareCommonCoord( const std::pair<Point2d_<FPT1>,Point2d_<FPT2>>& ppts )
1281
1281
// / Private free function, get top-left and bottom-right points from two arbitrary points
1282
1282
/* * Throws if one of the coordinates is equal to the other (x1=x2 or y1=y2)*/
1283
1283
template <typename FPT>
1284
- PointPair1_ <FPT>
1284
+ PointPair_ <FPT>
1285
1285
getCorrectPoints ( const Point2d_<FPT>& p0, const Point2d_<FPT>& p1 )
1286
1286
{
1287
1287
#ifndef HOMOG2D_NOCHECKS
@@ -2487,7 +2487,7 @@ class Intersect<Inters_2,FPT>: public IntersectCommon
2487
2487
}
2488
2488
size_t size () const { return _doesIntersect?2 :0 ; }
2489
2489
2490
- PointPair1_ <FPT>
2490
+ PointPair_ <FPT>
2491
2491
get () const
2492
2492
{
2493
2493
if ( !_doesIntersect )
@@ -2629,7 +2629,7 @@ class FRect_: public detail::Common<FPT>
2629
2629
2630
2630
// / Constructor from pair of points
2631
2631
template <typename FPT2>
2632
- FRect_ ( const PointPair1_ <FPT2>& ppts )
2632
+ FRect_ ( const PointPair_ <FPT2>& ppts )
2633
2633
{
2634
2634
set ( ppts.first , ppts.second );
2635
2635
}
@@ -2730,7 +2730,7 @@ class FRect_: public detail::Common<FPT>
2730
2730
2731
2731
// / Returns the 2 major points of the rectangle
2732
2732
// / \sa getPts( const FRect_<FPT>& )
2733
- PointPair1_ <FPT>
2733
+ PointPair_ <FPT>
2734
2734
getPts () const
2735
2735
{
2736
2736
return std::make_pair ( _ptR1, _ptR2 );
@@ -3445,7 +3445,7 @@ Use of Sfinae so it can be selected only for arithmetic types
3445
3445
3446
3446
private:
3447
3447
template <typename FPT2>
3448
- bool implC_isInside ( const PointPair1_ <FPT2>& ppts ) const
3448
+ bool implC_isInside ( const PointPair_ <FPT2>& ppts ) const
3449
3449
{
3450
3450
const auto & p1 = ppts.first ;
3451
3451
const auto & p2 = ppts.second ;
@@ -4098,15 +4098,15 @@ Thus, we need the second one.
4098
4098
4099
4099
// / Returns a pair of points that are lying on line at distance \c dist from a point defined by one of its coordinates.
4100
4100
template <typename FPT2>
4101
- PointPair1_ <FPT>
4101
+ PointPair_ <FPT>
4102
4102
getPoints ( GivenCoord gc, FPT coord, FPT2 dist ) const
4103
4103
{
4104
4104
return impl_getPoints_A ( gc, coord, dist, detail::BaseHelper<LP>() );
4105
4105
}
4106
4106
4107
4107
// / Returns a pair of points that are lying on line at distance \c dist from point \c pt, assuming that one is lying on the line.
4108
4108
template <typename FPT2>
4109
- PointPair1_ <FPT>
4109
+ PointPair_ <FPT>
4110
4110
getPoints ( const Point2d_<FPT>& pt, FPT2 dist ) const
4111
4111
{
4112
4112
return impl_getPoints_B ( pt, dist, detail::BaseHelper<LP>() );
@@ -4384,13 +4384,13 @@ Please check out warning described in impl_getAngle()
4384
4384
constexpr Point2d_<FPT> impl_getPoint ( GivenCoord gc, FPT other, const detail::BaseHelper<typename typ::IsPoint>& ) const ;
4385
4385
4386
4386
template <typename FPT2>
4387
- PointPair2_<FPT, FPT> impl_getPoints_A ( GivenCoord, FPT, FPT2, const detail::BaseHelper<typename typ::IsLine>& ) const ;
4387
+ PointPair_< FPT> impl_getPoints_A ( GivenCoord, FPT, FPT2, const detail::BaseHelper<typename typ::IsLine>& ) const ;
4388
4388
template <typename FPT2>
4389
- constexpr PointPair2_<FPT, FPT> impl_getPoints_A ( GivenCoord, FPT, FPT2, const detail::BaseHelper<typename typ::IsPoint>& ) const ;
4389
+ constexpr PointPair_< FPT> impl_getPoints_A ( GivenCoord, FPT, FPT2, const detail::BaseHelper<typename typ::IsPoint>& ) const ;
4390
4390
template <typename FPT2>
4391
- PointPair2_<FPT, FPT> impl_getPoints_B ( const Point2d_<FPT>&, FPT2, const detail::BaseHelper<typename typ::IsLine>& ) const ;
4391
+ PointPair_< FPT> impl_getPoints_B ( const Point2d_<FPT>&, FPT2, const detail::BaseHelper<typename typ::IsLine>& ) const ;
4392
4392
template <typename FPT2>
4393
- constexpr PointPair2_<FPT, FPT> impl_getPoints_B ( const Point2d_<FPT>&, FPT2, const detail::BaseHelper<typename typ::IsPoint>& ) const ;
4393
+ constexpr PointPair_< FPT> impl_getPoints_B ( const Point2d_<FPT>&, FPT2, const detail::BaseHelper<typename typ::IsPoint>& ) const ;
4394
4394
4395
4395
void impl_op_stream ( std::ostream&, const Point2d_<FPT>& ) const ;
4396
4396
void impl_op_stream ( std::ostream&, const Line2d_<FPT>& ) const ;
@@ -5270,7 +5270,7 @@ Requires both points inside AND no intersections
5270
5270
If x-coordinate are equal, then
5271
5271
the one with smallest y-coordinate will be returned first
5272
5272
*/
5273
- PointPair1_ <FPT>
5273
+ PointPair_ <FPT>
5274
5274
getPts () const
5275
5275
{
5276
5276
return std::make_pair ( _ptS1, _ptS2 );
@@ -5879,7 +5879,7 @@ template<
5879
5879
T
5880
5880
>::type* = nullptr
5881
5881
>
5882
- PointPair1_ <typename T::value_type::FType>
5882
+ PointPair_ <typename T::value_type::FType>
5883
5883
getBB_Points ( const T& vpts )
5884
5884
{
5885
5885
HOMOG2D_START;
@@ -8843,14 +8843,14 @@ LPBase<LP,FPT>::impl_getPoint( GivenCoord gc, FPT other, const detail::BaseHelpe
8843
8843
// / ILLEGAL INSTANCIATION
8844
8844
template <typename LP,typename FPT>
8845
8845
template <typename FPT2>
8846
- constexpr PointPair1_ <FPT>
8846
+ constexpr PointPair_ <FPT>
8847
8847
LPBase<LP,FPT>::impl_getPoints_A( GivenCoord, FPT, FPT2, const detail::BaseHelper<typename typ::IsPoint>& ) const
8848
8848
{
8849
8849
static_assert ( detail::AlwaysFalse<LP>::value, " Invalid: you cannot call getPoints() on a point" );
8850
8850
}
8851
8851
template <typename LP,typename FPT>
8852
8852
template <typename FPT2>
8853
- constexpr PointPair1_ <FPT>
8853
+ constexpr PointPair_ <FPT>
8854
8854
LPBase<LP,FPT>::impl_getPoints_B( const Point2d_<FPT>&, FPT2, const detail::BaseHelper<typename typ::IsPoint>& ) const
8855
8855
{
8856
8856
static_assert ( detail::AlwaysFalse<LP>::value, " Invalid: you cannot call getPoints() on a point" );
@@ -8859,7 +8859,7 @@ LPBase<LP,FPT>::impl_getPoints_B( const Point2d_<FPT>&, FPT2, const detail::Base
8859
8859
// / Returns pair of points on line at distance \c dist from point on line at coord \c coord. Implementation for lines
8860
8860
template <typename LP,typename FPT>
8861
8861
template <typename FPT2>
8862
- PointPair2_<FPT, FPT>
8862
+ PointPair_< FPT>
8863
8863
LPBase<LP,FPT>::impl_getPoints_A( GivenCoord gc, FPT coord, FPT2 dist, const detail::BaseHelper<typename typ::IsLine>& ) const
8864
8864
{
8865
8865
const auto pt = impl_getPoint ( gc, coord, detail::BaseHelper<typ::IsLine>() );
@@ -8869,7 +8869,7 @@ LPBase<LP,FPT>::impl_getPoints_A( GivenCoord gc, FPT coord, FPT2 dist, const det
8869
8869
// / Returns pair of points on line at distance \c dist from point on line at coord \c coord. Implementation for lines
8870
8870
template <typename LP,typename FPT>
8871
8871
template <typename FPT2>
8872
- PointPair2_<FPT, FPT>
8872
+ PointPair_< FPT>
8873
8873
LPBase<LP,FPT>::impl_getPoints_B( const Point2d_<FPT>& pt, FPT2 dist, const detail::BaseHelper<typename typ::IsLine>& ) const
8874
8874
{
8875
8875
#ifndef HOMOG2D_NOCHECKS
@@ -10135,7 +10135,7 @@ getPointPair( const T& elem )
10135
10135
10136
10136
// / Needed because of variant
10137
10137
template <typename FPT>
10138
- PointPair2_<FPT, FPT>
10138
+ PointPair_< FPT>
10139
10139
getPointPair ( const Line2d_<FPT>& )
10140
10140
{
10141
10141
HOMOG2D_START;
@@ -10160,7 +10160,7 @@ namespace fct {
10160
10160
struct PtPairFunct
10161
10161
{
10162
10162
template <typename T>
10163
- PointPair1_ <typename T::FType>
10163
+ PointPair_ <typename T::FType>
10164
10164
operator ()(const T& a)
10165
10165
{
10166
10166
return ppair::getPointPair (a);
@@ -10285,7 +10285,7 @@ getBB_CommonType( const std::vector<CommonType_<FPT>>& v_var )
10285
10285
10286
10286
std::vector<Point2d_<FPT>> vpts;
10287
10287
vpts.reserve ( v_var.size ()*2 );
10288
- PointPair2_<FPT, FPT> ppair;
10288
+ PointPair_< FPT> ppair;
10289
10289
for ( const auto & elem: v_var )
10290
10290
{
10291
10291
try
@@ -10594,7 +10594,7 @@ class ClosestPoints
10594
10594
}
10595
10595
10596
10596
public:
10597
- PointPair1_ <HOMOG2D_INUMTYPE>
10597
+ PointPair_ <HOMOG2D_INUMTYPE>
10598
10598
getPoints () const
10599
10599
{
10600
10600
return std::make_pair (
@@ -11822,7 +11822,7 @@ Used both in the SVG and the Opencv backends
11822
11822
namespace priv {
11823
11823
11824
11824
template <typename FPT>
11825
- std::array<PointPair1_ <double >,3 >
11825
+ std::array<PointPair_ <double >,3 >
11826
11826
getArrowSegments (
11827
11827
const base::SegVec<typ::IsOSeg,FPT>& vec
11828
11828
)
@@ -12419,6 +12419,11 @@ using OPolylineF = OPolyline_<float>;
12419
12419
using OPolylineD = OPolyline_<double >;
12420
12420
using OPolylineL = OPolyline_<long double >;
12421
12421
12422
+ using PointPairF = PointPair_<float >;
12423
+ using PointPairD = PointPair_<double >;
12424
+ using PointPairL = PointPair_<long double >;
12425
+ using PointPair = PointPair_<double >;
12426
+
12422
12427
#ifdef HOMOG2D_ENABLE_VRTP
12423
12428
// variant type
12424
12429
using CommonType = CommonType_<HOMOG2D_INUMTYPE>;
0 commit comments