00001
00002
00003
00004
00005
00006
00007 #ifndef BACKGROUND_STATE_ABSTRACT_BASE_H
00008 #define BACKGROUND_STATE_ABSTRACT_BASE_H
00009
00010 #include <QGraphicsPixmapItem>
00011 #include <QImage>
00012
00014 enum BackgroundState {
00015 BACKGROUND_STATE_CURVE,
00016 BACKGROUND_STATE_NONE,
00017 BACKGROUND_STATE_ORIGINAL,
00018 BACKGROUND_STATE_UNLOADED,
00019 NUM_BACKGROUND_STATES
00020 };
00021
00022 class BackgroundStateContext;
00023 class DocumentModelColorFilter;
00024 class DocumentModelGridRemoval;
00025 class GraphicsScene;
00026 class GraphicsView;
00027 class Transformation;
00028
00030 class BackgroundStateAbstractBase
00031 {
00032 public:
00034 BackgroundStateAbstractBase(BackgroundStateContext &context,
00035 GraphicsScene &scene);
00036 ~BackgroundStateAbstractBase();
00037
00039 virtual void begin() = 0;
00040
00042 BackgroundStateContext &context();
00043
00045 const BackgroundStateContext &context() const;
00046
00048 virtual void end() = 0;
00049
00051 virtual void fitInView (GraphicsView &view) = 0;
00052
00054 QImage image () const;
00055
00057 QGraphicsPixmapItem &imageItem () const;
00058
00060 GraphicsScene &scene();
00061
00063 const GraphicsScene &scene() const;
00064
00066 virtual void setCurveSelected (const Transformation &transformation,
00067 const DocumentModelGridRemoval &modelGridRemoval,
00068 const DocumentModelColorFilter &colorFilter,
00069 const QString &curveSelected) = 0;
00070
00072 virtual void setPixmap (const Transformation &transformation,
00073 const DocumentModelGridRemoval &modelGridRemoval,
00074 const DocumentModelColorFilter &modelColorFilter,
00075 const QPixmap &pixmap,
00076 const QString &curveSelected) = 0;
00077
00079 virtual QString state() const = 0;
00080
00082 virtual void updateColorFilter (const Transformation &transformation,
00083 const DocumentModelGridRemoval &modelGridRemoval,
00084 const DocumentModelColorFilter &modelColorFilter,
00085 const QString &curveSelected) = 0;
00086
00087 protected:
00088
00090 void setImageVisible (bool visible);
00091
00093 void setProcessedPixmap (const QPixmap &pixmap);
00094
00095 private:
00096 BackgroundStateAbstractBase();
00097
00098 BackgroundStateContext &m_context;
00099 GraphicsScene &m_scene;
00100
00101
00102
00103 QGraphicsPixmapItem *m_imageItem;
00104
00105 QImage m_image;
00106 };
00107
00108 #endif // BACKGROUND_STATE_ABSTRACT_BASE_H