8 #include "GraphicsPoint.h" 9 #include "GraphicsPointPolygon.h" 11 #include <QGraphicsScene> 12 #include "QtToString.h" 15 const QPolygonF &polygon) :
16 QGraphicsPolygonItem (polygon),
17 m_graphicsPoint (graphicsPoint),
20 LOG4CPP_INFO_S ((*mainCat)) <<
"GraphicsPointPolygon::GraphicsPointPolygon";
30 QGraphicsPolygonItem::hoverEnterEvent (event);
36 setOpacityForSubtree (MAX_OPACITY);
40 QGraphicsPolygonItem::hoverLeaveEvent (event);
44 const QVariant &value)
46 if (change == QGraphicsItem::ItemPositionHasChanged) {
48 LOG4CPP_DEBUG_S ((*mainCat)) <<
"GraphicsPointPolygon::itemChange" 49 <<
" identifier=" << data (DATA_KEY_IDENTIFIER).toString().toLatin1().data()
50 <<
" positionHasChanged";
52 setData (DATA_KEY_POSITION_HAS_CHANGED, QVariant (
true));
55 return QGraphicsPolygonItem::itemChange(change,
59 void GraphicsPointPolygon::setOpacityForSubtree (
double opacity)
67 m_shadow->setOpacity (opacity < MAX_OPACITY ? 0.0 : opacity);
74 double scale = (2 * radius) / boundingRect().width();
QVariant itemChange(GraphicsItemChange change, const QVariant &value)
Intercept moves by dragging so moved items can be identified. This replaces unreliable hit tests...
void setRadius(int radius)
Update the radius.
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
Unhighlight this point.
double highlightOpacity() const
Get method for highlight opacity.
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event)
Accept hover so point can be highlighted when cursor is over it as a guide to user.
Graphics item for drawing a circular or polygonal Point.
This class add event handling to QGraphicsPolygonItem.
void signalPointHoverLeave(QString)
Signal for geometry window to unhighlight the current point upon hover leave.
GraphicsPointPolygon(GraphicsPoint &graphicsPoint, const QPolygonF &polygon)
Single constructor.
void signalPointHoverEnter(QString)
Signal for geometry window to highlight the current point upon hover enter.
void setShadow(GraphicsPointPolygon *shadow)
Bind this graphics item to its shadow.