1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- /*********************************************************************/
- /* */
- /* Copyright 2022-2023 Rémi Synave - remi.synave@univ-littoral.fr */
- /* */
- /* This file is part of DSL. */
- /* This software uses Qt to build the Graphical User Interface */
- /* https://www.qt.io/ */
- /* */
- /* DSL is free software: you can redistribute it and/or modify */
- /* it under the terms of the GNU General Public License as published */
- /* by the Free Software Foundation, either version 3 of the License, */
- /* or (at your option) any later version. */
- /* */
- /* DSL is distributed in the hope that it will be useful, */
- /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
- /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
- /* GNU General Public License for more details. */
- /* */
- /* You should have received a copy of the GNU General Public License */
- /* along with DSL. If not, see <http://www.gnu.org/licenses/>. */
- /* */
- /*********************************************************************/
- #ifndef WORKAREA_HPP
- #define WORKAREA_HPP
- #include <string>
- #include <QWidget>
- #include <QPainter>
- #include <QMouseEvent>
- #include <QPoint>
- #include <QImage>
- #include <QImageReader>
- #include "StrengthLine.hpp"
- class WorkArea: public QWidget
- {
-
- Q_OBJECT
-
- private:
- const int taillePoint = 10;
- const int epaisseurLigne = 3;
-
- unsigned int screenSizeX, screenSizeY;
- 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 ();
- void loadImage (const std::string & filename);
-
- void paint (QPainter & painter);
-
- void addSL(const StrengthLine *sl);
- double getDistance() const;
- signals:
- void click();
- };
- #endif
|