15 #ifndef BORNAGAIN_GUI_MODEL_DESCRIPTOR_DISTRIBUTIONITEMS_H
16 #define BORNAGAIN_GUI_MODEL_DESCRIPTOR_DISTRIBUTIONITEMS_H
23 class IDistribution1D;
24 class IRangedDistribution;
35 return dynamic_cast<const T*
>(
this) !=
nullptr;
46 virtual void setUnit(
const variant<QString, Unit>& unit) = 0;
73 void setUnit(
const variant<QString, Unit>& unit)
override;
87 std::unique_ptr<IDistribution1D>
createDistribution(
double scale = 1.0)
const override;
89 double deviation(
double scale)
const override;
99 void setUnit(
const variant<QString, Unit>& unit)
override;
101 std::unique_ptr<IDistribution1D>
createDistribution(
double scale = 1.0)
const override;
106 void setRange(
double min,
double max);
114 void setUnit(
const variant<QString, Unit>& unit)
override;
116 std::unique_ptr<IDistribution1D>
createDistribution(
double scale = 1.0)
const override;
118 double deviation(
double scale)
const override;
130 void setUnit(
const variant<QString, Unit>& unit)
override;
132 std::unique_ptr<IDistribution1D>
createDistribution(
double scale = 1.0)
const override;
134 double deviation(
double scale)
const override;
146 void setUnit(
const variant<QString, Unit>& unit)
override;
148 std::unique_ptr<IDistribution1D>
createDistribution(
double scale = 1.0)
const override;
160 void setUnit(
const variant<QString, Unit>& unit)
override;
162 std::unique_ptr<IDistribution1D>
createDistribution(
double scale = 1.0)
const override;
164 double deviation(
double scale)
const override;
175 void setUnit(
const variant<QString, Unit>& unit)
override;
177 std::unique_ptr<IDistribution1D>
createDistribution(
double scale = 1.0)
const override;
QList< DoubleDescriptor > DoubleDescriptors
Defines class DoubleProperty.
Defines class UIntProperty.
DOUBLE_PROPERTY(sigma, Sigma)
void setUnit(const variant< QString, Unit > &unit) override
Set the unit of the distributed value.
double deviation(double scale) const override
std::unique_ptr< IRangedDistribution > createIRangedDistribution(double scale) const override
DoubleDescriptors distributionValues(bool withMean=true) const override
void initDistribution(double value) override
std::unique_ptr< IDistribution1D > createDistribution(double scale=1.0) const override
DOUBLE_PROPERTY(minimum, Minimum)
DoubleDescriptors distributionValues(bool withMean=true) const override
void setRange(double min, double max)
std::unique_ptr< IDistribution1D > createDistribution(double scale=1.0) const override
DOUBLE_PROPERTY(maximum, Maximum)
void setUnit(const variant< QString, Unit > &unit) override
Set the unit of the distributed value.
void initDistribution(double value) override
std::unique_ptr< IDistribution1D > createDistribution(double scale=1.0) const override
void initDistribution(double value) override
DistributionGaussianItem()
DOUBLE_PROPERTY(standardDeviation, StandardDeviation)
double deviation(double scale) const override
std::unique_ptr< IRangedDistribution > createIRangedDistribution(double scale) const override
void setUnit(const variant< QString, Unit > &unit) override
Set the unit of the distributed value.
DoubleDescriptors distributionValues(bool withMean=true) const override
DOUBLE_PROPERTY(sigmaFactor, SigmaFactor)
UINT_PROPERTY(numberOfSamples, NumberOfSamples)
virtual std::unique_ptr< IDistribution1D > createDistribution(double scale=1.0) const =0
void serialize(Streamer &s)
Serialization of contents.
RealLimits limits() const
virtual ~DistributionItem()=default
void addToSerialization(DoubleProperty *d)
bool hasSigmaFactor() const
virtual void setLimits(const RealLimits &limits)
virtual void initDistribution(double)
virtual void setUnit(const variant< QString, Unit > &unit)=0
Set the unit of the distributed value.
QVector< DoubleProperty * > m_serializationProperties
virtual DoubleDescriptors distributionValues(bool withMean=true) const =0
void initDistribution(double value) override
DOUBLE_PROPERTY(scaleParameter, ScaleParameter)
DoubleDescriptors distributionValues(bool withMean=true) const override
DOUBLE_PROPERTY(median, Median)
std::unique_ptr< IDistribution1D > createDistribution(double scale=1.0) const override
DistributionLogNormalItem()
void setUnit(const variant< QString, Unit > &unit) override
Set the unit of the distributed value.
DOUBLE_PROPERTY(hwhm, Hwhm)
void initDistribution(double value) override
double deviation(double scale) const override
DoubleDescriptors distributionValues(bool withMean=true) const override
std::unique_ptr< IDistribution1D > createDistribution(double scale=1.0) const override
std::unique_ptr< IRangedDistribution > createIRangedDistribution(double scale) const override
void setUnit(const variant< QString, Unit > &unit) override
Set the unit of the distributed value.
DistributionLorentzItem()
std::unique_ptr< IDistribution1D > createDistribution(double scale=1.0) const override
DoubleDescriptors distributionValues(bool withMean=true) const override
double deviation(double scale) const override
void initDistribution(double value) override
std::unique_ptr< IRangedDistribution > createIRangedDistribution(double scale) const override
DOUBLE_PROPERTY(middleWidth, MiddleWidth)
void setUnit(const variant< QString, Unit > &unit) override
Set the unit of the distributed value.
DistributionTrapezoidItem()
std::unique_ptr< IDistribution1D > createDistribution(double scale=1.0) const override
void initDistribution(double value) override
DOUBLE_PROPERTY(rightWidth, RightWidth)
DoubleDescriptors distributionValues(bool withMean=true) const override
DOUBLE_PROPERTY(leftWidth, LeftWidth)
DOUBLE_PROPERTY(center, Center)
Class for representing a double value, its attributes and its accessors.
Supports serialization to or deserialization from QXmlStream.
virtual double deviation(double scale) const =0
void setLimits(const RealLimits &limits) override
virtual std::unique_ptr< IRangedDistribution > createIRangedDistribution(double scale) const =0
void setUnit(const variant< QString, Unit > &unit) override
Set the unit of the distributed value.
SymmetricResolutionItem(double mean, int decimals=3, const QString &meanLabel="Mean")
void setMeanDecimals(uint d)
DOUBLE_PROPERTY(mean, Mean)