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"
22 
24 
26 {
28 
31 }
32 
34 {
35  *this = other;
36 }
37 
39 
41 {
42  if (this != &other)
43  {
44  TYElement::operator=(other);
49  }
50  return *this;
51 }
52 
54 {
55  if (this != &other)
56  {
57  if (TYElement::operator!=(other))
58  {
59  return false;
60  }
61  if (TYColorInterface::operator!=(other))
62  {
63  return false;
64  }
65  if (TYAcousticInterface::operator!=(other))
66  {
67  return false;
68  }
69  if (!(_tabAcousticSurf == other._tabAcousticSurf))
70  {
71  return false;
72  }
73  if (!(_pBoundingRect == other._pBoundingRect))
74  {
75  return false;
76  }
77  }
78  return true;
79 }
80 
82 {
83  return !operator==(other);
84 }
85 
86 bool TYAcousticSurfaceNode::deepCopy(const TYElement* pOther, bool copyId /*=true*/,
87  bool pUseCopyTag /*=false*/)
88 {
89  if (!TYElement::deepCopy(pOther, copyId))
90  {
91  return false;
92  }
93 
94  purge();
95 
96  TYAcousticSurfaceNode* pOtherAccSurfNode = (TYAcousticSurfaceNode*)pOther;
97 
98  TYColorInterface::deepCopy((TYColorInterface*)pOtherAccSurfNode, copyId);
99 
100  TYAcousticInterface::deepCopy(pOtherAccSurfNode, copyId);
101 
102  for (int i = 0; i < pOtherAccSurfNode->getNbChild(); i++)
103  {
104  TYAcousticSurface* pNewChild = (TYAcousticSurface*)pOtherAccSurfNode->getAcousticSurf(i)->clone();
105  pNewChild->deepCopy(pOtherAccSurfNode->getAcousticSurf(i).getRealPointer(), copyId);
106  pNewChild->setParent(this);
107  addAcousticSurf(pNewChild, pOtherAccSurfNode->_tabAcousticSurf[i]->getORepere3D());
108  }
109 
110  _pBoundingRect->deepCopy(pOtherAccSurfNode->_pBoundingRect, copyId);
111  _pBoundingRect->setParent(this);
112 
113  return true;
114 }
115 
117 {
118  return "TYAcousticSurfaceNode";
119 }
120 
122 {
123  DOM_Element domNewElem = TYElement::toXML(domElement);
124  TYColorInterface::toXML(domNewElem);
125  TYAcousticInterface::toXML(domNewElem);
126 
127  _pBoundingRect->toXML(domNewElem);
128 
129  TYXMLTools::addElementUIntValue(domNewElem, "nbChild", getNbChild());
130 
131  for (int i = 0; i < getNbChild(); i++)
132  {
133  _tabAcousticSurf.at(i)->toXML(domNewElem);
134  }
135 
136  return domNewElem;
137 }
138 
140 {
141  TYElement::fromXML(domElement);
142  TYColorInterface::fromXML(domElement);
143  TYAcousticInterface::fromXML(domElement);
144 
145  // Reset
146  purge();
147 
148  int nbChild = 0, retVal = -1;
149  LPTYAcousticSurfaceGeoNode pAccSurfGeoNode = new TYAcousticSurfaceGeoNode(NULL, this);
150 
151  bool nbChildOk = false;
152  DOM_Element elemCur;
153 
154  QDomNodeList childs = domElement.childNodes();
155  for (unsigned int i = 0; i < childs.length(); i++)
156  {
157  elemCur = childs.item(i).toElement();
159 
160  TYXMLTools::getElementIntValue(elemCur, "nbChild", nbChild, nbChildOk);
161 
162  if (pAccSurfGeoNode->callFromXMLIfEqual(elemCur, &retVal))
163  {
164  if (retVal == 1)
165  {
166  // Ajout de la surface au tableau des surfaces
167  pAccSurfGeoNode->setParent(this);
168  pAccSurfGeoNode->getElement()->setParent(this);
169  _tabAcousticSurf.push_back(pAccSurfGeoNode);
170 
171  // Creation d'une surface vierge
172  pAccSurfGeoNode = new TYAcousticSurfaceGeoNode(NULL, this);
173  }
174  }
175  }
176 
177  return 1;
178 }
179 
181 {
183 
184  if (_pParent)
185  {
186  _pParent->setIsAcousticModified(isModified);
187  }
188 }
189 
190 void TYAcousticSurfaceNode::getChilds(LPTYElementArray& childs, bool recursif /*=true*/)
191 {
192  TYElement::getChilds(childs, recursif);
193 
194  for (int i = 0; i < getNbChild(); i++)
195  {
196  childs.push_back(_tabAcousticSurf[i]);
197  childs.push_back(_tabAcousticSurf[i]->getElement());
198  }
199 
200  if (recursif)
201  {
202  for (int i = 0; i < getNbChild(); i++)
203  {
204  _tabAcousticSurf[i]->getChilds(childs, recursif);
205  }
206  }
207 }
208 
210 {
212 
213  // Pour chaque child
214  for (int i = 0; i < getNbChild(); i++)
215  {
217 
218  if (pSurface->getIsRayonnant())
219  {
220  // Recupere l'ensemble des srcs du child...
221  TYTabSourcePonctuelleGeoNode tabChild = pSurface->getSrcs();
222 
223  // Concatenation des matrices
224  OMatrix matrix = _tabAcousticSurf[i]->getMatrix();
225  for (unsigned int j = 0; j < tabChild.size(); j++)
226  {
227  tabChild[j]->setMatrix(matrix * tabChild[j]->getMatrix());
228  }
229 
230  //...et ajoute au tableau a retourner
231  tab.insert(tab.end(), tabChild.begin(), tabChild.end());
232  }
233  }
234 
235  return tab;
236 }
237 
239 {
240  return TYSourcePonctuelle();
241 }
242 
243 void TYAcousticSurfaceNode::setDensiteSrcsH(double densite, bool recursif /*=true*/)
244 {
245  TYAcousticInterface::setDensiteSrcsH(densite, recursif);
246 
247  if (recursif)
248  {
249  for (int i = 0; i < getNbChild(); i++)
250  {
252 
253  assert(pSurface);
254 
255  // Densite H de srcs ponct
256  pSurface->setDensiteSrcsH(getDensiteSrcsH(), recursif);
257  }
258  }
259 }
260 
261 void TYAcousticSurfaceNode::setDensiteSrcsV(double densite, bool recursif /*=true*/)
262 {
263  TYAcousticInterface::setDensiteSrcsV(densite, recursif);
264 
265  if (recursif)
266  {
267  for (int i = 0; i < getNbChild(); i++)
268  {
270 
271  assert(pSurface);
272 
273  // Densite V de srcs ponct
274  pSurface->setDensiteSrcsV(getDensiteSrcsV(), recursif);
275  }
276  }
277 }
278 
279 void TYAcousticSurfaceNode::setRegime(TYSpectre& Spectre, int regime /*=-1*/, bool recursif /*=false*/)
280 {
281  if (recursif)
282  {
283  for (int i = 0; i < getNbChild(); i++)
284  {
286 
287  pSurface->setRegime(Spectre, regime, recursif);
288  }
289  }
290 
291  TYAcousticInterface::setRegime(Spectre, regime, recursif);
292 }
293 
295 {
296  for (int i = 0; i < getNbChild(); i++)
297  {
299 
300  pSurface->remRegime(regime);
301  }
302 
303  return TYAcousticInterface::remRegime(regime);
304 }
305 
307 {
308  for (int i = 0; i < getNbChild(); i++)
309  {
311 
312  pSurface->loadRegime(regimeNb);
313  }
314 
316 }
317 
319 {
320  for (unsigned int i = 0; i < _tabAcousticSurf.size(); i++)
321  {
323 
324  pSurface->setCurRegime(regime);
325  }
326 
328 
329  setIsAcousticModified(true);
330 }
331 /*
332 int TYAcousticSurfaceNode::addRegime(const TYRegime& regime)
333 {
334  for (int i = 0; i < getNbChild(); i++)
335  {
336  LPTYAcousticSurface pSurface = TYAcousticSurface::safeDownCast(_tabAcousticSurf[i]->getElement());
337 
338  pSurface->addRegime();
339  }
340 
341  return TYAcousticInterface::addRegime(regime);
342 }
343 */
345 {
346  for (int i = 0; i < getNbChild(); i++)
347  {
349 
350  pSurface->addRegime();
351  }
352 
354 }
355 
357 {
358  size_t nbRegimes = _tabRegimes.size();
359  LPTYElementArray childs;
360  getChilds(childs, false);
361 
362  LPTYGeometryNode pNode = NULL;
363  LPTYAcousticSurface pSurf = NULL;
364  for (size_t i = 0; i < childs.size(); i++)
365  {
366  pNode = TYGeometryNode::safeDownCast(childs[i]);
367  if (pNode == NULL)
368  {
369  continue;
370  }
372  if (pSurf && (pSurf->getNbRegimes() > nbRegimes))
373  {
374  pSurf->setNbRegimes(static_cast<int>(nbRegimes));
375  }
376  }
377 }
378 
380 {
381  LPTYAcousticSurface pSurface = NULL;
382  for (int i = 0; i < getNbChild(); i++)
383  {
384  pSurface = TYAcousticSurface::safeDownCast(_tabAcousticSurf[i]->getElement());
385 
386  if (pSurface)
387  {
388  pSurface->propagateAtt(pAtt);
389  }
390  }
391 
393 }
394 
396 {
397  for (int i = 0; i < getNbChild(); i++)
398  {
400 
401  if (pSurface->getIsSub() == false)
402  {
403  pSurface->setUseAtt(state);
404  }
405  }
406 
408 }
409 
411 {
412  for (int i = 0; i < getNbChild(); i++)
413  {
415 
416  assert(pSurface);
417 
418  if (pSurface->getIsRayonnant())
419  {
420  pSurface->distriSrcs();
421  }
422  }
423 }
424 
426 {
427  bool ret = false;
428 
429  for (unsigned int i = 0; i < _tabAcousticSurf.size(); i++)
430  {
432 
433  if (pSurface->getIsRayonnant())
434  {
435  ret = pSurface->setSrcsLw();
436  }
437  }
438 
439  return ret;
440 }
441 
442 bool TYAcousticSurfaceNode::updateAcoustic(const bool& force) // force=false
443 {
444  unsigned int j = 0;
445  bool ret = true;
446 
447  // Si la surface n'est pas rayonnante, inutile de tenter de distribuer
448  // la puissance, mais ce n'est pas une raison pour bloquer le calcul
449  if (!_isRayonnant)
450  {
451  return true;
452  }
453 
454  // 1/ Recuperer la surface totale
455  double surfTotale = activeSurface();
456 
457  TYSpectre LWc = TYSpectre::getEmptyLinSpectre(); // Spectre cumule de l'ensembles des elements
458  TYSpectre LWg = getCurrentSpectre().toGPhy(); // Spectre global du regime courant
459  TYSpectre LWv; // Spectre de puissance de la face courante
460 
462 
463  // On recupere le tableau des sous faces
464  for (j = 0; j < _tabAcousticSurf.size(); j++)
465  {
467 
468  if (pSurf->getIsRayonnant()) // Si elle est rayonnante
469  {
470  LWv = pSurf->setGlobalLW(LWg, surfTotale);
471  LWc = LWc.sum(LWv);
472  }
473  else
474  {
475  TYSpectre aTYSpectre;
476  pSurf->setRegime(aTYSpectre);
477  }
478  }
479 
480  // 3 cas
481  if (ret && (_typeDistribution == TY_PUISSANCE_IMPOSEE))
482  {
483  // Il faut s'assurer que la somme des puissances des volumes egale la puissance de la machine
484  double residu = ABS(10 * log10(LWg.sigma()) - 10 * log10(LWc.sigma()));
485 
486  // Si l'ecart est inferieur a 1 dB on accepte
487  ret = residu < 1 ? true : false;
488  }
489  else if (ret && (_typeDistribution == TY_PUISSANCE_CALCULEE))
490  {
491  TYSpectre temp = LWc.toDB();
492  setRegime(temp); // Pas de probleme le spectre peut etre remplace
493  }
494  else
495  {
496  ret = false; // Probleme, la somme des puissances des faces n'est pas correcte
497  }
498 
499  return ret;
500 }
501 
503 {
504  return _pBoundingRect->surface();
505 }
506 
508 {
509  return _pBoundingRect->normal();
510 }
511 
513 {
514  return _pBoundingRect->plan();
515 }
516 
518 {
519  return _pBoundingRect->getContour(n);
520 }
521 
523 {
524  return _pBoundingRect->getOContour(n);
525 }
526 
528 {
529  return _pBoundingRect->intersects(pSurf, seg);
530 }
531 
533 {
534  return _pBoundingRect->intersects(seg, pt);
535 }
536 
538 {
539  return _pBoundingRect->intersects(pt);
540 }
541 
543 {
544  _tabAcousticSurf.clear();
545  setIsGeometryModified(true);
546 }
547 
549 {
550 
551  assert(pAccSurfGeoNode);
552 
553  LPTYAcousticSurface pSurface = TYAcousticSurface::safeDownCast(pAccSurfGeoNode->getElement());
554 
555  assert(pSurface);
556 
557  // On lui passe la meme couleur
558  // pSurface->setColor(_color);
559 
560  int i = 0;
561 
562  // On construit autant de regime pour cette nouvelle surface que (this) en a
563  // NB elle a au moins un regime par construction c'est pourquoi on par de 1
564  for (i = 1; i < getNbRegimes(); i++)
565  {
566  pSurface->addRegime();
567  }
568 
569  // On affecte les memes noms aux differents regimes
570  bool status = true;
571  for (i = 0; i < getNbRegimes(); i++)
572  {
573  QString nomReg = getRegimeNb(i, status).getRegimeName();
574  pSurface->setCurRegime(i);
575  pSurface->setRegimeName(nomReg);
576 
577  if (!pSurface->getIsSub())
578  {
579  pSurface->getRegimeNb(i, status)._isRayonnant =
580  getRegimeNb(i, status)._isRayonnant; // Etat de l'element
581  pSurface->getRegimeNb(i, status)._useAtt =
582  getRegimeNb(i, status)._useAtt; // Utilisation d'un attenuateur
583  pSurface->getRegimeNb(i, status)._typeDistribution =
584  TY_PUISSANCE_CALCULEE; // Puissance imposee ou calculee;
585  pSurface->getRegimeNb(i, status)._pAtt =
586  getRegimeNb(i, status)._pAtt; // Attenuateur eventuellement associe au regime
587  }
588  }
589 
590  // On met la surface au meme regime que son parent (CAD this)
591  pSurface->setCurRegime(getCurRegime());
592 
593  // Synchronise le numero suivant
594  pSurface->setNextRegimeNb(getNextRegimeNb());
595 
596  pAccSurfGeoNode->setParent(this);
597  pSurface->setParent(this);
598 
599  // Mise a jour des densite de sources pour la nouvelle surface
600  pSurface->setDensiteSrcsH(_densiteSrcsH);
601  pSurface->setDensiteSrcsV(_densiteSrcsV);
602 
603  // Les rejetons rayonnent comme les parents
604  // Sauf pour les faces marquees "sub"
605  if (pSurface->getIsSub() == false)
606  {
607  pSurface->setIsRayonnant(_isRayonnant, true);
608  }
609 
610  _tabAcousticSurf.push_back(pAccSurfGeoNode);
611 
612  setIsGeometryModified(true);
613 
614  return true;
615 }
617 {
618  _nextRegime = next;
619 
620  for (unsigned int i = 0; i < _tabAcousticSurf.size(); i++)
621  {
623 
624  pSurf->setNextRegimeNb(next);
625  }
626 }
627 
629 {
631 
632  for (unsigned int i = 0; i < _tabAcousticSurf.size(); i++)
633  {
635 
636  pSurf->setRegimeName(name);
637  }
638 }
639 
641 {
642  TYAcousticSurfaceGeoNode* pSurfGeoNode = new TYAcousticSurfaceGeoNode(repere, (LPTYElement)pAccSurf);
643  pSurfGeoNode->setParent(pAccSurf->getParent());
644  return addAcousticSurf(pSurfGeoNode);
645 }
646 
648 {
650 }
651 
653 {
654  assert(pAccSurf);
655  bool ret = false;
656  TYTabAcousticSurfaceGeoNode::iterator ite;
657 
658  for (ite = _tabAcousticSurf.begin(); ite != _tabAcousticSurf.end(); ite++)
659  {
660  if (TYAcousticSurface::safeDownCast((*ite)->getElement()) == pAccSurf)
661  {
662  _tabAcousticSurf.erase(ite);
663  ret = true;
664  break;
665  }
666  }
667 
668  setIsGeometryModified(true);
669 
670  return ret;
671 }
672 
674 {
675  assert(pAccSurfGeoNode);
676  bool ret = false;
677  TYTabAcousticSurfaceGeoNode::iterator ite;
678 
679  for (ite = _tabAcousticSurf.begin(); ite != _tabAcousticSurf.end(); ite++)
680  {
681  if ((*ite) == pAccSurfGeoNode)
682  {
683  _tabAcousticSurf.erase(ite);
684  ret = true;
685  break;
686  }
687  }
688 
689  setIsGeometryModified(true);
690 
691  return ret;
692 }
693 
695 {
696  bool ret = false;
697  TYTabAcousticSurfaceGeoNode::iterator ite;
698 
699  for (ite = _tabAcousticSurf.begin(); ite != _tabAcousticSurf.end(); ite++)
700  {
701  if (TYAcousticSurface::safeDownCast((*ite)->getElement())->getID().toString() == idAccSurf)
702  {
703  _tabAcousticSurf.erase(ite);
704  ret = true;
705  break;
706  }
707  }
708 
709  setIsGeometryModified(true);
710 
711  return ret;
712 }
713 
715 {
716  if ((index >= 0) && (index < (int)_tabAcousticSurf.size()))
717  {
718  return TYAcousticSurface::safeDownCast(_tabAcousticSurf.at(index)->getElement());
719  }
720  else
721  {
722  return NULL;
723  }
724 }
725 
727 {
728  assert(pAccSurf);
729  TYTabAcousticSurfaceGeoNode::iterator ite;
730 
731  for (ite = _tabAcousticSurf.begin(); ite != _tabAcousticSurf.end(); ite++)
732  {
733  if (TYAcousticSurface::safeDownCast((*ite)->getElement()) == pAccSurf)
734  {
735  return (*ite);
736  }
737  }
738 
739  return NULL;
740 }
741 
742 TYSpectre TYAcousticSurfaceNode::setGlobalLW(const TYSpectre& spectre, const double& surfGlobale,
743  const int& regime /*=-1*/)
744 {
745  TYSpectre LWv;
746 
747  // 2 cas
749  {
750  LWv =
751  spectre.toGPhy().mult(surface() / surfGlobale).toDB(); // Spectre pondere de la surface de la face
752  setRegime(LWv, regime, false);
753  }
754 
755  return getCurrentSpectre().toGPhy();
756 }
757 
758 void TYAcousticSurfaceNode::setIsRayonnant(bool rayonnant, bool recursif)
759 {
761 
762  // Les faces de construction (!= cheminee/ventilation/fenetre) sont automatiquement rayonnantes
763  for (unsigned int i = 0; i < _tabAcousticSurf.size(); i++)
764  {
766  assert(pSurf);
767  if (pSurf->getIsSub() == false) // Si ce n'est pas une cheminee/ventil/fenetre
768  {
769  pSurf->setIsRayonnant(rayonnant, recursif);
770  }
771  }
772 
773  // Si une face rayonne son parent rayonne mais si elle ne rayonne plus ca ne veut pas dire que son parent
774  // ne rayonne plus
775  if (rayonnant)
776  {
778  assert(pVol);
779  pVol->setIsRayonnant(rayonnant, recursif);
780  }
781 }
782 
784 {
785  double surface = 0.0;
786 
787  for (unsigned int i = 0; i < _tabAcousticSurf.size(); i++)
788  {
790 
791  if (pSurf->getIsRayonnant() &&
792  (pSurf->getDensiteSrcs() != 0.0 || dynamic_cast<TYBoucheSurface*>(pSurf) ||
793  dynamic_cast<TYChemineeSurface*>(pSurf)))
794  {
795  surface += pSurf->surface();
796  }
797  }
798 
799  return surface;
800 }
801 
803 {
804  double surface = 0.0;
805 
806  for (unsigned int j = 0; j < _tabAcousticSurf.size(); j++)
807  {
809 
810  if (pSurf->getIsSub() == false) // Si ce n'est pas une cheminee ou une bouche de ventilation
811  {
812  if (pSurf->getIsRayonnant() && (pSurf->getDensiteSrcs() != 0.0))
813  {
814  surface += pSurf->surface();
815  }
816  }
817  }
818 
819  return surface;
820 }
821 
823 {
824  for (unsigned int j = 0; j < _tabAcousticSurf.size(); j++)
825  {
827 
828  if (pSurf->getIsSub() == false) // Si ce n'est pas une cheminee ou une bouche de ventilation
829  {
830  pSurf->remAllSrcs();
831  }
832  }
833 }
834 
836 void TYAcousticSurfaceNode::exportCSV(std::ofstream& ofs)
837 {
838  // Export du nom de l'objet
839  ofs << getName().toLatin1().data() << '\n';
840 
841  // Export du type de l'objet
842  ofs << toString() << '\n';
843  // Export des donnees acoustiques
845 
846  for (unsigned int j = 0; j < _tabAcousticSurf.size(); j++)
847  {
849 
850  if (pSurf->getIsSub()) // Si c'est une cheminee ou une bouche de ventilation
851  {
852  pSurf->exportCSV(ofs);
853  }
854  }
855 
856  ofs << '\n';
857 }
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:642
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:706
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:965
TYElement & operator=(const TYElement &other)
Definition: TYElement.cpp:263
bool callFromXMLIfEqual(DOM_Element &domElement, int *pRetVal=NULL)
Definition: TYElement.cpp:542
virtual QString getName() const
Definition: TYElement.h:691
TYElement * _pParent
Reference sur l'element parent.
Definition: TYElement.h:968
virtual void getChilds(LPTYElementArray &childs, bool recursif=true)
Definition: TYElement.h:530
void setParent(TYElement *pParent)
Definition: TYElement.h:699
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