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

use SelectionDescriptor in InterferenceItems

parent 11ad2691
No related branches found
No related tags found
1 merge request!393Selection descriptor
...@@ -14,12 +14,14 @@ ...@@ -14,12 +14,14 @@
#include "GUI/Models/InterferenceItems.h" #include "GUI/Models/InterferenceItems.h"
#include "Base/Const/Units.h" #include "Base/Const/Units.h"
#include "ComboProperty.h"
#include "GUI/Models/DoubleDescriptor.h" #include "GUI/Models/DoubleDescriptor.h"
#include "GUI/Models/FTDecayFunctionItems.h" #include "GUI/Models/FTDecayFunctionItems.h"
#include "GUI/Models/FTDistributionItems.h" #include "GUI/Models/FTDistributionItems.h"
#include "GUI/Models/GroupItem.h" #include "GUI/Models/GroupItem.h"
#include "GUI/Models/Lattice2DItems.h" #include "GUI/Models/Lattice2DItems.h"
#include "Sample/Aggregate/Interferences.h" #include "Sample/Aggregate/Interferences.h"
#include "SelectionDescriptor.h"
// TODO (when back compatibility will be broken again) // TODO (when back compatibility will be broken again)
// Make Interference1DLatticeItem::P_DECAY_FUNCTION and // Make Interference1DLatticeItem::P_DECAY_FUNCTION and
...@@ -86,6 +88,11 @@ DoubleDescriptor Interference1DLatticeItem::rotationAngle() const ...@@ -86,6 +88,11 @@ DoubleDescriptor Interference1DLatticeItem::rotationAngle() const
return d; return d;
} }
SelectionDescriptor<FTDecayFunction1DItem*> Interference1DLatticeItem::decayFunction() const
{
return SelectionDescriptor<FTDecayFunction1DItem*>(item<GroupItem>(P_DECAY_FUNCTION));
}
// --------------------------------------------------------------------------------------------- // // --------------------------------------------------------------------------------------------- //
Lattice2DItem* Interference2DAbstractLatticeItem::latticeType() const Lattice2DItem* Interference2DAbstractLatticeItem::latticeType() const
...@@ -424,3 +431,9 @@ DoubleDescriptor InterferenceRadialParaCrystalItem::kappa() const ...@@ -424,3 +431,9 @@ DoubleDescriptor InterferenceRadialParaCrystalItem::kappa() const
{ {
return DoubleDescriptor(getItem(P_KAPPA), Unit::unitless); return DoubleDescriptor(getItem(P_KAPPA), Unit::unitless);
} }
SelectionDescriptor<FTDistribution1DItem*>
InterferenceRadialParaCrystalItem::probabilityDistribution() const
{
return SelectionDescriptor<FTDistribution1DItem*>(item<GroupItem>(P_PDF));
}
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#ifndef BORNAGAIN_GUI_MODELS_INTERFERENCEITEMS_H #ifndef BORNAGAIN_GUI_MODELS_INTERFERENCEITEMS_H
#define BORNAGAIN_GUI_MODELS_INTERFERENCEITEMS_H #define BORNAGAIN_GUI_MODELS_INTERFERENCEITEMS_H
#include "GUI/Models/SelectionDescriptor.h"
#include "GUI/Models/SessionGraphicsItem.h" #include "GUI/Models/SessionGraphicsItem.h"
class FTDecayFunction1DItem; class FTDecayFunction1DItem;
...@@ -55,6 +56,7 @@ public: ...@@ -55,6 +56,7 @@ public:
DoubleDescriptor rotationAngle() const; DoubleDescriptor rotationAngle() const;
template <typename T> T* setDecayFunctionType(); template <typename T> T* setDecayFunctionType();
SelectionDescriptor<FTDecayFunction1DItem*> decayFunction() const;
}; };
class Interference2DAbstractLatticeItem : public InterferenceItem { class Interference2DAbstractLatticeItem : public InterferenceItem {
...@@ -167,7 +169,7 @@ public: ...@@ -167,7 +169,7 @@ public:
DoubleDescriptor dampingLength() const; DoubleDescriptor dampingLength() const;
DoubleDescriptor domainSize() const; DoubleDescriptor domainSize() const;
DoubleDescriptor kappa() const; DoubleDescriptor kappa() const;
SelectionDescriptor<FTDistribution1DItem*> probabilityDistribution() const;
template <typename T> T* setPDFType(); template <typename T> T* setPDFType();
}; };
......
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