23 std::unique_ptr<OutputData<double>> makeOutputData(
const IAxis& axis);
70 const auto converted_axis = converter->createConvertedAxis(0, Axes::Units::DEGREES);
73 std::vector<double> centers = converted_axis->binCenters();
74 std::for_each(centers.begin(), centers.end(), [scale](
double&
value) { value *= scale; });
76 return std::make_unique<PointwiseAxis>(converted_axis->getName(), std::move(centers));
86 m_axis = std::unique_ptr<IAxis>(data->axis(0).clone());
104 return static_cast<bool>(
m_axis);
131 parent_item = parent_item->
parent();
141 setLowerBound(converter->calculateMin(0, Axes::Units::DEGREES));
142 setUpperBound(converter->calculateMax(0, Axes::Units::DEGREES));
149 std::unique_ptr<OutputData<double>> makeOutputData(
const IAxis& axis)
152 result->addAxis(axis);
Defines interface IUnitConverter and possible axis units.
Defines InstrumentItems classes.
Defines class IntensityDataIOFactory.
Defines and implements templated class OutputData.
Defines pointwise axis item.
Defines class PointwiseAxis.
void setBinCount(int value)
static const QString P_NBINS
static const QString P_MAX_DEG
void setLowerBound(double value)
void setUpperBound(double value)
static const QString P_MIN_DEG
Interface for one-dimensional axes.
virtual IAxis * clone() const =0
clone function
static OutputData< double > * readOutputData(const std::string &file_name)
Reads file and returns newly created OutputData object.
static void writeOutputData(const OutputData< double > &data, const std::string &file_name)
Writes OutputData in file.
void setOnPropertyChange(std::function< void(QString)> f, const void *caller=0)
void setLastModified(const QDateTime &dtime)
void findInstrument()
Sets internal m_instrument to containing SpecularInstrumentItem.
bool save(const QString &projectDir) override
Saves non-XML data in projectDir and returns success flag.
~PointwiseAxisItem() override
bool checkValidity() const
const SpecularInstrumentItem * m_instrument
const QString getUnitsLabel() const
QString fileName() const override
Reports file name to save/load non-XML data.
std::unique_ptr< IAxis > createAxis(double scale) const override
std::unique_ptr< IAxis > m_axis
bool containsNonXMLData() const override
Checks if object owns non-XML data.
const IAxis * axis() const
static const QString P_FILE_NAME
QDateTime lastModified() const override
Indicates last modification timepoint.
bool load(const QString &projectDir) override
Loads non-XML data from projectDir and returns success flag.
void init(const IAxis &axis, const QString &units_label)
static const QString P_NATIVE_AXIS_UNITS
QDateTime m_last_modified
virtual QString fileName() const =0
Reports file name to save/load non-XML data.
SessionItem * addProperty(const QString &name, const QVariant &variant)
Add new property item and register new tag.
QVariant value() const
Get value.
void setVisible(bool enabled)
Flags accessors.
QVariant getItemValue(const QString &tag) const
Directly access value of item under given tag.
ModelMapper * mapper()
Returns the current model mapper of this item. Creates new one if necessary.
SessionItem * parent() const
Returns parent of this item.
void setItemValue(const QString &tag, const QVariant &variant)
Directly set value of item under given tag.
void emitDataChanged(int role=Qt::DisplayRole)
Notify model about data changes.
void setEnabled(bool enabled)
SessionItem * getItem(const QString &tag="", int row=0) const
Returns item in given row of given tag.
std::unique_ptr< IUnitConverter > createUnitConverter() const
std::string filename(const std::string &path)
Returns path without directory part ("Foo/Bar/Doz.int.gz" -> "Doz.int.gz")
QString currentDateTime()
QString projectDir(const QString &projectFileName)
Returns project directory deduced from project file name.
QString const & name(EShape k)