Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYIGNGeoProvider.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 TY_IGN_GEO_PROVIDER_H
17 #define TY_IGN_GEO_PROVIDER_H
18 
19 #include <QObject>
20 #include <QQuickWindow>
21 #include <QQmlApplicationEngine>
22 #include "TYIGNLevelCurvesParser.h"
23 #include "TYIGNGeoPfMocker.h"
24 
29 class TYIGNGeoProvider : public QObject
30 {
31  Q_OBJECT
32 
33 private:
35 
37 
38  std::shared_ptr<QQmlApplicationEngine> _engine;
39 
45 
51 
52  QObject* _geographicData;
53 
54 public:
56  void operator=(const TYIGNGeoProvider&) = delete;
57 
58  static TYIGNGeoProvider* getInstance();
59  const QString getLandtakeCoord();
60  void setLandtakeCoord(const QString& text);
61  const QString getScaleFactor();
62  void setScaleFactor(const QString& text);
63  const QString getImageWidth();
64  void setImageWidth(const QString& text);
65  bool saveImageToFile(const QString& filePath);
66 
67  void initEngine();
68 
70  {
71  return _isInitialised;
72  }
73 
74  void openModalWindow(QWidget* mainWindow);
75  void closeModalWindow();
76  void buildLevelCurves(const OCoord3D& SIGCoords, const OBox& selectedZone, double scaleFactor);
77  std::vector<double> coordinatesToDouble(const QString& coord);
83  bool mockGeoPf();
84 
85  void resetGeographicData();
86 
87  std::shared_ptr<TYIGNLevelCurvesParser> _parser;
88  std::shared_ptr<TYIGNGeoPfMocker> _mocker;
89 
90 signals:
92 
93 private slots:
94  void handleCancelRequest();
95  void handleOKRequest();
96  void resetEngine();
97 };
98 
99 #endif // TY_IGN_GEO_PROVIDER_H
The box class.
Definition: 3d.h:1346
The 3D coordinate class.
Definition: 3d.h:226
This class holds a singleton instance which is an entry point for accessing IGN Geoplatform in order ...
std::shared_ptr< TYIGNLevelCurvesParser > _parser
std::shared_ptr< TYIGNGeoPfMocker > _mocker
void setImageWidth(const QString &text)
const QString getLandtakeCoord()
const QString getImageWidth()
static TYIGNGeoProvider * getInstance()
void setLandtakeCoord(const QString &text)
QObject * _geographicData
void geoProjectCreationRequested()
bool _isInitialised
True when web engine is intialized.
std::vector< double > coordinatesToDouble(const QString &coord)
void buildLevelCurves(const OCoord3D &SIGCoords, const OBox &selectedZone, double scaleFactor)
TYIGNGeoProvider(TYIGNGeoProvider &other)=delete
void openModalWindow(QWidget *mainWindow)
std::shared_ptr< QQmlApplicationEngine > _engine
bool _isSelectionValidated
Set to false when displaying zone selection page. When selection is validated, it is set to true in o...
bool mockGeoPf()
Mocks IGN Geoplatform web services when they are down.
void setScaleFactor(const QString &text)
void operator=(const TYIGNGeoProvider &)=delete
bool saveImageToFile(const QString &filePath)
const QString getScaleFactor()
static TYIGNGeoProvider * singleton_