Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYProjet.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012> <EDF-R&D> <FRANCE>
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License along
12  * with this program; if not, write to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
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 
227  LPTYPointControl duplicatePointControl(const LPTYPointControl& pPoint);
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 
329  LPTYMaillageGeoNode findMaillage(const LPTYMaillage pMaillage);
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(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;
524  verifGeometricParam();
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 
585 public:
586  // CLM-NT33 : Sauvegarde sans resultats
587  static bool gSaveValues;
588 
589  // Membres
590 protected:
592  QString _auteur;
594  QString _dateCreation;
596  QString _dateModif;
598  QString _comment;
599 
602 
605 
608 
611 
614 
619 
620  // Statut de disponibilite du solveur du calcul courant
622 };
623 
624 #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:432
#define OPROTODECL(classname)
Definition: TYElement.h:65
#define TY_EXTENSION_DECL_ONLY(classname)
Definition: TYElement.h:386
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
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
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:621
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
const double getDMax() const
Definition: TYProjet.h:510
QString _dateCreation
Date de creation.
Definition: TYProjet.h:594
QString _dateModif
Date de modification.
Definition: TYProjet.h:596
const LPTYCalcul getCurrentCalcul() const
Set/Get du pointeur du Calcul courant.
Definition: TYProjet.h:435
QString _comment
Commentaires.
Definition: TYProjet.h:598
TYTabMaillageGeoNode & getMaillages()
Get de la collection de maillages.
Definition: TYProjet.h:261
TYTabLPPointControl _pointsControl
Liste des points de controles.
Definition: TYProjet.h:607
QString getAuteur() const
Get du nom de l'auteur.
Definition: TYProjet.h:93
TYTabLPCalcul _listCalcul
Liste des Calcul.
Definition: TYProjet.h:604
LPTYCalcul _pCurrentCalcul
Un pointeur sur le Calcul courant.
Definition: TYProjet.h:613
bool getStatusSolver()
Get/Set du statut de disponibilite du solveur du calcul courant.
Definition: TYProjet.h:566
QString getComment() const
Get des commentaires.
Definition: TYProjet.h:150
const double getDelaunayTolerence() const
Definition: TYProjet.h:494
void setUseDefGeomVal(const bool &bVal)
Get/Set de l'option d'utilisation des valeurs par defaut.
Definition: TYProjet.h:521
QString _auteur
Nom de l'auteur.
Definition: TYProjet.h:592
const TYTabLPCalcul & getListCalcul() const
Definition: TYProjet.h:374
void setAuteur(const QString &auteur)
Set du nom de l'auteur.
Definition: TYProjet.h:102
const TYTabLPPointControl & getPointsControl() const
Definition: TYProjet.h:200
TYTabMaillageGeoNode _maillages
Collections de Maillages.
Definition: TYProjet.h:610
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:616
LPTYSiteNode getSite()
Get du site.
Definition: TYProjet.h:169
LPTYPointControl getPointControl(int index)
Definition: TYProjet.h:232
void setListCalcul(const TYTabLPCalcul &list)
Definition: TYProjet.h:382
LPTYSiteNode _pSite
Site.
Definition: TYProjet.h:601
bool _useDefaultGeomVal
Definition: TYProjet.h:618
double _maxDistBetweenPoints
Definition: TYProjet.h:617
double getDelaunayTolerence()
Definition: TYProjet.h:490
LPTYMaillage getMaillage(int index)
Retourne un maillage a partir de son index.
Definition: TYProjet.h:318
bool getUseDefGeomVal()
Definition: TYProjet.h:526
TYTabLPPointControl & getPointsControl()
Definition: TYProjet.h:193
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:587
void setDateCreation(const QString &date)
Set de la date de creation.
Definition: TYProjet.h:121
void setPointsControl(const TYTabLPPointControl &pointsControl)
Definition: TYProjet.h:207
const bool getStatusSolver() const
Definition: TYProjet.h:570
const LPTYSiteNode getSite() const
Get du site.
Definition: TYProjet.h:179