21 const double default_wl = 0.1;
26 newDistribution->
setLimits(RealLimits::positive());
29 double meanVal = default_wl;
35 nd->setMeanDecimals(4);
51 "Distribution",
"",
"distribution",
84 const double new_value =
85 limits.isLimited() ? (limits.upperLimit() - limits.lowerLimit()) / 2. : default_wl;
86 symmetricDistribution->setMean(new_value);
88 symmetricDistribution->setLimits(limits);
Defines class BeamWavelengthItem.
Defines class DistributionItemCatalog.
DistributionItem * distribution() const
SelectionProperty< DistributionItem * > m_distribution
virtual double meanValue() const
double wavelength() const
Returns wavelength. In the case of distribution applied, returns its mean.
void serialize(Streamer &s) override
static QVector< Type > symmetricTypes()
Types of symmetric distributions.
static QVector< Type > types()
Available types of items.
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.
void initWithInitializer(const QString &label, const QString &tooltip, const QString &persistentTag, std::function< void(T newItem, const T oldItem)> initializer)
Initialize by means of a catalog class and an initializer function.
void setToRange(const RealLimits &limits)
SpecularBeamWavelengthItem()
Supports serialization to or deserialization from QXmlStream.
QXmlStreamReader * xmlReader()
Returns stream reader or nullptr.
void assertVersion(unsigned expectedVersion) const
As reader, throws DeserializationException unless the expected version is read. As writer,...