Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYSourceCheminee.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012-2024> <EDF-DTG> <FRANCE>
3  * This file is part of Code_TYMPAN (R).
4  * Code_TYMPAN (R) is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * Code_TYMPAN (R) is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  * You should have received a copy of the GNU General Public License along
13  * with Code_TYMPAN (R). If not, see <https://www.gnu.org/licenses/>.
14  */
15 
17 
18 #include "Tympan/core/logging.h"
19 
20 #include "TYSourceCheminee.h"
21 
23 {
25 
27 
29 }
30 
32 {
33  *this = other;
34 }
35 
37 
39 {
40  if (this != &other)
41  {
44  }
45  return *this;
46 }
47 
49 {
50  if (this != &other)
51  {
52  if (TYSourcePonctuelle::operator!=(other))
53  {
54  return false;
55  }
57  {
58  return false;
59  }
60  }
61  return true;
62 }
63 
65 {
66  return !operator==(other);
67 }
68 
69 bool TYSourceCheminee::deepCopy(const TYElement* pOther, bool copyId /*=true*/, bool pUseCopyTag /*=false*/)
70 {
71  if (!TYSource::deepCopy(pOther, copyId))
72  {
73  return false;
74  }
75 
76  TYSourceCheminee* pOtherSrc = (TYSourceCheminee*)pOther;
77 
78  if (_pAcousticRectangle && pOtherSrc->_pAcousticRectangle)
79  {
81  }
82  else
83  {
84  _pAcousticRectangle = NULL;
85  }
86 
87  return true;
88 }
89 
90 std::string TYSourceCheminee::toString() const
91 {
92  return "TYSourceCheminee";
93 }
94 
96 {
97  DOM_Element domNewElem = TYSourcePonctuelle::toXML(domElement);
98 
100  {
101  // Mise en commentaire DT20061228 - car cette ligne devrait etre inutile
102  // TYXMLTools::addElementStringValue(domNewElem, "accRectId",
103  // _pAcousticRectangle->getID().toString().c_str());
104  }
105 
106  return domNewElem;
107 }
108 
110 {
111  TYSourcePonctuelle::fromXML(domElement);
112 
113  _pAcousticRectangle = NULL;
114 
115  QString id;
116  DOM_Element elemCur;
117 
118  QDomNodeList childs = domElement.childNodes();
119 
120  for (unsigned int i = 0; i < childs.length(); i++)
121  {
122  elemCur = childs.item(i).toElement();
123 
124  if (TYXMLTools::getElementStringValue(elemCur, "accRectId", id))
125  {
127  }
128  }
129 
130  return 1;
131 }
132 
134 {
135  _pAcousticRectangle = pAcousticRectangle;
137  setIsAcousticModified(true);
138 }
All base classes related to 3D manipulation.
QDomElement DOM_Element
Definition: QT2DOM.h:30
int id
virtual const char * getClassName() const
Definition: TYElement.h:248
static OPrototype * safeDownCast(OPrototype *pObject)
Definition: TYElement.cpp:71
QString _name
Nom courant de l'element.
Definition: TYElement.h:956
void setParent(TYElement *pParent)
Definition: TYElement.h:690
virtual void setIsAcousticModified(bool isModified)
Definition: TYElement.cpp:248
static TYElement * getInstance(TYUUID uuid)
Definition: TYElement.cpp:158
QString generateName(const char *classname)
Retourne le nom de la classe associe a un nombre.
static TYNameManager * get()
Retourne l'instance singleton.
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
LPTYRectangle _pAcousticRectangle
Le rectangle acoustique associe a cette source.
bool operator!=(const TYSourceCheminee &other) const
Operateur !=.
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
TYSourceCheminee & operator=(const TYSourceCheminee &other)
Operateur =.
bool operator==(const TYSourceCheminee &other) const
Operateur ==.
virtual ~TYSourceCheminee()
void setAcousticRectangle(LPTYRectangle pAcousticRectangle)
virtual std::string toString() const
virtual int fromXML(DOM_Element domElement)
virtual DOM_Element toXML(DOM_Element &domElement)
int _type
Type de cette source.
virtual int fromXML(DOM_Element domElement)
virtual DOM_Element toXML(DOM_Element &domElement)
TYSourcePonctuelle & operator=(const TYSourcePonctuelle &other)
Operateur =.
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
Definition: TYSource.cpp:71
static bool getElementStringValue(DOM_Element parentElem, DOMString nodeName, QString &nodeValue)
Definition: TYXMLTools.cpp:93