Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYGeographicData.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012-2024> <EDF-DTG> <FRANCE>
3  * This file is part of Code_TYMPAN (R).
4  * Code_TYMPAN (R) is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * Code_TYMPAN (R) is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  * You should have received a copy of the GNU General Public License along
13  * with Code_TYMPAN (R). If not, see <https://www.gnu.org/licenses/>.
14  */
15 
16 #ifndef TYGEOGRAPHICDATA_H
17 #define TYGEOGRAPHICDATA_H
18 
19 #include <QImage>
20 #include <QObject>
21 #include <qqml.h>
22 #include <QXmlStreamWriter>
23 #include <QFile>
24 #include <QTextStream>
25 
26 class TYGeographicData : public QObject
27 {
28  Q_OBJECT
29  Q_PROPERTY(QString landtake_coordinates READ landtakeCoordinates WRITE setLandtakeCoordinates NOTIFY
31  Q_PROPERTY(QString background_img READ backgroundImg WRITE setBackgroundImg NOTIFY backgroundImgChanged)
32  Q_PROPERTY(QString crs READ crs WRITE setCrs NOTIFY crsChanged)
33  Q_PROPERTY(QString level_curves READ levelCurves WRITE setLevelCurves NOTIFY levelCurvesChanged)
34  Q_PROPERTY(QString scale_factor READ scaleFactor WRITE setScaleFactor NOTIFY scaleFactorChanged)
35  Q_PROPERTY(QString image_width READ imageWidth WRITE setImageWidth NOTIFY imageWidthChanged)
36  QML_ELEMENT
37 public:
38  explicit TYGeographicData(QObject* parent = nullptr);
39 
40  void setLandtakeCoordinates(const QString& text);
41  QString crs() const;
42  void setCrs(const QString& text);
43  QString landtakeCoordinates() const;
44  void setBackgroundImg(const QString& base64Image);
45  QString backgroundImg() const;
46  QString levelCurves() const;
47  void setLevelCurves(const QString& text);
48  QImage getImage() const;
49  QString scaleFactor() const;
50  void setScaleFactor(const QString& text);
51  QString imageWidth() const;
52  void setImageWidth(const QString& text);
53  Q_INVOKABLE bool saveImageToFile(const QString& filePath);
54 
55 signals:
57  void crsChanged();
62 
63 private:
65  QString m_crs;
66  QString m_base64Image;
67  QString m_level_curves;
68  mutable QImage m_image;
69  QString m_scale_factor;
70  QString m_image_width;
71 
72  QImage buildImageFromBase64(const QString& base64Image) const;
73 };
74 
75 #endif // TYGEOGRAPHICDATA_H
void imageWidthChanged()
void setScaleFactor(const QString &text)
QImage getImage() const
void backgroundImgChanged()
void scaleFactorChanged()
void setLandtakeCoordinates(const QString &text)
QString m_landtake_coordinates
void landtakeCoordinatesChanged()
QString landtakeCoordinates() const
QString backgroundImg() const
void levelCurvesChanged()
TYGeographicData(QObject *parent=nullptr)
QString scaleFactor() const
QImage buildImageFromBase64(const QString &base64Image) const
void setLevelCurves(const QString &text)
void setBackgroundImg(const QString &base64Image)
void setCrs(const QString &text)
Q_INVOKABLE bool saveImageToFile(const QString &filePath)
QString landtake_coordinates
QString levelCurves() const
QString imageWidth() const
void setImageWidth(const QString &text)