Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYUserSourcePonctuelle.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_USER_SOURCEPONCTUELLE__
21 #define __TY_USER_SOURCEPONCTUELLE__
22 
23 #include "TYSourcePonctuelle.h"
24 #include "TYUserSrcRegime.h"
25 
30 {
33 
34  // Methodes
35 public:
44 
49 
53  virtual ~TYUserSourcePonctuelle();
54 
58  bool operator==(const TYUserSourcePonctuelle& other) const;
60  bool operator!=(const TYUserSourcePonctuelle& other) const;
61 
70  virtual bool deepCopy(const TYElement* pOther, bool copyId = true, bool pUseCopyTag = false);
71 
72  virtual std::string toString() const;
73 
74  virtual DOM_Element toXML(DOM_Element& domElement);
75  virtual int fromXML(DOM_Element domElement);
76 
81  {
82  return _pAttenuateur;
83  }
84 
89  {
90  return _pAttenuateur;
91  }
92 
97  {
98  _pAttenuateur = pAtt;
99  }
100 
104  virtual TYSpectre* getSpectre(int regime = -1) const;
105 
110 
114  virtual TYSpectre* getCurrentSpectre() const;
115 
119  virtual int addRegime(TYUserSrcRegime regime);
120 
124  virtual bool remRegime(int regimeNumber);
125 
129  virtual TYUserSrcRegime buildRegime();
130 
134  virtual void updateCurrentRegime();
135 
139  virtual void loadRegime(int regimeNb = -1);
140 
144  void setCurrentRegime(const int& regimeNumber);
145 
150  {
151  return _curRegime;
152  }
153  const int getCurrentRegime() const
154  {
155  return _curRegime;
156  }
157 
161  TYUserSrcRegime& getRegimeNb(const int& nb);
162  const TYUserSrcRegime& getRegimeNb(const int& nb) const;
163 
167  size_t getNbRegimes()
168  {
169  return _tabRegimes.size();
170  }
171  const size_t getNbRegimes() const
172  {
173  return _tabRegimes.size();
174  }
175 
179  QString getRegimeName()
180  {
181  return getRegimeNb(_curRegime).getName();
182  }
183  void setRegimeName(const QString& name);
184 
188  void setIsRayonnant(const bool& rayonnant)
189  {
190  _isRayonnant = rayonnant;
191  }
192 
197  {
198  return _isRayonnant;
199  }
200  const bool getIsRayonnant() const
201  {
202  return _isRayonnant;
203  }
204 
208  bool getUseAtt()
209  {
210  return _useAtt;
211  }
212  const bool getUseAtt() const
213  {
214  return _useAtt;
215  }
216 
220  void setUseAtt(const bool& useAtt)
221  {
222  _useAtt = useAtt;
223  }
224 
226  void exportCSV(std::ofstream& ofs);
227 
228 private:
229  // Membres
230 protected:
232  bool _useAtt;
233 
236 
239 
242 
245 
248 };
249 
257 typedef std::vector<LPTYUserSourcePonctuelleGeoNode> TYTabUserSourcePonctuelleGeoNode;
258 
259 #endif // __TY_USER_SOURCEPONCTUELLE__
QDomElement DOM_Element
Definition: QT2DOM.h:30
#define OPROTODECL(classname)
Definition: TYElement.h:65
#define TY_EXTENSION_DECL_ONLY(classname)
Definition: TYElement.h:386
const char * name
std::vector< LPTYUserSourcePonctuelleGeoNode > TYTabUserSourcePonctuelleGeoNode
Collection de noeuds geometriques de type TYSourcePonctuelle.
SmartPtr< TYUserSourcePonctuelle > LPTYUserSourcePonctuelle
Smart pointeur sur un source ponctuelle utilisateur.
TYGeometryNode TYUserSourcePonctuelleGeoNode
Noeud geometrique de type TYSourcePonctuelle.
SmartPtr< TYUserSourcePonctuelleGeoNode > LPTYUserSourcePonctuelleGeoNode
Smart Pointer sur TYSourcePonctuelleGeoNode.
std::vector< TYUserSrcRegime > TYTabUserSrcRegimes
Tableau de regimes.
virtual QString getName() const
Definition: TYElement.h:684
TYUserSrcRegime & getRegimeNb(const int &nb)
virtual void loadRegime(int regimeNb=-1)
void setUseAtt(const bool &useAtt)
virtual int fromXML(DOM_Element domElement)
virtual int addRegime(TYUserSrcRegime regime)
TYTabUserSrcRegimes _tabRegimes
Tableau de regimes de fonctionnement.
virtual bool remRegime(int regimeNumber)
int _curRegime
Numero du regime de fonctionnement courant.
virtual std::string toString() const
virtual DOM_Element toXML(DOM_Element &domElement)
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
void exportCSV(std::ofstream &ofs)
Export au format csv sur un flux transmis.
TYUserSourcePonctuelle & operator=(const TYUserSourcePonctuelle &other)
Operateur =.
virtual TYSpectre * getSpectre(int regime=-1) const
void setAttenuateur(const LPTYAttenuateur pAtt)
LPTYAttenuateur getAttenuateur()
const int getCurrentRegime() const
int _nextRegime
Numero d'ordre du regime suivant.
virtual TYUserSrcRegime buildRegime()
void setCurrentRegime(const int &regimeNumber)
const LPTYAttenuateur getAttenuateur() const
bool operator==(const TYUserSourcePonctuelle &other) const
Operateur ==.
void setIsRayonnant(const bool &rayonnant)
bool operator!=(const TYUserSourcePonctuelle &other) const
Operateur !=.
bool _isRayonnant
Source rayonnante.
const bool getIsRayonnant() const
void setRegimeName(const QString &name)
const size_t getNbRegimes() const
bool _useAtt
Utilisation d'un attenuateur.
LPTYAttenuateur _pAttenuateur
Attenuateur lie a cette source.
virtual TYSpectre * getCurrentSpectre() const