Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYRegime.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_REGIME__
21 #define __TY_REGIME__
22 
24 #include "TYSpectre.h"
25 #include "TYAttenuateur.h"
26 
27 //*/
28 
33 class TYRegime : public TYElement
34 {
37 
38  // Methodes
39 public:
43  TYRegime();
47  TYRegime(const TYRegime& other);
51  virtual ~TYRegime();
52 
54  TYRegime& operator=(const TYRegime& other);
56  bool operator==(const TYRegime& other) const;
58  bool operator!=(const TYRegime& other) const;
59 
68  virtual bool deepCopy(const TYElement* pOther, bool copyId = true, bool pUseCopyTag = false);
69 
70  virtual std::string toString() const;
71 
72  virtual DOM_Element toXML(DOM_Element& domElement);
73  virtual int fromXML(DOM_Element domElement);
74 
78  void setRegimeName(const QString& nom)
79  {
80  setName(nom);
81  }
82 
86  QString getRegimeName()
87  {
88  return getName();
89  }
90  const QString getRegimeName() const
91  {
92  return getName();
93  }
94 
98  void setIsRayonnant(const bool& rayonnant)
99  {
100  _isRayonnant = rayonnant;
101  }
102 
107  {
108  return _isRayonnant;
109  }
110  const bool getIsRayonnant() const
111  {
112  return _isRayonnant;
113  }
114 
118  bool getUseAtt()
119  {
120  return _useAtt;
121  }
122  const bool getUseAtt() const
123  {
124  return _useAtt;
125  }
126 
130  void setUseAtt(const bool& useAtt)
131  {
132  _useAtt = useAtt;
133  }
134 
139  {
140  return _pAtt;
141  }
142 
146  const LPTYAttenuateur getAtt() const
147  {
148  return _pAtt;
149  }
150 
155  {
156  _pAtt = pAtt;
157  }
158 
163  {
164  return _spectre;
165  }
166 
170  const TYSpectre getSpectre() const
171  {
172  return _spectre;
173  }
174 
178  void setSpectre(const TYSpectre& spectre)
179  {
180  _spectre = spectre;
181  }
182 
187  {
191  };
192 
193  // Membres
194 public:
195  // string _nom; // Nom du regime
196  bool _isRayonnant; // Etat de l'element
197  bool _useAtt; // Utilisation d'un attenuateur
198  int _typeDistribution; // Puissance imposee ou calculee;
199  TYSpectre _spectre; // Spectre associe au regime
200  LPTYAttenuateur _pAtt; // Attenuateur eventuellement associe au regime
201 
202 protected:
203 };
204 
206 typedef std::vector<TYRegime> TYTabRegimes;
207 
208 #endif // __TY_REGIME__
QDomElement DOM_Element
Definition: QT2DOM.h:30
#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
void setName(QString name)
Definition: TYElement.h:671
virtual QString getName() const
Definition: TYElement.h:684
void setAtt(LPTYAttenuateur pAtt)
Definition: TYRegime.h:154
bool _useAtt
Definition: TYRegime.h:197
bool _isRayonnant
Definition: TYRegime.h:196
const TYSpectre getSpectre() const
Definition: TYRegime.h:170
TYRegime()
Definition: TYRegime.cpp:28
const LPTYAttenuateur getAtt() const
Definition: TYRegime.h:146
TYSpectre getSpectre()
Definition: TYRegime.h:162
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
Definition: TYRegime.cpp:99
TYSpectre _spectre
Definition: TYRegime.h:199
const bool getUseAtt() const
Definition: TYRegime.h:122
virtual ~TYRegime()
Definition: TYRegime.cpp:41
virtual DOM_Element toXML(DOM_Element &domElement)
Definition: TYRegime.cpp:127
bool getIsRayonnant()
Definition: TYRegime.h:106
TYRegime & operator=(const TYRegime &other)
Operateur =.
Definition: TYRegime.cpp:46
void setSpectre(const TYSpectre &spectre)
Definition: TYRegime.h:178
LPTYAttenuateur getAtt()
Definition: TYRegime.h:138
bool getUseAtt()
Definition: TYRegime.h:118
virtual int fromXML(DOM_Element domElement)
Definition: TYRegime.cpp:148
QString getRegimeName()
Definition: TYRegime.h:86
int _typeDistribution
Definition: TYRegime.h:198
const bool getIsRayonnant() const
Definition: TYRegime.h:110
TypeDistribution
Definition: TYRegime.h:187
@ TY_PUISSANCE_CALCULEE
Definition: TYRegime.h:188
@ TY_PUISSANCE_IMPOSEE
Definition: TYRegime.h:190
const QString getRegimeName() const
Definition: TYRegime.h:90
void setUseAtt(const bool &useAtt)
Definition: TYRegime.h:130
void setIsRayonnant(const bool &rayonnant)
Definition: TYRegime.h:98
bool operator!=(const TYRegime &other) const
Operateur !=.
Definition: TYRegime.cpp:94
void setRegimeName(const QString &nom)
Definition: TYRegime.h:78
bool operator==(const TYRegime &other) const
Operateur ==.
Definition: TYRegime.cpp:66
LPTYAttenuateur _pAtt
Definition: TYRegime.h:200
virtual std::string toString() const
Definition: TYRegime.cpp:122