15 #ifndef BORNAGAIN_GUI_MODEL_DEVICE_MASKITEMS_H
16 #define BORNAGAIN_GUI_MODEL_DEVICE_MASKITEMS_H
33 virtual std::unique_ptr<IShape2D>
createShape(
double scale)
const = 0;
55 static constexpr
auto P_XLOW{
"xlow"};
56 static constexpr
auto P_YLOW{
"ylow"};
57 static constexpr
auto P_XUP{
"xup"};
58 static constexpr
auto P_YUP{
"yup"};
61 static constexpr
auto M_TYPE{
"RectangleMask"};
64 std::unique_ptr<IShape2D>
createShape(
double scale)
const override;
83 static constexpr
auto M_TYPE{
"RegionOfInterest"};
86 std::unique_ptr<IShape2D>
createShape(
double scale)
const override;
91 static constexpr
auto P_POSX{
"X position"};
92 static constexpr
auto P_POSY{
"Y position"};
95 static constexpr
auto M_TYPE{
"PolygonPoint"};
112 static constexpr
auto M_TYPE{
"PolygonMask"};
115 std::unique_ptr<IShape2D>
createShape(
double scale)
const override;
120 QVector<PolygonPointItem*>
points()
const;
128 static constexpr
auto P_POSX{
"X position"};
131 static constexpr
auto M_TYPE{
"VerticalLineMask"};
134 std::unique_ptr<IShape2D>
createShape(
double scale)
const override;
144 static constexpr
auto P_POSY{
"Y position"};
147 static constexpr
auto M_TYPE{
"HorizontalLineMask"};
150 std::unique_ptr<IShape2D>
createShape(
double scale)
const override;
167 static constexpr
auto M_TYPE{
"EllipseMask"};
170 std::unique_ptr<IShape2D>
createShape(
double scale)
const override;
192 static constexpr
auto M_TYPE{
"MaskAllMask"};
195 std::unique_ptr<IShape2D>
createShape(
double scale)
const override;
204 static constexpr
auto M_TYPE{
"MaskContainer"};
Defines class DoubleDescriptor.
Defines class SessionItem.
Defines class SessionModel.
Describes properties of a double value which are necessary to allow GUI representation,...
static constexpr auto P_XCENTER
std::unique_ptr< IShape2D > createShape(double scale) const override
static constexpr auto P_XRADIUS
void setAngle(double angle)
DoubleDescriptor yRadius() const
DoubleDescriptor xRadius() const
static constexpr auto P_YCENTER
static constexpr auto P_ANGLE
void setYRadius(double y_radius)
DoubleDescriptor xCenter() const
void serialize(Streamer &s) override
DoubleDescriptor angle() const
void setYCenter(double y_center)
void setXCenter(double x_center)
void setXRadius(double x_radius)
DoubleDescriptor yCenter() const
static constexpr auto M_TYPE
static constexpr auto P_YRADIUS
void setPosY(double pos_y)
static constexpr auto M_TYPE
void serialize(Streamer &s) override
static constexpr auto P_POSY
std::unique_ptr< IShape2D > createShape(double scale) const override
DoubleDescriptor posY() const
void serialize(Streamer &s) override
std::unique_ptr< IShape2D > createShape(double scale) const override
static constexpr auto M_TYPE
Container holding various masks as children.
void clear()
Remove all masks.
QVector< MaskItem * > maskItems() const
static constexpr auto M_TYPE
RegionOfInterestItem * regionOfInterestItem() const
Can be nullptr.
void addMask(MaskItem *maskItem)
void insertMask(int row, MaskItem *maskItem)
Insert mask at given row.
A base class for all mask items.
virtual std::unique_ptr< IShape2D > createShape(double scale) const =0
static bool isIsVisiblePropertyName(const QString &name)
MaskItem(const QString &name)
static bool isMaskValuePropertyName(const QString &name)
static constexpr auto P_IS_VISIBLE
void setMaskValue(bool mask_value)
void setMaskName(const QString &name)
void setIsVisibleValue(bool visible)
static constexpr auto P_MASK_VALUE
bool isVisibleValue() const
SessionItem * maskValueItem() const
virtual void serialize(Streamer &s)=0
MaskContainerItem * m_maskContainer
void clear()
Removes all maskItems.
void copy(const MaskContainerItem *maskContainer)
Copy the mask items stored in the given maskContainer.
void insertMask(int index, MaskItem *maskItem)
Takes ownership of maskItem.
void serialize(Streamer &s)
QVector< MaskItem * > maskItems() const
static constexpr auto P_ISCLOSED
void setIsClosed(bool closed)
void addPoint(double x, double y)
static constexpr auto M_TYPE
QVector< PolygonPointItem * > points() const
std::unique_ptr< IShape2D > createShape(double scale) const override
void serialize(Streamer &s) override
void serialize(Streamer &s)
void setPosY(double pos_y)
static constexpr auto P_POSY
void setPosX(double pos_x)
static constexpr auto P_POSX
static constexpr auto M_TYPE
void serialize(Streamer &s) override
DoubleDescriptor xLow() const
static constexpr auto P_XUP
DoubleDescriptor yUp() const
static constexpr auto P_YUP
void setXLow(double x_low)
std::unique_ptr< IShape2D > createShape(double scale) const override
DoubleDescriptor yLow() const
DoubleDescriptor xUp() const
void setYLow(double y_low)
static constexpr auto P_YLOW
static constexpr auto P_XLOW
static constexpr auto M_TYPE
static constexpr auto M_TYPE
std::unique_ptr< IShape2D > createShape(double scale) const override
Base class for a GUI data item.
QString modelType() const
Get model type.
Base class for a GUI data collection. A collection is e.g. all real data (RealDataModel)....
QModelIndex index(int row, int column, const QModelIndex &parent) const override
Supports serialization to or deserialization from QXmlStream.
static constexpr auto M_TYPE
void serialize(Streamer &s) override
std::unique_ptr< IShape2D > createShape(double scale) const override
void setPosX(double pos_x)
static constexpr auto P_POSX
DoubleDescriptor posX() const
QString const & name(EShape k)