Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYAcousticLine.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 #ifndef __TY_ACOUSTICLINE__
21 #define __TY_ACOUSTICLINE__
22 
27 #include "TYAcousticInterface.h"
28 
33 {
37 
38  // Methodes
39 public:
47  TYAcousticLine(const TYAcousticLine& other);
51  virtual ~TYAcousticLine();
52 
56  bool operator==(const TYAcousticLine& other) const;
58  bool operator!=(const TYAcousticLine& other) const;
59 
73  virtual bool deepCopy(const TYElement* pOther, bool copyId = true, bool pUseCopyTag = false);
74 
75  virtual std::string toString() const;
76 
77  virtual DOM_Element toXML(DOM_Element& domElement);
78  virtual int fromXML(DOM_Element domElement);
79 
83  double getLargeur() const
84  {
85  return _largeur;
86  }
90  void setLargeur(double larg)
91  {
92  _largeur = larg;
94  }
95 
100  {
101  return _pSrcLineic;
102  }
107  {
108  return _pSrcLineic;
109  }
113  void setSrcLineic(const LPTYSourceLineic pSrcLin)
114  {
115  _pSrcLineic = pSrcLin;
116  _pSrcLineic->setParent(this);
117  }
118 
123  {
124  return _tabPoint;
125  }
129  const TYTabPoint& getTabPoint() const
130  {
131  return _tabPoint;
132  }
136  void setTabPoint(const TYTabPoint& tab)
137  {
138  _tabPoint = tab;
139  setIsGeometryModified(true);
140  }
141 
145  virtual void distriSrcs(); // Rajoute pour avoir une interface commune avec les autres objets
146 
150  virtual void remAllSrcs(); // Rajoute pour avoir une interface commune avec les autres objets
151 
155  virtual bool updateAcoustic(const bool& force = false);
156 
160  virtual void computeSpectre();
161 
167  virtual TYTabSourcePonctuelleGeoNode getSrcs() const;
168 
172  virtual bool setSrcsLw();
173 
181  virtual void setRegime(TYSpectre& Spectre, int regime = -1, bool recursif = false);
182 
186  virtual int addRegime(TYRegime regime);
187 
196  virtual bool remRegime(int regime);
197 
201  TYRegime& getRegimeNb(const int& nb)
202  {
203  return _tabRegimes[nb];
204  }
205  const TYRegime& getRegimeNb(const int& nb) const
206  {
207  return _tabRegimes[nb];
208  }
209 
213  size_t getNbRegimes() const
214  {
215  return _tabRegimes.size();
216  }
217 
221  int getCurRegime() const
222  {
223  return _curRegime;
224  }
225 
229  virtual void setCurRegime(int regimeNumber);
230 
234  virtual TYRegime buildRegime();
235 
239  virtual void loadRegime(int regimeNb = -1);
240 
244  virtual void updateCurrentRegime();
245 
249  QString getRegimeName()
250  {
251  return getRegimeNb(_curRegime).getName();
252  }
253  void setRegimeName(const QString& name);
254 
259  {
260  return _isRayonnant;
261  }
262  const bool getIsRayonnant() const
263  {
264  return _isRayonnant;
265  }
266 
271  {
272  return _typeDistribution;
273  }
274 
278  void setTypeDistribution(int typeDistri);
279 
283  void setIsRayonnant(const bool& rayonnant)
284  {
285  _isRayonnant = rayonnant;
286  }
287 
291  bool getUseAtt()
292  {
293  return _useAtt;
294  }
295  const bool getUseAtt() const
296  {
297  return _useAtt;
298  }
302  void setUseAtt(const bool& useAtt)
303  {
304  _useAtt = useAtt;
305  }
306 
311  {
312  return _pAtt;
313  }
314 
318  const LPTYAttenuateur getAtt() const
319  {
320  return _pAtt;
321  }
325  void setAtt(LPTYAttenuateur pAtt);
326 
330  TYSpectre* getSpectre(int regime = -1) const
331  {
332  return _pSpectre;
333  }
334 
339  {
340  return _regimeChangeAble;
341  }
342 
347 
349  void exportCSV(std::ofstream& ofs);
350 
355  {
359  };
360 
361  // Membres
362 protected:
365 
368 
370  bool _useAtt;
371 
374 
377 
380 
383 
385  double _largeur;
386 
389 
392 
395 };
396 
402 typedef std::vector<LPTYAcousticLineGeoNode> TYTabAcousticLineGeoNode;
403 
404 #endif // __TY_ACOUSTICLINE__
QDomElement DOM_Element
Definition: QT2DOM.h:30
TYGeometryNode TYAcousticLineGeoNode
Noeud geometrique de type TYAcousticLine.
std::vector< LPTYAcousticLineGeoNode > TYTabAcousticLineGeoNode
Collection de noeuds geometriques de type TYAcousticLine.
SmartPtr< TYAcousticLineGeoNode > LPTYAcousticLineGeoNode
Smart Pointer sur TYAcousticLineGeoNode.
std::vector< TYPoint > TYTabPoint
Collection de TYPoint.
Definition: TYDefines.h:340
#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< TYRegime > TYTabRegimes
Tableau de regimes.
Definition: TYRegime.h:206
const char * name
std::vector< LPTYSourcePonctuelleGeoNode > TYTabSourcePonctuelleGeoNode
Collection de noeuds geometriques de type TYSourcePonctuelle.
Spectrum class.
Definition: Spectre.h:25
TYTabPoint & getTabPoint()
void setIsRayonnant(const bool &rayonnant)
bool _isRayonnant
Mise en fonctionnement.
void setLargeur(double larg)
bool getIsRegimeChangeAble()
virtual int addRegime(TYRegime regime)
TYRegime & getRegimeNb(const int &nb)
virtual void setCurRegime(int regimeNumber)
const TYRegime & getRegimeNb(const int &nb) const
void setUseAtt(const bool &useAtt)
QString getRegimeName()
virtual std::string toString() const
const bool getUseAtt() const
TYTabRegimes _tabRegimes
Tableau des regimes.
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
bool _useAtt
Utilisation d'un attenuateur.
const LPTYSourceLineic getSrcLineic() const
TYSpectre * getSpectre(int regime=-1) const
virtual void computeSpectre()
virtual int fromXML(DOM_Element domElement)
size_t getNbRegimes() const
LPTYSourceLineic _pSrcLineic
Source Lineique.
virtual bool setSrcsLw()
LPTYAttenuateur getAtt()
int _curRegime
Regime de fonctionnement courant.
bool operator==(const TYAcousticLine &other) const
Operateur ==.
virtual TYTabSourcePonctuelleGeoNode getSrcs() const
virtual void setRegime(TYSpectre &Spectre, int regime=-1, bool recursif=false)
virtual LPTYSpectre getRealPowerSpectrum()
virtual ~TYAcousticLine()
double getLargeur() const
int getCurRegime() const
virtual TYRegime buildRegime()
virtual void updateCurrentRegime()
LPTYSourceLineic getSrcLineic()
int getTypeDistribution() const
void setAtt(LPTYAttenuateur pAtt)
virtual bool updateAcoustic(const bool &force=false)
double _largeur
Largeur.
void setRegimeName(const QString &name)
void exportCSV(std::ofstream &ofs)
Export au format csv sur un flux transmis.
const TYTabPoint & getTabPoint() const
virtual void remAllSrcs()
const LPTYAttenuateur getAtt() const
bool operator!=(const TYAcousticLine &other) const
Operateur !=.
virtual bool remRegime(int regime)
virtual void loadRegime(int regimeNb=-1)
void setTypeDistribution(int typeDistri)
void setTabPoint(const TYTabPoint &tab)
const bool getIsRayonnant() const
LPTYAttenuateur _pAtt
Attenuateur associe a l'element;.
bool _regimeChangeAble
Indique si on peut ajouter un regime a un element (cas des routes)
TYAcousticLine & operator=(const TYAcousticLine &other)
Operateur =.
void setSrcLineic(const LPTYSourceLineic pSrcLin)
int _typeDistribution
Indique le type de distribution a utiliser. pour l'etat courant.
int _nextRegime
Numero d'ordre du regime suivant.
virtual void distriSrcs()
virtual DOM_Element toXML(DOM_Element &domElement)
TYTabPoint _tabPoint
Tableau des points.
virtual QString getName() const
Definition: TYElement.h:684
void setParent(TYElement *pParent)
Definition: TYElement.h:692
virtual void setIsGeometryModified(bool isModified)
Definition: TYElement.cpp:253
LPTYSpectre _pSpectre
Definition: TYSource.h:96