20 #include <QStyleOptionGraphicsItem>
24 const double mask_width = 8.0;
25 const double mask_visible_width = 3.0;
33 setFlag(QGraphicsItem::ItemIsSelectable);
34 setFlag(QGraphicsItem::ItemIsMovable);
35 setFlag(QGraphicsItem::ItemSendsGeometryChanges);
36 setCursor(Qt::SizeHorCursor);
47 p.addRect(QRectF(-mask_visible_width / 2., 0.0, mask_visible_width,
m_bounding_rect.height()));
73 setY(plot_scene_rectangle.top());
75 m_bounding_rect = QRectF(-mask_width / 2., 0.0, mask_width, plot_scene_rectangle.height());
85 QRectF(-mask_visible_width / 2., 0.0, mask_visible_width,
m_bounding_rect.height()));
89 pen.setStyle(Qt::DashLine);
91 painter->setBrush(Qt::NoBrush);
93 QRectF(-mask_visible_width / 2., 0.0, mask_visible_width,
m_bounding_rect.height()));
99 const QVariant& value)
101 if (isSelected() && change == ItemPositionChange && scene()) {
102 QPointF newPos = value.toPointF();
106 return QGraphicsItem::itemChange(change, value);
120 setFlag(QGraphicsItem::ItemIsSelectable);
121 setFlag(QGraphicsItem::ItemIsMovable);
122 setFlag(QGraphicsItem::ItemSendsGeometryChanges);
123 setCursor(Qt::SizeVerCursor);
135 QRectF(0.0, -mask_visible_width / 2.,
m_bounding_rect.width(), mask_visible_width));
160 setX(plot_scene_rectangle.left());
163 m_bounding_rect = QRectF(0.0, -mask_width / 2., plot_scene_rectangle.width(), mask_width);
173 QRectF(0.0, -mask_visible_width / 2.,
m_bounding_rect.width(), mask_visible_width));
177 pen.setStyle(Qt::DashLine);
178 painter->setPen(pen);
179 painter->setBrush(Qt::NoBrush);
181 QRectF(0.0, -mask_visible_width / 2.,
m_bounding_rect.width(), mask_visible_width));
187 const QVariant& value)
189 if (isSelected() && change == ItemPositionChange && scene()) {
190 QPointF newPos = value.toPointF();
194 return QGraphicsItem::itemChange(change, value);
Defines class ColorMapSceneAdaptor.
Defines classes VerticalLineView and HorizontalLineView.
Defines MaskItems classes.
void setPosY(double pos_y)
DoubleDescriptor posY() const
HorizontalLineView(HorizontalLineItem *item)
void onPropertyChange() override
void update_view() override
HorizontalLineItem * m_item
void onChangedY() override
QPainterPath shape() const override
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override
Allows item movement along y, prevent movement along x.
SessionItem * parameterizedItem() const override
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override
~HorizontalLineView() override
void onItemDestroyed() override
virtual const QRectF & viewportRectangle() const
Returns viewport rectangle in scene coordinates.
Main interface class for views representing MaskItems, Projections on graphics scene.
const ISceneAdaptor * m_adaptor
qreal toSceneX(qreal value) const
qreal fromSceneY(qreal value) const
void setBlockOnProperty(bool value)
void disconnectFromItem(SessionItem *item)
qreal fromSceneX(qreal value) const
convert scene coordinates to ColorMap plot coordinates
qreal toSceneY(qreal value) const
static QBrush getMaskBrush(bool mask_value)
static QPen getMaskPen(bool mask_value)
Base class for a GUI data item.
void setPosX(double pos_x)
DoubleDescriptor posX() const
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override
Allows item movement along x, prevent movement along y.
void onItemDestroyed() override
void onChangedX() override
void onPropertyChange() override
SessionItem * parameterizedItem() const override
QPainterPath shape() const override
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override
VerticalLineView(VerticalLineItem *item)
void update_view() override
~VerticalLineView() override
VerticalLineItem * m_item