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, GeometryWindow *geometryWindow) | |
Constructor of circular point. | |
GraphicsPoint (QGraphicsScene &scene, const QString &identifier, const QPointF &posScreen, const QColor &color, const QPolygonF &polygon, double lineWidth, GeometryWindow *geometryWindow) | |
Constructor of polygon point. | |
~GraphicsPoint () | |
Destructor. This remove the graphics item from the scene. | |
QRectF | boundingRect () const |
Proxy method for QGraphicsItem::boundingRect. | |
QVariant | data (int key) const |
Proxy method for QGraphicsItem::data. | |
double | highlightOpacity () const |
Get method for highlight opacity. | |
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 | setHighlightOpacity (double highlightOpacity) |
Set method for highlight opacity. | |
void | setPointStyle (const PointStyle &pointStyle) |
Update the point style. | |
void | setPos (const QPointF pos) |
Update the position. | |
void | setPassive () |
Prevent automatic focus on point (=make it passive) for scale bar so drags can be made to work properly. | |
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. | |
virtual | ~GraphicsPointAbstractBase () |
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 43 of file GraphicsPoint.h.
GraphicsPoint::GraphicsPoint | ( | QGraphicsScene & | scene, |
const QString & | identifier, | ||
const QPointF & | posScreen, | ||
const QColor & | color, | ||
unsigned int | radius, | ||
double | lineWidth, | ||
GeometryWindow * | geometryWindow ) |
Constructor of circular point.
Definition at line 31 of file GraphicsPoint.cpp.
GraphicsPoint::GraphicsPoint | ( | QGraphicsScene & | scene, |
const QString & | identifier, | ||
const QPointF & | posScreen, | ||
const QColor & | color, | ||
const QPolygonF & | polygon, | ||
double | lineWidth, | ||
GeometryWindow * | geometryWindow ) |
Constructor of polygon point.
Definition at line 55 of file GraphicsPoint.cpp.
GraphicsPoint::~GraphicsPoint | ( | ) |
Destructor. This remove the graphics item from the scene.
Definition at line 79 of file GraphicsPoint.cpp.
QRectF GraphicsPoint::boundingRect | ( | ) | const |
Proxy method for QGraphicsItem::boundingRect.
Definition at line 105 of file GraphicsPoint.cpp.
QVariant GraphicsPoint::data | ( | int | key | ) | const |
Proxy method for QGraphicsItem::data.
Definition at line 193 of file GraphicsPoint.cpp.
double GraphicsPoint::highlightOpacity | ( | ) | const |
Get method for highlight opacity.
Definition at line 202 of file GraphicsPoint.cpp.
QPointF GraphicsPoint::pos | ( | ) | const |
Proxy method for QGraphicsItem::pos.
Definition at line 207 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 216 of file GraphicsPoint.cpp.
void GraphicsPoint::reset | ( | ) |
Mark point as unwanted, and unbind any bound lines.
Definition at line 246 of file GraphicsPoint.cpp.
void GraphicsPoint::setData | ( | int | key, |
const QVariant & | data ) |
Proxy method for QGraphicsItem::setData.
Definition at line 251 of file GraphicsPoint.cpp.
void GraphicsPoint::setHighlightOpacity | ( | double | highlightOpacity | ) |
Set method for highlight opacity.
Definition at line 264 of file GraphicsPoint.cpp.
void GraphicsPoint::setPassive | ( | ) |
Prevent automatic focus on point (=make it passive) for scale bar so drags can be made to work properly.
Definition at line 273 of file GraphicsPoint.cpp.
void GraphicsPoint::setPointStyle | ( | const PointStyle & | pointStyle | ) |
Update the point style.
Definition at line 286 of file GraphicsPoint.cpp.
void GraphicsPoint::setPos | ( | const QPointF | pos | ) |
Update the position.
Definition at line 334 of file GraphicsPoint.cpp.
void GraphicsPoint::setWanted | ( | ) |
Mark point as wanted. Marking as unwanted is done by the reset function.
Definition at line 343 of file GraphicsPoint.cpp.
void GraphicsPoint::updateCurveStyle | ( | const CurveStyle & | curveStyle | ) |
Update point and line styles that comprise the curve style.
Definition at line 348 of file GraphicsPoint.cpp.
bool GraphicsPoint::wanted | ( | ) | const |
Identify point as wanted//unwanted.
Definition at line 353 of file GraphicsPoint.cpp.