Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYAcousticVolumeNode.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 /*
17  *
18  */
19 
20 #if TY_USE_IHM
22 #endif
23 
24 #include "TYAcousticVolumeNode.h"
25 
27 
29 {
31 
32  _regimeChangeAble = true;
33 }
34 
36 {
37  *this = other;
38 }
39 
41 
43 {
44  if (this != &other)
45  {
46  TYElement::operator=(other);
50  }
51  return *this;
52 }
53 
55 {
56  if (this != &other)
57  {
58  if (TYElement::operator!=(other))
59  {
60  return false;
61  }
62  if (TYColorInterface::operator!=(other))
63  {
64  return false;
65  }
66  if (TYAcousticInterface::operator!=(other))
67  {
68  return false;
69  }
70  if (!(_tabAcousticVol == other._tabAcousticVol))
71  {
72  return false;
73  }
74  }
75  return true;
76 }
77 
79 {
80  return !operator==(other);
81 }
82 
83 bool TYAcousticVolumeNode::deepCopy(const TYElement* pOther, bool copyId /*=true*/,
84  bool pUseCopyTag /*=false*/)
85 {
86  if (!TYElement::deepCopy(pOther, copyId, pUseCopyTag))
87  {
88  return false;
89  }
90 
91  purge();
92 
93  TYAcousticVolumeNode* pOtherAccVolNode = (TYAcousticVolumeNode*)pOther;
94 
96 
97  TYAcousticInterface::deepCopy(pOtherAccVolNode, copyId);
98 
99  for (int i = 0; i < pOtherAccVolNode->getNbChild(); i++)
100  {
101  TYAcousticVolume* pNewChild = (TYAcousticVolume*)pOtherAccVolNode->getAcousticVol(i)->clone();
102  pNewChild->deepCopy(pOtherAccVolNode->getAcousticVol(i), copyId);
103  pNewChild->setParent(this);
104  addAcousticVol(pNewChild, pOtherAccVolNode->_tabAcousticVol[i]->getORepere3D(), false);
105  }
106 
107  return true;
108 }
109 
111 {
112  return "TYAcousticVolumeNode";
113 }
114 
116 {
117  DOM_Element domNewElem = TYElement::toXML(domElement);
118  TYColorInterface::toXML(domNewElem);
119  TYAcousticInterface::toXML(domNewElem);
120 
121  // On commence par supprimer toutes les sources ponctuelles sauf celles des ventils et des cheminees
122  remAllSrcs();
123 
124  TYXMLTools::addElementUIntValue(domNewElem, "nbChild", getNbChild());
125 
126  for (int i = 0; i < getNbChild(); i++)
127  {
128  _tabAcousticVol.at(i)->toXML(domNewElem);
129  }
130 
131  distriSrcs();
132 
133  return domNewElem;
134 }
135 
137 {
138  TYElement::fromXML(domElement);
139  TYColorInterface::fromXML(domElement);
140  TYAcousticInterface::fromXML(domElement);
141 
142  // Reset
143  purge();
144 
145  int retVal = -1;
146  LPTYAcousticVolumeGeoNode pAccVolGeoNode = new TYAcousticVolumeGeoNode(NULL, this);
147 
148  DOM_Element elemCur;
149  QDomNodeList childs = domElement.childNodes();
150  for (unsigned int i = 0; i < childs.length(); i++)
151  {
152  elemCur = childs.item(i).toElement();
153 
154  if (pAccVolGeoNode->callFromXMLIfEqual(elemCur, &retVal))
155  {
156  if (retVal == 1)
157  {
158  // Ajout au tableau des volumes
159  pAccVolGeoNode->setParent(this);
160  pAccVolGeoNode->getElement()->setParent(this);
161  _tabAcousticVol.push_back(pAccVolGeoNode);
162  // Cration d'un nouveau volume vierge
163  pAccVolGeoNode = new TYAcousticVolumeGeoNode(NULL, this);
164  }
165  }
166  }
167 
168  // On force le regime des sous elements
170 
171  // Corrige le nombre de regimes des enfants (correction bug)
173 
174  return 1;
175 }
176 
177 void TYAcousticVolumeNode::getChilds(LPTYElementArray& childs, bool recursif /*=true*/)
178 {
179  TYElement::getChilds(childs, recursif);
180 
181  for (int i = 0; i < getNbChild(); i++)
182  {
183  childs.push_back(_tabAcousticVol[i]);
184  childs.push_back(_tabAcousticVol[i]->getElement());
185  }
186 
187  if (recursif)
188  {
189  for (int i = 0; i < getNbChild(); i++)
190  {
191  _tabAcousticVol[i]->getChilds(childs, recursif);
192  }
193  }
194 }
195 
196 void TYAcousticVolumeNode::setRegime(TYSpectre& Spectre, int regime /*=-1*/, bool recursif /*=false*/)
197 {
198  if (recursif)
199  {
200  for (int i = 0; i < getNbChild(); i++)
201  {
203 
204  pVolume->setRegime(Spectre, regime, recursif);
205  }
206  }
207 
208  TYAcousticInterface::setRegime(Spectre, regime, recursif);
209 }
210 
212 {
214 
215  for (int i = 0; i < getNbChild(); i++)
216  {
218 
219  pVolume->setRegimeName(name);
220  }
221 }
222 
224 {
225  bool ret = true;
226 
227  if (TYAcousticInterface::remRegime(regime))
228  {
229  for (int i = 0; i < getNbChild(); i++)
230  {
232 
233  pVolume->remRegime(regime);
234  }
235  }
236  else
237  {
238  ret = false;
239  }
240 
241  return ret;
242 }
243 
245 {
246  for (int i = 0; i < getNbChild(); i++)
247  {
249 
250  pVolume->loadRegime(regimeNb);
251  }
252 
254 }
255 
257 {
258  for (unsigned int i = 0; i < _tabAcousticVol.size(); i++)
259  {
261 
262  pVolume->setCurRegime(regime);
263  }
264 
266 
267  setIsAcousticModified(true);
268 }
269 
271 {
272  for (unsigned int i = 0; i < _tabAcousticVol.size(); i++)
273  {
274  TYAcousticVolume::safeDownCast(_tabAcousticVol[i]->getElement())->addRegime();
275  }
276 
278 }
279 
281 {
282  size_t nbRegimes = _tabRegimes.size();
283  LPTYElementArray childs;
284  getChilds(childs, false);
285  LPTYAcousticVolume pVolume = NULL;
286  LPTYGeometryNode pNode = NULL;
287  for (size_t i = 0; i < childs.size(); i++)
288  {
289  pNode = TYGeometryNode::safeDownCast(childs[i]);
290  if (pNode == NULL)
291  {
292  continue;
293  }
294  pVolume = TYAcousticVolume::safeDownCast(pNode->getElement());
295  if (pVolume)
296  {
297  if (pVolume->getNbRegimes() > nbRegimes)
298  {
299  pVolume->setNbRegimes(static_cast<int>(nbRegimes));
300  }
301 
302  pVolume->correctNbRegimes();
303  }
304  }
305 }
306 
308 {
309  LPTYAcousticVolume pVol = NULL;
310  for (unsigned int i = 0; i < _tabAcousticVol.size(); i++)
311  {
312  pVol = TYAcousticVolume::safeDownCast(_tabAcousticVol[i]->getElement());
313  if (pVol)
314  {
315  pVol->propagateAtt(pAtt);
316  }
317  }
318 
320 }
321 
323 {
325 
326  // Pour chaque child
327  for (unsigned int i = 0; i < _tabAcousticVol.size(); i++)
328  {
330 
331  if (pVolume->getIsRayonnant())
332  {
333  // Recupere l'ensemble des srcs du child...
334  TYTabSourcePonctuelleGeoNode tabChild = pVolume->getSrcs();
335 
336  // Concatenation des matrices
337  OMatrix matrix = _tabAcousticVol[i]->getMatrix();
338  for (unsigned int j = 0; j < tabChild.size(); j++)
339  {
340  tabChild[j]->setMatrix(matrix * tabChild[j]->getMatrix());
341  }
342 
343  //...et ajoute au tableau a retourner
344  tab.insert(tab.end(), tabChild.begin(), tabChild.end());
345  }
346  }
347 
348  return tab;
349 }
350 
352 {
353  return TYSourcePonctuelle();
354 }
355 
356 void TYAcousticVolumeNode::setDensiteSrcsH(double densite, bool recursif /*=true*/)
357 {
358  TYAcousticInterface::setDensiteSrcsH(densite, recursif);
359 
360  if (recursif)
361  {
362  for (int i = 0; i < getNbChild(); i++)
363  {
365 
366  assert(pVolume);
367 
368  // Densite H de srcs ponct
369  pVolume->setDensiteSrcsH(getDensiteSrcsH(), recursif);
370  }
371  }
372 }
373 
374 void TYAcousticVolumeNode::setDensiteSrcsV(double densite, bool recursif /*=true*/)
375 {
376  TYAcousticInterface::setDensiteSrcsV(densite, recursif);
377 
378  if (recursif)
379  {
380  for (int i = 0; i < getNbChild(); i++)
381  {
383 
384  assert(pVolume);
385 
386  // Densite V de srcs ponct
387  pVolume->setDensiteSrcsV(getDensiteSrcsV(), recursif);
388  }
389  }
390 }
391 
393 {
394  for (int i = 0; i < getNbChild(); i++)
395  {
397 
398  assert(pVolume);
399 
400  // Calcul de la distribution des srcs pour chaque volume s'il est rayonnant
401  if (pVolume->getIsRayonnant())
402  {
403  pVolume->distriSrcs();
404  }
405  }
406 }
407 
409 {
410  for (int i = 0; i < getNbChild(); i++)
411  {
413 
414  assert(pVolume);
415 
416  // Affectation de la puissance a chaque volume (si rayonnant)
417  if (pVolume->getIsRayonnant())
418  {
419  pVolume->setSrcsLw();
420  }
421  }
422 
423  return true;
424 }
425 
427 {
428  for (int i = 0; i < getNbChild(); i++)
429  {
431 
432  assert(pVolume);
433 
434  pVolume->remAllSrcs();
435  }
436 }
437 
438 bool TYAcousticVolumeNode::updateAcoustic(const bool& force) // force = false
439 {
440  // NB : On travaille sur un regime donne.
441 
442  if (!getIsAcousticModified() && !force)
443  {
444  return true;
445  } // L'acoustique est à jour
446 
447  int i = 0;
448  bool ret = true;
449 
450  // Quoiqu'il en soit, on efface toutes les sources
451  remAllSrcs();
452 
453  // 1/ Recuperer la surface totale
454  double surfTotale = activeSurface();
455 
456  // Les densités à 0 sur la Machine reviennent à désactiver son rayonnement
457  if (surfTotale == 0)
458  {
459  return true;
460  }
461 
462  TYSpectre LWc = TYSpectre::getEmptyLinSpectre(); // Spectre cumule de tous les volumes
463  TYSpectre LWg;
464  TYSpectre LWv; // Spectre de puissance du volume courant
465 
466  // Si la puissance est imposee on part de cette puissance, sinon on repart d'une puissance nulle
467  // Pour eviter la redistribution due aux appels successifs a la methode update
469  {
470  LWg = this->getCurrentSpectre().toGPhy(); // Spectre global du regime courant
471  }
472  else // TY_PUISSANCE_CALCULEE
473  {
475  }
476 
478 
479  // la machine(volumeNode transmet son spectre de puissance a ses elements volumes)
480 
481  for (i = 0; i < getNbChild(); i++)
482  {
484 
485  // Si le volume est rayonnant
486  if (volCourant->getIsRayonnant())
487  {
488  LWv = volCourant->setGlobalLW(LWg, surfTotale);
489  LWc = LWc.sum(LWv);
490  ret &= volCourant->updateAcoustic();
491  }
492  else
493  {
494  TYSpectre aTYSpectre;
495  volCourant->setRegime(aTYSpectre);
496  }
497  }
498 
500  {
501  // Puissance de la machine = puissance cumulee des volumes qui la composent
504 
505  for (i = 0; i < getNbChild(); i++)
506  {
508  if (volCourant->getIsRayonnant())
509  {
510  LWc = LWc.sum(volCourant->getCurrentSpectre().toGPhy());
511  }
512  }
513  TYSpectre aTYSpectre(LWc.toDB());
514  setRegime(aTYSpectre);
515  }
516  else if (ret && (_typeDistribution == TY_PUISSANCE_IMPOSEE))
517  {
518  // Il faut s'assurer que la somme des puissances des volumes egale la puissance de la machine
519  double residu = ABS(10 * log10(LWg.sigma()) - 10 * log10(LWc.sigma()));
520 
521  // Si l'ecart est inferieur a 1 dB on accepte
522  ret = residu < 1 ? true : false;
523  }
524 
525  if (ret) // Si ca c'est bien passe, on remet des sources et on leur attribue la puissance
526  {
527  distriSrcs();
528  ret &= setSrcsLw();
529  }
530 
531  if (ret)
532  {
533  setIsAcousticModified(false);
534  } // L'acoustique est à jour
535 
536  return ret;
537 }
538 
540 {
541  double res = 0.0;
542 
543  for (int i = 0; i < getNbChild(); i++)
544  {
546 
547  res += pVolume->volume();
548  }
549 
550  return res;
551 }
552 
554 {
555  double res = 0.0;
556 
557  for (int i = 0; i < getNbChild(); i++)
558  {
560 
561  res += pVolume->surface();
562  }
563 
564  return res;
565 }
566 
568 {
569  double res = 0.0;
570 
571  for (int i = 0; i < getNbChild(); i++)
572  {
574 
575  if (pVolume->getIsRayonnant())
576  {
577  res += pVolume->activeSurface();
578  } // Somme la surface si rayonnant !
579  }
580 
581  return res;
582 }
583 
585 {
586  double res = 0.0;
587 
588  for (int i = 0; i < getNbChild(); i++)
589  {
591 
592  if (pVolume->getIsRayonnant())
593  {
594  res += pVolume->activeSurface();
595  } // Somme la surface si rayonnant !
596  }
597 
598  return res;
599 }
600 
602 {
603  TYTabVector tab;
604 
605  for (int i = 0; i < getNbChild(); i++)
606  {
608  // On recupere l'ensemble des normales par volume
609  TYTabVector tabTmp = pVolume->normals();
610  OMatrix matrix = _tabAcousticVol[i]->getMatrix();
611 
612  // Pour chacune de ces normales
613  for (unsigned int j = 0; j < tabTmp.size(); j++)
614  {
615  // On convertit la normale dans le repere du vol node
616  tabTmp[j] = matrix * tabTmp[j];
617  }
618 
619  // Ajout
620  tab.insert(tab.end(), tabTmp.begin(), tabTmp.end());
621  }
622 
623  return tab;
624 }
625 
627 {
628  TYTabPoint tab;
629 
630  for (int i = 0; i < getNbChild(); i++)
631  {
633  // On recupere l'ensemble des sommets par volume
634  TYTabPoint tabTmp = pVolume->sommets();
635  OMatrix matrix = _tabAcousticVol[i]->getMatrix();
636 
637  // Pour chacun de ces sommets
638  for (unsigned int j = 0; j < tabTmp.size(); j++)
639  {
640  // On convertit le point dans le repere du vol node
641  tabTmp[j] = matrix * tabTmp[j];
642  }
643 
644  // Ajout
645  tab.insert(tab.end(), tabTmp.begin(), tabTmp.end());
646  }
647 
648  return tab;
649 }
650 
652 {
653  TYTabLPPolygon tab;
654 
655  for (int i = 0; i < getNbChild(); i++)
656  {
658  // On recupere l'ensemble des faces par volume
659  TYTabLPPolygon tabTmp = pVolume->faces();
660  OMatrix matrix = _tabAcousticVol[i]->getMatrix();
661 
662  // Pour chacune de ces faces
663  for (unsigned int j = 0; j < tabTmp.size(); j++)
664  {
665  // Polygon representant la face
666  TYPolygon* pPolygon = tabTmp[j];
667 
668  // On convertit le polygon dans le repere du vol node
669  pPolygon->transform(matrix);
670  }
671 
672  // Ajout
673  tab.insert(tab.end(), tabTmp.begin(), tabTmp.end());
674  }
675 
676  return tab;
677 }
678 
680 {
682 }
683 
685 {
686  printf("TYAcousticVolumeNode::centreGravite non implemente.\n");
687  return volEnglob().getPosition();
688 }
689 
691 {
692  return TYVolumeInterface::intersects(seg, ptList);
693 }
694 
696 {
697  int res = INTERS_NULLE;
698  TYPoint ptTest;
699 
700  // Pour eviter des calculs inutiles...
701  if (volEnglob().isInside(pt) == INTERS_NULLE)
702  {
703  return res;
704  }
705 
706  // On teste si le point se trouve au moins a l'interieur d'un
707  // volume composant ce volume node
708  for (int i = 0; (i < getNbChild()) && (res == INTERS_NULLE); i++)
709  {
710  // On convertit le point dans le repere local au volume
711  OMatrix matrix = _tabAcousticVol[i]->getMatrix();
712  matrix.invert();
713  ptTest = matrix * pt;
714 
716 
717  // Test
718  res = pVolume->isInside(ptTest);
719  }
720 
721  return res;
722 }
723 
725 {
727 
728  for (int i = 0; i < getNbChild(); i++)
729  {
731  TYTabAcousticSurfaceGeoNode tabTmp = pVolume->acousticFaces();
732  OMatrix matrixVol = _tabAcousticVol[i]->getMatrix();
733 
734  for (unsigned int j = 0; j < tabTmp.size(); j++)
735  {
736  tabTmp[j]->setMatrix(matrixVol * tabTmp[j]->getMatrix());
737  tab.push_back(tabTmp[j]);
738  }
739  }
740 
741  return tab;
742 }
743 
745 {
746  _tabAcousticVol.clear();
747  setIsGeometryModified(true);
748 }
749 
750 bool TYAcousticVolumeNode::addAcousticVol(LPTYAcousticVolumeGeoNode pAccVolGeoNode, bool recursif /*=true*/)
751 {
752  assert(pAccVolGeoNode);
753 
754  LPTYAcousticVolume pVolume = TYAcousticVolume::safeDownCast(pAccVolGeoNode->getElement());
755 
756  assert(pVolume);
757 
758  pAccVolGeoNode->setParent(this);
759  pVolume->setParent(this);
760 
761  if (recursif)
762  {
763  // Affectation de la densite du volume egale a celle du parent
764  pVolume->setDensiteSrcsH(_densiteSrcsH);
765  pVolume->setDensiteSrcsV(_densiteSrcsV);
766  }
767 
768  // On construit autant de regime pour cette nouvelle surface que (this) en a
769  // NB elle a au moins un regime par construction c'est pourquoi on par de 1
770  int i = 0;
771  for (i = 1; i < getNbRegimes(); i++)
772  {
773  pVolume->addRegime();
774  }
775 
776  // On affecte les memes noms aux differents regimes
777  bool status = true;
778  for (i = 0; i < getNbRegimes(); i++)
779  {
780  QString nomReg = getRegimeNb(i, status).getRegimeName();
781  pVolume->setCurRegime(i);
782  pVolume->setRegimeName(nomReg);
783  }
784 
785  // On met le volume au meme regime que son parent (CAD this)
786  pVolume->setCurRegime(getCurRegime());
787 
788  // Synchronise le numero suivant
789  pVolume->setNextRegimeNb(getNextRegimeNb());
790 
791  _tabAcousticVol.push_back(pAccVolGeoNode);
792 
793  setIsAcousticModified(true);
794  setIsGeometryModified(true);
795 
796  return true;
797 }
798 
799 bool TYAcousticVolumeNode::addAcousticVol(LPTYAcousticVolume pAccVol, const TYRepere& repere, bool recursif)
800 {
801  TYAcousticVolumeGeoNode* pVolGeoNode = new TYAcousticVolumeGeoNode(repere, (LPTYElement)pAccVol);
802  pVolGeoNode->setParent(pAccVol->getParent());
803  return addAcousticVol(pVolGeoNode, recursif);
804 }
805 
807 {
808  return addAcousticVol(new TYAcousticVolumeGeoNode((LPTYElement)pAccVol), recursif);
809 }
810 
812 {
813  assert(pAccVol);
814  bool ret = false;
815  TYTabAcousticVolumeGeoNode::iterator ite;
816 
817  for (ite = _tabAcousticVol.begin(); ite != _tabAcousticVol.end(); ite++)
818  {
819  if (TYAcousticVolume::safeDownCast((*ite)->getElement()) == pAccVol)
820  {
821  _tabAcousticVol.erase(ite);
822  ret = true;
823  break;
824  }
825  }
826 
827  setIsGeometryModified(true);
828  setIsAcousticModified(true);
829 
830  return ret;
831 }
832 
834 {
835  assert(pAccVolGeoNode);
836  bool ret = false;
837  TYTabAcousticVolumeGeoNode::iterator ite;
838 
839  for (ite = _tabAcousticVol.begin(); ite != _tabAcousticVol.end(); ite++)
840  {
841  if ((*ite) == pAccVolGeoNode)
842  {
843  _tabAcousticVol.erase(ite);
844  ret = true;
845  break;
846  }
847  }
848 
849  setIsGeometryModified(true);
850  setIsAcousticModified(true);
851 
852  return ret;
853 }
854 
856 {
857  bool ret = false;
858  TYTabAcousticVolumeGeoNode::iterator ite;
859 
860  for (ite = _tabAcousticVol.begin(); ite != _tabAcousticVol.end(); ite++)
861  {
862  if (TYAcousticVolume::safeDownCast((*ite)->getElement())->getID().toString() == idAccVol)
863  {
864  _tabAcousticVol.erase(ite);
865  ret = true;
866  break;
867  }
868  }
869 
870  setIsGeometryModified(true);
871  setIsAcousticModified(true);
872 
873  return ret;
874 }
875 
877 {
878  if ((index >= 0) && (index < (int)_tabAcousticVol.size()))
879  {
880  return TYAcousticVolume::safeDownCast(_tabAcousticVol.at(index)->getElement());
881  }
882  else
883  {
884  return NULL;
885  }
886 }
887 
889 {
890  assert(pAccVol);
891  TYTabAcousticVolumeGeoNode::iterator ite;
892 
893  for (ite = _tabAcousticVol.begin(); ite != _tabAcousticVol.end(); ite++)
894  {
895  if (TYAcousticVolume::safeDownCast((*ite)->getElement()) == pAccVol)
896  {
897  return (*ite);
898  }
899  }
900 
901  return NULL;
902 }
903 
904 void TYAcousticVolumeNode::setIsRayonnant(bool rayonnant, bool recursif /*= true */)
905 {
907 }
908 
910 {
911  LPTYSpectre ret = nullptr;
913  TYSpectre sp;
915  LPTYSourcePonctuelle pSource = nullptr;
916  for (unsigned int i = 0; i < srcs.size(); i++)
917  {
918  pSource = dynamic_cast<TYSourcePonctuelle*>(srcs[i]._pObj->getElement());
919  if (pSource._pObj != nullptr)
920  {
921  sp = sp.sumdB(*pSource->getSpectre());
922  }
923  }
924  ret = new TYSpectre(sp);
925  return ret;
926 }
927 
928 void TYAcousticVolumeNode::exportCSV(std::ofstream& ofs)
929 {
930  // Mise a jour de l'acoustique
931  updateAcoustic();
932 
933  // Export du nom de l'objet
934  ofs << getName().toLatin1().data() << '\n';
935 
936  // Export du type de l'objet
937  ofs << toString() << '\n';
938  // Export des donnees acoustiques
940 
941  TYTabAcousticVolumeGeoNode::iterator ite;
942 
943  LPTYAcousticVolume pVol = NULL;
944 
945  for (ite = _tabAcousticVol.begin(); ite != _tabAcousticVol.end(); ite++)
946  {
947  pVol = TYAcousticVolume::safeDownCast((*ite)->getElement());
948  if (pVol)
949  {
950  pVol->exportCSV(ofs);
951  }
952  }
953 
954  ofs << '\n';
955 }
double ABS(double a)
Return the absolute value.
Definition: 3d.h:67
#define INTERS_NULLE
No intersection.
Definition: 3d.h:35
QDomElement DOM_Element
Definition: QT2DOM.h:30
std::vector< LPTYAcousticSurfaceGeoNode > TYTabAcousticSurfaceGeoNode
Collection de noeuds geometriques de type TYAcousticSurface.
outil IHM pour un ensemble de volumes acoustiques (fichier header)
TY_EXTENSION_INST(TYAcousticVolumeNode)
TYGeometryNode TYAcousticVolumeGeoNode
Noeud geometrique de type TYAcousticVolume.
std::vector< TYPoint > TYTabPoint
Collection de TYPoint.
Definition: TYDefines.h:340
std::vector< OVector3D > TYTabVector
Collection de OVector3D.
Definition: TYDefines.h:398
std::vector< LPTYPolygon > TYTabLPPolygon
Collection de pointeurs de TYPolygon.
Definition: TYDefines.h:349
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
int invert()
Matrix inversion.
Definition: 3d.cpp:792
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 & sumdB(const OSpectreAbstract &spectre) const
Energetic sum of two spectrums.
Definition: spectre.cpp:176
static OSpectre getEmptyLinSpectre(const double &valInit=1.0E-20)
Create a physical quantity spectrum.
Definition: spectre.cpp:1129
T * _pObj
The real pointer, must derived IRefCount.
Definition: smartptr.h:307
Spectrum class.
Definition: Spectre.h:25
double _densiteSrcsV
Densite verticale de sources.
double getDensiteSrcsH() const
virtual void setDensiteSrcsH(double densite, bool recursif=true)
TYRegime & getRegimeNb(const int &nb, bool &status)
size_t getNbRegimes() const
double getDensiteSrcsV() const
int _curRegime
Numero du regime de fonctionnement courant.
int _typeDistribution
Indique le type de distribution a utiliser. pour l'etat courant.
virtual void loadRegime(int regimeNb=-1)
TYSpectre & getCurrentSpectre()
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)
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 fromXML(DOM_Element domElement)
bool _regimeChangeAble
Indique si un element peux changer de regime de lui meme.
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)
virtual TYTabAcousticSurfaceGeoNode acousticFaces()
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
virtual void exportCSV(std::ofstream &ofs)
Export au format csv sur un flux transmis.
virtual void setDensiteSrcsV(double densite, bool recursif=true)
virtual TYTabVector normals() const
virtual int fromXML(DOM_Element domElement)
virtual TYPoint centreGravite() const
bool addAcousticVol(LPTYAcousticVolumeGeoNode pAccVolGeoNode, bool recursif=true)
virtual void setRegime(TYSpectre &Spectre, int regime=-1, bool recursif=false)
virtual bool updateAcoustic(const bool &force=false)
virtual void setIsRayonnant(bool rayonnant=true, bool recursif=true)
virtual double activeSurface() const
TYTabAcousticVolumeGeoNode _tabAcousticVol
Tableau des AcousticVolumes.
virtual int isInside(const TYPoint &pt) const
virtual TYBox volEnglob() const
virtual void propagateAtt(LPTYAttenuateur pAtt)
virtual TYTabPoint sommets() const
virtual TYTabSourcePonctuelleGeoNode getSrcs() const
virtual DOM_Element toXML(DOM_Element &domElement)
virtual LPTYSpectre getRealPowerSpectrum()
virtual std::string toString() const
LPTYAcousticVolume getAcousticVol(int index)
LPTYAcousticVolumeGeoNode findAcousticVol(const LPTYAcousticVolume pAccVol)
TYAcousticVolumeNode & operator=(const TYAcousticVolumeNode &other)
Operateur =.
virtual double surface() const
virtual void loadRegime(int regimeNb=-1)
virtual TYTabLPPolygon faces() const
bool remAcousticVol(const LPTYAcousticVolumeGeoNode pAccVolGeoNode)
virtual bool remRegime(int regime)
bool operator==(const TYAcousticVolumeNode &other) const
Operateur ==.
virtual double volume() const
virtual int intersects(const OSegment3D &seg, TYTabPoint &ptList) const
virtual void setDensiteSrcsH(double densite, bool recursif=true)
bool operator!=(const TYAcousticVolumeNode &other) const
Operateur !=.
virtual void setCurRegime(int regime)
virtual void setRegimeName(const QString &name)
virtual void getChilds(LPTYElementArray &childs, bool recursif=true)
virtual TYSourcePonctuelle srcPonctEquiv() const
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
Definition: TYBox.h:34
TYPoint & getPosition()
Definition: TYBox.h:113
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)
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
bool getIsAcousticModified()
Definition: TYElement.h:716
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.
void transform(const OMatrix &matrix)
Definition: TYPolygon.cpp:417
QString getRegimeName()
Definition: TYRegime.h:86
virtual TYSpectre * getSpectre(int regime=-1) const
Definition: TYSource.h:76
static TYSpectre getEmptyLinSpectre(const double &valInit=1.0E-20)
Cree un spectre en lin.
Definition: TYSpectre.cpp:451
virtual int intersects(const OSegment3D &seg, TYTabPoint &ptList) const
virtual TYBox volEnglob() const
static void addElementUIntValue(DOM_Element &parentElem, DOMString nodeName, unsigned int nodeValue)
Definition: TYXMLTools.cpp:42
@ SPECTRE_TYPE_LW
Definition: spectre.h:30