Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYAcousticSurfaceNode.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 
16 #if TY_USE_IHM
18 #endif
19 #include "TYAcousticSurfaceNode.h"
20 
22 
24 {
26 
29 }
30 
32 {
33  *this = other;
34 }
35 
37 
39 {
40  if (this != &other)
41  {
42  TYElement::operator=(other);
47  }
48  return *this;
49 }
50 
52 {
53  if (this != &other)
54  {
55  if (TYElement::operator!=(other))
56  {
57  return false;
58  }
59  if (TYColorInterface::operator!=(other))
60  {
61  return false;
62  }
63  if (TYAcousticInterface::operator!=(other))
64  {
65  return false;
66  }
67  if (!(_tabAcousticSurf == other._tabAcousticSurf))
68  {
69  return false;
70  }
71  if (!(_pBoundingRect == other._pBoundingRect))
72  {
73  return false;
74  }
75  }
76  return true;
77 }
78 
80 {
81  return !operator==(other);
82 }
83 
84 bool TYAcousticSurfaceNode::deepCopy(const TYElement* pOther, bool copyId /*=true*/,
85  bool pUseCopyTag /*=false*/)
86 {
87  if (!TYElement::deepCopy(pOther, copyId))
88  {
89  return false;
90  }
91 
92  purge();
93 
94  TYAcousticSurfaceNode* pOtherAccSurfNode = (TYAcousticSurfaceNode*)pOther;
95 
96  TYColorInterface::deepCopy((TYColorInterface*)pOtherAccSurfNode, copyId);
97 
98  TYAcousticInterface::deepCopy(pOtherAccSurfNode, copyId);
99 
100  for (int i = 0; i < pOtherAccSurfNode->getNbChild(); i++)
101  {
102  TYAcousticSurface* pNewChild = (TYAcousticSurface*)pOtherAccSurfNode->getAcousticSurf(i)->clone();
103  pNewChild->deepCopy(pOtherAccSurfNode->getAcousticSurf(i).getRealPointer(), copyId);
104  pNewChild->setParent(this);
105  addAcousticSurf(pNewChild, pOtherAccSurfNode->_tabAcousticSurf[i]->getORepere3D());
106  }
107 
108  _pBoundingRect->deepCopy(pOtherAccSurfNode->_pBoundingRect, copyId);
109  _pBoundingRect->setParent(this);
110 
111  return true;
112 }
113 
115 {
116  return "TYAcousticSurfaceNode";
117 }
118 
120 {
121  DOM_Element domNewElem = TYElement::toXML(domElement);
122  TYColorInterface::toXML(domNewElem);
123  TYAcousticInterface::toXML(domNewElem);
124 
125  _pBoundingRect->toXML(domNewElem);
126 
127  TYXMLTools::addElementUIntValue(domNewElem, "nbChild", getNbChild());
128 
129  for (int i = 0; i < getNbChild(); i++)
130  {
131  _tabAcousticSurf.at(i)->toXML(domNewElem);
132  }
133 
134  return domNewElem;
135 }
136 
138 {
139  TYElement::fromXML(domElement);
140  TYColorInterface::fromXML(domElement);
141  TYAcousticInterface::fromXML(domElement);
142 
143  // Reset
144  purge();
145 
146  int nbChild = 0, retVal = -1;
147  LPTYAcousticSurfaceGeoNode pAccSurfGeoNode = new TYAcousticSurfaceGeoNode(NULL, this);
148 
149  bool nbChildOk = false;
150  DOM_Element elemCur;
151 
152  QDomNodeList childs = domElement.childNodes();
153  for (unsigned int i = 0; i < childs.length(); i++)
154  {
155  elemCur = childs.item(i).toElement();
157 
158  TYXMLTools::getElementIntValue(elemCur, "nbChild", nbChild, nbChildOk);
159 
160  if (pAccSurfGeoNode->callFromXMLIfEqual(elemCur, &retVal))
161  {
162  if (retVal == 1)
163  {
164  // Ajout de la surface au tableau des surfaces
165  pAccSurfGeoNode->setParent(this);
166  pAccSurfGeoNode->getElement()->setParent(this);
167  _tabAcousticSurf.push_back(pAccSurfGeoNode);
168 
169  // Creation d'une surface vierge
170  pAccSurfGeoNode = new TYAcousticSurfaceGeoNode(NULL, this);
171  }
172  }
173  }
174 
175  return 1;
176 }
177 
179 {
181 
182  if (_pParent)
183  {
184  _pParent->setIsAcousticModified(isModified);
185  }
186 }
187 
188 void TYAcousticSurfaceNode::getChilds(LPTYElementArray& childs, bool recursif /*=true*/)
189 {
190  TYElement::getChilds(childs, recursif);
191 
192  for (int i = 0; i < getNbChild(); i++)
193  {
194  childs.push_back(_tabAcousticSurf[i]);
195  childs.push_back(_tabAcousticSurf[i]->getElement());
196  }
197 
198  if (recursif)
199  {
200  for (int i = 0; i < getNbChild(); i++)
201  {
202  _tabAcousticSurf[i]->getChilds(childs, recursif);
203  }
204  }
205 }
206 
208 {
210 
211  // Pour chaque child
212  for (int i = 0; i < getNbChild(); i++)
213  {
215 
216  if (pSurface->getIsRayonnant())
217  {
218  // Recupere l'ensemble des srcs du child...
219  TYTabSourcePonctuelleGeoNode tabChild = pSurface->getSrcs();
220 
221  // Concatenation des matrices
222  OMatrix matrix = _tabAcousticSurf[i]->getMatrix();
223  for (unsigned int j = 0; j < tabChild.size(); j++)
224  {
225  tabChild[j]->setMatrix(matrix * tabChild[j]->getMatrix());
226  }
227 
228  //...et ajoute au tableau a retourner
229  tab.insert(tab.end(), tabChild.begin(), tabChild.end());
230  }
231  }
232 
233  return tab;
234 }
235 
237 {
238  return TYSourcePonctuelle();
239 }
240 
241 void TYAcousticSurfaceNode::setDensiteSrcsH(double densite, bool recursif /*=true*/)
242 {
243  TYAcousticInterface::setDensiteSrcsH(densite, recursif);
244 
245  if (recursif)
246  {
247  for (int i = 0; i < getNbChild(); i++)
248  {
250 
251  assert(pSurface);
252 
253  // Densite H de srcs ponct
254  pSurface->setDensiteSrcsH(getDensiteSrcsH(), recursif);
255  }
256  }
257 }
258 
259 void TYAcousticSurfaceNode::setDensiteSrcsV(double densite, bool recursif /*=true*/)
260 {
261  TYAcousticInterface::setDensiteSrcsV(densite, recursif);
262 
263  if (recursif)
264  {
265  for (int i = 0; i < getNbChild(); i++)
266  {
268 
269  assert(pSurface);
270 
271  // Densite V de srcs ponct
272  pSurface->setDensiteSrcsV(getDensiteSrcsV(), recursif);
273  }
274  }
275 }
276 
277 void TYAcousticSurfaceNode::setRegime(TYSpectre& Spectre, int regime /*=-1*/, bool recursif /*=false*/)
278 {
279  if (recursif)
280  {
281  for (int i = 0; i < getNbChild(); i++)
282  {
284 
285  pSurface->setRegime(Spectre, regime, recursif);
286  }
287  }
288 
289  TYAcousticInterface::setRegime(Spectre, regime, recursif);
290 }
291 
293 {
294  for (int i = 0; i < getNbChild(); i++)
295  {
297 
298  pSurface->remRegime(regime);
299  }
300 
301  return TYAcousticInterface::remRegime(regime);
302 }
303 
305 {
306  for (int i = 0; i < getNbChild(); i++)
307  {
309 
310  pSurface->loadRegime(regimeNb);
311  }
312 
314 }
315 
317 {
318  for (unsigned int i = 0; i < _tabAcousticSurf.size(); i++)
319  {
321 
322  pSurface->setCurRegime(regime);
323  }
324 
326 
327  setIsAcousticModified(true);
328 }
329 /*
330 int TYAcousticSurfaceNode::addRegime(const TYRegime& regime)
331 {
332  for (int i = 0; i < getNbChild(); i++)
333  {
334  LPTYAcousticSurface pSurface = TYAcousticSurface::safeDownCast(_tabAcousticSurf[i]->getElement());
335 
336  pSurface->addRegime();
337  }
338 
339  return TYAcousticInterface::addRegime(regime);
340 }
341 */
343 {
344  for (int i = 0; i < getNbChild(); i++)
345  {
347 
348  pSurface->addRegime();
349  }
350 
352 }
353 
355 {
356  size_t nbRegimes = _tabRegimes.size();
357  LPTYElementArray childs;
358  getChilds(childs, false);
359 
360  LPTYGeometryNode pNode = NULL;
361  LPTYAcousticSurface pSurf = NULL;
362  for (size_t i = 0; i < childs.size(); i++)
363  {
364  pNode = TYGeometryNode::safeDownCast(childs[i]);
365  if (pNode == NULL)
366  {
367  continue;
368  }
370  if (pSurf && (pSurf->getNbRegimes() > nbRegimes))
371  {
372  pSurf->setNbRegimes(static_cast<int>(nbRegimes));
373  }
374  }
375 }
376 
378 {
379  LPTYAcousticSurface pSurface = NULL;
380  for (int i = 0; i < getNbChild(); i++)
381  {
382  pSurface = TYAcousticSurface::safeDownCast(_tabAcousticSurf[i]->getElement());
383 
384  if (pSurface)
385  {
386  pSurface->propagateAtt(pAtt);
387  }
388  }
389 
391 }
392 
394 {
395  for (int i = 0; i < getNbChild(); i++)
396  {
398 
399  if (pSurface->getIsSub() == false)
400  {
401  pSurface->setUseAtt(state);
402  }
403  }
404 
406 }
407 
409 {
410  for (int i = 0; i < getNbChild(); i++)
411  {
413 
414  assert(pSurface);
415 
416  if (pSurface->getIsRayonnant())
417  {
418  pSurface->distriSrcs();
419  }
420  }
421 }
422 
424 {
425  bool ret = false;
426 
427  for (unsigned int i = 0; i < _tabAcousticSurf.size(); i++)
428  {
430 
431  if (pSurface->getIsRayonnant())
432  {
433  ret = pSurface->setSrcsLw();
434  }
435  }
436 
437  return ret;
438 }
439 
440 bool TYAcousticSurfaceNode::updateAcoustic(const bool& force) // force=false
441 {
442  unsigned int j = 0;
443  bool ret = true;
444 
445  // Si la surface n'est pas rayonnante, inutile de tenter de distribuer
446  // la puissance, mais ce n'est pas une raison pour bloquer le calcul
447  if (!_isRayonnant)
448  {
449  return true;
450  }
451 
452  // 1/ Recuperer la surface totale
453  double surfTotale = activeSurface();
454 
455  TYSpectre LWc = TYSpectre::getEmptyLinSpectre(); // Spectre cumule de l'ensembles des elements
456  TYSpectre LWg = getCurrentSpectre().toGPhy(); // Spectre global du regime courant
457  TYSpectre LWv; // Spectre de puissance de la face courante
458 
460 
461  // On recupere le tableau des sous faces
462  for (j = 0; j < _tabAcousticSurf.size(); j++)
463  {
465 
466  if (pSurf->getIsRayonnant()) // Si elle est rayonnante
467  {
468  LWv = pSurf->setGlobalLW(LWg, surfTotale);
469  LWc = LWc.sum(LWv);
470  }
471  else
472  {
473  TYSpectre aTYSpectre;
474  pSurf->setRegime(aTYSpectre);
475  }
476  }
477 
478  // 3 cas
479  if (ret && (_typeDistribution == TY_PUISSANCE_IMPOSEE))
480  {
481  // Il faut s'assurer que la somme des puissances des volumes egale la puissance de la machine
482  double residu = ABS(10 * log10(LWg.sigma()) - 10 * log10(LWc.sigma()));
483 
484  // Si l'ecart est inferieur a 1 dB on accepte
485  ret = residu < 1 ? true : false;
486  }
487  else if (ret && (_typeDistribution == TY_PUISSANCE_CALCULEE))
488  {
489  TYSpectre temp = LWc.toDB();
490  setRegime(temp); // Pas de probleme le spectre peut etre remplace
491  }
492  else
493  {
494  ret = false; // Probleme, la somme des puissances des faces n'est pas correcte
495  }
496 
497  return ret;
498 }
499 
501 {
502  return _pBoundingRect->surface();
503 }
504 
506 {
507  return _pBoundingRect->normal();
508 }
509 
511 {
512  return _pBoundingRect->plan();
513 }
514 
516 {
517  return _pBoundingRect->getContour(n);
518 }
519 
521 {
522  return _pBoundingRect->getOContour(n);
523 }
524 
526 {
527  return _pBoundingRect->intersects(pSurf, seg);
528 }
529 
531 {
532  return _pBoundingRect->intersects(seg, pt);
533 }
534 
536 {
537  return _pBoundingRect->intersects(pt);
538 }
539 
541 {
542  _tabAcousticSurf.clear();
543  setIsGeometryModified(true);
544 }
545 
547 {
548 
549  assert(pAccSurfGeoNode);
550 
551  LPTYAcousticSurface pSurface = TYAcousticSurface::safeDownCast(pAccSurfGeoNode->getElement());
552 
553  assert(pSurface);
554 
555  // On lui passe la meme couleur
556  // pSurface->setColor(_color);
557 
558  int i = 0;
559 
560  // On construit autant de regime pour cette nouvelle surface que (this) en a
561  // NB elle a au moins un regime par construction c'est pourquoi on par de 1
562  for (i = 1; i < getNbRegimes(); i++)
563  {
564  pSurface->addRegime();
565  }
566 
567  // On affecte les memes noms aux differents regimes
568  bool status = true;
569  for (i = 0; i < getNbRegimes(); i++)
570  {
571  QString nomReg = getRegimeNb(i, status).getRegimeName();
572  pSurface->setCurRegime(i);
573  pSurface->setRegimeName(nomReg);
574 
575  if (!pSurface->getIsSub())
576  {
577  pSurface->getRegimeNb(i, status)._isRayonnant =
578  getRegimeNb(i, status)._isRayonnant; // Etat de l'element
579  pSurface->getRegimeNb(i, status)._useAtt =
580  getRegimeNb(i, status)._useAtt; // Utilisation d'un attenuateur
581  pSurface->getRegimeNb(i, status)._typeDistribution =
582  TY_PUISSANCE_CALCULEE; // Puissance imposee ou calculee;
583  pSurface->getRegimeNb(i, status)._pAtt =
584  getRegimeNb(i, status)._pAtt; // Attenuateur eventuellement associe au regime
585  }
586  }
587 
588  // On met la surface au meme regime que son parent (CAD this)
589  pSurface->setCurRegime(getCurRegime());
590 
591  // Synchronise le numero suivant
592  pSurface->setNextRegimeNb(getNextRegimeNb());
593 
594  pAccSurfGeoNode->setParent(this);
595  pSurface->setParent(this);
596 
597  // Mise a jour des densite de sources pour la nouvelle surface
598  pSurface->setDensiteSrcsH(_densiteSrcsH);
599  pSurface->setDensiteSrcsV(_densiteSrcsV);
600 
601  // Les rejetons rayonnent comme les parents
602  // Sauf pour les faces marquees "sub"
603  if (pSurface->getIsSub() == false)
604  {
605  pSurface->setIsRayonnant(_isRayonnant, true);
606  }
607 
608  _tabAcousticSurf.push_back(pAccSurfGeoNode);
609 
610  setIsGeometryModified(true);
611 
612  return true;
613 }
615 {
616  _nextRegime = next;
617 
618  for (unsigned int i = 0; i < _tabAcousticSurf.size(); i++)
619  {
621 
622  pSurf->setNextRegimeNb(next);
623  }
624 }
625 
627 {
629 
630  for (unsigned int i = 0; i < _tabAcousticSurf.size(); i++)
631  {
633 
634  pSurf->setRegimeName(name);
635  }
636 }
637 
639 {
640  TYAcousticSurfaceGeoNode* pSurfGeoNode = new TYAcousticSurfaceGeoNode(repere, (LPTYElement)pAccSurf);
641  pSurfGeoNode->setParent(pAccSurf->getParent());
642  return addAcousticSurf(pSurfGeoNode);
643 }
644 
646 {
648 }
649 
651 {
652  assert(pAccSurf);
653  bool ret = false;
654  TYTabAcousticSurfaceGeoNode::iterator ite;
655 
656  for (ite = _tabAcousticSurf.begin(); ite != _tabAcousticSurf.end(); ite++)
657  {
658  if (TYAcousticSurface::safeDownCast((*ite)->getElement()) == pAccSurf)
659  {
660  _tabAcousticSurf.erase(ite);
661  ret = true;
662  break;
663  }
664  }
665 
666  setIsGeometryModified(true);
667 
668  return ret;
669 }
670 
672 {
673  assert(pAccSurfGeoNode);
674  bool ret = false;
675  TYTabAcousticSurfaceGeoNode::iterator ite;
676 
677  for (ite = _tabAcousticSurf.begin(); ite != _tabAcousticSurf.end(); ite++)
678  {
679  if ((*ite) == pAccSurfGeoNode)
680  {
681  _tabAcousticSurf.erase(ite);
682  ret = true;
683  break;
684  }
685  }
686 
687  setIsGeometryModified(true);
688 
689  return ret;
690 }
691 
693 {
694  bool ret = false;
695  TYTabAcousticSurfaceGeoNode::iterator ite;
696 
697  for (ite = _tabAcousticSurf.begin(); ite != _tabAcousticSurf.end(); ite++)
698  {
699  if (TYAcousticSurface::safeDownCast((*ite)->getElement())->getID().toString() == idAccSurf)
700  {
701  _tabAcousticSurf.erase(ite);
702  ret = true;
703  break;
704  }
705  }
706 
707  setIsGeometryModified(true);
708 
709  return ret;
710 }
711 
713 {
714  if ((index >= 0) && (index < (int)_tabAcousticSurf.size()))
715  {
716  return TYAcousticSurface::safeDownCast(_tabAcousticSurf.at(index)->getElement());
717  }
718  else
719  {
720  return NULL;
721  }
722 }
723 
725 {
726  assert(pAccSurf);
727  TYTabAcousticSurfaceGeoNode::iterator ite;
728 
729  for (ite = _tabAcousticSurf.begin(); ite != _tabAcousticSurf.end(); ite++)
730  {
731  if (TYAcousticSurface::safeDownCast((*ite)->getElement()) == pAccSurf)
732  {
733  return (*ite);
734  }
735  }
736 
737  return NULL;
738 }
739 
740 TYSpectre TYAcousticSurfaceNode::setGlobalLW(const TYSpectre& spectre, const double& surfGlobale,
741  const int& regime /*=-1*/)
742 {
743  TYSpectre LWv;
744 
745  // 2 cas
747  {
748  LWv =
749  spectre.toGPhy().mult(surface() / surfGlobale).toDB(); // Spectre pondere de la surface de la face
750  setRegime(LWv, regime, false);
751  }
752 
753  return getCurrentSpectre().toGPhy();
754 }
755 
756 void TYAcousticSurfaceNode::setIsRayonnant(bool rayonnant, bool recursif)
757 {
759 
760  // Les faces de construction (!= cheminee/ventilation/fenetre) sont automatiquement rayonnantes
761  for (unsigned int i = 0; i < _tabAcousticSurf.size(); i++)
762  {
764  assert(pSurf);
765  if (pSurf->getIsSub() == false) // Si ce n'est pas une cheminee/ventil/fenetre
766  {
767  pSurf->setIsRayonnant(rayonnant, recursif);
768  }
769  }
770 
771  // Si une face rayonne son parent rayonne mais si elle ne rayonne plus ca ne veut pas dire que son parent
772  // ne rayonne plus
773  if (rayonnant)
774  {
776  assert(pVol);
777  pVol->setIsRayonnant(rayonnant, recursif);
778  }
779 }
780 
782 {
783  double surface = 0.0;
784 
785  for (unsigned int i = 0; i < _tabAcousticSurf.size(); i++)
786  {
788 
789  if (pSurf->getIsRayonnant() && (pSurf->getDensiteSrcs() != 0.0))
790  {
791  surface += pSurf->surface();
792  }
793  }
794 
795  return surface;
796 }
797 
799 {
800  double surface = 0.0;
801 
802  for (unsigned int j = 0; j < _tabAcousticSurf.size(); j++)
803  {
805 
806  if (pSurf->getIsSub() == false) // Si ce n'est pas une cheminee ou une bouche de ventilation
807  {
808  if (pSurf->getIsRayonnant() && (pSurf->getDensiteSrcs() != 0.0))
809  {
810  surface += pSurf->surface();
811  }
812  }
813  }
814 
815  return surface;
816 }
817 
819 {
820  for (unsigned int j = 0; j < _tabAcousticSurf.size(); j++)
821  {
823 
824  if (pSurf->getIsSub() == false) // Si ce n'est pas une cheminee ou une bouche de ventilation
825  {
826  pSurf->remAllSrcs();
827  }
828  }
829 }
830 
832 void TYAcousticSurfaceNode::exportCSV(std::ofstream& ofs)
833 {
834  // Export du nom de l'objet
835  ofs << getName().toLatin1().data() << '\n';
836 
837  // Export du type de l'objet
838  ofs << toString() << '\n';
839  // Export des donnees acoustiques
841 
842  for (unsigned int j = 0; j < _tabAcousticSurf.size(); j++)
843  {
845 
846  if (pSurf->getIsSub()) // Si c'est une cheminee ou une bouche de ventilation
847  {
848  pSurf->exportCSV(ofs);
849  }
850  }
851 
852  ofs << '\n';
853 }
double ABS(double a)
Return the absolute value.
Definition: 3d.h:67
QDomElement DOM_Element
Definition: QT2DOM.h:30
outil IHM pour un ensemble de surfaces acoustiques (fichier header)
TY_EXTENSION_INST(TYAcousticSurfaceNode)
TYGeometryNode TYAcousticSurfaceGeoNode
Noeud geometrique de type TYAcousticSurface.
std::vector< TYPoint > TYTabPoint
Collection de TYPoint.
Definition: TYDefines.h:340
std::deque< OPoint3D > TYTabPoint3D
Collection de OPoint3D.
Definition: TYDefines.h:403
std::vector< LPTYElement > LPTYElementArray
Definition: TYElement.h:344
const char * name
std::vector< LPTYSourcePonctuelleGeoNode > TYTabSourcePonctuelleGeoNode
Collection de noeuds geometriques de type TYSourcePonctuelle.
The 4x4 matrix class.
Definition: 3d.h:625
Plan defined by its equation : ax+by+cz+d=0.
Definition: plan.h:31
The 3D point class.
Definition: 3d.h:487
virtual OPrototype * clone() const =0
virtual const char * getClassName() const
Definition: TYElement.h:248
static OPrototype * safeDownCast(OPrototype *pObject)
Definition: TYElement.cpp:71
Class to define a segment.
Definition: 3d.h:1141
OSpectreAbstract & sum(const OSpectreAbstract &spectre) const
Arithmetic sum of two spectrums in one-third Octave.
Definition: spectre.cpp:224
OSpectreAbstract & toGPhy() const
Converts to physical quantity.
Definition: spectre.cpp:641
void setType(TYSpectreType type)
Set the spectrum type.
Definition: spectre.h:153
double sigma()
Sum the values of the spectrum.
Definition: spectre.cpp:558
OSpectreAbstract & toDB() const
Converts to dB.
Definition: spectre.cpp:595
OSpectreAbstract & mult(const OSpectreAbstract &spectre) const
Multiplication of two spectrums.
Definition: spectre.cpp:248
The 3D vector class.
Definition: 3d.h:298
T * getRealPointer()
Definition: smartptr.h:291
Spectrum class.
Definition: Spectre.h:25
double _densiteSrcsV
Densite verticale de sources.
double getDensiteSrcsH() const
virtual void setDensiteSrcsH(double densite, bool recursif=true)
virtual void setNextRegimeNb(const int &next)
TYRegime & getRegimeNb(const int &nb, bool &status)
size_t getNbRegimes() const
double getDensiteSrcsV() const
int _typeDistribution
Indique le type de distribution a utiliser. pour l'etat courant.
virtual void loadRegime(int regimeNb=-1)
TYSpectre & getCurrentSpectre()
virtual int addRegime(const TYRegime &regime)
virtual void setUseAtt(bool state)
TYTabRegimes _tabRegimes
Tableau des regimes de fonctionnement.
virtual void setDensiteSrcsV(double densite, bool recursif=true)
DOM_Element toXML(DOM_Element &domElement)
virtual void exportCSV(std::ofstream &ofs)
Export au format csv sur un flux transmis.
TYAcousticInterface & operator=(const TYAcousticInterface &other)
void setNbRegimes(unsigned int nb)
virtual void setRegime(TYSpectre &Spectre, int regime=-1, bool recursif=false)
virtual void setIsRayonnant(bool rayonnant=true, bool recursif=true)
virtual void setCurRegime(int regimeNumber)
int _nextRegime
Numero d'ordre du regime suivant.
int fromXML(DOM_Element domElement)
virtual int getNextRegimeNb()
void deepCopy(const TYAcousticInterface *pOther, bool copyId=true, bool pUseCopyTag=false)
virtual void propagateAtt(LPTYAttenuateur pAtt)
double _densiteSrcsH
Densite horizontale de sources.
virtual bool remRegime(int regime)
virtual void setRegimeName(const QString &name)
bool _isRayonnant
Etat courant de l'element (rayonnant ou non rayonnant)
virtual void setDensiteSrcsV(double densite, bool recursif=true)
virtual void setDensiteSrcsH(double densite, bool recursif=true)
virtual void exportCSV(std::ofstream &ofs)
Export au format csv sur un flux transmis.
TYSpectre setGlobalLW(const TYSpectre &spectre, const double &surfGlobale, const int &regime=-1)
virtual void setIsAcousticModified(bool isModified)
virtual void setNextRegimeNb(const int &next)
virtual double activeSurface() const
virtual int fromXML(DOM_Element domElement)
virtual void setCurRegime(int regime)
virtual bool remAcousticSurf(const LPTYAcousticSurfaceGeoNode pAccSurfGeoNode)
virtual void setIsRayonnant(bool rayonnant=true, bool recursif=true)
virtual OVector3D normal() const
virtual void propagateAtt(LPTYAttenuateur pAtt)
LPTYRectangle _pBoundingRect
Rectangle englobant.
TYAcousticSurfaceNode & operator=(const TYAcousticSurfaceNode &other)
Operateur =.
virtual void setRegimeName(const QString &name)
virtual OPlan plan() const
virtual TYTabPoint getContour(int n=-1) const
virtual int intersects(const TYSurfaceInterface *pSurf, OSegment3D &seg) const
virtual void loadRegime(int regimeNb=-1)
bool operator!=(const TYAcousticSurfaceNode &other) const
Operateur !=.
TYTabAcousticSurfaceGeoNode _tabAcousticSurf
Tableau des AcousticSurfaces.
virtual void getChilds(LPTYElementArray &childs, bool recursif=true)
virtual double surface() const
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
virtual bool remRegime(int regime)
bool operator==(const TYAcousticSurfaceNode &other) const
Operateur ==.
LPTYAcousticSurfaceGeoNode findAcousticSurf(const LPTYAcousticSurface pAccSurf)
virtual std::string toString() const
virtual bool updateAcoustic(const bool &force=false)
virtual void setRegime(TYSpectre &Spectre, int regime=-1, bool recursif=false)
virtual TYTabPoint3D getOContour(int n=-1) const
virtual DOM_Element toXML(DOM_Element &domElement)
LPTYAcousticSurface getAcousticSurf(int index)
bool addAcousticSurf(LPTYAcousticSurfaceGeoNode pAccSurfGeoNode)
virtual void setUseAtt(bool state)
virtual TYSourcePonctuelle srcPonctEquiv() const
virtual TYTabSourcePonctuelleGeoNode getSrcs() const
virtual void setDensiteSrcsV(double densite, bool recursif=true)
virtual void remAllSrcs()
virtual void setCurRegime(int regime)
virtual double surface() const
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
virtual void propagateAtt(LPTYAttenuateur pAtt)
virtual TYTabSourcePonctuelleGeoNode getSrcs() const
virtual void distriSrcs()
virtual void exportCSV(std::ofstream &ofs)
Export au format csv sur un flux transmis.
TYSpectre setGlobalLW(const TYSpectre &spectre, const double &surfGlobale, const int &regime=-1)
virtual void setDensiteSrcsH(double densite, bool recursif=true)
virtual bool setSrcsLw()
virtual void setIsRayonnant(bool rayonnant=true, bool recursif=true)
Get/set de l'etat rayonnant ou pas.
virtual void setIsRayonnant(bool rayonnant=true, bool recursif=true)
int fromXML(DOM_Element domElement)
TYColorInterface & operator=(const TYColorInterface &other)
void deepCopy(const TYColorInterface *pOther, bool copyId=true, bool pUseCopyTag=false)
DOM_Element toXML(DOM_Element &domElement)
TYElement * getParent() const
Definition: TYElement.h:697
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
Definition: TYElement.cpp:305
virtual DOM_Element toXML(DOM_Element &domElement)
Definition: TYElement.cpp:366
QString _name
Nom courant de l'element.
Definition: TYElement.h:956
TYElement & operator=(const TYElement &other)
Definition: TYElement.cpp:263
bool callFromXMLIfEqual(DOM_Element &domElement, int *pRetVal=NULL)
Definition: TYElement.cpp:545
virtual QString getName() const
Definition: TYElement.h:682
TYElement * _pParent
Reference sur l'element parent.
Definition: TYElement.h:959
virtual void getChilds(LPTYElementArray &childs, bool recursif=true)
Definition: TYElement.h:530
void setParent(TYElement *pParent)
Definition: TYElement.h:690
virtual int fromXML(DOM_Element domElement)
Definition: TYElement.cpp:379
virtual void setIsAcousticModified(bool isModified)
Definition: TYElement.cpp:248
virtual void setIsGeometryModified(bool isModified)
Definition: TYElement.cpp:253
TYElement * getElement() const
QString generateName(const char *classname)
Retourne le nom de la classe associe a un nombre.
static TYNameManager * get()
Retourne l'instance singleton.
virtual DOM_Element toXML(DOM_Element &domElement)
virtual int intersects(const TYSurfaceInterface *pSurf, OSegment3D &seg) const
virtual OPlan plan() const
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
virtual TYTabPoint getContour(int n=-1) const
virtual OVector3D normal() const
virtual TYTabPoint3D getOContour(int n=-1) const
virtual double surface() const
bool _useAtt
Definition: TYRegime.h:197
bool _isRayonnant
Definition: TYRegime.h:196
QString getRegimeName()
Definition: TYRegime.h:86
int _typeDistribution
Definition: TYRegime.h:198
LPTYAttenuateur _pAtt
Definition: TYRegime.h:200
static TYSpectre getEmptyLinSpectre(const double &valInit=1.0E-20)
Cree un spectre en lin.
Definition: TYSpectre.cpp:451
static bool getElementIntValue(DOM_Element parentElem, DOMString nodeName, int &nodeValue)
Definition: TYXMLTools.cpp:129
static void addElementUIntValue(DOM_Element &parentElem, DOMString nodeName, unsigned int nodeValue)
Definition: TYXMLTools.cpp:42
@ SPECTRE_TYPE_LW
Definition: spectre.h:30