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

Two points intersection. More...

#include <homog2d.hpp>

Inheritance diagram for h2d::detail::Intersect< Inters_2, FPT >:
Inheritance graph
[legend]
Collaboration diagram for h2d::detail::Intersect< Inters_2, FPT >:
Collaboration graph
[legend]

Public Member Functions

PointPair_< FPT > get () const
 
 Intersect ()
 
 Intersect (const Point2d_< FPT > &p1, const Point2d_< FPT > &p2)
 
template<typename FPT2 >
 Intersect (const Intersect< Inters_2, FPT2 > &other)
 To enable conversions from different floating-point types. More...
 
size_t size () const
 
- Public Member Functions inherited from h2d::detail::IntersectCommon
bool operator() () const
 

Friends

template<typename U , typename V >
class ::h2d::base::LPBase
 
std::ostream & operator<< (std::ostream &f, const Intersect< Inters_2, FPT > &inters)
 

Additional Inherited Members

- Protected Attributes inherited from h2d::detail::IntersectCommon
bool _doesIntersect = false
 

Detailed Description

template<typename FPT>
class h2d::detail::Intersect< Inters_2, FPT >

Two points intersection.

Constructor & Destructor Documentation

◆ Intersect() [1/3]

template<typename FPT >
h2d::detail::Intersect< Inters_2, FPT >::Intersect ( )
inline
2503 {}

◆ Intersect() [2/3]

template<typename FPT >
h2d::detail::Intersect< Inters_2, FPT >::Intersect ( const Point2d_< FPT > &  p1,
const Point2d_< FPT > &  p2 
)
inline
2505  : _ptIntersect_1(p1), _ptIntersect_2(p2)
2506  {
2507  _doesIntersect = true;
2508  }
bool _doesIntersect
Definition: homog2d.hpp:2442

◆ Intersect() [3/3]

template<typename FPT >
template<typename FPT2 >
h2d::detail::Intersect< Inters_2, FPT >::Intersect ( const Intersect< Inters_2, FPT2 > &  other)
inline

To enable conversions from different floating-point types.

2512  : IntersectCommon( other )
2513  {
2514  auto ppts = other.get();
2515  _ptIntersect_1 = ppts.first;
2516  _ptIntersect_2 = ppts.second;
2517  }

Member Function Documentation

◆ get()

template<typename FPT >
PointPair_<FPT> h2d::detail::Intersect< Inters_2, FPT >::get ( ) const
inline
2522  {
2523  if( !_doesIntersect )
2524  HOMOG2D_THROW_ERROR_1( "No intersection points" );
2525  return std::make_pair( _ptIntersect_1, _ptIntersect_2 );
2526  }
bool _doesIntersect
Definition: homog2d.hpp:2442
#define HOMOG2D_THROW_ERROR_1(msg)
Error throw wrapper macro.
Definition: homog2d.hpp:181

◆ size()

template<typename FPT >
size_t h2d::detail::Intersect< Inters_2, FPT >::size ( ) const
inline
2518 { return _doesIntersect?2:0; }
bool _doesIntersect
Definition: homog2d.hpp:2442

Friends And Related Function Documentation

◆ ::h2d::base::LPBase

template<typename FPT >
template<typename U , typename V >
friend class ::h2d::base::LPBase
friend

◆ operator<<

template<typename FPT >
std::ostream& operator<< ( std::ostream &  f,
const Intersect< Inters_2, FPT > &  inters 
)
friend
2532  {
2533  f << "bool=" << inters._doesIntersect
2534  << " p1:" << inters._ptIntersect_1
2535  << " p2:" << inters._ptIntersect_2;
2536  return f;
2537  }

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