3#include <NDEVR/TranslatedString.h>
4#include <NDEVR/StringStream.h>
5#include <NDEVR/Angle.h>
8 class TranslatedString;
51 template<
class t_angle_type>
54 return convertToString(program_space.template internal<false>(), add_comma, min_decimals, max_decimals, min_digits, include_abv, direction);
56 template<
class t_angle_type>
59 return convertToUnit(program_space.template internal<false>(), direction);
61 template<
class t_angle_type>
68 return toString(convertToUnit(program_space, direction), add_comma, min_decimals, max_decimals, min_digits, include_abv, direction);
73 toString(s, unit_space, add_comma, min_decimals, max_decimals, min_digits, include_abv, direction);
80 if (add_comma || min_decimals > 0 || max_decimals <=
string.size() || min_digits > 0)
81 string =
string.formatNumberString(add_comma, min_decimals, max_decimals, min_digits);
83 string += abbreviation(direction).translation();
88 return convertFromUnit(fromString(unit_string, direction), direction);
108 return other.
matrix() == matrix() && other.
name == name;
#define UNUSED(expr)
Definition BaseValues.hpp:409
The primary angle storage class for this API. Stores an angle in an optimized format.
Definition StringStream.h:540
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Definition Matrix.hpp:176
Definition Vertex.hpp:317
The core String class for the NDEVR API.
Definition String.h:69
t_type getAs() const
Converts a string into an object. To use this function an object must have overwritten StringStream<t...
Definition String.h:143
Logic for reading or writing to a string or a user friendly, TranslatedString.
Definition StringStream.h:230
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
A vertex or point. A specific type of Vector used primarily for spacial location information.
Definition Vertex.hpp:48
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
@ INTERNAL_ANGLE
Definition Angle.h:59
UnitCategory
A category of unit describing what it relates to. Any category can have some number of units defined ...
Definition Unit.h:14
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
A definition of how to describe and display data. Units can be of any type.
Definition Unit.h:36
virtual const Unit * subUnit(uint01 direction) const =0
virtual Vertex< 3, fltp08 > convertFromUnit(const Vertex< 3, fltp08 > &unit_space) const =0
virtual fltp08 convertFromUnit(const fltp08 &unit_space, const uint01 direction=X) const =0
virtual String toFormula(const String &unit_string, uint01 direction=X) const
virtual Matrix< fltp08 > matrix() const =0
virtual fltp08 epsilon(fltp08 value, uint01 direction=X) const
const TranslatedString translated_id
Definition Unit.h:38
String toString(const fltp08 &unit_space, bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, bool include_abv=true, uint01 direction=X) const
Definition Unit.h:70
virtual const TranslatedString & abbreviation(uint01 direction=X) const =0
virtual Unit * clone(const String &new_name, const TranslatedString &new_display_name) const =0
virtual Unit * clone() const
fltp08 convertToUnit(const Angle< t_angle_type > &program_space, uint01 direction=X) const
Definition Unit.h:57
virtual Ray< 3, fltp08 > convertToUnit(const Ray< 3, fltp08 > &program_space) const =0
virtual void toString(String &string, const fltp08 &unit_space, bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, bool include_abv=true, uint01 direction=X) const
Definition Unit.h:77
virtual fltp08 convertToUnit(const fltp08 &program_space, const uint01 direction=X) const =0
bool operator==(const Unit &other) const
Definition Unit.h:106
virtual String convertToString(const fltp08 &program_space, bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, bool include_abv=true, uint01 direction=X) const
Definition Unit.h:66
virtual TranslatedString translatedAxisName(uint04 index) const
virtual fltp08 convertFromString(const String &unit_string, uint01 direction=X) const
Definition Unit.h:86
static Buffer< String > OperatorSplit(const String &string)
virtual String getNextPreferredSeparator(const String ¤t_string, uint01 direction=X) const
String convertToString(const Angle< t_angle_type > &program_space, bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, bool include_abv=true, uint01 direction=X) const
Definition Unit.h:52
virtual Vertex< 3, fltp08 > convertToUnit(const Vertex< 3, fltp08 > &program_space) const =0
virtual fltp08 fromString(const String &unit_string, uint01 direction=X) const
Definition Unit.h:90
TranslatedString translatedName() const
const String name
Definition Unit.h:37
virtual Ray< 3, fltp08 > convertFromUnit(const Ray< 3, fltp08 > &unit_space) const =0
Unit(String name, TranslatedString translated_id)
Angle< t_angle_type > convertAngleFromUnit(const fltp08 &unit_space, uint01 direction=X) const
Definition Unit.h:62