Skip to content
Snippets Groups Projects
Commit ab097ee9 authored by m.puchner's avatar m.puchner
Browse files

Merge branch 'docu' into 'main'

add documentation

See merge request !713
parents ddddc2e9 66ccb589
No related branches found
No related tags found
1 merge request!713add documentation
Pipeline #57984 failed
......@@ -26,3 +26,47 @@ See file [AUTHORS](https://github.com/scgmlz/BornAgain/blob/master/AUTHORS).
### Citation
See file [CITATION](https://github.com/scgmlz/BornAgain/blob/master/CITATION).
### Classes for representing the UI data
For representing the UI data there are classes which provide
* storing the value
* serializing the value
* accessing the value
* additional properties like label, tooltip, unit, limits
* creating a UI element for this value
The most important classes regarding data representation are
Class | Description
--------------------------|------------
@ref DoubleProperty | @copybrief DoubleProperty
@ref UIntProperty | @copybrief UIntProperty
@ref VectorProperty | @copybrief VectorProperty
@ref SelectionProperty | @copybrief SelectionProperty
@ref AxisProperty | @copybrief AxisProperty
as well as their direct associates
Class | Description
--------------------------|------------
@ref DoubleDescriptor | @copybrief DoubleDescriptor
@ref UIntDescriptor | @copybrief UIntDescriptor
@ref VectorDescriptor | @copybrief VectorDescriptor
@ref SelectionDescriptor | @copybrief SelectionDescriptor
### Migration to eliminate SessionModel/SessionItem
The descriptions in the following issues contain detailed explanations and best-practices how to eliminate SessionModel and SessionItem dependency:
[Refactor signaling of value changes (less generic, more explicit)](https://jugit.fz-juelich.de/mlz/bornagain/-/issues/88)
[Refactor dynamic hierarchy in SessionItems (less generic, more explicit)](https://jugit.fz-juelich.de/mlz/bornagain/-/issues/89)
[Refactor serialization of SessionItem (less generic, more explicit)](https://jugit.fz-juelich.de/mlz/bornagain/-/issues/90)
Also mentioned should be the explanations in [merge request 695](https://jugit.fz-juelich.de/mlz/bornagain/-/merge_requests/695). In
this merge request the UI-code was greatly simplified by using descriptors and related functions like GUI::Util::createSpinBox().
......@@ -44,7 +44,7 @@ using std::variant;
//! and fully initialize the created spin box.
//!
//! \sa DoubleProperty
//! \sa GUI:Util::createSpinBox
//! \sa GUI:Util::createSpinBox()
//!
class DoubleDescriptor {
private: // private as long as path initialization is not included in params (to be done after
......
......@@ -28,12 +28,14 @@ class SessionItem;
using std::function;
using std::variant;
//! Class for representing a double value, its attributes and its accessors.
//! Class for representing a uint value, its attributes and its accessors.
//!
//! For a complete description please refer to the documentation of DoubleProperty. Everything said
//! there also applies to this class, of course not for double values but for uint values.
//!
//! \sa DoubleProperty
//! \sa UIntDescriptor
//!
class UIntProperty {
public:
void init(const QString& label, const QString& tooltip, uint value,
......
......@@ -24,6 +24,10 @@
//! By using this class, the underlying data scheme is hidden from the user of the data. This e.g.
//! eases SessionItem migration. The underlying implementation can be a R3 vector, a member array
//! of three doubles, three double members, or any other construction to hold the three values.
//!
//! \a VectorProperty
//! \a DoubleDescriptor
//!
class VectorDescriptor {
public:
VectorDescriptor() = default;
......
......@@ -24,7 +24,12 @@ class Streamer;
//!
//! Use this as a member in your class to hold a 3D vector if you want to have support for
//! serialization, and if this vector is editable on the UI.
//!
//! For a more complete documentation about property classes, please refer to DoubleProperty.
//!
//! \sa VectorDescriptor
//! \sa DoubleProperty
//!
class VectorProperty {
public:
void init(const QString& label, const QString& tooltip, const variant<QString, Unit>& unit,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment