16 #include "Base/Axis/FrameUtil.h"
23 , m_direction(UNDEFINED)
59 if (
auto* maskItem =
dynamic_cast<MaskItem*
>(item))
67 if (
auto* rectItem =
dynamic_cast<RectangleItem*
>(maskItem)) {
72 }
else if (
auto* poly =
dynamic_cast<PolygonItem*
>(maskItem)) {
81 }
else if (
auto* ellItem =
dynamic_cast<EllipseItem*
>(maskItem)) {
82 double xc = ellItem->xCenter();
83 double yc = ellItem->yCenter();
84 double xR = ellItem->xRadius();
85 double yR = ellItem->yRadius();
91 FramUtil::coordinatesToBinf(xc, yc,
m_data->frame());
92 FramUtil::coordinatesToBinf(x2, y2,
m_data->frame());
94 FramUtil::coordinatesFromBinf(xc, yc,
m_data->frame());
95 FramUtil::coordinatesFromBinf(x2, y2,
m_data->frame());
97 ellItem->setXCenter(xc);
98 ellItem->setYCenter(yc);
99 ellItem->setXRadius(x2 - xc);
100 ellItem->setYRadius(y2 - yc);
108 const QString& yname)
110 if (maskItem->
isTag(xname)) {
114 if (maskItem->
isTag(yname)) {
124 auto axis_index =
static_cast<size_t>(axis);
127 ASSERT(axis_index == 0 || axis_index == 1);
130 return FramUtil::coordinateToBinf(value,
m_data->axis(axis_index));
132 return FramUtil::coordinateFromBinf(value,
m_data->axis(axis_index));
Defines class IntensityDataItem.
Defines MaskItems classes.
Defines class MaskUnitsConverter.
Defines items related to projections over color map.
Datafield * getDatafield()
MaskContainerItem * maskContainerItem()
ProjectionContainerItem * projectionContainerItem()
QVector< MaskItem * > maskItems() const
A base class for all mask items.
void convertIntensityDataItem(IntensityDataItem *intensityData)
Converts all masks on board of IntensityDataItem from/to bin-fraction coordinates.
void convertMask(MaskItem *maskItem)
Converts single mask from/to bin-fraction coordinates.
EConvertionDirection m_direction
double convert(double value, Axis axis)
Convert value of axis from/to bin-fraction coordinates.
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...
void convertCoordinate(SessionItem *maskItem, const QString &xname, const QString &yname)
Convert (x,y) coordinates registered as property (i.e. under P_XPOS, P_YPOS) from/to bin-fraction coo...
Base class for a GUI data item.
bool isTag(const QString &name) const
Returns true if tag is available.
QVector< SessionItem * > getItems(const QString &tag="") const
Returns vector of all items of given tag.
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.