1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #ifndef WORKAREA_HPP
- #define WORKAREA_HPP
- #include <string>
- #include <QWidget>
- #include <QPainter>
- #include <QMouseEvent>
- #include <QPoint>
- #include <QImage>
- class WorkArea: public QWidget
- {
-
- Q_OBJECT
-
- private:
- const int taillePoint = 10;
- const int epaisseurLigne = 3;
-
- unsigned int screenSizeX, screenSizeY;
- bool readOnly;
-
- QImage *img;
- QList < QPoint * >liste_points;
- int indexPointClicked;
-
- protected:
- void paintEvent (QPaintEvent * event) override;
- void mousePressEvent (QMouseEvent * event);
- void mouseMoveEvent (QMouseEvent * event);
- void mouseReleaseEvent (QMouseEvent * event);
-
- public:
- WorkArea (int screenSizeX, int screenSizeY, QWidget * parent = nullptr);
- WorkArea (int screenSizeX, int screenSizeY, const std::string & filename, QWidget * parent = nullptr);
- WorkArea (int screenSizeX, int screenSizeY, const std::string & imageFilename, const std::string & SLFilename, bool readOnly, QWidget * parent = nullptr);
- ~WorkArea ();
-
- void paint (QPainter & painter);
- void loadImage (const std::string & filename);
- void loadSL (const std::string & filename);
- void saveStrengthLine (const std::string & filename);
- void setReadOnly(bool readOnly);
- };
- #endif
|