BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
SessionXML.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/Model/SessionXML.h
6 //! @brief Defines reader and writer classes for SessionModel
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_MODEL_MODEL_SESSIONXML_H
16 #define BORNAGAIN_GUI_MODEL_MODEL_SESSIONXML_H
17 
18 #include <QVariant>
19 #include <QXmlStreamWriter> // used in every including file
20 #include <heinz/Complex.h>
21 #include <heinz/Vectors3D.h>
22 
23 class QXmlStreamReader;
24 class SessionItem;
25 class MessageService;
26 class QUuid;
27 
28 namespace GUI::Session::XML {
29 
30 constexpr auto ItemMimeType = "application/org.bornagainproject.xml.item.z";
31 constexpr auto LinkMimeType = "application/org.bornagainproject.fittinglink";
32 constexpr auto InstrumentModelTag("InstrumentModel");
33 constexpr auto JobModelTag("JobModel");
34 constexpr auto RealDataModelTag("RealDataModel");
35 constexpr auto ItemTag("Item");
36 constexpr auto ModelTypeAttribute("ModelType");
37 constexpr auto ParameterTag("Parameter");
38 
39 void writeModel(QXmlStreamWriter* writer, SessionItem* modelRootItem);
40 void writeItemAndChildItems(QXmlStreamWriter* writer, const SessionItem* item);
41 
42 void readItems(QXmlStreamReader* reader, SessionItem* parent, QString topTag = "",
43  MessageService* messageService = nullptr);
44 QString readProperty(QXmlStreamReader* reader, SessionItem* item);
45 
46 } // namespace GUI::Session::XML
47 
48 #endif // BORNAGAIN_GUI_MODEL_MODEL_SESSIONXML_H
The service to collect messages from different senders.
Base class for a GUI data item.
Definition: SessionItem.h:204
void writeItemAndChildItems(QXmlStreamWriter *writer, const SessionItem *item)
Definition: SessionXML.cpp:70
void readItems(QXmlStreamReader *reader, SessionItem *parent, QString topTag="", MessageService *messageService=nullptr)
Definition: SessionXML.cpp:113
constexpr auto ParameterTag("Parameter")
constexpr auto ItemMimeType
Definition: SessionXML.h:30
void writeModel(QXmlStreamWriter *writer, SessionItem *modelRootItem)
Definition: SessionXML.cpp:59
constexpr auto ModelTypeAttribute("ModelType")
constexpr auto RealDataModelTag("RealDataModel")
QString readProperty(QXmlStreamReader *reader, SessionItem *item)
Definition: SessionXML.cpp:189
constexpr auto ItemTag("Item")
constexpr auto InstrumentModelTag("InstrumentModel")
constexpr auto JobModelTag("JobModel")
constexpr auto LinkMimeType
Definition: SessionXML.h:31