docs: UML diagrams replaced to plantuml generated SVGs
This commit is contained in:
1 parent
8fccfd2d68
commit
1525101555
8 files changed
+388
-71
No files matched your search
@@ -6,50 +6,71 @@ Basic Concepts
|
||||
The most important concepts in the library are `Unit`, `Dimension`,
|
||||
`Quantity`, `QuantityPoint`, `QuantityKind`, and `QuantityPointKind`:
|
||||
|
||||
.. image:: /_static/img/concepts.png
|
||||
:align: center
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<object data="/_static/img/concepts.svg" type="image/svg+xml" class="align-center" style="max-width: 100%;"></object>
|
||||
|
||||
..
|
||||
http://www.nomnoml.com
|
||||
https://www.planttext.com
|
||||
|
||||
@startuml
|
||||
|
||||
[<abstract>Dimension|
|
||||
[base_dimension<Symbol, Unit>]<-[exponent<Dimension, Num, Den>]
|
||||
[derived_dimension<Child, Unit, Exponent...>]<-[exponent<Dimension, Num, Den>]
|
||||
[exponent<Dimension, Num, Den>]<-[derived_dimension<Child, Unit, Exponent...>]
|
||||
]
|
||||
skinparam monochrome true
|
||||
skinparam shadowing false
|
||||
skinparam backgroundColor #fcfcfc
|
||||
|
||||
[<abstract>Quantity|
|
||||
[quantity<Dimension, Unit, Rep>]
|
||||
]
|
||||
hide circle
|
||||
hide members
|
||||
show class methods
|
||||
|
||||
[<abstract>QuantityPoint|
|
||||
[quantity_point<PointOrigin, Unit, Rep>]
|
||||
]
|
||||
package Unit <<Frame>> [[../../framework/units.html]] {
|
||||
}
|
||||
|
||||
[<abstract>QuantityKind|
|
||||
[quantity_kind<Kind, Unit, Rep>]
|
||||
]
|
||||
package Dimension <<Frame>> [[../../framework/dimensions.html]] {
|
||||
}
|
||||
|
||||
[<abstract>QuantityPointKind|
|
||||
[quantity_point_kind<PointKind, Unit, Rep>]
|
||||
]
|
||||
abstract kind<Dimension> [[../../framework/quantity_kinds.html#kind-creation]]
|
||||
abstract point_kind<Kind, PointOrigin> [[../../framework/quantity_kinds.html#quantity-point-kinds]]
|
||||
abstract point_origin<Dimension> [[../../framework/quantity_points.html#point-origins]]
|
||||
|
||||
[<abstract>Unit]<-[Dimension]
|
||||
[Dimension]<-[Quantity]
|
||||
[Unit]<-[Quantity]
|
||||
[Quantity]<-[QuantityPoint]
|
||||
class quantity<Dimension, Unit, Rep> [[../../framework/quantities.html]] {
|
||||
rep number()
|
||||
}
|
||||
class quantity_point<PointOrigin, Unit, Rep> [[../../framework/quantity_points.html#construction]] {
|
||||
quantity relative()
|
||||
}
|
||||
class quantity_kind<Kind, Unit, Rep> [[../../framework/quantity_kinds.html#construction]] {
|
||||
quantity common()
|
||||
}
|
||||
class quantity_point_kind<PointKind, Unit, Rep> [[../../framework/quantity_kinds.html#quantity-point-kinds]] {
|
||||
quantity_kind relative()
|
||||
}
|
||||
|
||||
[<abstract>PointOrigin]<-[QuantityPoint]
|
||||
[Dimension]<-[PointOrigin]
|
||||
[PointOrigin]<-[PointKind]
|
||||
|
||||
[<abstract>Kind]<-[QuantityKind]
|
||||
[Dimension]<-[Kind]
|
||||
[Quantity]<-[QuantityKind]
|
||||
Unit <.. Dimension
|
||||
|
||||
[<abstract>PointKind]<-[QuantityPointKind]
|
||||
[Kind]<-[PointKind]
|
||||
[QuantityKind]<-[QuantityPointKind]
|
||||
Dimension <.. quantity
|
||||
Unit <.. quantity
|
||||
|
||||
Dimension <.. kind
|
||||
Dimension <.. point_origin
|
||||
point_origin <.. point_kind
|
||||
kind <.. point_kind
|
||||
|
||||
Unit <.. quantity_point
|
||||
point_origin <.. quantity_point
|
||||
quantity --* quantity_point
|
||||
|
||||
Unit <.. quantity_kind
|
||||
kind <.. quantity_kind
|
||||
quantity --* quantity_kind
|
||||
|
||||
Unit <.. quantity_point_kind
|
||||
point_kind <.. quantity_point_kind
|
||||
quantity_kind --* quantity_point_kind
|
||||
|
||||
@enduml
|
||||
|
||||
`Unit` is a basic building block of the library. Every dimension works with
|
||||
a concrete hierarchy of units. Such hierarchy defines a reference unit and
|
||||
|
||||
@@ -8,6 +8,14 @@ In the previous chapter we briefly introduced the notion of a physical
|
||||
Length, time, speed, area, energy are only a few examples of physical
|
||||
dimensions.
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<object data="/_static/img/dimensions.svg" type="image/svg+xml" class="align-center" style="max-width: 100%;"></object>
|
||||
|
||||
..
|
||||
https://www.planttext.com
|
||||
|
||||
|
||||
Base Dimensions
|
||||
---------------
|
||||
|
||||
|
||||
+79
-38
@@ -15,6 +15,85 @@ Base quantities are expressed in terms of :term:`base units <base unit>`
|
||||
in terms of :term:`derived units <derived unit>`.
|
||||
|
||||
|
||||
Class Hierarchy
|
||||
---------------
|
||||
|
||||
All of the described here class templates to produce unit types inherit from some instance
|
||||
of a `scaled_unit` class template:
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<object data="/_static/img/units.svg" type="image/svg+xml" class="align-center" style="max-width: 100%;"></object>
|
||||
|
||||
..
|
||||
https://www.planttext.com
|
||||
|
||||
@startuml
|
||||
|
||||
skinparam monochrome true
|
||||
skinparam shadowing false
|
||||
skinparam backgroundColor #fcfcfc
|
||||
|
||||
hide members
|
||||
hide circle
|
||||
|
||||
left to right direction
|
||||
|
||||
package Unit <<Frame>> [[../../framework/units.html]] {
|
||||
abstract prefix_family [[../../framework/units.html#prefixed-unit]]
|
||||
abstract no_prefix [[../../framework/units.html#named-scaled-units]]
|
||||
abstract prefix<PrefixFamily, Symbol, Ratio> [[../../framework/units.html#prefixed-unit]]
|
||||
|
||||
prefix_family <|-- no_prefix
|
||||
prefix_family <.. prefix
|
||||
|
||||
' prefix_family <.. named_unit
|
||||
' prefix_family <.. named_scaled_unit
|
||||
' prefix_family <.. named_derived_unit
|
||||
' prefix_family <.. alias_unit
|
||||
|
||||
' prefix <.. prefixed_unit
|
||||
' prefix <.. prefixed_alias_unit
|
||||
|
||||
abstract scaled_unit<UnitRatio, Unit>
|
||||
|
||||
abstract prefixed_alias_unit<Unit, Prefix, AliasUnit> [[../../framework/units.html#aliased-units]]
|
||||
abstract alias_unit<Unit, Symbol, PrefixFamily> [[../../framework/units.html#aliased-units]]
|
||||
abstract named_derived_unit<Dimension, Symbol, PrefixFamily, Unit, Unit...> [[../../framework/units.html#derived-scaled-units]]
|
||||
abstract derived_unit<Dimension, Unit, Unit...> [[../../framework/units.html#derived-scaled-units]]
|
||||
abstract prefixed_unit<Prefix, Unit> [[../../framework/units.html#prefixed-unit]]
|
||||
abstract named_scaled_unit<Symbol, PrefixFamily, Ratio, Unit> [[../../framework/units.html#named-scaled-units]]
|
||||
abstract named_unit<Symbol, PrefixFamily> [[../../framework/units.html#base-units]]
|
||||
abstract unit [[../../framework/units.html#derived-unnamed-units]]
|
||||
|
||||
scaled_unit <|-- unit
|
||||
scaled_unit <|-- named_unit
|
||||
scaled_unit <|-- named_scaled_unit
|
||||
scaled_unit <|-- prefixed_unit
|
||||
scaled_unit <|-- derived_unit
|
||||
scaled_unit <|-- named_derived_unit
|
||||
scaled_unit <|-- alias_unit
|
||||
scaled_unit <|-- prefixed_alias_unit
|
||||
}
|
||||
|
||||
@enduml
|
||||
|
||||
`scaled_unit` is a class template used exclusively by the library's framework
|
||||
and user should not instantiate it by him/her-self. However the user can sometimes
|
||||
observe this type in case an unit/dimension conversion expression will end up with an
|
||||
unknown/undefined unit type like in the below example::
|
||||
|
||||
using namespace units::isq::si::references;
|
||||
|
||||
Length auto l = 100 * (km / h) * (10 * s);
|
||||
|
||||
The type of ``l`` above will be
|
||||
``si::length<scaled_unit<ratio(1, 36, 1), si::metre>, long double>``. This is caused
|
||||
by the fact that the library does not define a unit of a length quantity that has the
|
||||
ratio ``10/36`` of a ``si::metre``. If such a unit was predefined we would see its concrete
|
||||
type here instead.
|
||||
|
||||
|
||||
Base Units
|
||||
----------
|
||||
|
||||
@@ -359,44 +438,6 @@ class template::
|
||||
}
|
||||
|
||||
|
||||
Class Hierarchy
|
||||
---------------
|
||||
|
||||
All of the above class templates to produce unit types inherit from some instance
|
||||
of a `scaled_unit` class template:
|
||||
|
||||
.. image:: /_static/img/units.png
|
||||
:align: center
|
||||
|
||||
..
|
||||
http://www.nomnoml.com
|
||||
|
||||
#direction: right
|
||||
|
||||
[scaled_unit<UnitRatio, Unit>]<:-[unit<Child>]
|
||||
[scaled_unit<UnitRatio, Unit>]<:-[named_unit<Child, Symbol, PrefixFamily>]
|
||||
[scaled_unit<UnitRatio, Unit>]<:-[named_scaled_unit<Child, Symbol, PrefixFamily, Ratio, Unit>]
|
||||
[scaled_unit<UnitRatio, Unit>]<:-[prefixed_unit<Child, Prefix, Unit>]
|
||||
[scaled_unit<UnitRatio, Unit>]<:-[derived_unit<Child, Dimension, Unit, Unit...>]
|
||||
[scaled_unit<UnitRatio, Unit>]<:-[named_derived_unit<Child, Dimension, Symbol, PrefixFamily, Unit, Unit...>]
|
||||
[scaled_unit<UnitRatio, Unit>]<:-[alias_unit<Unit, Symbol, PrefixFamily>]
|
||||
[scaled_unit<UnitRatio, Unit>]<:-[prefixed_alias_unit<Unit, Prefix, AliasUnit>]
|
||||
|
||||
`scaled_unit` is a class template used exclusively by the library's framework
|
||||
and user should not instantiate it by him/her-self. However the user can sometimes
|
||||
observe this type in case an unit/dimension conversion expression will end up with an
|
||||
unknown/undefined unit type like in the below example::
|
||||
|
||||
using namespace units::isq::si::references;
|
||||
|
||||
Length auto l = 100 * (km / h) * (10 * s);
|
||||
|
||||
The type of ``l`` above will be
|
||||
``si::length<scaled_unit<ratio(1, 36, 1), si::metre>, long double>``. This is caused
|
||||
by the fact that the library does not define a unit of a length quantity that has the
|
||||
ratio ``10/36`` of a ``si::metre``. If such a unit was predefined we would see its concrete
|
||||
type here instead.
|
||||
|
||||
.. seealso::
|
||||
|
||||
To learn more about unknown units please refer to the
|
||||
|
||||
Reference in new issue
Block a user