Engauge Digitizer  2
 All Classes Files Functions Variables Enumerations Enumerator Friends Pages
GraphicsPoint.h
1 #ifndef GRAPHICS_POINT_H
2 #define GRAPHICS_POINT_H
3 
4 #include "GraphicsPointAbstractBase.h"
5 #include "GraphicsPoint.h"
6 #include <QColor>
7 #include <QPointF>
8 
9 class CurveStyle;
12 class PointStyle;
13 class QColor;
14 class QGraphicsScene;
15 class QPolygonF;
16 class QTextStream;
17 class QVariant;
18 
34 {
35 public:
37  GraphicsPoint(QGraphicsScene &scene,
38  const QString &identifier,
39  const QPointF &posScreen,
40  const QColor &color,
41  unsigned int radius,
42  double lineWidth);
43 
45  GraphicsPoint(QGraphicsScene &scene,
46  const QString &identifier,
47  const QPointF &posScreen,
48  const QColor &color,
49  const QPolygonF &polygon,
50  double lineWidth);
51 
53  ~GraphicsPoint ();
54 
56  QVariant data (int key) const;
57 
59  QPointF pos () const;
60 
62  void printStream (QString indentation,
63  QTextStream &str,
64  double ordinalKey) const;
65 
67  void reset();
68 
70  void setData (int key, const QVariant &data);
71 
73  void setPointStyle (const PointStyle &pointStyle);
74 
76  void setPos (const QPointF pos);
77 
79  void setToolTip (const QString &toolTip);
80 
82  void setWanted ();
83 
85  void updateCurveStyle (const CurveStyle &curveStyle);
86 
88  bool wanted () const;
89 
90 private:
91  GraphicsPoint();
92 
93  void createPointEllipse (unsigned int radius); // Attributes shared by circle and polygon points are passed through member variables
94  void createPointPolygon (const QPolygonF &polygon); // Attributes shared by circle and polygon points are passed through member variables
95 
96  QGraphicsScene &m_scene;
97 
98  // Ellipse graphics items. Unused if point is polygonal.
99  GraphicsPointEllipse *m_graphicsItemEllipse;
100  GraphicsPointEllipse *m_shadowZeroWidthEllipse; // Shadow item overlays the superclass instance to ensure visibility
101 
102  // Polygon graphics items. Unused if point is elliptical.
103  GraphicsPointPolygon *m_graphicsItemPolygon;
104  GraphicsPointPolygon *m_shadowZeroWidthPolygon; // Shadow item overlays the superclass instance to ensure visibility
105 
106  // Shared attributes
107  const QString m_identifier;
108  const QPointF m_posScreen;
109  const QColor m_color;
110  double m_lineWidth;
111 
112  // Housekeeping
113  bool m_wanted;
114 };
115 
116 #endif // GRAPHICS_POINT_H
void setWanted()
Mark point as wanted. Marking as unwanted is done by the reset function.
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(...
Base class for adding identifiers to graphics items that represent Points.
void setData(int key, const QVariant &data)
Proxy method for QGraphicsItem::setData.
void setPos(const QPointF pos)
Update the position.
bool wanted() const
Identify point as wanted//unwanted.
void setPointStyle(const PointStyle &pointStyle)
Update the point style.
void updateCurveStyle(const CurveStyle &curveStyle)
Update point and line styles that comprise the curve style.
This class add event handling to QGraphicsEllipseItem.
Details for a specific Point.
Definition: PointStyle.h:14
~GraphicsPoint()
Destructor. This remove the graphics item from the scene.
Container for LineStyle and PointStyle for one Curve.
Definition: CurveStyle.h:12
Graphics item for drawing a circular or polygonal Point.
Definition: GraphicsPoint.h:33
This class add event handling to QGraphicsPolygonItem.
QPointF pos() const
Proxy method for QGraphicsItem::pos.
QVariant data(int key) const
Proxy method for QGraphicsItem::data.
void setToolTip(const QString &toolTip)
Proxy method for QGraphicsItem::setToolTip.
void reset()
Mark point as unwanted, and unbind any bound lines.