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
00014 extern const double DEFAULT_HIGHLIGHT_OPACITY;
00015 extern const double MAX_OPACITY;
00016
00017 class CurveStyle;
00018 class GeometryWindow;
00019 class GraphicsPointEllipse;
00020 class GraphicsPointPolygon;
00021 class PointStyle;
00022 class QColor;
00023 class QGraphicsScene;
00024 class QPolygonF;
00025 class QTextStream;
00026 class QVariant;
00027
00042 class GraphicsPoint : public GraphicsPointAbstractBase
00043 {
00044 public:
00046 GraphicsPoint(QGraphicsScene &scene,
00047 const QString &identifier,
00048 const QPointF &posScreen,
00049 const QColor &color,
00050 unsigned int radius,
00051 double lineWidth,
00052 GeometryWindow *geometryWindow);
00053
00055 GraphicsPoint(QGraphicsScene &scene,
00056 const QString &identifier,
00057 const QPointF &posScreen,
00058 const QColor &color,
00059 const QPolygonF &polygon,
00060 double lineWidth,
00061 GeometryWindow *geometryWindow);
00062
00064 ~GraphicsPoint ();
00065
00067 QVariant data (int key) const;
00068
00070 double highlightOpacity () const;
00071
00073 QPointF pos () const;
00074
00076 void printStream (QString indentation,
00077 QTextStream &str,
00078 double ordinalKey) const;
00079
00081 void reset();
00082
00084 void setData (int key, const QVariant &data);
00085
00087 void setHighlightOpacity (double highlightOpacity);
00088
00090 void setPointStyle (const PointStyle &pointStyle);
00091
00093 void setPos (const QPointF pos);
00094
00096 void setWanted ();
00097
00099 void updateCurveStyle (const CurveStyle &curveStyle);
00100
00102 bool wanted () const;
00103
00104 private:
00105 GraphicsPoint();
00106
00107 void createPointEllipse (unsigned int radius);
00108 void createPointPolygon (const QPolygonF &polygon);
00109
00110 QGraphicsScene &m_scene;
00111
00112
00113 GraphicsPointEllipse *m_graphicsItemEllipse;
00114 GraphicsPointEllipse *m_shadowZeroWidthEllipse;
00115
00116
00117 GraphicsPointPolygon *m_graphicsItemPolygon;
00118 GraphicsPointPolygon *m_shadowZeroWidthPolygon;
00119
00120
00121 const QString m_identifier;
00122 const QPointF m_posScreen;
00123 const QColor m_color;
00124 double m_lineWidth;
00125
00126
00127 bool m_wanted;
00128
00129 double m_highlightOpacity;
00130
00131 GeometryWindow *m_geometryWindow;
00132 };
00133
00134 #endif // GRAPHICS_POINT_H