Skip to content
Snippets Groups Projects
Commit fe3e41ee authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

profiles and lattices now PolyPtr

parent 7af55910
No related branches found
No related tags found
1 merge request!2696PolyItem -> PolyPtr, with BaseItem as separate template parameter
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#define BORNAGAIN_GUI_MODEL_SAMPLE_INTERFERENCEITEMS_H #define BORNAGAIN_GUI_MODEL_SAMPLE_INTERFERENCEITEMS_H
#include "GUI/Model/Descriptor/DoubleProperty.h" #include "GUI/Model/Descriptor/DoubleProperty.h"
#include "GUI/Model/Descriptor/PolyItem.h" #include "GUI/Model/Descriptor/PolyPtr.h"
#include "GUI/Model/Sample/Lattice2DCatalog.h" #include "GUI/Model/Sample/Lattice2DCatalog.h"
#include "GUI/Model/Sample/Lattice2DItems.h" #include "GUI/Model/Sample/Lattice2DItems.h"
#include "GUI/Model/Sample/ProfileCatalogs.h" #include "GUI/Model/Sample/ProfileCatalogs.h"
...@@ -62,13 +62,13 @@ public: ...@@ -62,13 +62,13 @@ public:
const DoubleProperty& rotationAngle() const { return m_rotation_angle; } const DoubleProperty& rotationAngle() const { return m_rotation_angle; }
void setRotationAngle(double v) { m_rotation_angle.setDVal(v); } void setRotationAngle(double v) { m_rotation_angle.setDVal(v); }
PolyItem<Profile1DCatalog>& decayFunctionSelection() { return m_decay_function; } PolyPtr<Profile1DItem, Profile1DCatalog>& decayFunctionSelection() { return m_decay_function; }
void setDecayFunctionType(Profile1DItem* p) { m_decay_function.setCertainItem(p); } void setDecayFunctionType(Profile1DItem* p) { m_decay_function.setCertainItem(p); }
private: private:
DoubleProperty m_length; DoubleProperty m_length;
DoubleProperty m_rotation_angle; DoubleProperty m_rotation_angle;
PolyItem<Profile1DCatalog> m_decay_function; PolyPtr<Profile1DItem, Profile1DCatalog> m_decay_function;
}; };
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
...@@ -76,7 +76,7 @@ private: ...@@ -76,7 +76,7 @@ private:
class Interference2DAbstractLatticeItem : public InterferenceItem { class Interference2DAbstractLatticeItem : public InterferenceItem {
public: public:
Lattice2DItem* latticeTypeItem() const { return m_lattice_type.certainItem(); } Lattice2DItem* latticeTypeItem() const { return m_lattice_type.certainItem(); }
PolyItem<Lattice2DCatalog>& latticeTypeSelection() { return m_lattice_type; } PolyPtr<Lattice2DItem, Lattice2DCatalog>& latticeTypeSelection() { return m_lattice_type; }
void setLatticeType(Lattice2DItem* p) { m_lattice_type.setCertainItem(p); } void setLatticeType(Lattice2DItem* p) { m_lattice_type.setCertainItem(p); }
bool xiIntegration() const { return m_xi_integration; } bool xiIntegration() const { return m_xi_integration; }
...@@ -89,7 +89,7 @@ protected: ...@@ -89,7 +89,7 @@ protected:
explicit Interference2DAbstractLatticeItem(bool xiIntegration); explicit Interference2DAbstractLatticeItem(bool xiIntegration);
bool m_xi_integration; bool m_xi_integration;
PolyItem<Lattice2DCatalog> m_lattice_type; PolyPtr<Lattice2DItem, Lattice2DCatalog> m_lattice_type;
}; };
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
...@@ -102,11 +102,11 @@ public: ...@@ -102,11 +102,11 @@ public:
void writeTo(QXmlStreamWriter* w) const override; void writeTo(QXmlStreamWriter* w) const override;
void readFrom(QXmlStreamReader* r) override; void readFrom(QXmlStreamReader* r) override;
PolyItem<Profile2DCatalog>& decayFunctionSelection() { return m_decay_function; } PolyPtr<Profile2DItem, Profile2DCatalog>& decayFunctionSelection() { return m_decay_function; }
void setDecayFunctionType(Profile2DItem* p) { m_decay_function.setCertainItem(p); } void setDecayFunctionType(Profile2DItem* p) { m_decay_function.setCertainItem(p); }
protected: protected:
PolyItem<Profile2DCatalog> m_decay_function; PolyPtr<Profile2DItem, Profile2DCatalog> m_decay_function;
}; };
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
...@@ -131,18 +131,18 @@ public: ...@@ -131,18 +131,18 @@ public:
const DoubleProperty& domainSize2() const { return m_domain_size2; } const DoubleProperty& domainSize2() const { return m_domain_size2; }
void setDomainSize2(double size) { m_domain_size2.setDVal(size); } void setDomainSize2(double size) { m_domain_size2.setDVal(size); }
PolyItem<Profile2DCatalog>& probabilityDistributionSelection1() { return m_pdf1; } PolyPtr<Profile2DItem, Profile2DCatalog>& probabilityDistributionSelection1() { return m_pdf1; }
void setPDF1Type(Profile2DItem* p) { m_pdf1.setCertainItem(p); } void setPDF1Type(Profile2DItem* p) { m_pdf1.setCertainItem(p); }
PolyItem<Profile2DCatalog>& probabilityDistributionSelection2() { return m_pdf2; } PolyPtr<Profile2DItem, Profile2DCatalog>& probabilityDistributionSelection2() { return m_pdf2; }
void setPDF2Type(Profile2DItem* p) { m_pdf2.setCertainItem(p); } void setPDF2Type(Profile2DItem* p) { m_pdf2.setCertainItem(p); }
private: private:
DoubleProperty m_damping_length; DoubleProperty m_damping_length;
DoubleProperty m_domain_size1; DoubleProperty m_domain_size1;
DoubleProperty m_domain_size2; DoubleProperty m_domain_size2;
PolyItem<Profile2DCatalog> m_pdf1; PolyPtr<Profile2DItem, Profile2DCatalog> m_pdf1;
PolyItem<Profile2DCatalog> m_pdf2; PolyPtr<Profile2DItem, Profile2DCatalog> m_pdf2;
}; };
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
...@@ -215,7 +215,7 @@ public: ...@@ -215,7 +215,7 @@ public:
const DoubleProperty& kappa() const { return m_kappa; } const DoubleProperty& kappa() const { return m_kappa; }
void setKappa(double v) { m_kappa.setDVal(v); } void setKappa(double v) { m_kappa.setDVal(v); }
PolyItem<Profile1DCatalog>& probabilityDistributionSelection() { return m_pdf; } PolyPtr<Profile1DItem, Profile1DCatalog>& probabilityDistributionSelection() { return m_pdf; }
void setPDFType(Profile1DItem* p) { m_pdf.setCertainItem(p); } void setPDFType(Profile1DItem* p) { m_pdf.setCertainItem(p); }
private: private:
...@@ -223,7 +223,7 @@ private: ...@@ -223,7 +223,7 @@ private:
DoubleProperty m_damping_length; DoubleProperty m_damping_length;
DoubleProperty m_domain_size; DoubleProperty m_domain_size;
DoubleProperty m_kappa; DoubleProperty m_kappa;
PolyItem<Profile1DCatalog> m_pdf; PolyPtr<Profile1DItem, Profile1DCatalog> m_pdf;
}; };
#endif // BORNAGAIN_GUI_MODEL_SAMPLE_INTERFERENCEITEMS_H #endif // BORNAGAIN_GUI_MODEL_SAMPLE_INTERFERENCEITEMS_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment