Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYProjet.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 /*
17  *
18  *
19  *
20  *
21  */
22 
23 #ifndef __TY_PROJET__
24 #define __TY_PROJET__
25 
26 #include "TYCalcul.h"
28 #include "TYPointControl.h"
29 
30 #include <iostream>
31 #include <vector>
32 // using namespace std;
33 
44 class TYProjet : public TYElement
45 {
49 
50  // Methodes
51 public:
57  TYProjet();
58 
64  TYProjet(const TYProjet& other);
65 
71  virtual ~TYProjet();
72 
74  TYProjet& operator=(const TYProjet& other);
75 
77  bool operator==(const TYProjet& other) const;
78 
80  bool operator!=(const TYProjet& other) const;
81 
82  virtual std::string toString() const;
83 
84  virtual DOM_Element toXML(DOM_Element& domElement);
85 
86  virtual int fromXML(DOM_Element domElement);
87 
93  QString getAuteur() const
94  {
95  return _auteur;
96  }
97 
102  void setAuteur(const QString& auteur)
103  {
104  _auteur = auteur;
105  }
106 
112  QString getDateCreation() const
113  {
114  return _dateCreation;
115  }
116 
121  void setDateCreation(const QString& date)
122  {
123  _dateCreation = date;
124  }
125 
131  QString getDateModif() const
132  {
133  return _dateModif;
134  }
135 
140  void setDateModif(const QString& date)
141  {
142  _dateModif = date;
143  }
144 
150  QString getComment() const
151  {
152  return _comment;
153  }
154 
159  void setComment(const QString& comment)
160  {
161  _comment = comment;
162  }
163 
170  {
171  return _pSite;
172  }
173 
179  const LPTYSiteNode getSite() const
180  {
181  return _pSite;
182  }
183 
188  void setSite(const LPTYSiteNode pSite);
189 
194  {
195  return _pointsControl;
196  }
201  {
202  return _pointsControl;
203  }
207  void setPointsControl(const TYTabLPPointControl& pointsControl)
208  {
209  _pointsControl = pointsControl;
210  setIsGeometryModified(true);
211  }
215  bool addPointControl(LPTYPointControl pPointControl);
219  bool remPointControl(LPTYPointControl pPointControl);
220 
228 
233  {
234  return _pointsControl[index];
235  }
239  bool remAllPointControl();
240 
245  bool updateAltiRecepteurs();
246 
247  bool updateAltiRecepteurs(const TYAltimetrie* pAlti);
248 
252  bool updateAltiPointControle(TYPointControl* pPtControl, const TYAltimetrie* pAlti);
253 
254  // ++++ DEBUT MAILLAGES ++++
255 
262  {
263  return _maillages;
264  }
265 
272  {
273  return _maillages;
274  }
275 
276  void updateCalculsWithMaillage(TYMaillage* pMaillage);
277 
282  bool addMaillage(LPTYMaillageGeoNode pMaillageGeoNode);
287  bool addMaillage(LPTYMaillage pMaillage);
288 
293  bool remMaillage(const LPTYMaillageGeoNode pMaillageGeoNode);
294 
299  bool remMaillage(const LPTYMaillage pMaillage);
300 
305  bool remMaillage(QString idMaillage);
306 
311  bool remAllMaillage();
312 
319  {
320  return TYMaillage::safeDownCast(_maillages.at(index)->getElement());
321  }
322 
330 
335  bool updateAltiMaillage(TYMaillageGeoNode* pMaillageGeoNode, const TYAltimetrie* pAlti);
336 
341  bool updateAltiMaillage(TYMaillageGeoNode* pMaillageGeoNode); // Remis pour compatibilite
342 
347  void selectActivePoint(const LPTYSiteNode pSite);
348 
349  virtual void updateGraphic();
350 
351 protected:
356  void updateGraphicMaillage();
357 
358  // ++++ FIN MAILLAGES ++++
359 
360 public:
367  {
368  return _listCalcul;
369  }
370 
375  {
376  return _listCalcul;
377  }
378 
382  void setListCalcul(const TYTabLPCalcul& list)
383  {
384  _listCalcul = list;
385  setIsGeometryModified(true);
386  }
387 
393  bool addCalcul(LPTYCalcul pCalcul);
394 
400  bool remCalcul(const LPTYCalcul pCalcul);
401 
407  bool remCalcul(QString idCalcul);
408 
413  void remAllCalcul();
414 
419  void unsetSite();
420 
427  {
428  return _pCurrentCalcul;
429  }
430 
436  {
437  return _pCurrentCalcul;
438  }
439 
444  void setCurrentCalcul(LPTYCalcul pCurCalcul);
445 
452  LPTYCalcul duplicateCalcul(const LPTYCalcul pCalcul);
453 
459  void duplicatePtCalcState(const TYCalcul* pCalculRef, TYCalcul* pCalculNew);
460 
466  void duplicateNoiseMapState(const TYCalcul* pCalculRef, TYCalcul* pCalculNew);
467 
472  void remElmtFromCalculs(TYElement* pElement);
473 
478  void remTabElmtFromCalculs(std::vector<LPTYGeometryNode> tabGeoNode);
479 
486  void setDelaunayTolerence(const double& val)
487  {
488  _delaunayTolerance = val;
489  }
491  {
492  return _delaunayTolerance;
493  }
494  const double getDelaunayTolerence() const
495  {
496  return _delaunayTolerance;
497  }
498 
505  void setDMax(const double& val);
506  double getDMax()
507  {
508  return _maxDistBetweenPoints;
509  }
510  const double getDMax() const
511  {
512  return _maxDistBetweenPoints;
513  }
514 
521  void setUseDefGeomVal(const bool& bVal)
522  {
523  _useDefaultGeomVal = bVal;
525  }
527  {
528  return _useDefaultGeomVal;
529  }
530  const bool getUseDefGeomVal() const
531  {
532  return _useDefaultGeomVal;
533  }
534 
539  void verifGeometricParam();
540 
545  void forceUseDefault();
546 
551  const double getDefaultDelaunayTolerence() const;
552 
557  const double getDefaultDMax() const;
558 
567  {
568  return _bStatusSolver;
569  }
570  const bool getStatusSolver() const
571  {
572  return _bStatusSolver;
573  }
574  void setStatusSolver(const bool& bStatus)
575  {
576  _bStatusSolver = bStatus;
577  }
578 
583  void cleanReceptorsStatus(TYCalcul* pCalcul);
584 
590  const bool displaySpectrumInOctaveForm();
591 
599  {
600  return _spectreForm;
601  }
603  {
604  _spectreForm = f;
605  }
606 
613  QString getSpectrePond() const
614  {
615  return _spectrePond;
616  }
617  void setSpectrePond(QString& p)
618  {
619  _spectrePond = p;
620  }
621 
622 public:
623  // CLM-NT33 : Sauvegarde sans resultats
624  static bool gSaveValues;
625 
626  // Membres
627 protected:
629  QString _auteur;
631  QString _dateCreation;
633  QString _dateModif;
635  QString _comment;
636 
639 
642 
645 
648 
651 
656 
657  // Statut de disponibilite du solveur du calcul courant
659 
660  // Default spectre form used for displaying spectrum for this project
662  // Default spectre weighting used for displaying spectrum for this project
663  QString _spectrePond;
664 };
665 
666 #endif // __TY_PROJET__
QDomElement DOM_Element
Definition: QT2DOM.h:30
std::vector< LPTYCalcul > TYTabLPCalcul
Collection de pointeurs de TYCalcul.
Definition: TYDefines.h:394
#define TY_EXT_GRAPHIC_DECL_ONLY(classname)
Definition: TYElement.h:430
#define OPROTODECL(classname)
Definition: TYElement.h:64
#define TY_EXTENSION_DECL_ONLY(classname)
Definition: TYElement.h:385
std::vector< LPTYMaillageGeoNode > TYTabMaillageGeoNode
Collection de noeuds geometriques de type TYMaillage.
Definition: TYMaillage.h:438
std::vector< LPTYPointControl > TYTabLPPointControl
Collection de Smart Pointer sur TYPointControl.
static OPrototype * safeDownCast(OPrototype *pObject)
Definition: TYElement.cpp:71
Assigne une altitude a chaque point de l'espace.
Definition: TYAltimetrie.h:35
Calculation program.
Definition: TYCalcul.h:50
virtual void setIsGeometryModified(bool isModified)
Definition: TYElement.cpp:253
Classe de definition d'un maillage.
Definition: TYMaillage.h:51
Classe de definition d'un point de controle.Le point de controle est un point de calcul avec une haut...
classe de definition d'un projet.
Definition: TYProjet.h:45
virtual std::string toString() const
Definition: TYProjet.cpp:168
const TYTabMaillageGeoNode & getMaillages() const
Get de la collection de maillages.
Definition: TYProjet.h:271
TYTabLPCalcul & getListCalcul()
Set/Get de la liste des Calcul.
Definition: TYProjet.h:366
void setStatusSolver(const bool &bStatus)
Definition: TYProjet.h:574
bool _bStatusSolver
Definition: TYProjet.h:658
QString getDateModif() const
Get de la date de modification.
Definition: TYProjet.h:131
void setDelaunayTolerence(const double &val)
Get/Set du parametre de Delaunay.
Definition: TYProjet.h:486
void setComment(const QString &comment)
Set des commentaires.
Definition: TYProjet.h:159
TYProjet & operator=(const TYProjet &other)
Operateur =.
Definition: TYProjet.cpp:74
TYSpectreForm _spectreForm
Definition: TYProjet.h:661
QString getSpectrePond() const
Get/Set de la pondération du spectre Ã&#160; afficher pour le projet.
Definition: TYProjet.h:613
const double getDMax() const
Definition: TYProjet.h:510
QString _dateCreation
Date de creation.
Definition: TYProjet.h:631
void setSpectrePond(QString &p)
Definition: TYProjet.h:617
QString _dateModif
Date de modification.
Definition: TYProjet.h:633
const LPTYCalcul getCurrentCalcul() const
Set/Get du pointeur du Calcul courant.
Definition: TYProjet.h:435
TYSpectreForm getSpectreForm() const
Get/Set de la forme de spectre Ã&#160; afficher pour le projet.
Definition: TYProjet.h:598
void forceUseDefault()
Force l'utilisation des parametres par defaut.
Definition: TYProjet.cpp:759
QString _comment
Commentaires.
Definition: TYProjet.h:635
bool addMaillage(LPTYMaillageGeoNode pMaillageGeoNode)
Ajout d'un maillage.
Definition: TYProjet.cpp:827
TYTabMaillageGeoNode & getMaillages()
Get de la collection de maillages.
Definition: TYProjet.h:261
TYTabLPPointControl _pointsControl
Liste des points de controles.
Definition: TYProjet.h:644
void setSpectreForm(TYSpectreForm f)
Definition: TYProjet.h:602
bool operator==(const TYProjet &other) const
Operateur ==.
Definition: TYProjet.cpp:99
QString getAuteur() const
Get du nom de l'auteur.
Definition: TYProjet.h:93
TYTabLPCalcul _listCalcul
Liste des Calcul.
Definition: TYProjet.h:641
const double getDefaultDMax() const
Relecture de la distance minimale entre deux points par defaut.
Definition: TYProjet.cpp:784
void remTabElmtFromCalculs(std::vector< LPTYGeometryNode > tabGeoNode)
Supprime un ensemble d'elements des calculs.
Definition: TYProjet.cpp:741
bool addPointControl(LPTYPointControl pPointControl)
Definition: TYProjet.cpp:438
LPTYCalcul _pCurrentCalcul
Un pointeur sur le Calcul courant.
Definition: TYProjet.h:650
bool getStatusSolver()
Get/Set du statut de disponibilite du solveur du calcul courant.
Definition: TYProjet.h:566
virtual DOM_Element toXML(DOM_Element &domElement)
Definition: TYProjet.cpp:173
QString getComment() const
Get des commentaires.
Definition: TYProjet.h:150
void remElmtFromCalculs(TYElement *pElement)
Supprime un element de tous les calculs.
Definition: TYProjet.cpp:733
bool updateAltiMaillage(TYMaillageGeoNode *pMaillageGeoNode, const TYAltimetrie *pAlti)
Met a niveau l'altimetrie d'un maillage.
Definition: TYProjet.cpp:950
LPTYMaillageGeoNode findMaillage(const LPTYMaillage pMaillage)
Retrouve le GeoNode associe a un maillage.
Definition: TYProjet.cpp:917
bool remAllPointControl()
Definition: TYProjet.cpp:497
void setCurrentCalcul(LPTYCalcul pCurCalcul)
Set/Get du pointeur du Calcul courant.
Definition: TYProjet.cpp:571
const double getDelaunayTolerence() const
Definition: TYProjet.h:494
void duplicateNoiseMapState(const TYCalcul *pCalculRef, TYCalcul *pCalculNew)
copie l'etat des points de controle pour un calcul pour un autre calcul
Definition: TYProjet.cpp:722
void setUseDefGeomVal(const bool &bVal)
Get/Set de l'option d'utilisation des valeurs par defaut.
Definition: TYProjet.h:521
void cleanReceptorsStatus(TYCalcul *pCalcul)
clean status of control points and noise maps
Definition: TYProjet.cpp:1144
QString _auteur
Nom de l'auteur.
Definition: TYProjet.h:629
const TYTabLPCalcul & getListCalcul() const
Definition: TYProjet.h:374
void selectActivePoint(const LPTYSiteNode pSite)
Selectionne les points actifs du maillage.
Definition: TYProjet.cpp:1060
bool updateAltiRecepteurs()
Definition: TYProjet.cpp:643
void setAuteur(const QString &auteur)
Set du nom de l'auteur.
Definition: TYProjet.h:102
void verifGeometricParam()
verification des parametres de geometrisation (si necessaire)
Definition: TYProjet.cpp:749
const TYTabLPPointControl & getPointsControl() const
Definition: TYProjet.h:200
TYProjet()
Constructeur. Le constructeur de la classe TYProjet.
Definition: TYProjet.cpp:37
TYTabMaillageGeoNode _maillages
Collections de Maillages.
Definition: TYProjet.h:647
bool remPointControl(LPTYPointControl pPointControl)
Definition: TYProjet.cpp:456
const double getDefaultDelaunayTolerence() const
Relecture de la valeur de tolerence de Delaunay par defaut.
Definition: TYProjet.cpp:766
const bool displaySpectrumInOctaveForm()
Definition: TYProjet.cpp:1157
bool remMaillage(const LPTYMaillageGeoNode pMaillageGeoNode)
Suppression d'un maillage.
Definition: TYProjet.cpp:862
bool remAllMaillage()
Suppression de tous les maillages.
Definition: TYProjet.cpp:909
virtual ~TYProjet()
Destructeur Le destructeur de la classe TYProjet .
Definition: TYProjet.cpp:69
const bool getUseDefGeomVal() const
Definition: TYProjet.h:530
void setDateModif(const QString &date)
Set de la date de modification.
Definition: TYProjet.h:140
QString getDateCreation() const
Get de la date de creation.
Definition: TYProjet.h:112
double _delaunayTolerance
Parametres de geometrisation.
Definition: TYProjet.h:653
LPTYSiteNode getSite()
Get du site.
Definition: TYProjet.h:169
LPTYPointControl getPointControl(int index)
Definition: TYProjet.h:232
void setSite(const LPTYSiteNode pSite)
Set du site.
Definition: TYProjet.cpp:808
void setListCalcul(const TYTabLPCalcul &list)
Definition: TYProjet.h:382
bool updateAltiPointControle(TYPointControl *pPtControl, const TYAltimetrie *pAlti)
Definition: TYProjet.cpp:611
LPTYSiteNode _pSite
Site.
Definition: TYProjet.h:638
void updateCalculsWithMaillage(TYMaillage *pMaillage)
Definition: TYProjet.cpp:819
bool _useDefaultGeomVal
Definition: TYProjet.h:655
void unsetSite()
Supprime la liaison avec le site.
Definition: TYProjet.cpp:566
double _maxDistBetweenPoints
Definition: TYProjet.h:654
void setDMax(const double &val)
Get/set de la distance max entre les points.
Definition: TYProjet.cpp:802
void duplicatePtCalcState(const TYCalcul *pCalculRef, TYCalcul *pCalculNew)
copie l'etat des points de controle pour un calcul pour un autre calcul
Definition: TYProjet.cpp:711
double getDelaunayTolerence()
Definition: TYProjet.h:490
LPTYMaillage getMaillage(int index)
Retourne un maillage a partir de son index.
Definition: TYProjet.h:318
bool addCalcul(LPTYCalcul pCalcul)
Ajout d'un Calcul a la liste des Calcul.
Definition: TYProjet.cpp:505
bool getUseDefGeomVal()
Definition: TYProjet.h:526
LPTYCalcul duplicateCalcul(const LPTYCalcul pCalcul)
Duplique pCalcul.
Definition: TYProjet.cpp:685
virtual void updateGraphic()
Definition: TYProjet.cpp:1162
QString _spectrePond
Definition: TYProjet.h:663
TYTabLPPointControl & getPointsControl()
Definition: TYProjet.h:193
bool operator!=(const TYProjet &other) const
Operateur !=.
Definition: TYProjet.cpp:163
virtual int fromXML(DOM_Element domElement)
Definition: TYProjet.cpp:224
LPTYCalcul getCurrentCalcul()
Set/Get du pointeur du Calcul courant.
Definition: TYProjet.h:426
double getDMax()
Definition: TYProjet.h:506
static bool gSaveValues
Definition: TYProjet.h:624
LPTYPointControl duplicatePointControl(const LPTYPointControl &pPoint)
Duplique pPoint.
Definition: TYProjet.cpp:484
void setDateCreation(const QString &date)
Set de la date de creation.
Definition: TYProjet.h:121
void setPointsControl(const TYTabLPPointControl &pointsControl)
Definition: TYProjet.h:207
bool remCalcul(const LPTYCalcul pCalcul)
Suppression d'un Calcul a la liste des Calcul.
Definition: TYProjet.cpp:515
const bool getStatusSolver() const
Definition: TYProjet.h:570
const LPTYSiteNode getSite() const
Get du site.
Definition: TYProjet.h:179
void remAllCalcul()
Suppression de tous les elements.
Definition: TYProjet.cpp:561
void updateGraphicMaillage()
Mets a jour l'objet graphique des maillage apres calcul.
Definition: TYProjet.cpp:933
TYSpectreForm
Spectrum representation.
Definition: spectre.h:36