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