Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYSourceLineic.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_SOURCELINEIC__
21 #define __TY_SOURCELINEIC__
22 
23 #include "TYSource.h"
24 #include "TYSourcePonctuelle.h"
25 
30 class TYSourceLineic : public TYSource
31 {
35 
36  // Methodes
37 public:
45  TYSourceLineic(const TYSourceLineic& other);
49  virtual ~TYSourceLineic();
50 
54  bool operator==(const TYSourceLineic& other) const;
56  bool operator!=(const TYSourceLineic& other) const;
57 
66  virtual bool deepCopy(const TYElement* pOther, bool copyId = true, bool pUseCopyTag = false);
67 
68  virtual std::string toString() const;
69 
70  virtual DOM_Element toXML(DOM_Element& domElement);
71  virtual int fromXML(DOM_Element domElement);
72 
76  void purge()
77  {
78  remAllSrc();
79  }
80 
84  double getDensiteSrcs() const
85  {
86  return _densiteSrcs;
87  }
91  void setDensiteSrcs(const double& densite)
92  {
93  _densiteSrcs = densite;
94  }
95 
99  bool getSrcsCorr() const
100  {
101  return _srcsCorr;
102  }
106  void setSrcsCorr(bool corr)
107  {
108  _srcsCorr = corr;
109  }
110 
114  size_t getNbSrcs() const
115  {
116  return _listSrcPonct.size();
117  }
118 
127  bool addSrc(LPTYSourcePonctuelle pSrcPonct);
128 
137  bool remSrc(const LPTYSourcePonctuelle pSrcPonct);
138 
148  bool remSrc(QString idSrc);
149 
153  void remAllSrc();
154 
159  {
160  return _listSrcPonct.at(index);
161  }
165  const LPTYSourcePonctuelle getSrc(int index) const
166  {
167  return _listSrcPonct.at(index);
168  }
169 
175  void setSrcs(const TYTabLPSourcePonctuelle& listSrcPonct)
176  {
177  _listSrcPonct = listSrcPonct;
178  }
185  {
186  return _listSrcPonct;
187  }
194  {
195  return _listSrcPonct;
196  }
197 
198  // Membres
199 protected:
201  double _densiteSrcs;
202 
204  bool _srcsCorr;
205 
208 };
209 
210 #endif // __TY_SOURCELINEIC__
QDomElement DOM_Element
Definition: QT2DOM.h:30
std::vector< LPTYSourcePonctuelle > TYTabLPSourcePonctuelle
Collection de pointeurs de TYSourcePonctuelle.
Definition: TYDefines.h:355
#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
double getDensiteSrcs() const
void setSrcs(const TYTabLPSourcePonctuelle &listSrcPonct)
bool operator==(const TYSourceLineic &other) const
Operateur ==.
bool getSrcsCorr() const
bool addSrc(LPTYSourcePonctuelle pSrcPonct)
virtual DOM_Element toXML(DOM_Element &domElement)
bool remSrc(const LPTYSourcePonctuelle pSrcPonct)
LPTYSourcePonctuelle getSrc(int index)
const LPTYSourcePonctuelle getSrc(int index) const
size_t getNbSrcs() const
bool _srcsCorr
Indiquateur de correlation des sources ponctuelles.
virtual int fromXML(DOM_Element domElement)
TYTabLPSourcePonctuelle _listSrcPonct
Liste des sources ponctuelles.
bool operator!=(const TYSourceLineic &other) const
Operateur !=.
double _densiteSrcs
Densite des sources ponctuelles (exprimee en sources/metre).
void setSrcsCorr(bool corr)
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
virtual ~TYSourceLineic()
virtual std::string toString() const
void setDensiteSrcs(const double &densite)
const TYTabLPSourcePonctuelle & getSrcs() const
TYTabLPSourcePonctuelle & getSrcs()
TYSourceLineic & operator=(const TYSourceLineic &other)
Operateur =.