Skip to content
Snippets Groups Projects
Commit ad9f60a0 authored by Matthias Puchner's avatar Matthias Puchner
Browse files

introduce descriptor class to describe a 3D vector

parent 9bd7290e
No related branches found
No related tags found
1 merge request!402Preparation for upcoming sample editor - add more descriptors (continued)
// ************************************************************************************************
//
// BornAgain: simulate and fit reflection and scattering
//
//! @file GUI/Models/VectorDescriptor.h
//! @brief Defines class VectorDescriptor
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2021
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
// ************************************************************************************************
#ifndef BORNAGAIN_GUI_MODELS_VECTORDESCRIPTOR_H
#define BORNAGAIN_GUI_MODELS_VECTORDESCRIPTOR_H
#include "GUI/Models/DoubleDescriptor.h"
#include "GUI/Models/VectorItem.h"
//! Describes properties of a 3D vector, consisting of three double values.
//!
//! 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 VectorItem, a member array
//! of three doubles, three double members, or any other construction to hold the three values.
class VectorDescriptor {
public:
//! Operates on a VectorItem.
//!
//! The settings (like decimals, limits) are taken from the item.
//! Only for easier migration. Should be removed after SessionItem refactoring.
VectorDescriptor(VectorItem* item, const variant<QString, Unit>& unit)
: x(item->xItem(), unit), y(item->yItem(), unit), z(item->zItem(), unit)
{
}
DoubleDescriptor x;
DoubleDescriptor y;
DoubleDescriptor z;
};
#endif // BORNAGAIN_GUI_MODELS_VECTORDESCRIPTOR_H
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