API Documentation
Loading...
Searching...
No Matches
UnitTypes.h
Go to the documentation of this file.
1/**--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Base
28File: Units
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/String.h>
34#include "DLLInfo.h"
35#include <NDEVR/Unit.h>
36namespace NDEVR
37{
38
39 class INIFactory;
41 {
43 ReferenceUnit(String name, TranslatedString translated_id, const Unit& reference)
44 : Unit(name, translated_id)
45 , reference(reference)
46 {
47 axis_abbreviations[0] = reference.axis_abbreviations[0];
48 axis_abbreviations[1] = reference.axis_abbreviations[1];
49 axis_abbreviations[2] = reference.axis_abbreviations[2];
50 axis_abbreviations[3] = reference.axis_abbreviations[3];
51 }
52
53 [[nodiscard]] virtual fltp08 convertToUnit(const fltp08& program_space, const uint01 direction = X) const override
54 {
55 return reference.convertToUnit(program_space, direction);
56 }
57 [[nodiscard]] virtual fltp08 convertFromUnit(const fltp08& program_space, const uint01 direction = X) const override
58 {
59 return reference.convertToUnit(program_space, direction);
60 }
61 [[nodiscard]] virtual Vertex<3, fltp08> convertToUnit(const Vertex<3, fltp08>& program_space) const override
62 {
63 return reference.convertToUnit(program_space);
64 }
65 [[nodiscard]] virtual Vertex<3, fltp08> convertFromUnit(const Vertex<3, fltp08>& program_space) const override
66 {
67 return reference.convertFromUnit(program_space);
68 }
69 [[nodiscard]] virtual Ray<3, fltp08> convertToUnit(const Ray<3, fltp08>& program_space) const override
70 {
71 return reference.convertToUnit(program_space);
72 }
73 [[nodiscard]] virtual Ray<3, fltp08> convertFromUnit(const Ray<3, fltp08>& program_space) const override
74 {
75 return reference.convertFromUnit(program_space);
76 }
77 [[nodiscard]] 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 override
78 {
79 return reference.convertToString(program_space, add_comma, min_decimals, max_decimals, min_digits, include_abv, direction);
80 }
81 virtual void toString(String& s, const fltp08& program_space, bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, bool include_abv = true, uint01 direction = X) const override
82 {
83 reference.toString(s, program_space, add_comma, min_decimals, max_decimals, min_digits, include_abv, direction);
84 }
85 [[nodiscard]] virtual fltp08 convertFromString(const String& unit_string, uint01 direction = X) const override
86 {
87 return reference.convertFromString(unit_string, direction);
88 }
89 [[nodiscard]] virtual fltp08 fromString(const String& unit_string, uint01 direction = X) const override
90 {
91 return reference.fromString(unit_string, direction);
92 }
93 [[nodiscard]] virtual const TranslatedString& abbreviation(uint01 direction = X) const override
94 {
95 return reference.abbreviation(direction);
96 }
97
98 [[nodiscard]] virtual String getNextPreferredSeparator(const String& current_string, uint01 direction = X) const override
99 {
100 return reference.getNextPreferredSeparator(current_string, direction);
101 }
102
103 [[nodiscard]] virtual String toFormula(const String& unit_string, uint01 direction = X) const override
104 {
105 return reference.toFormula(unit_string, direction);
106 }
107 [[nodiscard]] virtual fltp08 epsilon(fltp08 value, uint01 direction = X) const override
108 {
109 return reference.epsilon(value, direction);
110 }
111 [[nodiscard]] virtual const Unit* subUnit(uint01 direction) const override
112 {
113 return reference.subUnit(direction);
114 }
115 [[nodiscard]] virtual Matrix<fltp08> matrix() const override
116 {
117 return reference.matrix();
118 }
119 };
121 {
124 ScaledUnit(String name, TranslatedString translated_id, TranslatedString abbreviation, fltp08 scale)
125 : Unit(std::move(name), std::move(translated_id))
126 , scale(scale)
127 , core_abbreviation(abbreviation)
128 {}
129
130 [[nodiscard]] virtual fltp08 convertToUnit(const fltp08& program_space, const uint01 direction = X) const override
131 {
132 lib_assert(direction < 3, "Out of bounds direction");
133 UNUSED(direction);
134 return program_space * scale;
135 }
136 [[nodiscard]] virtual fltp08 convertFromUnit(const fltp08& program_space, const uint01 direction = X) const override
137 {
138 lib_assert(direction < 3, "Out of bounds direction");
139 UNUSED(direction);//Not used for simple conversions
140 return program_space / scale;
141 }
142 [[nodiscard]] virtual Vertex<3, fltp08> convertToUnit(const Vertex<3, fltp08>& program_space) const override
143 {
144 return Vertex<3, fltp08>(scale * program_space);
145 }
146 [[nodiscard]] virtual Vertex<3, fltp08> convertFromUnit(const Vertex<3, fltp08>& program_space) const override
147 {
148 return Vertex<3, fltp08>(program_space / scale);
149 }
150 [[nodiscard]] virtual Ray<3, fltp08> convertToUnit(const Ray<3, fltp08>& program_space) const override
151 {
152 return scale * program_space;
153 }
154 [[nodiscard]] virtual Ray<3, fltp08> convertFromUnit(const Ray<3, fltp08>& program_space) const override
155 {
156 return program_space / scale;
157 }
158 [[nodiscard]] 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 override
159 {
160 return toString(convertToUnit(program_space, direction), add_comma, min_decimals, max_decimals, min_digits, include_abv, direction);
161 }
162 [[nodiscard]] virtual fltp08 convertFromString(const String& unit_string, uint01 direction = X) const override
163 {
164 return convertFromUnit(fromString(unit_string, direction), direction);
165 }
166 [[nodiscard]] virtual fltp08 fromString(const String& unit_string, uint01 direction = X) const override
167 {
168 UNUSED(direction);
169 return unit_string.getAs<fltp08>();
170 }
171 [[nodiscard]] virtual const TranslatedString& abbreviation(uint01 direction = X) const override
172 {
173 UNUSED(direction);
174 return core_abbreviation;
175 }
176 [[nodiscard]] virtual const Unit* subUnit(uint01) const override
177 {
178 return this;
179 }
180 [[nodiscard]] virtual Matrix<fltp08> matrix() const override
181 {
182 return Matrix<fltp08>::ScalerMatrix(scale);
183 }
184 [[nodiscard]] virtual Unit* clone(const String& name, const TranslatedString& translated_id) const override;;
185 };
187 {
191 ScaledOffsetUnit(String name, TranslatedString translated_id, TranslatedString abbreviation, fltp08 scale, fltp08 offset)
192 : Unit(std::move(name), std::move(translated_id))
193 , scale(scale)
194 , offset(offset)
195 , core_abbreviation(abbreviation)
196 {}
197
198 [[nodiscard]] virtual fltp08 convertToUnit(const fltp08& program_space, const uint01 direction = X) const override
199 {
200 lib_assert(direction < 3, "Out of bounds direction");
201 UNUSED(direction);
202 return program_space * scale + offset;
203 }
204 [[nodiscard]] virtual fltp08 convertFromUnit(const fltp08& program_space, const uint01 direction = X) const override
205 {
206 lib_assert(direction < 3, "Out of bounds direction");
207 UNUSED(direction);//Not used for simple conversions
208 return (program_space - offset) / scale;
209 }
210 [[nodiscard]] virtual Vertex<3, fltp08> convertToUnit(const Vertex<3, fltp08>& program_space) const override
211 {
212 return scale * program_space + offset;
213 }
214 [[nodiscard]] virtual Vertex<3, fltp08> convertFromUnit(const Vertex<3, fltp08>& program_space) const override
215 {
216 return (program_space - offset) / scale;
217 }
218 [[nodiscard]] virtual Ray<3, fltp08> convertToUnit(const Ray<3, fltp08>& program_space) const override
219 {
220 return scale * program_space + offset;
221 }
222 [[nodiscard]] virtual Ray<3, fltp08> convertFromUnit(const Ray<3, fltp08>& program_space) const override
223 {
224 return (program_space - offset) / scale;
225 }
226
227 [[nodiscard]] virtual const TranslatedString& abbreviation(uint01 direction = X) const override
228 {
229 UNUSED(direction);
230 return core_abbreviation;
231 }
232 [[nodiscard]] virtual const Unit* subUnit(uint01) const override
233 {
234 return this;
235 }
236 [[nodiscard]] virtual Matrix<fltp08> matrix() const override
237 {
238 return Matrix<fltp08>::ScalerMatrix(scale);
239 }
240
241 [[nodiscard]] virtual Unit* clone(const String& new_name, const TranslatedString& new_display_name) const override
242 {
243 ScaledOffsetUnit* unit = new ScaledOffsetUnit(new_name, new_display_name, abbreviation(), scale, offset);
244 unit->axis_abbreviations[0] = axis_name_ids[0];
245 unit->axis_abbreviations[1] = axis_name_ids[1];
246 unit->axis_abbreviations[2] = axis_name_ids[2];
247 unit->axis_abbreviations[3] = axis_name_ids[3];
248 return unit;
249 }
250 };
252 {
254 MatrixUnit(String name, const TranslatedString& translated_id, const Matrix<fltp08>& mat, const Unit& base)
255 : ReferenceUnit(std::move(name), std::move(translated_id), base)
256 , local_matrix(mat * base.matrix())
257 {}
258
259 [[nodiscard]] virtual fltp08 convertToUnit(const fltp08& program_space, const uint01 direction = X) const override;
260 [[nodiscard]] virtual fltp08 convertFromUnit(const fltp08& program_space, const uint01 direction = X) const override;
261 [[nodiscard]] virtual Vertex<3, fltp08> convertToUnit(const Vertex<3, fltp08>& program_space) const override;
262 [[nodiscard]] virtual Vertex<3, fltp08> convertFromUnit(const Vertex<3, fltp08>& program_space) const override;
263 [[nodiscard]] virtual Ray<3, fltp08> convertToUnit(const Ray<3, fltp08>& program_space) const override;
264 [[nodiscard]] virtual Ray<3, fltp08> convertFromUnit(const Ray<3, fltp08>& program_space) const override;
265
266 [[nodiscard]] virtual fltp08 epsilon(fltp08 value, uint01 direction = X) const override;
267 [[nodiscard]] virtual Matrix<fltp08> matrix() const override
268 {
269 return local_matrix;
270 }
271 [[nodiscard]] virtual const Unit* subUnit(uint01) const override
272 {
273 return &reference;
274 }
275 [[nodiscard]] virtual Unit* clone(const String& name, const TranslatedString& translated_id) const override;
276 };
277
279 {
280 TwoPartUnit(const String& name, const TranslatedString& translated_id, const TranslatedString& abr_major, const TranslatedString& abr_minor, fltp08 scale, fltp08 sub_unit);
281
282 void toString(String& string, const fltp08& local_space, bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, bool include_abv = true, uint01 direction = X) const override;
283 [[nodiscard]] virtual fltp08 fromString(const String& unit_string, uint01 direction = X) const override;
284 [[nodiscard]] virtual fltp08 epsilon(fltp08 value, uint01 direction) const override;
285
286 [[nodiscard]] virtual String getNextPreferredSeparator(const String& string, uint01 direction) const override;
287
288 [[nodiscard]] virtual Unit* clone(const String& name, const TranslatedString& translated_id) const override;
293 };
294 /**--------------------------------------------------------------------------------------------------
295 Class: AngleUnit
296
297 \brief Contains logic for converting angles into user defined units including up-direction and clockwise-logic.
298 *-----------------------------------------------------------------------------------------------**/
300 {
301 AngleUnit(const String& name, const TranslatedString& translated_name, const TranslatedString& abbreviation, fltp08 scale);
302 protected:
303 AngleUnit(const String& name, const TranslatedString& translated_name, const TranslatedString& abbreviation, fltp08 scale, const Vector<3, bool>& normalized,
304 const Vector<3, fltp08>& upper_limits,
305 const Vector<3, fltp08>& reflexes, const Vector<3, bool>& reflexes_up);
306 public:
307 virtual ~AngleUnit() = default;
308 [[nodiscard]] virtual fltp08 convertToUnit(const fltp08& program_space, uint01 direction = X) const override;
309 [[nodiscard]] virtual fltp08 normalize(fltp08 value, uint01 direction) const;
310 [[nodiscard]] virtual fltp08 denormalize(fltp08 value, uint01 direction) const;
311 [[nodiscard]] virtual fltp08 convertFromUnit(const fltp08& program_space, uint01 direction = X) const override;
312
313 [[nodiscard]] virtual Vertex<3, fltp08> convertToUnit(const Vertex<3, fltp08>& program_space) const override;
314
315 [[nodiscard]] virtual Ray<3, fltp08> convertToUnit(const Ray<3, fltp08>& program_space) const override;
316
317 [[nodiscard]] virtual Vertex<3, fltp08> convertFromUnit(const Vertex<3, fltp08>& program_space) const override;
318 [[nodiscard]] virtual Ray<3, fltp08> convertFromUnit(const Ray<3, fltp08>& program_space) const override;
319 [[nodiscard]] virtual Unit* clone(const String& name, const TranslatedString& translated_id) const override;
320 [[nodiscard]] virtual fltp08 epsilon(fltp08 value, uint01 direction = X) const override;
321
325 Vector<3, bool> normalized = Vector<3, bool>(false);
326 Vector<3, bool> reflexes_up = Vector<3, bool>(false);
327 };
329 {
330 TwoPartAngleUnit(const String& name, const TranslatedString& translated_name, const TranslatedString& abr_major, const TranslatedString& abr_minor, fltp08 sub_unit, const AngleUnit& angle_unit);
331 TwoPartAngleUnit(const String& name, const TranslatedString& translated_name, const TranslatedString& abr_major, const TranslatedString& abr_minor, fltp08 sub_unit, fltp08 scale, const Vector<3, bool>& normalized, Vector<3, fltp08> upper_limits, Vector<3, fltp08> reflex_point, Vector<3, bool> reflexes_up);
332 void toString(String& string, const fltp08& local_space, bool add_comma, uint04 min_decimals, uint04 max_decimals,
333 uint04 min_digits, bool use_abv = true, uint01 direction = X) const override;
334
335 fltp08 fromString(const String& unit_string, uint01 direction = X) const override;
336
337
338 String getNextPreferredSeparator(const String& string, uint01 direction = X) const override;
339 fltp08 epsilon(fltp08 value, uint01 direction = X) const override;
340 [[nodiscard]] virtual Unit* clone(const String& name, const TranslatedString& translated_id) const override;
345 };
346
347
349 {
350 ThreePartAngleUnit(const String& name, const TranslatedString& translated_name, const TranslatedString& abr_major, const TranslatedString& abr_minor_a, const TranslatedString& abr_minor_b, fltp08 sub_unit_a, fltp08 sub_unit_b, const AngleUnit& angle_unit);
351
352 ThreePartAngleUnit(const String& name, const TranslatedString& translated_name, const TranslatedString& abr_major, const TranslatedString& abr_minor_a, const TranslatedString& abr_minor_b, fltp08 sub_unit_a, fltp08 sub_unit_b, fltp08 scale, const Vector<3, bool>& normalized, Vector<3, fltp08> upper_limits, Vector<3, fltp08> reflex_point, Vector<3, bool> reflexes_up);
353 void toString(String& string, const fltp08& local_space, bool add_comma, uint04 min_decimals, uint04 max_decimals,
354 uint04 min_digits, bool use_abv = true, uint01 direction = X) const override;
355
356 fltp08 fromString(const String& unit_string, uint01 direction = X) const override;
357
358 String getNextPreferredSeparator(const String& current_string, uint01 direction = X) const override;
359
360 fltp08 epsilon(fltp08 value, uint01 direction = X) const override;
361 [[nodiscard]] virtual Unit* clone(const String& name, const TranslatedString& translated_id) const override;
368 };
369
371 {
372 DDMMSSAngleUnit(const String& name, const TranslatedString& translated_name, const TranslatedString& abbreviation, fltp08 scale, const Vector<3, bool>& normalized, const Vector<3, fltp08>& upper_limits, const Vector<3, fltp08>& reflexes, const Vector<3, bool>& reflexes_up);
373 DDMMSSAngleUnit(const String& name, const TranslatedString& translated_name, const TranslatedString& abbreviation, const AngleUnit& unit);
374 void toString(String& string, const fltp08& local_space, bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, bool use_abv = true, uint01 direction = X) const override;
375 fltp08 fromString(const String& unit_string, uint01 direction = X) const override;
376
377 String getNextPreferredSeparator(const String& string, uint01 direction = X) const override;
378 fltp08 epsilon(fltp08 value, uint01 direction = X) const override;
379
380 [[nodiscard]] virtual Unit* clone(const String& name, const TranslatedString& translated_id) const override;
382 };
384 {
385 LocationElevationUnit(String name, TranslatedString translated_id, const Unit* location_unit, const Unit* elevation_unit);
386 [[nodiscard]] virtual fltp08 convertToUnit(const fltp08& program_space, uint01 direction = X) const override;
387 [[nodiscard]] virtual fltp08 convertFromUnit(const fltp08& program_space, uint01 direction = X) const override;
388 [[nodiscard]] virtual Vertex<3, fltp08> convertToUnit(const Vertex<3, fltp08>& program_space) const override;
389 [[nodiscard]] virtual Vertex<3, fltp08> convertFromUnit(const Vertex<3, fltp08>& program_space) const override;
390 [[nodiscard]] virtual Ray<3, fltp08> convertToUnit(const Ray<3, fltp08>& program_space) const override;
391 [[nodiscard]] virtual Ray<3, fltp08> convertFromUnit(const Ray<3, fltp08>& program_space) const override;
392 [[nodiscard]] 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 override;
393 void toString(String& string, const fltp08& program_space, bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, bool include_abv = true, uint01 direction = X) const override;
394 [[nodiscard]] virtual fltp08 convertFromString(const String& unit_string, uint01 direction = X) const override;
395 [[nodiscard]] virtual fltp08 fromString(const String& unit_string, uint01 direction = X) const override;
396 [[nodiscard]] virtual const TranslatedString& abbreviation(uint01 direction = X) const override;
397 [[nodiscard]] virtual String getNextPreferredSeparator(const String& current_string, uint01 direction = X) const override;
398 [[nodiscard]] virtual String toFormula(const String& unit_string, uint01 direction = X) const override;
399 [[nodiscard]] virtual const Unit* subUnit(uint01 direction) const override;
400 [[nodiscard]] virtual Unit* clone(const String& name, const TranslatedString& translated_id) const override;
401 fltp08 epsilon(fltp08 value, uint01 direction) const override;
402 [[nodiscard]] virtual TranslatedString translatedAxisName(uint04 index) const override;
403 [[nodiscard]] virtual Matrix<fltp08> matrix() const override;
406 };
407
408
409}
#define NDEVR_BASE_API
Definition DLLInfo.h:78
#define UNUSED(expr)
Definition BaseValues.hpp:433
#define lib_assert(expression, message)
Asserts some logic in the code. Disabled in non debug mode by default. Can be re-enabled in release u...
Definition LibAssert.h:70
Stores an angle in an optimized format.
Definition StringStream.h:352
Definition Matrix.hpp:173
Definition Vertex.hpp:341
Definition String.h:40
t_type getAs() const
Definition String.h:334
Definition TranslatedString.h:9
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
A vertex.
Definition Vertex.hpp:54
Definition ACIColor.h:37
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:98
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
@ X
Definition BaseValues.hpp:200
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:181
Definition File.h:213
Contains logic for converting angles into user defined units including up-direction and clockwise-log...
Definition UnitTypes.h:300
virtual ~AngleUnit()=default
Definition BaseValues.hpp:272
Definition UnitTypes.h:371
uint04 max_decimal_digits
Definition UnitTypes.h:381
Definition UnitTypes.h:384
const Unit * elevation_unit
Definition UnitTypes.h:405
const Unit * location_unit
Definition UnitTypes.h:404
Definition UnitTypes.h:252
virtual const Unit * subUnit(uint01) const override
Definition UnitTypes.h:271
const Matrix< fltp08 > local_matrix
Definition UnitTypes.h:253
MatrixUnit(String name, const TranslatedString &translated_id, const Matrix< fltp08 > &mat, const Unit &base)
Definition UnitTypes.h:254
virtual Matrix< fltp08 > matrix() const override
Definition UnitTypes.h:267
Definition UnitTypes.h:41
virtual const Unit * subUnit(uint01 direction) const override
Definition UnitTypes.h:111
virtual fltp08 fromString(const String &unit_string, uint01 direction=X) const override
Definition UnitTypes.h:89
virtual Ray< 3, fltp08 > convertFromUnit(const Ray< 3, fltp08 > &program_space) const override
Definition UnitTypes.h:73
virtual fltp08 convertToUnit(const fltp08 &program_space, const uint01 direction=X) const override
Definition UnitTypes.h:53
virtual fltp08 convertFromUnit(const fltp08 &program_space, const uint01 direction=X) const override
Definition UnitTypes.h:57
virtual fltp08 convertFromString(const String &unit_string, uint01 direction=X) const override
Definition UnitTypes.h:85
virtual const TranslatedString & abbreviation(uint01 direction=X) const override
Definition UnitTypes.h:93
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 override
Definition UnitTypes.h:77
virtual Vertex< 3, fltp08 > convertFromUnit(const Vertex< 3, fltp08 > &program_space) const override
Definition UnitTypes.h:65
const Unit & reference
Definition UnitTypes.h:42
virtual Ray< 3, fltp08 > convertToUnit(const Ray< 3, fltp08 > &program_space) const override
Definition UnitTypes.h:69
ReferenceUnit(String name, TranslatedString translated_id, const Unit &reference)
Definition UnitTypes.h:43
virtual void toString(String &s, const fltp08 &program_space, bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, bool include_abv=true, uint01 direction=X) const override
Definition UnitTypes.h:81
virtual String toFormula(const String &unit_string, uint01 direction=X) const override
Definition UnitTypes.h:103
virtual Matrix< fltp08 > matrix() const override
Definition UnitTypes.h:115
virtual String getNextPreferredSeparator(const String &current_string, uint01 direction=X) const override
Definition UnitTypes.h:98
virtual fltp08 epsilon(fltp08 value, uint01 direction=X) const override
Definition UnitTypes.h:107
virtual Vertex< 3, fltp08 > convertToUnit(const Vertex< 3, fltp08 > &program_space) const override
Definition UnitTypes.h:61
Definition UnitTypes.h:187
virtual const Unit * subUnit(uint01) const override
Definition UnitTypes.h:232
virtual Ray< 3, fltp08 > convertFromUnit(const Ray< 3, fltp08 > &program_space) const override
Definition UnitTypes.h:222
virtual fltp08 convertToUnit(const fltp08 &program_space, const uint01 direction=X) const override
Definition UnitTypes.h:198
virtual fltp08 convertFromUnit(const fltp08 &program_space, const uint01 direction=X) const override
Definition UnitTypes.h:204
virtual const TranslatedString & abbreviation(uint01 direction=X) const override
Definition UnitTypes.h:227
virtual Vertex< 3, fltp08 > convertFromUnit(const Vertex< 3, fltp08 > &program_space) const override
Definition UnitTypes.h:214
virtual Ray< 3, fltp08 > convertToUnit(const Ray< 3, fltp08 > &program_space) const override
Definition UnitTypes.h:218
virtual Unit * clone(const String &new_name, const TranslatedString &new_display_name) const override
Definition UnitTypes.h:241
const fltp08 offset
Definition UnitTypes.h:189
virtual Matrix< fltp08 > matrix() const override
Definition UnitTypes.h:236
ScaledOffsetUnit(String name, TranslatedString translated_id, TranslatedString abbreviation, fltp08 scale, fltp08 offset)
Definition UnitTypes.h:191
virtual Vertex< 3, fltp08 > convertToUnit(const Vertex< 3, fltp08 > &program_space) const override
Definition UnitTypes.h:210
const TranslatedString core_abbreviation
Definition UnitTypes.h:190
const fltp08 scale
Definition UnitTypes.h:188
Definition UnitTypes.h:121
virtual fltp08 fromString(const String &unit_string, uint01 direction=X) const override
Definition UnitTypes.h:166
virtual const Unit * subUnit(uint01) const override
Definition UnitTypes.h:176
virtual Ray< 3, fltp08 > convertFromUnit(const Ray< 3, fltp08 > &program_space) const override
Definition UnitTypes.h:154
virtual fltp08 convertToUnit(const fltp08 &program_space, const uint01 direction=X) const override
Definition UnitTypes.h:130
virtual fltp08 convertFromUnit(const fltp08 &program_space, const uint01 direction=X) const override
Definition UnitTypes.h:136
virtual fltp08 convertFromString(const String &unit_string, uint01 direction=X) const override
Definition UnitTypes.h:162
virtual const TranslatedString & abbreviation(uint01 direction=X) const override
Definition UnitTypes.h:171
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 override
Definition UnitTypes.h:158
virtual Vertex< 3, fltp08 > convertFromUnit(const Vertex< 3, fltp08 > &program_space) const override
Definition UnitTypes.h:146
ScaledUnit(String name, TranslatedString translated_id, TranslatedString abbreviation, fltp08 scale)
Definition UnitTypes.h:124
virtual Ray< 3, fltp08 > convertToUnit(const Ray< 3, fltp08 > &program_space) const override
Definition UnitTypes.h:150
virtual Matrix< fltp08 > matrix() const override
Definition UnitTypes.h:180
virtual Vertex< 3, fltp08 > convertToUnit(const Vertex< 3, fltp08 > &program_space) const override
Definition UnitTypes.h:142
const TranslatedString core_abbreviation
Definition UnitTypes.h:123
const fltp08 scale
Definition UnitTypes.h:122
Definition UnitTypes.h:349
const fltp08 sub_unit_a
Definition UnitTypes.h:365
const TranslatedString abr_major
Definition UnitTypes.h:362
const TranslatedString abr_minor_a
Definition UnitTypes.h:363
const TranslatedString abr_minor_b
Definition UnitTypes.h:364
uint04 max_decimal_digits
Definition UnitTypes.h:367
const fltp08 sub_unit_b
Definition UnitTypes.h:366
Definition UnitTypes.h:329
const TranslatedString abr_major
Definition UnitTypes.h:341
const TranslatedString abr_minor
Definition UnitTypes.h:342
const fltp08 sub_unit
Definition UnitTypes.h:343
uint04 max_decimal_digits
Definition UnitTypes.h:344
Definition UnitTypes.h:279
const TranslatedString abr_major
Definition UnitTypes.h:289
const TranslatedString abr_minor
Definition UnitTypes.h:290
const fltp08 sub_unit
Definition UnitTypes.h:291
uint04 max_decimal_digits
Definition UnitTypes.h:292
Definition Unit.h:28
virtual const Unit * subUnit(uint01 direction) const =0
virtual String getNextPreferredSeparator(const String &current_string, uint01 direction=X) const
Definition Unit.cpp:51
virtual fltp08 convertFromUnit(const fltp08 &unit_space, const uint01 direction=X) const =0
virtual Matrix< fltp08 > matrix() const =0
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:62
virtual const TranslatedString & abbreviation(uint01 direction=X) const =0
virtual fltp08 convertToUnit(const fltp08 &program_space, const uint01 direction=X) const =0
TranslatedString axis_abbreviations[4]
Definition Unit.h:32
virtual fltp08 convertFromString(const String &unit_string, uint01 direction=X) const
Definition Unit.h:78
virtual String toFormula(const String &unit_string, uint01 direction=X) const
Definition Unit.cpp:63
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:44
virtual fltp08 fromString(const String &unit_string, uint01 direction=X) const
Definition Unit.h:82
virtual fltp08 epsilon(fltp08 value, uint01 direction=X) const
Definition Unit.cpp:77