Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::geometry::segment_ratio< Type > Class Template Reference

Small class to keep a ratio (e.g. More...

#include <segment_ratio.hpp>

Public Types

typedef Type numeric_type
 
typedef segment_ratio< Type > thistype
 

Public Member Functions

 segment_ratio ()
 
 segment_ratio (const Type &nominator, const Type &denominator)
 
Type const & numerator () const
 
Type const & denominator () const
 
void assign (const Type &nominator, const Type &denominator)
 
void initialize ()
 
bool is_zero () const
 
bool is_one () const
 
bool on_segment () const
 
bool in_segment () const
 
bool on_end () const
 
bool left () const
 
bool right () const
 
bool close_to (thistype const &other) const
 
bool operator< (thistype const &other) const
 
bool operator== (thistype const &other) const
 

Static Public Member Functions

static thistype zero ()
 
static thistype one ()
 

Detailed Description

template<typename Type>
class boost::geometry::segment_ratio< Type >

Small class to keep a ratio (e.g.

1/4) Main purpose is intersections and checking on 0, 1, and smaller/larger The prototype used Boost.Rational. However, we also want to store FP ratios, (so numerator/denominator both in float) and Boost.Rational starts with GCD which we prefer to avoid if not necessary On a segment means: this ratio is between 0 and 1 (both inclusive)

Member Typedef Documentation

template<typename Type >
typedef Type boost::geometry::segment_ratio< Type >::numeric_type
template<typename Type >
typedef segment_ratio<Type> boost::geometry::segment_ratio< Type >::thistype

Constructor & Destructor Documentation

template<typename Type >
boost::geometry::segment_ratio< Type >::segment_ratio ( )
inline
template<typename Type >
boost::geometry::segment_ratio< Type >::segment_ratio ( const Type &  nominator,
const Type &  denominator 
)
inline

Member Function Documentation

template<typename Type >
void boost::geometry::segment_ratio< Type >::assign ( const Type &  nominator,
const Type &  denominator 
)
inline
template<typename Type >
bool boost::geometry::segment_ratio< Type >::close_to ( thistype const &  other) const
inline
template<typename Type >
Type const& boost::geometry::segment_ratio< Type >::denominator ( ) const
inline
template<typename Type >
bool boost::geometry::segment_ratio< Type >::in_segment ( ) const
inline
template<typename Type >
bool boost::geometry::segment_ratio< Type >::is_one ( ) const
inline
template<typename Type >
bool boost::geometry::segment_ratio< Type >::is_zero ( ) const
inline
template<typename Type >
bool boost::geometry::segment_ratio< Type >::left ( ) const
inline
template<typename Type >
Type const& boost::geometry::segment_ratio< Type >::numerator ( ) const
inline
template<typename Type >
bool boost::geometry::segment_ratio< Type >::on_segment ( ) const
inline
template<typename Type >
static thistype boost::geometry::segment_ratio< Type >::one ( )
inlinestatic
template<typename Type >
bool boost::geometry::segment_ratio< Type >::operator< ( thistype const &  other) const
inline
template<typename Type >
bool boost::geometry::segment_ratio< Type >::operator== ( thistype const &  other) const
inline
template<typename Type >
bool boost::geometry::segment_ratio< Type >::right ( ) const
inline
template<typename Type >
static thistype boost::geometry::segment_ratio< Type >::zero ( )
inlinestatic

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