Engauge Digitizer  2
Public Member Functions | List of all members
GraphicsPoint Class Reference

Graphics item for drawing a circular or polygonal Point. More...

#include <GraphicsPoint.h>

Inheritance diagram for GraphicsPoint:
GraphicsPointAbstractBase

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.
 

Detailed Description

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.


The documentation for this class was generated from the following files: