MIRA
Classes | Namespaces | Macros | Typedefs | Functions | Variables
Angle.h File Reference

Implementations of angles (values in periodic interval of width 2*pi) with arbitrary base type. More...

#include <type_traits>
#include <error/Exceptions.h>
#include <platform/Platform.h>
#include <math/Math.h>
#include <serialization/Accessor.h>
Include dependency graph for Angle.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  AngleBase< T, UnitTag, Derived >
 Base class template for derived Angle implementations. More...
 
class  DegreeBase< T, Derived >
 Base class for angle classes that represent angles using degrees. More...
 
class  RadianBase< T, Derived >
 Base class for angle classes that represent angles using radians. More...
 
class  Degree< T >
 Unsigned angle that is represented using degrees. More...
 
class  SignedDegree< T >
 Signed angle that is represented using degrees. More...
 
class  IsTransparentSerializable< SignedDegree< T >, SerializerTag >
 
class  Degree< T >
 Unsigned angle that is represented using degrees. More...
 
class  IsTransparentSerializable< Degree< T >, SerializerTag >
 
class  Radian< T >
 Unsigned angle that is represented using radians. More...
 
class  SignedRadian< T >
 Signed angle that is represented using radians. More...
 
class  IsTransparentSerializable< SignedRadian< T >, SerializerTag >
 
class  Radian< T >
 Unsigned angle that is represented using radians. More...
 
class  IsTransparentSerializable< Radian< T >, SerializerTag >
 
class  Angle< T >
 Unsigned angle that is represented using radians. More...
 
class  SignedAngle< T >
 Signed angle that is represented using radians. More...
 
class  IsTransparentSerializable< SignedAngle< T >, SerializerTag >
 
class  Angle< T >
 Unsigned angle that is represented using radians. More...
 
class  IsTransparentSerializable< Angle< T >, SerializerTag >
 
struct  Deg2RadNonNegativeType
 A tag type used as parameter type in deg2radSetter, signalling that negative values are not permitted. More...
 

Namespaces

 mira
 specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
 

Macros

#define _MIRA_ANGLE_H_
 
#define MIRA_ANGLE_CONSTRUCTORS_AND_ASSIGNOPS(Type)
 

Typedefs

typedef SignedDegree< int > SignedDegreei
 Integer precision signed angle. More...
 
typedef SignedDegree< float > SignedDegreef
 Float precision signed angle. More...
 
typedef SignedDegree< double > SignedDegreed
 Double precision signed angle. More...
 
typedef Degree< int > Degreei
 Integer precision angle. More...
 
typedef Degree< float > Degreef
 Float precision angle. More...
 
typedef Degree< double > Degreed
 Double precision angle. More...
 
typedef SignedRadian< float > SignedRadianf
 Float precision signed angle. More...
 
typedef SignedRadian< double > SignedRadiand
 Double precision signed angle. More...
 
typedef Radian< float > Radianf
 Float precision angle. More...
 
typedef Radian< double > Radiand
 Double precision angle. More...
 
typedef SignedAngle< float > SignedAnglef
 Float precision signed angle. More...
 
typedef SignedAngle< double > SignedAngled
 Double precision signed angle. More...
 
typedef Angle< float > Anglef
 Float precision angle. More...
 
typedef Angle< double > Angled
 Double precision angle. More...
 

Functions

template<typename T >
INTERNAL std::enable_if< std::is_floating_point< T >::value, T >::type deg2rad (T value)
 Convert degree to radian, for floating point arguments (return type = argument type) More...
 
template<typename T >
std::enable_if< std::is_integral< T >::value, double >::type deg2rad (T value)
 Convert degree to radian, for integral arguments (return type = double) More...
 
template<typename T >
std::enable_if<!std::is_arithmetic< T >::value >::type deg2rad (T value)
 
template<typename T >
std::enable_if< std::is_floating_point< T >::value, T >::type rad2deg (T value)
 Convert radian to degree, for floating point arguments (return type = argument type) More...
 
template<typename T >
std::enable_if< std::is_integral< T >::value, double >::type rad2deg (T value)
 Convert radian to degree, for integral arguments (return type = double) More...
 
template<typename T >
std::enable_if<!std::is_arithmetic< T >::value >::type rad2deg (T value)
 
template<typename T >
smallestAngleDifference (const T &a, const T &b)
 Returns the signed difference angle between the specified angles (in radian) that has the smallest absolute value. More...
 
template<typename T >
bool inAngleInterval (T value, T min, T max)
 
template<typename T >
bool isInAngleInterval (T value, T min, T max)
 Returns true, if the given angle (in radian) is in the given interval [min,max]. More...
 
template<typename T >
Getter< T > rad2degGetter (const T &cref)
 Create a getter for serializing radians as degrees. More...
 
template<typename T >
Setter< T > deg2radSetter (T &ref)
 Create setter for deserializing radians from degrees. See rad2degGetter. More...
 
template<typename T >
Setter< T > deg2radSetter (T &ref, Deg2RadNonNegativeType)
 Create a setter for deserializing radians from degrees. More...
 
template<typename T >
Accessor< Getter< T >, Setter< T > > radAsDegAccessor (T &ref)
 Create an accessor consisting of getter + setter for serializing radians as degrees. More...
 
template<typename T >
Accessor< Getter< T >, Setter< T > > radAsDegAccessor (T &ref, Deg2RadNonNegativeType)
 Create a complete accessor consisting of getter + setter for serializing radians as degrees. More...
 
template<typename T , typename UnitTag , typename Derived >
Derived abs (const mira::AngleBase< T, UnitTag, Derived > &other)
 

Variables

constexpr Deg2RadNonNegativeType Deg2RadNonNegative
 Use this constant as second parameter when calling deg2radSetter, in order to prohibit negative values. More...
 

Detailed Description

Implementations of angles (values in periodic interval of width 2*pi) with arbitrary base type.

Author
Erik Einhorn
Date
2010/08/02

Macro Definition Documentation

◆ _MIRA_ANGLE_H_

#define _MIRA_ANGLE_H_

◆ MIRA_ANGLE_CONSTRUCTORS_AND_ASSIGNOPS

#define MIRA_ANGLE_CONSTRUCTORS_AND_ASSIGNOPS (   Type)
Value:
protected: \
Type(const T& value, int) : Base(value,1) {} \
public: \
Type() {} \
explicit Type(T value) : Base(value) {} \
template <typename OtherT, typename OtherUnitTag, typename OtherDerived> \
Type(const AngleBase<OtherT,OtherUnitTag,OtherDerived>& other) : Base(other) {} \
template <typename OtherUnitTag, typename OtherDerived> \
Type& operator=(const AngleBase<T,OtherUnitTag,OtherDerived>& other) { \
Base::operator=(other); \
return *this; } \
Type& operator=(const T& other) { \
Base::operator=(other); \
return *this; }

Function Documentation

◆ abs()

Derived std::abs ( const mira::AngleBase< T, UnitTag, Derived > &  other)
inline