homog2d library
Public Member Functions | Friends | List of all members
h2d::detail::IntersectM< FPT > Class Template Reference

Multiple points intersections. More...

#include <homog2d.hpp>

Public Member Functions

void add (const Point2d_< FPT > &pt)
 
void add (const std::vector< Point2d_< FPT >> &vpt)
 
std::vector< Point2d_< FPT > > get () const
 Returns the intersection points, sorted. More...
 
 IntersectM ()
 
template<typename FPT2 >
 IntersectM (const IntersectM< FPT2 > &other)
 To enable conversions from different floating-point types. More...
 
bool operator() () const
 
size_t size () const
 

Friends

std::ostream & operator<< (std::ostream &f, const IntersectM &i)
 

Detailed Description

template<typename FPT>
class h2d::detail::IntersectM< FPT >

Multiple points intersections.

Constructor & Destructor Documentation

◆ IntersectM() [1/2]

template<typename FPT>
h2d::detail::IntersectM< FPT >::IntersectM ( )
inline
2548 {}

◆ IntersectM() [2/2]

template<typename FPT>
template<typename FPT2 >
h2d::detail::IntersectM< FPT >::IntersectM ( const IntersectM< FPT2 > &  other)
inline

To enable conversions from different floating-point types.

2552  {
2553  _vecInters.resize( other.size() );
2554  auto it = _vecInters.begin();
2555  for( const auto& elem: other.get() )
2556  *it++ = elem; // automatic type conversion
2557  }
Here is the call graph for this function:

Member Function Documentation

◆ add() [1/2]

template<typename FPT>
void h2d::detail::IntersectM< FPT >::add ( const Point2d_< FPT > &  pt)
inline
2565  {
2566  _vecInters.push_back(pt);
2567  }
Point2d pt
Definition: homog2d_test.cpp:4034
Here is the caller graph for this function:

◆ add() [2/2]

template<typename FPT>
void h2d::detail::IntersectM< FPT >::add ( const std::vector< Point2d_< FPT >> &  vpt)
inline
2570  {
2571  for( const auto& pt: vpt )
2572  _vecInters.push_back(pt);
2573  }
Point2d pt
Definition: homog2d_test.cpp:4034

◆ get()

template<typename FPT>
std::vector<Point2d_<FPT> > h2d::detail::IntersectM< FPT >::get ( ) const
inline

Returns the intersection points, sorted.

2577  {
2578  std::sort( std::begin(_vecInters), std::end(_vecInters) );
2579  return _vecInters;
2580  }
Here is the caller graph for this function:

◆ operator()()

template<typename FPT>
bool h2d::detail::IntersectM< FPT >::operator() ( ) const
inline
2560  {
2561  return !_vecInters.empty();
2562  }

◆ size()

template<typename FPT>
size_t h2d::detail::IntersectM< FPT >::size ( ) const
inline
2563 { return _vecInters.size(); }
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

template<typename FPT>
std::ostream& operator<< ( std::ostream &  f,
const IntersectM< FPT > &  i 
)
friend
2583  {
2584  f << "IntersectM: size=" << i.size() << '\n' << i._vecInters;
2585  return f;
2586  }

The documentation for this class was generated from the following file: