Skip to content

Commit

Permalink
misc, + fixes related to #11
Browse files Browse the repository at this point in the history
  • Loading branch information
skramm committed Dec 21, 2023
1 parent 56e7f88 commit 78d0cae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
11 changes: 7 additions & 4 deletions homog2d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5644,11 +5644,11 @@ this should work !!! (but doesn't...)
private:
template<typename FPT2>
std::pair<HOMOG2D_INUMTYPE,HOMOG2D_INUMTYPE>
impl_set_RCP( FPT2 rad, size_t n, const detail::PlHelper<type::IsClosed>& );
impl_set_RCP( FPT2 rad, size_t n, const typename detail::PlHelper<type::IsClosed>& );

template<typename FPT2>
constexpr std::pair<HOMOG2D_INUMTYPE,HOMOG2D_INUMTYPE>
impl_set_RCP( FPT2, size_t, const detail::PlHelper<type::IsOpen>& )
impl_set_RCP( FPT2, size_t, const typename detail::PlHelper<type::IsOpen>& )
{
static_assert( detail::AlwaysFalse<PLT>::value, "cannot build an regular convex polygon for a OPolyline object");
return std::make_pair(0.,0.); // to avoid a compiler warning
Expand Down Expand Up @@ -6251,10 +6251,13 @@ Two tasks:
}; // class PolylineBase

/// Build a Regular Convex Polygon of radius \c rad with \c n points, centered at (0,0)
/**
\return: segment distance, inscribed circle radius
*/
template<typename PLT,typename FPT>
template<typename FPT2>
std::pair<HOMOG2D_INUMTYPE,HOMOG2D_INUMTYPE> // segment distance, inscribed circle radius
PolylineBase<PLT,FPT>::impl_set_RCP( FPT2 rad, size_t n, const detail::PlHelper<type::IsClosed>& )
std::pair<HOMOG2D_INUMTYPE,HOMOG2D_INUMTYPE>
PolylineBase<PLT,FPT>::impl_set_RCP( FPT2 rad, size_t n, const typename detail::PlHelper<type::IsClosed>& )
{
if( n < 3 )
HOMOG2D_THROW_ERROR_1( "unable, nb of points must be > 2" );
Expand Down
6 changes: 1 addition & 5 deletions misc/demo_opencv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1688,8 +1688,7 @@ void action_RCP( void* param )
auto values = pol.set( data.radius, data.nbPts );
std::cout << " -Building Regular Convex Polygon with " << data.nbPts << " points\n";

// pol.translate(data.trans_x,data.trans_y);
pol.moveTo( Point2d(data.trans_x,data.trans_y) );
pol.moveTo( Point2d(data.trans_x+data.radius,data.trans_y) );

pol.draw( data.img );
drawText( data.img, "NbPts=" +std::to_string(data.nbPts), Point2d(20,40) );
Expand All @@ -1713,10 +1712,7 @@ void demo_RCP( int demidx )

kbloop.addCommonAction( action_RCP );
action_RCP( &data );
// data.setMouseCB( action_ORS );

kbloop.start( data );

}

//------------------------------------------------------------------
Expand Down

0 comments on commit 78d0cae

Please sign in to comment.