Skip to content

Commit

Permalink
Merge branch 'master' of github.com:skramm/homog2d
Browse files Browse the repository at this point in the history
  • Loading branch information
skramm committed Feb 4, 2025
2 parents 891fa3b + e1e5ea0 commit 7d9e44d
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 14 deletions.
25 changes: 15 additions & 10 deletions homog2d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5046,6 +5046,15 @@ Please note that the source (points) floating-point type is lost
SegVec( const SegVec<SV2,FPT2>& other )
: _ptS1(other._ptS1), _ptS2(other._ptS2)
{
// if constexpr( std::is_same_v<SV2,typ::IsSegment> && std::is_same_v<SV,typ::IsOSeg> )
// HOMOG2D_THROW_ERROR_1( "Cannot build a OSegment from a Segment" );
static_assert(
( std::is_same_v<SV,typ::IsSegment>
||
( std::is_same_v<SV,typ::IsOSeg> && std::is_same_v<SV2,typ::IsOSeg> ) ),
"Cannot build a OSegment from a Segment"
);

if constexpr( std::is_same_v<SV2,typ::IsSegment> )
priv::fix_order( _ptS1, _ptS2 );
}
Expand Down Expand Up @@ -6019,16 +6028,10 @@ class PolylineBase: public detail::Common<FPT>

Type type() const
{
return impl_Poly_type( detail::PlHelper<PLT>() );
}
private:
Type impl_Poly_type( const detail::PlHelper<typ::IsClosed>& ) const
{
return Type::CPolyline;
}
Type impl_Poly_type( const detail::PlHelper<typ::IsOpen>& ) const
{
return Type::OPolyline;
if constexpr( std::is_same_v<PLT,typ::IsClosed> )
return Type::CPolyline;
else
return Type::OPolyline;
}

private:
Expand Down Expand Up @@ -8869,6 +8872,7 @@ constexpr Line2d_<FPT>
LPBase<LP,FPT>::impl_getOrthogonalLine_A( GivenCoord, FPT, const detail::BaseHelper<typename typ::IsPoint>& ) const
{
static_assert( detail::AlwaysFalse<LP>::value, "Invalid: you cannot call getOrthogonalLine() on a point" );
return Line2d_<FPT>(); // to avoid a compile warning
}

/// Illegal instanciation
Expand All @@ -8877,6 +8881,7 @@ constexpr Line2d_<FPT>
LPBase<LP,FPT>::impl_getOrthogonalLine_B( const Point2d_<FPT>&, const detail::BaseHelper<typename typ::IsPoint>& ) const
{
static_assert( detail::AlwaysFalse<LP>::value, "Invalid: you cannot call getOrthogonalLine() on a point" );
return Line2d_<FPT>(); // to avoid a compile warning
}

/// Illegal instanciation
Expand Down
9 changes: 5 additions & 4 deletions misc/homog2d.cbp
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,8 @@
<Unit filename="no_build/no_build_08.cxx" />
<Unit filename="no_build/no_build_09.cxx" />
<Unit filename="no_build/no_build_10.cxx" />
<Unit filename="no_build/no_build_11.cxx" />
<Unit filename="no_build/no_build_12.cxx" />
<Unit filename="no_build/no_build_13.cxx" />
<Unit filename="no_build/no_build_14.cxx" />
<Unit filename="no_build/no_build_15.cxx" />
<Unit filename="no_build/no_build_16.cxx" />
<Unit filename="no_build/no_build_17.cxx" />
<Unit filename="no_build/no_build_18.cxx" />
<Unit filename="no_build/no_build_19.cxx" />
Expand All @@ -176,6 +172,11 @@
<Unit filename="no_build/no_build_getbb_01.cxx" />
<Unit filename="no_build/no_build_getbb_02.cxx" />
<Unit filename="no_build/no_build_getbb_03.cxx" />
<Unit filename="no_build/no_build_poly_1.cxx" />
<Unit filename="no_build/no_build_poly_2.cxx" />
<Unit filename="no_build/no_build_poly_3.cxx" />
<Unit filename="no_build/no_build_poly_4.cxx" />
<Unit filename="no_build/no_build_seg.cxx" />
<Unit filename="no_build/readme.txt" />
<Unit filename="other/test_svg_import_1.svg" />
<Unit filename="other/test_svg_import_2.svg" />
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions misc/no_build/no_build_seg.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Cant build a OSegment from a Segment
Segment s;
OSegment s2(s);


0 comments on commit 7d9e44d

Please sign in to comment.