ActiveLib
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
active::measure::AngleUnit Struct Reference

#include <AngleUnit.h>

Inheritance diagram for active::measure::AngleUnit:
Inheritance graph
[legend]
Collaboration diagram for active::measure::AngleUnit:
Collaboration graph
[legend]

Public Types

using Type = AngleType
 

Public Member Functions

 AngleUnit ()
 
 AngleUnit (AngleType type, uint8_t prec, bool isDecimal=true, bool suffixes=true)
 
 AngleUnit (AngleType first, AngleType second, uint8_t prec, bool isDecimal=true)
 
 AngleUnit (AngleType first, AngleType second, AngleType third, uint8_t prec, bool isDecimal=true)
 
bool isConventionalAngle () const
 
- Public Member Functions inherited from active::measure::Unit< AngleUnit, AngleType >
 Unit (AngleType type)
 
 Unit (AngleType first, AngleType second)
 
 Unit (AngleType type, uint8_t prec, bool isDecimal=true, bool suffixes=true)
 
 Unit (AngleType first, AngleType second, uint8_t prec, bool isDecimal=true)
 
 Unit (AngleType first, AngleType second, AngleType third, uint8_t prec, bool isDecimal=true)
 
bool isDecimal () const
 
double divisor () const
 
double eps () const
 
bool isMetric (AngleType type) const
 
double simpleRatio (double value, double factor, bool reversed) const
 
double conversion (AngleType type, double value, bool reversed=false) const
 
utility::String suffix (AngleType type) const
 
std::optional< AngleTypefromTag (const utility::String &text) const
 
utility::String toTag (AngleType type) const
 
std::optional< std::pair< AngleType, utility::String::size_type > > findSuffix (const utility::String &text, utility::String::size_type startPos=0) const
 

Static Public Member Functions

static AngleUnit radians (uint8_t prec=4, bool suffixes=true)
 
static AngleUnit degreesDec (uint8_t prec=4, bool suffixes=true)
 
static AngleUnit degrees (bool suffixes=true)
 
static AngleUnit degreesMinutes ()
 
static AngleUnit degreesMinutesSeconds ()
 
static AngleUnit surveyorBearings ()
 

Public Attributes

bool isSurveyBearing = false
 True if convention for survey bearings is used, e.g. N 25° W.
 
bool isClockwisePositive = false
 True if s clockwise sweep angle is positive. Ignored when isSurveyBearing = true.
 
double zeroOffset = 0.0
 Offset to 0° (from the positive x axis)) e.g. zeroOffset = pi / 2 if 0° points North. Ignored when isSurveyBearing = true.
 
- Public Attributes inherited from active::measure::Unit< AngleUnit, AngleType >
AngleType primary
 The primary unit to display.
 
std::optional< AngleTypesecondary
 An optional secondary unit, e.g. for foot/inch combos (nullopt = none)
 
std::optional< AngleTypetertiary
 An optional teriary unit, e.g. for degrees/minutes/seconds combos (nullopt = none, ignored if no secondary unit)
 
uint8_t precision
 The display precision (decimal places for metric or 2^-n for fractional units.
 
double base
 The numeric base for fractional quantities (10.0 = floating point to specified decimal places, other values create a fraction)
 
bool isUnitSuffix
 True if values should be displayed with a unit suffix, e.g. "100.0mm" rather than "100.0" (always true when multiple units)
 
bool isLeadingZero
 True if a value is displayed with multiple units and zero values (apart from the last unit) should be included, e.g. 0' 10" vs 10".
 

Friends

struct Unit
 

Detailed Description

Structure to represent angle units

Constructor & Destructor Documentation

◆ AngleUnit() [1/4]

active::measure::AngleUnit::AngleUnit ( )
inline

Default constructor

◆ AngleUnit() [2/4]

active::measure::AngleUnit::AngleUnit ( AngleType type,
uint8_t prec,
bool isDecimal = true,
bool suffixes = true )
inlineexplicit

Constructor

Parameters
typeThe primary unit type
precThe unit display precision (decimal places for metric or 2^-n for fractional units)
isDecimalTrue if fractional values should display as decimal (floating point) numbers
suffixesTrue if the value should be displayed with the unit suffix, e.g. 100mm

◆ AngleUnit() [3/4]

active::measure::AngleUnit::AngleUnit ( AngleType first,
AngleType second,
uint8_t prec,
bool isDecimal = true )
inlineexplicit

Constructor

Parameters
firstThe primary unit type
secondThe secondary unit type
precThe unit display precision (decimal places for metric or 2^-n for fractional units)
isDecimalTrue if fractional values should display as decimal (floating point) numbers

◆ AngleUnit() [4/4]

active::measure::AngleUnit::AngleUnit ( AngleType first,
AngleType second,
AngleType third,
uint8_t prec,
bool isDecimal = true )
inlineexplicit

Constructor

Parameters
firstThe primary unit type
secondThe secondary unit type
thirdThe tertiary unit type
precThe unit display precision (decimal places for metric or 2^-n for fractional units)
isDecimalTrue if fractional values should display as decimal (floating point) numbers

Member Function Documentation

◆ isConventionalAngle()

bool active::measure::AngleUnit::isConventionalAngle ( ) const
inline

Determine if this angle unit uses the math convention for angles (0° aligns to positive x axis, positive sweep is anti-clockwise)

Returns
True if a conventional angle is used
Here is the caller graph for this function:

The documentation for this struct was generated from the following files: