homog2d library
Todo List
Member h2d::areCollinear (const Point2d_< FPT > &pt1, const Point2d_< FPT > &pt2, const Point2d_< FPT > &pt3)
at present, defined by the distance between third point and line. Need to change that, and replace by computation of the angle between the two lines
Namespace h2d::base

20250201: why do we need this and why isn't the same required for OSegment_ ?

20250127: implement arrows for the Opencv/png version, and share the code between the two versions

Member h2d::base::convexHull (const std::vector< Point2d_< FPT >> &input)
20230728: make this function accept also std::array and std::list (using Sfinae alogn with trait::IsContainer)
Member h2d::base::LPBase< LP, FPT >::getAngle (const LPBase< LP2, FPT2 > &li) const
more investigation needed ! : what are the exact situation that will lead to this event?
Member h2d::base::LPBase< LP, FPT >::getParallelLine (const Point2d_< FPT2 > &) const
clarify orientation: on which side will that line appear?
Member h2d::base::LPBase< LP, FPT >::LPBase (const Line2d_< T > &li)
We should be able to declare this "explicit". This fails at present when attempting to convert a line (or point) from double to float, but I don't get why...
Member h2d::base::PolylineBase< PLT, FPT >::draw (img::Image< img::SvgImage > &, img::DrawParams dp=img::DrawParams()) const
20240215 Why don't we use the drawText() function ?
Member h2d::base::PolylineBase< PLT, FPT >::isConvex () const

20221120: as points are homogeneous, the cross product can probably be computed in a different way (quicker? simpler?). Need to check this.

20250127: use crossProduct free function with base::SegVec args

20250127: use crossProduct free function with base::SegVec args

Member h2d::base::PolylineBase< PLT, FPT >::minimize ()
20230217: implement these:
Member h2d::base::PolylineBase< PLT, FPT >::PolylineBase (const boost::geometry::model::polygon< BPT, CLKW, CLOSED > &bgpol)
20230216: add some checking that the type BPT needs to fit certain requirements (must have 2-dimensions, and use cartesian coordinates). Maybe we should add some Sfinae to check this.
Member h2d::base::SegVec< SV, FPT >::distTo (const Point2d_< FPT2 > &, int *segDistCase=0) const
20250219: pass an enum instead as an int, for segDistCase
Member h2d::base::SegVec< SV, FPT >::type () const
20250127: if this works, then generalize to all the other base type() member functions
Member h2d::Circle_< FPT >::intersects (const Circle_< FPT2 > &) const
20230219: in some situation, the difference below (x2 - x1) can be numericaly instable. Check if things would get improved by multiplying first (by a/d and h/d), before proceeding the difference.
Member h2d::Circle_< FPT >::set (const Point2d_< T1 > &, const Point2d_< T2 > &, const Point2d_< T3 > &)
Check this other technique: https://www.johndcook.com/blog/2023/06/18/circle-through-three-points/
Member h2d::Circle_< FPT >::set (const Point2d_< FPT2 > &center, FPT3 rad)
20211216: replace with move
Class h2d::detail::Matrix_< FPT >
20240326: we might need to add another level of inheritance. This class inherits Common, which is designed to be inherited geometric primitives and as such holds member function that cannot be used on a matrix ! (example: isInside() )
So either we remove the latter function and find a way to put it somewhere else, either we create another intermediate class.
Member h2d::draw (img::Image< U > &img, const Prim &prim, const img::DrawParams &dp=img::DrawParams())
20240504: see note on the IsDrawable trait class
Member h2d::Ellipse_< FPT >::getOBB () const
20240330: unclear, the text above does not match what is done below (or does it?). Clarify that, and build a gif showing how this is done.
Member h2d::err::errorCount ()
20250123: for some reason, the error count is always 42! Need to investigate this.
Member h2d::findNearestPoint (const Point2d_< FPT > &pt, const T &cont)

add some sfinae and/or checking on type T

perform some speed analysis, and check if usage of squared distance is really better

add other distance computations (Manhattan?)

Would it be better to return an iterator?

Member h2d::FRect_< FPT >::getBB () const
20250205: fix this so that it return a "full res" rectangle
Member h2d::FRect_< FPT >::isInside (const T &shape) const
add some SFINAE to enable only for allowed types?
Member h2d::getLmPoint (const T &t)
20250222: CHANGE RETURN TYPE! => should return an iterator, not a pair (so this allows usage of any non-random access container)
Member h2d::getPts (const std::vector< Point2d_< FPT >> &vpt)
20230219: sfinae this to accept other containers using trait::IsContainer
Member h2d::getPtsInside (const CONT &input_set, const PRIM &prim)
20250123: maybe replace the bunch of static_asserts with something around trait::HasArea ?
Member h2d::Hmatrix_< M, FPT >::buildFrom4Points (const std::vector< Point2d_< FPT >> &, const std::vector< Point2d_< FPT >> &, int method=1)
fix this so that user can provide a std::array of points
Member h2d::img::Image< T >::drawText (std::string str, Point2d_< float > pt, img::DrawParams dp)
20230118: find a way to add a default parameter for dp (not allowed on explicit instanciation)
Member h2d::operator* (const Homogr_< FPT2 > &, const base::PolylineBase< PLT2, FPT1 > &) -> base::PolylineBase< PLT2, FPT1 >
20230215: check if this has to be moved in the 'base' namespace. Can it be called without using namespace std;. This was the case for the streaming operator...
Member h2d::priv::chull::orientation (Point2d_< T > p, Point2d_< T > q, Point2d_< T > r)

20240326: this is subject to numerical instability, as it is based on differences.

20230212: replace const value HOMOG2D_THR_ZERO_DETER with related static function

20230212: replace const value HOMOG2D_THR_ZERO_DETER with related static function

Member h2d::priv::getBB_CommonType (const std::vector< CommonType_< FPT >> &v_var)
20240513: At present, this is only implemented for std::vector. Let it handle std::list and std::array.
Member h2d::priv::getBB_FRect (const std::vector< FRect_< FPT >> &v_rects)
same as getBB_Segments() ???
Member h2d::priv::getBB_Points (const T &vpts)
This loops twice on the points. Maybe some improvement here.
Member h2d::priv::getLargestDistancePoints (PT pt1, PT pt2, PT pt3)
20220520: needs some optimization, once it has been extensively tested
Member h2d::rtp::operator<< (std::ostream &f, const Root &p)
replace this by a call to a virtual function print() (that needs to be defined in all the child classes as:
Member h2d::svg::svgp::getAttribString (const char *attribName, const tinyxml2::XMLElement &e)
Who owns the data? Should we return a string and/or release the memory?
Member h2d::svg::svgp::parsePoints (const char *pts)
20240326: this is used to import SVG polygon type. Maybe this can be replaced by the "path" import code?
Class h2d::trait::IsDrawable< T >
20240504 this is only used in the draw() free function but actually not really needed: as that function just calls the member function, we can just let the build fail is no suitable member function is found.
Class h2d::trait::PolIsClosed< T >
20250131: probably useless, check if this can be replaced by some "if constexpr"
File showcase19.cpp
20240421 switch all showcases to Svg images, much nicer!
Member TEST_CASE ("types testing 3", "[test-types-3]")
Once we switch to C++17, we can remove the checking and use: https://en.cppreference.com/w/cpp/language/attributes/maybe_unused
Member TEST_CASE ("pts_inside", "[ptsins]")
20250201: add tests cases