From e1e5ea0b7deb36eb1173545206c3f281039810b0 Mon Sep 17 00:00:00 2001 From: "S. Kramm" Date: Tue, 4 Feb 2025 11:59:14 +0100 Subject: [PATCH] fixed Segment CC, reorganize some nobuild files --- homog2d.hpp | 25 +++++++++++-------- misc/homog2d.cbp | 9 ++++--- .../{no_build_11.cxx => no_build_poly_1.cxx} | 0 .../{no_build_12.cxx => no_build_poly_2.cxx} | 0 .../{no_build_15.cxx => no_build_poly_3.cxx} | 0 .../{no_build_16.cxx => no_build_poly_4.cxx} | 0 misc/no_build/no_build_seg.cxx | 5 ++++ 7 files changed, 25 insertions(+), 14 deletions(-) rename misc/no_build/{no_build_11.cxx => no_build_poly_1.cxx} (100%) rename misc/no_build/{no_build_12.cxx => no_build_poly_2.cxx} (100%) rename misc/no_build/{no_build_15.cxx => no_build_poly_3.cxx} (100%) rename misc/no_build/{no_build_16.cxx => no_build_poly_4.cxx} (100%) create mode 100644 misc/no_build/no_build_seg.cxx diff --git a/homog2d.hpp b/homog2d.hpp index 9b8d93cc..ca8f4741 100644 --- a/homog2d.hpp +++ b/homog2d.hpp @@ -5046,6 +5046,15 @@ Please note that the source (points) floating-point type is lost SegVec( const SegVec& other ) : _ptS1(other._ptS1), _ptS2(other._ptS2) { +// if constexpr( std::is_same_v && std::is_same_v ) +// HOMOG2D_THROW_ERROR_1( "Cannot build a OSegment from a Segment" ); + static_assert( + ( std::is_same_v + || + ( std::is_same_v && std::is_same_v ) ), + "Cannot build a OSegment from a Segment" + ); + if constexpr( std::is_same_v ) priv::fix_order( _ptS1, _ptS2 ); } @@ -6019,16 +6028,10 @@ class PolylineBase: public detail::Common Type type() const { - return impl_Poly_type( detail::PlHelper() ); - } -private: - Type impl_Poly_type( const detail::PlHelper& ) const - { - return Type::CPolyline; - } - Type impl_Poly_type( const detail::PlHelper& ) const - { - return Type::OPolyline; + if constexpr( std::is_same_v ) + return Type::CPolyline; + else + return Type::OPolyline; } private: @@ -8869,6 +8872,7 @@ constexpr Line2d_ LPBase::impl_getOrthogonalLine_A( GivenCoord, FPT, const detail::BaseHelper& ) const { static_assert( detail::AlwaysFalse::value, "Invalid: you cannot call getOrthogonalLine() on a point" ); + return Line2d_(); // to avoid a compile warning } /// Illegal instanciation @@ -8877,6 +8881,7 @@ constexpr Line2d_ LPBase::impl_getOrthogonalLine_B( const Point2d_&, const detail::BaseHelper& ) const { static_assert( detail::AlwaysFalse::value, "Invalid: you cannot call getOrthogonalLine() on a point" ); + return Line2d_(); // to avoid a compile warning } /// Illegal instanciation diff --git a/misc/homog2d.cbp b/misc/homog2d.cbp index 6f449d91..4b8207da 100644 --- a/misc/homog2d.cbp +++ b/misc/homog2d.cbp @@ -162,12 +162,8 @@ - - - - @@ -176,6 +172,11 @@ + + + + + diff --git a/misc/no_build/no_build_11.cxx b/misc/no_build/no_build_poly_1.cxx similarity index 100% rename from misc/no_build/no_build_11.cxx rename to misc/no_build/no_build_poly_1.cxx diff --git a/misc/no_build/no_build_12.cxx b/misc/no_build/no_build_poly_2.cxx similarity index 100% rename from misc/no_build/no_build_12.cxx rename to misc/no_build/no_build_poly_2.cxx diff --git a/misc/no_build/no_build_15.cxx b/misc/no_build/no_build_poly_3.cxx similarity index 100% rename from misc/no_build/no_build_15.cxx rename to misc/no_build/no_build_poly_3.cxx diff --git a/misc/no_build/no_build_16.cxx b/misc/no_build/no_build_poly_4.cxx similarity index 100% rename from misc/no_build/no_build_16.cxx rename to misc/no_build/no_build_poly_4.cxx diff --git a/misc/no_build/no_build_seg.cxx b/misc/no_build/no_build_seg.cxx new file mode 100644 index 00000000..59b25026 --- /dev/null +++ b/misc/no_build/no_build_seg.cxx @@ -0,0 +1,5 @@ +// Cant build a OSegment from a Segment + Segment s; + OSegment s2(s); + +