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