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
2537 {}

◆ Intersect() [2/3]

template<typename FPT >
h2d::detail::Intersect< Inters_2, FPT >::Intersect ( const Point2d_< FPT > &  p1,
const Point2d_< FPT > &  p2 
)
inline
2539  : _ptIntersect_1(p1), _ptIntersect_2(p2)
2540  {
2541  _doesIntersect = true;
2542  }
bool _doesIntersect
Definition: homog2d.hpp:2476

◆ 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.

2546  : IntersectCommon( other )
2547  {
2548  auto ppts = other.get();
2549  _ptIntersect_1 = ppts.first;
2550  _ptIntersect_2 = ppts.second;
2551  }

Member Function Documentation

◆ get()

template<typename FPT >
PointPair_<FPT> h2d::detail::Intersect< Inters_2, FPT >::get ( ) const
inline
2556  {
2557  if( !_doesIntersect )
2558  HOMOG2D_THROW_ERROR_1( "No intersection points" );
2559  return std::make_pair( _ptIntersect_1, _ptIntersect_2 );
2560  }
bool _doesIntersect
Definition: homog2d.hpp:2476
#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
2552 { return _doesIntersect?2:0; }
bool _doesIntersect
Definition: homog2d.hpp:2476

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
2566  {
2567  f << "bool=" << inters._doesIntersect
2568  << " p1:" << inters._ptIntersect_1
2569  << " p2:" << inters._ptIntersect_2;
2570  return f;
2571  }

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