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";
24 const QVariant &value)
26 if (change == QGraphicsItem::ItemPositionHasChanged) {
28 LOG4CPP_DEBUG_S ((*mainCat)) <<
"GraphicsPointPolygon::itemChange"
29 <<
" identifier=" << data (DATA_KEY_IDENTIFIER).toString().toLatin1().data()
30 <<
" positionHasChanged";
32 setData (DATA_KEY_POSITION_HAS_CHANGED, QVariant (
true));
35 return QGraphicsPolygonItem::itemChange(change,
46 QGraphicsPolygonItem::hoverEnterEvent (event);
52 setOpacityForSubtree (MAX_OPACITY);
56 QGraphicsPolygonItem::hoverLeaveEvent (event);
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.