17 #include <QGraphicsSceneMouseEvent>
51 painter->setRenderHints(QPainter::Antialiasing);
62 qreal xmin = std::min(event->pos().x(), opposPos.x());
63 qreal xmax = std::max(event->pos().x(), opposPos.x());
64 qreal ymin = std::min(event->pos().y(), opposPos.y());
65 qreal ymax = std::max(event->pos().y(), opposPos.y());
66 qreal
width = xmax - xmin;
67 qreal
height = ymax - ymin;
69 qreal xcenter = xmin + (xmax - xmin) / 2.;
70 qreal ycenter = ymin + (ymax - ymin) / 2.;
72 QPointF center(xcenter, ycenter);
73 QPointF centerInScene = mapToScene(center);
104 IShape2DView::mouseMoveEvent(event);
Defines EllipseView class.
Defines MaskItems classes.
static const QString P_XRADIUS
static const QString P_YRADIUS
static const QString P_XCENTER
static const QString P_ANGLE
static const QString P_YCENTER
qreal top() const
Returns the y-coordinate of the rectangle's top edge.
qreal right() const
returns the x-coordinate of the rectangle's right edge
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
virtual void onPropertyChange(const QString &propertyName)
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
void update_position()
updates position of view using item properties
virtual void onChangedY()
qreal bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
qreal left() const
returns the x-coordinate of the rectangle's left edge
virtual void onChangedX()
qreal toSceneX(const QString &property_name) const
qreal toSceneY(const QString &property_name) const
qreal fromSceneY(qreal value) const
void setBlockOnProperty(bool value)
qreal fromSceneX(qreal value) const
convert scene coordinates to ColorMap plot coordinates
double par(const QString &property_name) const
static QBrush getMaskBrush(bool mask_value)
static QPen getMaskPen(bool mask_value)
static const QString P_MASK_VALUE
SizeHandleElement * m_activeHandleElement
QRectF m_mask_rect
mask rectangle in scene coordinates
qreal width() const
returns width of the rectangle
void update_view()
update visual appearance of view (triggered by ISceneAdaptor)
QPointF m_resize_opposite_origin
QVariant getItemValue(const QString &tag) const
Directly access value of item under given tag.
void setItemValue(const QString &tag, const QVariant &variant)
Directly set value of item under given tag.
EHandleType getHandleType() const