|
Engauge Digitizer 2
|
Graphics item for drawing a circular or polygonal Point. More...
#include <GraphicsPoint.h>
Public Member Functions | |
| GraphicsPoint (QGraphicsScene &scene, const QString &identifier, const QPointF &posScreen, const QColor &color, unsigned int radius, double lineWidth) | |
| Constructor of circular point. | |
| GraphicsPoint (QGraphicsScene &scene, const QString &identifier, const QPointF &posScreen, const QColor &color, const QPolygonF &polygon, double lineWidth) | |
| Constructor of polygon point. | |
| ~GraphicsPoint () | |
| Destructor. This remove the graphics item from the scene. | |
| QVariant | data (int key) const |
| Proxy method for QGraphicsItem::data. | |
| QPointF | pos () const |
| Proxy method for QGraphicsItem::pos. | |
| void | printStream (QString indentation, QTextStream &str, double ordinalKey) const |
| Debugging method that supports print method of this class and printStream method of some other class(es) | |
| void | reset () |
| Mark point as unwanted, and unbind any bound lines. | |
| void | setData (int key, const QVariant &data) |
| Proxy method for QGraphicsItem::setData. | |
| void | setPointStyle (const PointStyle &pointStyle) |
| Update the point style. | |
| void | setPos (const QPointF pos) |
| Update the position. | |
| void | setToolTip (const QString &toolTip) |
| Proxy method for QGraphicsItem::setToolTip. | |
| void | setWanted () |
| Mark point as wanted. Marking as unwanted is done by the reset function. | |
| void | updateCurveStyle (const CurveStyle &curveStyle) |
| Update point and line styles that comprise the curve style. | |
| bool | wanted () const |
| Identify point as wanted//unwanted. | |
Public Member Functions inherited from GraphicsPointAbstractBase | |
| GraphicsPointAbstractBase () | |
| Single constructor. | |
Graphics item for drawing a circular or polygonal Point.
In this class, lines are drawn twice: 1) As nonzero-width lines so user can have thick, and highly visible, points 2) As a 'shadow' with zero-width lines since these always appear even when zooming results in some pixel rows/columns disappearing This dual-line approach is better than using QGraphicsItem::ItemIgnoresTransformations to prevent horrible aliasing problems, since that approach involves complicated transformation matrix manipulations
Layering is used for the single graphics item contained by this class. External code only has to deal with this single class, and there is no multiple inheritance involved. If inheritance was used, we would have one class based on QGraphicsEllipseItem and another on QGraphicsPolygonItem, so having a single class (for the convenience of the external code) would involve multiple inheritance (of those two classes). With the inheritance approach, using just the methods supplied by QGraphicsItem would be inadequate.
Definition at line 39 of file GraphicsPoint.h.
| GraphicsPoint::GraphicsPoint | ( | QGraphicsScene & | scene, |
| const QString & | identifier, | ||
| const QPointF & | posScreen, | ||
| const QColor & | color, | ||
| unsigned int | radius, | ||
| double | lineWidth | ||
| ) |
Constructor of circular point.
Definition at line 27 of file GraphicsPoint.cpp.
| GraphicsPoint::GraphicsPoint | ( | QGraphicsScene & | scene, |
| const QString & | identifier, | ||
| const QPointF & | posScreen, | ||
| const QColor & | color, | ||
| const QPolygonF & | polygon, | ||
| double | lineWidth | ||
| ) |
Constructor of polygon point.
Definition at line 51 of file GraphicsPoint.cpp.
| GraphicsPoint::~GraphicsPoint | ( | ) |
Destructor. This remove the graphics item from the scene.
Definition at line 75 of file GraphicsPoint.cpp.
| QVariant GraphicsPoint::data | ( | int | key | ) | const |
Proxy method for QGraphicsItem::data.
Definition at line 174 of file GraphicsPoint.cpp.
| QPointF GraphicsPoint::pos | ( | ) | const |
Proxy method for QGraphicsItem::pos.
Definition at line 183 of file GraphicsPoint.cpp.
| void GraphicsPoint::printStream | ( | QString | indentation, |
| QTextStream & | str, | ||
| double | ordinalKey | ||
| ) | const |
Debugging method that supports print method of this class and printStream method of some other class(es)
Definition at line 192 of file GraphicsPoint.cpp.
| void GraphicsPoint::reset | ( | ) |
Mark point as unwanted, and unbind any bound lines.
Definition at line 222 of file GraphicsPoint.cpp.
| void GraphicsPoint::setData | ( | int | key, |
| const QVariant & | data | ||
| ) |
Proxy method for QGraphicsItem::setData.
Definition at line 227 of file GraphicsPoint.cpp.
| void GraphicsPoint::setPointStyle | ( | const PointStyle & | pointStyle | ) |
Update the point style.
Definition at line 240 of file GraphicsPoint.cpp.
| void GraphicsPoint::setPos | ( | const QPointF | pos | ) |
Update the position.
Definition at line 288 of file GraphicsPoint.cpp.
| void GraphicsPoint::setToolTip | ( | const QString & | toolTip | ) |
Proxy method for QGraphicsItem::setToolTip.
Definition at line 297 of file GraphicsPoint.cpp.
| void GraphicsPoint::setWanted | ( | ) |
Mark point as wanted. Marking as unwanted is done by the reset function.
Definition at line 306 of file GraphicsPoint.cpp.
| void GraphicsPoint::updateCurveStyle | ( | const CurveStyle & | curveStyle | ) |
Update point and line styles that comprise the curve style.
Definition at line 311 of file GraphicsPoint.cpp.
| bool GraphicsPoint::wanted | ( | ) | const |
Identify point as wanted//unwanted.
Definition at line 316 of file GraphicsPoint.cpp.