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

implement serialization for RoughnessItem

parent 675e4c18
No related branches found
No related tags found
1 merge request!570remove SessionModel/Item from SampleModel and all related items
Pipeline #52809 failed
......@@ -13,6 +13,8 @@
// ************************************************************************************************
#include "GUI/Model/Sample/LayerRoughnessItems.h"
#include "GUI/Model/Session/Serializer.h"
#include "GUI/Model/Session/SessionXML.h"
#include "GUI/Model/Types/DoubleDescriptor.h"
......@@ -52,14 +54,10 @@ DoubleDescriptor LayerBasicRoughnessItem::lateralCorrelationLength() const
return m_lateralCorrelationLength;
}
void LayerBasicRoughnessItem::writeContentTo(QXmlStreamWriter* writer) const
{
writeProperty(writer, m_sigma);
writeProperty(writer, m_hurst);
writeProperty(writer, m_lateralCorrelationLength);
}
void LayerBasicRoughnessItem::readContentFrom(QXmlStreamReader* reader)
void LayerBasicRoughnessItem::serialize(Serializer& s)
{
// #baMigration ++ implement XML
s.assertVersion(0);
s.rw(m_sigma);
s.rw(m_hurst);
s.rw(m_lateralCorrelationLength);
}
......@@ -16,10 +16,10 @@
#define BORNAGAIN_GUI_MODEL_SAMPLE_LAYERROUGHNESSITEMS_H
#include "GUI/Model/Types/DoubleProperty.h"
#include <QUuid>
class QXmlStreamReader;
class QXmlStreamWriter;
class Serializer;
class LayerBasicRoughnessItem {
public:
......@@ -28,8 +28,7 @@ public:
DoubleDescriptor hurst() const;
DoubleDescriptor lateralCorrelationLength() const;
void writeContentTo(QXmlStreamWriter* writer) const;
void readContentFrom(QXmlStreamReader* reader);
void serialize(Serializer& s);
private:
DoubleProperty m_sigma;
......
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