BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
UserDefinedDataLoader1D.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/DataLoaders/UserDefinedDataLoader1D.cpp
6 //! @brief Implements class UserDefinedDataLoader1D
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2021
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
16 
18  const QString& name,
19  const QByteArray& defaultProperties)
20  : m_name(name), m_wrappedLoader(wrappedLoader), m_defaultProperties(defaultProperties)
21 {
24 }
25 
27 {
28  return m_name;
29 }
30 
32 {
34 }
35 
37 {
39 }
40 
42 {
44 }
45 
47 {
48  return m_wrappedLoader->serialize();
49 }
50 
51 void UserDefinedDataLoader1D::deserialize(const QByteArray& data)
52 {
54 }
55 
57 {
58  auto cloned = dynamic_cast<AbstractDataLoader1D*>(m_wrappedLoader->clone());
59  auto loader = new UserDefinedDataLoader1D(cloned, m_name, m_defaultProperties);
60  return loader;
61 }
62 
63 void UserDefinedDataLoader1D::setFileContents(const QByteArray& fileContent)
64 {
66 }
67 
69 {
71 }
72 
74 {
76 }
Defines class UserDefinedDataLoader1D.
Base class for data loaders for 1D import.
Base class for all data loaders (classes which can import real data)
virtual QByteArray serialize() const
Returns every internal setting so it can be restored completely.
virtual void populateImportSettingsWidget(QWidget *parent)
Fills the widget on the import dialog pane.
virtual void guessSettings()
Guess appropriate settings (for example the separator in a CSV file).
void importSettingsChanged()
Emitted whenever an import setting changed.
virtual QString persistentClassName() const =0
A name which can be used for save/load purposes (which will not change ever more)
virtual void setFileContents(const QByteArray &fileContent)=0
Sets the file contents to be imported.
virtual void deserialize(const QByteArray &data)
Initialize from serialization data.
virtual void processContents()=0
Process the file contents.
virtual QByteArray fileContent() const
Returns the original file content.
virtual AbstractDataLoader * clone() const =0
Create a complete clone, including all internal states.
virtual void populateImportSettingsWidget(QWidget *parent) override
Fills the widget on the import dialog pane.
virtual AbstractDataLoader * clone() const override
Create a complete clone, including all internal states.
UserDefinedDataLoader1D(AbstractDataLoader1D *wrappedLoader, const QString &name, const QByteArray &defaultProperties)
virtual void guessSettings() override
Guess appropriate settings (for example the separator in a CSV file).
virtual QString persistentClassName() const override
A name which can be used for save/load purposes (which will not change ever more)
virtual void deserialize(const QByteArray &data) override
Initialize from serialization data.
virtual void setFileContents(const QByteArray &fileContent) override
Sets the file contents to be imported.
virtual QByteArray serialize() const override
Returns every internal setting so it can be restored completely.
AbstractDataLoader1D * m_wrappedLoader
virtual void processContents() override
Process the file contents.
virtual void initWithDefaultImportSettings() override
Set import settings to defaults.
virtual QString name() const override
The name shown in the format selection combo.
QString const & name(EShape k)
Definition: particles.cpp:21