00001
00002
00003
00004
00005
00006
00007 #ifndef GRAPHICS_POINT_H
00008 #define GRAPHICS_POINT_H
00009
00010 #include "GraphicsPointAbstractBase.h"
00011 #include <QColor>
00012 #include <QPointF>
00013 #include <QRectF>
00014
00015 extern const double DEFAULT_HIGHLIGHT_OPACITY;
00016 extern const double MAX_OPACITY;
00017
00018 class CurveStyle;
00019 class GeometryWindow;
00020 class GraphicsPointEllipse;
00021 class GraphicsPointPolygon;
00022 class PointStyle;
00023 class QColor;
00024 class QGraphicsScene;
00025 class QPolygonF;
00026 class QTextStream;
00027 class QVariant;
00028
00043 class GraphicsPoint : public GraphicsPointAbstractBase
00044 {
00045 public:
00047 GraphicsPoint(QGraphicsScene &scene,
00048 const QString &identifier,
00049 const QPointF &posScreen,
00050 const QColor &color,
00051 unsigned int radius,
00052 double lineWidth,
00053 GeometryWindow *geometryWindow);
00054
00056 GraphicsPoint(QGraphicsScene &scene,
00057 const QString &identifier,
00058 const QPointF &posScreen,
00059 const QColor &color,
00060 const QPolygonF &polygon,
00061 double lineWidth,
00062 GeometryWindow *geometryWindow);
00063
00065 ~GraphicsPoint ();
00066
00068 QRectF boundingRect () const;
00069
00071 QVariant data (int key) const;
00072
00074 double highlightOpacity () const;
00075
00077 QPointF pos () const;
00078
00080 void printStream (QString indentation,
00081 QTextStream &str,
00082 double ordinalKey) const;
00083
00085 void reset();
00086
00088 void setData (int key, const QVariant &data);
00089
00091 void setHighlightOpacity (double highlightOpacity);
00092
00094 void setPointStyle (const PointStyle &pointStyle);
00095
00097 void setPos (const QPointF pos);
00098
00100 void setPassive ();
00101
00103 void setWanted ();
00104
00106 void updateCurveStyle (const CurveStyle &curveStyle);
00107
00109 bool wanted () const;
00110
00111 private:
00112 GraphicsPoint();
00113
00114 void createPointEllipse (unsigned int radius);
00115 void createPointPolygon (const QPolygonF &polygon);
00116
00117 QGraphicsScene &m_scene;
00118
00119
00120 GraphicsPointEllipse *m_graphicsItemEllipse;
00121 GraphicsPointEllipse *m_shadowZeroWidthEllipse;
00122
00123
00124 GraphicsPointPolygon *m_graphicsItemPolygon;
00125 GraphicsPointPolygon *m_shadowZeroWidthPolygon;
00126
00127
00128 const QString m_identifier;
00129 const QPointF m_posScreen;
00130 const QColor m_color;
00131 double m_lineWidth;
00132
00133
00134 bool m_wanted;
00135
00136 double m_highlightOpacity;
00137
00138 GeometryWindow *m_geometryWindow;
00139 };
00140
00141 #endif // GRAPHICS_POINT_H