homog2d library
Functions
h2d::ppair Namespace Reference

Holds free functions returning a pair of points. More...

Functions

template<typename T >
auto getPointPair (const T &elem)
 Returns pair of points defining a BB of a primitive Overload 1/4, private free function. More...
 
template<typename T , typename std::enable_if< std::is_same< T, Point2d_< typename T::FType >>::value, T >::type * = nullptr>
auto getPointPair (const T &elem)
 Returns pair of points defining a BB of a Point2d Overload 3/4, private free function. More...
 
template<typename FPT >
PointPair_< FPT > getPointPair (const Line2d_< FPT > &)
 Needed because of variant. More...
 

Detailed Description

Holds free functions returning a pair of points.

Function Documentation

◆ getPointPair() [1/3]

template<typename T >
auto h2d::ppair::getPointPair ( const T &  elem)

Returns pair of points defining a BB of a primitive Overload 1/4, private free function.

Returns pair of points defining a BB of Segment Overload 4/4, private free function.

Returns pair of points defining a BB of a Polyline Overload 2/4, private free function.

Arg is a neither a Point2d, a Segment, a Line2d or a polyline

10045 {
10046  HOMOG2D_START;
10047  return elem.getBB().getPts();
10048 }
#define HOMOG2D_START
Definition: homog2d.hpp:106
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPointPair() [2/3]

template<typename T , typename std::enable_if< std::is_same< T, Point2d_< typename T::FType >>::value, T >::type * = nullptr>
auto h2d::ppair::getPointPair ( const T &  elem)

Returns pair of points defining a BB of a Point2d Overload 3/4, private free function.

This seems useless at first glance, but it is used to get the common bounding box of two objects when one of them (or both) is a point.

10092 {
10093  HOMOG2D_START;
10094  return std::make_pair( Point2d_<HOMOG2D_INUMTYPE>(elem), Point2d_<HOMOG2D_INUMTYPE>(elem) );
10095 }
#define HOMOG2D_START
Definition: homog2d.hpp:106
Here is the call graph for this function:

◆ getPointPair() [3/3]

template<typename FPT >
PointPair_<FPT> h2d::ppair::getPointPair ( const Line2d_< FPT > &  )

Needed because of variant.

10118 {
10119  HOMOG2D_START;
10120  HOMOG2D_THROW_ERROR_1( "Unable to get pair of points for a Line2d" );
10121 }
#define HOMOG2D_START
Definition: homog2d.hpp:106
#define HOMOG2D_THROW_ERROR_1(msg)
Error throw wrapper macro.
Definition: homog2d.hpp:181
Here is the caller graph for this function: