16 #include "Base/Axis/IAxis.h"
59 addProperty<BasicAxisItem>(
P_XAXIS);
60 addProperty<BasicAxisItem>(
P_YAXIS);
61 addProperty<AmplitudeAxisItem>(
P_ZAXIS);
74 ASSERT(data &&
"Assertion failed in IntensityDataItem::setDatafield: nullptr data passed");
75 if (data->rank() != 2)
76 throw Error(
"Error in IntensityDataItem::setDatafield: cannot handle non-2D data");
108 const double defaultXmin(0.0);
114 const double defaultXmax(1.0);
130 const double defaultYmin(0.0);
136 const double defaultYmax(1.0);
192 return item<AmplitudeAxisItem>(
P_ZAXIS)->isLocked();
197 item<AmplitudeAxisItem>(
P_ZAXIS)->setLocked(state);
243 setDatafield(std::move(data).intensityData().release());
338 const int nx =
static_cast<int>(
m_data->axis(0).size());
340 const int ny =
static_cast<int>(
m_data->axis(1).size());
367 QPair<double, double> minmax =
dataRange();
376 const auto vec = data->flatVector();
377 double min(*std::min_element(vec.cbegin(), vec.cend()));
378 double max(*std::max_element(vec.cbegin(), vec.cend()));
391 return QPair<double, double>(min, max);
396 return item<BasicAxisItem>(
P_XAXIS);
401 return item<BasicAxisItem>(
P_XAXIS);
406 return item<BasicAxisItem>(
P_YAXIS);
411 return item<BasicAxisItem>(
P_YAXIS);
416 return item<AmplitudeAxisItem>(
P_ZAXIS);
421 return item<AmplitudeAxisItem>(
P_ZAXIS);
Defines various axis items.
Defines ImportDataInfo helper struct.
const QString y_axis_default_name
const QString x_axis_default_name
Defines class IntensityDataItem.
Defines namespace GUI::Model::JobItemUtils.
Defines MaskItems classes.
Defines class MaskUnitsConverter.
Defines items related to projections over color map.
void setLogScale(bool value)
DoubleDescriptor min(const QString &unit=QString()) const
void setBinCount(size_t value)
void setLowerBound(double value)
void setUpperBound(double value)
DoubleDescriptor max(const QString &unit=QString()) const
void setTitle(const QString &title)
Custom property to define list of string values with multiple selections. Intended for QVariant.
void setValue(const QString &name)
Abstract base class for IntensityDataItem and SpecularDataItem. Owns one simulated data set of type D...
virtual void setDatafield(Datafield *data)=0
The given pointer becomes owned by this class!!
Datafield * getDatafield()
void setAxesUnits(const ComboProperty &units)
std::unique_ptr< Datafield > m_data
simulation results
Carries information about loaded data.
QString unitsLabel() const
QString axisLabel(size_t axis_index) const
Abstract base class for instrument-specific item classes.
void setLowerX(double value)
std::vector< int > shape() const override
static constexpr auto P_ZAXIS
void setXaxisTitle(const QString &title) override
void setYaxisTitle(const QString &title) override
double getLowerZ() const
Returns lower and upper zoom ranges of z-axis.
bool hasProjections() const
void setGradient(const ComboProperty &gradient)
MaskContainerItem * maskContainerItem()
void updateAxesZoomLevel()
Sets zoom range of X,Y axes, if it was not yet defined.
const AmplitudeAxisItem * zAxisItem() const
QPair< double, double > dataRange() const
Init zmin, zmax to match the intensity values range.
double xMin() const
Returns min and max range of x-axis as given by IntensityData.
QString getXaxisTitle() const
SelectionDescriptor< QString > gradient() const
void setLowerY(double value)
void setLowerAndUpperZ(double zmin, double zmax)
void setUpperZ(double zmax)
bool isZAxisLocked() const
Returns true if min, max range of Z-axis is locked (change not allowed)
void setAxesRangeToData() override
set zoom range of x,y axes to axes of input data
void setLowerZ(double zmin)
MaskContainerItem * getOrCreateMaskContainerItem()
static bool isXaxisPropertyName(const QString &name)
double getLowerY() const
Returns lower and upper zoom ranges of y-axis.
ProjectionContainerItem * getOrCreateProjectionContainerItem()
void reset(ImportDataInfo data) override
Returns data to the state defined by user (imported) data.
static bool isZaxisPropertyName(const QString &name)
static constexpr auto P_YAXIS
void setDatafield(Datafield *data) override
The given pointer becomes owned by this class!!
void resetView()
Set axes viewport to original data.
const BasicAxisItem * yAxisItem() const
void setInterpolated(bool interp)
void setUpperX(double value)
QString getYaxisTitle() const
static constexpr auto P_PROJECTIONS
ComboProperty getGradient() const
static bool isInterpolatedPropertyName(const QString &name)
void updateDataRange()
Sets min,max values for z-axis, if axes is not locked, and ranges are not yet set.
QString getGradientValue() const
static constexpr auto P_IS_INTERPOLATED
static constexpr auto P_XAXIS
static constexpr auto T_PROJECTIONS
const BasicAxisItem * xAxisItem() const
static bool isYaxisPropertyName(const QString &name)
static constexpr auto P_TITLE
static constexpr auto T_MASKS
bool isInterpolated() const
void setUpperY(double value)
double getLowerX() const
Returns lower and upper zoom ranges of x-axis.
ProjectionContainerItem * projectionContainerItem()
double yMin() const
Returns min and max range of y-axis as given by IntensityData.
void updateCoords(const InstrumentItem *instrument) override
static bool isGradientPropertyName(const QString &name)
void updateAxesLabels()
Init axes labels, if it was not done already.
static constexpr auto P_GRADIENT
void setZAxisLocked(bool state)
Container holding various masks as children.
static constexpr auto M_TYPE
The MaskUnitsConverter converts coordinates of all masks from one units to anoter....
void convertToNbins(IntensityDataItem *intensityData)
Converts all masks on board of IntensityDataItem into bin-fraction coordinates.
void convertFromNbins(IntensityDataItem *intensityData)
Converts all masks on board of IntensityDataItem from bin-fraction coordinates to coordinates of axes...
A container to hold ProjectionItems, intended to store projections of color map on X,...
static constexpr auto M_TYPE
Describes a selection (various possibilities and the current one).
SessionItem * addProperty(const QString &name, const QVariant &variant)
Add new property item and register new tag. name is the tag name and the display name....
bool registerTag(const QString &name, int min=0, int max=-1, QStringList modelTypes={})
Add new tag to this item with given name, min, max and types. max = -1 -> unlimited,...
QVariant value() const
Get value.
QVariant getItemValue(const QString &tag) const
Directly access value of item under given tag.
void setItemValue(const QString &tag, const QVariant &variant) const
Directly set value of item under given tag.
void setDefaultTag(const QString &tag)
Set default tag.
SessionModel * model() const
Returns model of this item.
void emitDataChanged(int role=Qt::DisplayRole)
Notify model about data changes.
SessionItem * getItem(const QString &tag="", int row=0) const
Returns item in given row of given tag.
bool hasChildren() const
Indicates whether this SessionItem has any child items.
T * insertItem(SessionItem *parent=nullptr, int row=-1, QString tag="")
void updateDataAxes(DataItem *intensityItem, const InstrumentItem *instrumentItem)
updates axes of Datafield in IntensityData item
QString const & name(EShape k)