Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYInfrastructure.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
19 #endif
20 
21 #include "Tympan/core/logging.h"
26 #include "TYInfrastructure.h"
27 
30 
32 {
34 }
35 
37 {
38  *this = other;
39 }
40 
42 {
43  // purge();
44 }
45 
47 {
48  if (this != &other)
49  {
50  TYElement::operator=(other);
52  _listMachine = other._listMachine;
54 #if WITH_NMPB
55  _listRoute = other._listRoute;
56 #endif
57  _listSrc = other._listSrc;
58  }
59  return *this;
60 }
61 
63 {
64  if (this != &other)
65  {
66  if (TYElement::operator!=(other))
67  {
68  return false;
69  }
70  if (!(_listBatiment == other._listBatiment))
71  {
72  return false;
73  }
74  if (!(_listMachine == other._listMachine))
75  {
76  return false;
77  }
78  if (!(_listResTrans == other._listResTrans))
79  {
80  return false;
81  }
82 #if WITH_NMPB
83  if (!(_listRoute == other._listRoute))
84  {
85  return false;
86  }
87 #endif
88  if (!(_listSrc == other._listSrc))
89  {
90  return false;
91  }
92  }
93  return true;
94 }
95 
97 {
98  return !operator==(other);
99 }
100 
101 bool TYInfrastructure::deepCopy(const TYElement* pOther, bool copyId /*=true*/, bool pUseCopyTag /*=false*/)
102 {
103  if (!TYElement::deepCopy(pOther, copyId))
104  {
105  return false;
106  }
107 
108  TYInfrastructure* pOtherInfra = (TYInfrastructure*)pOther;
109 
110  unsigned int i = 0;
111 
112 #if WITH_NMPB
113  _listRoute.clear();
114  for (i = 0; i < pOtherInfra->_listRoute.size(); i++)
115  {
116  LPTYRouteGeoNode pRouteGeoNode = new TYRouteGeoNode(NULL, this);
117  pRouteGeoNode->deepCopy(pOtherInfra->_listRoute[i], copyId);
118  pRouteGeoNode->getElement()->setParent(this);
119  pRouteGeoNode->setParent(this);
120  addRoute(pRouteGeoNode);
121  }
122 #endif
123  _listResTrans.clear();
124  for (i = 0; i < pOtherInfra->_listResTrans.size(); i++)
125  {
126  LPTYReseauTransportGeoNode pResTransGeoNode = new TYReseauTransportGeoNode(NULL, this);
127  pResTransGeoNode->deepCopy(pOtherInfra->_listResTrans[i], copyId);
128  pResTransGeoNode->getElement()->setParent(this);
129  pResTransGeoNode->setParent(this);
130  addResTrans(pResTransGeoNode);
131  }
132 
133  _listBatiment.clear();
134  for (i = 0; i < pOtherInfra->_listBatiment.size(); i++)
135  {
136  LPTYBatimentGeoNode pBatGeoNode = new TYBatimentGeoNode(NULL, this);
137  pBatGeoNode->deepCopy(pOtherInfra->_listBatiment[i], copyId);
138  pBatGeoNode->getElement()->setParent(this);
139  pBatGeoNode->setParent(this);
140  addBatiment(pBatGeoNode);
141  }
142 
143  _listMachine.clear();
144  for (i = 0; i < pOtherInfra->_listMachine.size(); i++)
145  {
146  LPTYMachineGeoNode pMachineGeoNode = new TYMachineGeoNode(NULL, this);
147  pMachineGeoNode->deepCopy(pOtherInfra->_listMachine[i], copyId);
148  pMachineGeoNode->getElement()->setParent(this);
149  pMachineGeoNode->setParent(this);
150  addMachine(pMachineGeoNode);
151  }
152 
153  _listSrc.clear();
154  for (i = 0; i < pOtherInfra->_listSrc.size(); i++)
155  {
156  LPTYSourcePonctuelleGeoNode pSrcGeoNode = new TYSourcePonctuelleGeoNode(NULL, this);
157  pSrcGeoNode->deepCopy(pOtherInfra->_listSrc[i], copyId);
158  pSrcGeoNode->getElement()->setParent(this);
159  pSrcGeoNode->setParent(this);
160  addSrc(pSrcGeoNode);
161  }
162 
163  return true;
164 }
165 
166 std::string TYInfrastructure::toString() const
167 {
168  return "TYInfrastructure";
169 }
170 
172 {
173  unsigned int i = 0;
174 
175  DOM_Element domNewElem = TYElement::toXML(domElement);
176 
177  DOM_Document domDoc = domElement.ownerDocument();
178  DOM_Element listRouteNode = domDoc.createElement("ListRoute");
179  domNewElem.appendChild(listRouteNode);
180  DOM_Element listResTransNode = domDoc.createElement("ListResTrans");
181  domNewElem.appendChild(listResTransNode);
182  DOM_Element listBatimentNode = domDoc.createElement("ListBatiment");
183  domNewElem.appendChild(listBatimentNode);
184  DOM_Element listMachineNode = domDoc.createElement("ListMachine");
185  domNewElem.appendChild(listMachineNode);
186  DOM_Element listSrcNode = domDoc.createElement("ListSource");
187  domNewElem.appendChild(listSrcNode);
188 
189 #if WITH_NMPB
190  for (i = 0; i < _listRoute.size(); i++)
191  {
192  // Ajout de la route
193  _listRoute[i]->toXML(listRouteNode);
194  }
195 #endif
196 
197  for (i = 0; i < _listResTrans.size(); i++)
198  {
199  // Ajout du reseau de transport
200  _listResTrans[i]->toXML(listResTransNode);
201  }
202 
203  for (i = 0; i < _listBatiment.size(); i++)
204  {
205  // Ajout du bâtiment si valide (i.e. contient des etages)
207 
208  if (pNode && pNode->getNbChild() > 0)
209  {
210  _listBatiment[i]->toXML(listBatimentNode);
211  }
212  }
213 
214  for (i = 0; i < _listMachine.size(); i++)
215  {
216  // Ajout de la machine si valide (i.e. contient des volumes)
218 
219  if (pNode && pNode->getNbChild() > 0)
220  {
221  _listMachine[i]->toXML(listMachineNode);
222  }
223  }
224 
225  for (i = 0; i < _listSrc.size(); i++)
226  {
227  // Ajout de la source
228  _listSrc[i]->toXML(listSrcNode);
229  }
230 
231  return domNewElem;
232 }
233 
235 {
236  TYElement::fromXML(domElement);
237 
238  // Reset
239  clean();
240 #if WITH_NMPB
241  LPTYRouteGeoNode pRouteGeoNode = new TYRouteGeoNode(NULL, this);
242 #endif
243  LPTYReseauTransportGeoNode pResTransGeoNode = new TYReseauTransportGeoNode(NULL, this);
244  LPTYBatimentGeoNode pBatGeoNode = new TYBatimentGeoNode(NULL, this);
245  LPTYMachineGeoNode pMachineGeoNode = new TYMachineGeoNode(NULL, this);
247 
248  unsigned int i = 0, j = 0;
249  DOM_Element elemCur;
250 
251  QDomNodeList childs = domElement.childNodes();
252  unsigned int childcount = childs.length();
253  for (i = 0; i < childcount; i++)
254  {
255  elemCur = childs.item(i).toElement();
256 
257  OMessageManager::get()->info("Charge element d'infrastructure %d/%d.", i + 1, childcount);
258 #if WITH_NMPB
259  if (elemCur.nodeName() == "ListRoute")
260  {
261  QDomNodeList childs2 = elemCur.childNodes();
262  for (j = 0; j < childs2.length(); j++)
263  {
264  DOM_Element elemCur2 = childs2.item(j).toElement();
265  if (pRouteGeoNode->callFromXMLIfEqual(elemCur2))
266  {
267  addRoute(pRouteGeoNode);
268  pRouteGeoNode = new TYRouteGeoNode(NULL, this);
269  }
270  }
271  }
272 #endif
273  if (elemCur.nodeName() == "ListResTrans")
274  {
275  QDomNodeList childs2 = elemCur.childNodes();
276 
277  for (j = 0; j < childs2.length(); j++)
278  {
279  DOM_Element elemCur2 = childs2.item(j).toElement();
280  if (pResTransGeoNode->callFromXMLIfEqual(elemCur2))
281  {
282  addResTrans(pResTransGeoNode);
283  pResTransGeoNode = new TYReseauTransportGeoNode(NULL, this);
284  }
285  }
286  }
287  else if (elemCur.nodeName() == "ListBatiment")
288  {
289  QDomNodeList childs2 = elemCur.childNodes();
290  unsigned int childcount = childs2.length();
291  for (j = 0; j < childcount; j++)
292  {
293  DOM_Element elemCur2 = childs2.item(j).toElement();
294  OMessageManager::get()->info("Charge batiment %d/%d.", j + 1, childcount);
295  if (pBatGeoNode->callFromXMLIfEqual(elemCur2))
296  {
297  addBatiment(pBatGeoNode);
298  pBatGeoNode = new TYBatimentGeoNode(NULL, this);
299  }
300  }
301  }
302  else if (elemCur.nodeName() == "ListMachine")
303  {
304  QDomNodeList childs2 = elemCur.childNodes();
305  unsigned int childcount = childs2.length();
306  for (j = 0; j < childcount; j++)
307  {
308  DOM_Element elemCur2 = childs2.item(j).toElement();
309 
310  OMessageManager::get()->info("Charge machine %d/%d.", j + 1, childcount);
311  if (pMachineGeoNode->callFromXMLIfEqual(elemCur2))
312  {
313  addMachine(pMachineGeoNode);
314  pMachineGeoNode = new TYMachineGeoNode(NULL, this);
315  }
316  }
317  }
318  else if (elemCur.nodeName() == "ListSource")
319  {
320  QDomNodeList childs2 = elemCur.childNodes();
321 
322  for (j = 0; j < childs2.length(); j++)
323  {
324  DOM_Element elemCur2 = childs2.item(j).toElement();
325 
326  if (pSrcGeoNode->callFromXMLIfEqual(elemCur2))
327  {
328  if (pSrcGeoNode && pSrcGeoNode->getElement()->isA("TYSourcePonctuelle"))
329  {
330  // Si ancien fichier, conversion en "TYUserSourcePnctuelle"
331  LPTYSourcePonctuelle pSrc =
332  TYSourcePonctuelle::safeDownCast(pSrcGeoNode->getElement());
334  pSrcGeoNode->setElement((TYElement*)pUSrc);
335  }
336  addSrc(pSrcGeoNode);
337  pSrcGeoNode = new TYUserSourcePonctuelleGeoNode(NULL, this);
338  }
339  }
340  }
341  }
342 
343  return 1;
344 }
345 
346 void TYInfrastructure::getChilds(LPTYElementArray& childs, bool recursif /*=true*/)
347 {
348  unsigned int i = 0;
349 
350  TYElement::getChilds(childs, recursif);
351 #if WITH_NMPB
352  for (i = 0; i < _listRoute.size(); i++)
353  {
354  childs.push_back(_listRoute[i]);
355  childs.push_back(_listRoute[i]->getElement());
356  }
357 #endif
358  for (i = 0; i < _listResTrans.size(); i++)
359  {
360  childs.push_back(_listResTrans[i]);
361  childs.push_back(_listResTrans[i]->getElement());
362  }
363 
364  for (i = 0; i < _listBatiment.size(); i++)
365  {
366  childs.push_back(_listBatiment[i]);
367  childs.push_back(_listBatiment[i]->getElement());
368  }
369 
370  for (i = 0; i < _listMachine.size(); i++)
371  {
372  childs.push_back(_listMachine[i]);
373  childs.push_back(_listMachine[i]->getElement());
374  }
375 
376  for (i = 0; i < _listSrc.size(); i++)
377  {
378  childs.push_back(_listSrc[i]);
379  childs.push_back(_listSrc[i]->getElement());
380  }
381 
382  if (recursif)
383  {
384 #if WITH_NMPB
385  for (i = 0; i < _listRoute.size(); i++)
386  {
387  _listRoute[i]->getChilds(childs, recursif);
388  }
389 #endif
390 
391  for (i = 0; i < _listResTrans.size(); i++)
392  {
393  _listResTrans[i]->getChilds(childs, recursif);
394  }
395 
396  for (i = 0; i < _listBatiment.size(); i++)
397  {
398  _listBatiment[i]->getChilds(childs, recursif);
399  }
400 
401  for (i = 0; i < _listMachine.size(); i++)
402  {
403  _listMachine[i]->getChilds(childs, recursif);
404  }
405 
406  for (i = 0; i < _listSrc.size(); i++)
407  {
408  _listSrc[i]->getChilds(childs, recursif);
409  }
410  }
411 }
412 
413 void TYInfrastructure::updateCurrentCalcul(TYListID& listID, bool recursif) //=true
414 {
415  if (recursif) // On parcours les enfants si besoin est...
416  {
417  // Collecte des childs
418  LPTYElementArray childs;
419  getChilds(childs, false);
420  for (int i = 0; i < childs.size(); i++)
421  {
422  childs[i]->updateCurrentCalcul(listID, recursif);
423  }
424  }
425 
426  TYElement::updateCurrentCalcul(listID, false);
427  // l'infrastructure est toujours presente!
428  // setInCurrentCalcul ( true, false );
429 }
430 
432 {
433  unsigned int i = 0;
434 #if WITH_NMPB
435  for (i = 0; i < _listRoute.size(); i++)
436  {
437  _listRoute[i]->setParent(this);
438  _listRoute[i]->getElement()->setParent(this);
439  }
440 #endif
441 
442  for (i = 0; i < _listResTrans.size(); i++)
443  {
444  _listResTrans[i]->setParent(this);
445  _listResTrans[i]->getElement()->setParent(this);
446  }
447 
448  for (i = 0; i < _listBatiment.size(); i++)
449  {
450  _listBatiment[i]->setParent(this);
451  _listBatiment[i]->getElement()->setParent(this);
452  }
453 
454  for (i = 0; i < _listMachine.size(); i++)
455  {
456  _listMachine[i]->setParent(this);
457  _listMachine[i]->getElement()->setParent(this);
458  }
459 
460  for (i = 0; i < _listSrc.size(); i++)
461  {
462  _listSrc[i]->setParent(this);
463  _listSrc[i]->getElement()->setParent(this);
464  }
465 }
466 
468 {
469  if (_pParent)
470  {
472  if (pSite)
473  {
474  return pSite->getProjet();
475  }
476  }
477  return NULL;
478 }
479 
481 {
482  remAllBatiment();
483  remAllMachine();
484  remAllResTrans();
485 #if WITH_NMPB
486  remAllRoute();
487 #endif
488  remAllSrc();
489 
490  setIsGeometryModified(true);
491 }
492 
494 {
495  unsigned int i = 0;
496 #if WITH_NMPB
497  for (i = 0; i < infra->_listRoute.size(); ++i)
498  {
499  addRoute(infra->_listRoute[i]);
500  }
501 #endif
502 
503  for (i = 0; i < infra->_listResTrans.size(); ++i)
504  {
505  addResTrans(infra->_listResTrans[i]);
506  }
507 
508  for (i = 0; i < infra->_listBatiment.size(); ++i)
509  {
510  addBatiment(infra->_listBatiment[i]);
511  }
512 
513  for (i = 0; i < infra->_listMachine.size(); ++i)
514  {
515  addMachine(infra->_listMachine[i]);
516  }
517 
518  for (i = 0; i < infra->_listSrc.size(); ++i)
519  {
520  addSrc(infra->_listSrc[i]);
521  }
522 }
523 
524 #if WITH_NMPB
525 bool TYInfrastructure::addRoute(LPTYRouteGeoNode pRouteGeoNode)
526 {
527  assert(pRouteGeoNode);
528  assert(pRouteGeoNode->getElement());
529 
530  pRouteGeoNode->setParent(this);
531  pRouteGeoNode->getElement()->setParent(this);
532 
533  _listRoute.push_back(pRouteGeoNode);
534 
535  // Ajoute dans le calcul courant
536  addToCalcul(pRouteGeoNode);
537 
538  setIsGeometryModified(true);
539 
540  return true;
541 }
542 
543 bool TYInfrastructure::addRoute(LPTYRoute pRoute)
544 {
545  return addRoute(new TYRouteGeoNode((LPTYElement)pRoute));
546 }
547 
548 bool TYInfrastructure::remRoute(const LPTYRouteGeoNode pRouteGeoNode)
549 {
550  assert(pRouteGeoNode);
551 
552  bool ret = false;
553  TYTabRouteGeoNode::iterator ite;
554 
555  TYProjet* pProjet = getProjet();
556 
557  for (ite = _listRoute.begin(); ite != _listRoute.end(); ite++)
558  {
559  if ((*ite) == pRouteGeoNode)
560  {
561 
562  if (pProjet)
563  {
564  pProjet->remElmtFromCalculs((*ite)->getElement());
565  } // Supprime l'element des calculs
566 
567  _listRoute.erase(ite);
568  ret = true;
569  break;
570  }
571  }
572 
573  setIsGeometryModified(true);
574 
575  return ret;
576 }
577 
578 bool TYInfrastructure::remRoute(const LPTYRoute pRoute)
579 {
580  assert(pRoute);
581  bool ret = false;
582  TYTabRouteGeoNode::iterator ite;
583 
584  for (ite = _listRoute.begin(); ite != _listRoute.end(); ite++)
585  {
586  if (TYRoute::safeDownCast((*ite)->getElement()) == pRoute)
587  {
588  ret = remRoute(*ite);
589  break;
590  }
591  }
592 
593  return ret;
594 }
595 
596 bool TYInfrastructure::remRoute(QString idRoute)
597 {
598  bool ret = false;
599  TYTabRouteGeoNode::iterator ite;
600 
601  for (ite = _listRoute.begin(); ite != _listRoute.end(); ite++)
602  {
603  if ((*ite)->getElement()->getID().toString() == idRoute)
604  {
605  ret = remRoute(*ite);
606  break;
607  }
608  }
609 
610  return ret;
611 }
612 
613 void TYInfrastructure::remAllRoute()
614 {
615  TYProjet* pProjet = getProjet();
616 
617  if (pProjet)
618  {
619  pProjet->remTabElmtFromCalculs(_listRoute);
620  }
621 
622  _listRoute.clear();
623  setIsGeometryModified(true);
624 }
625 
626 LPTYRouteGeoNode TYInfrastructure::findRoute(const LPTYRoute pRoute)
627 {
628  assert(pRoute);
629  TYTabRouteGeoNode::iterator ite;
630 
631  for (ite = _listRoute.begin(); ite != _listRoute.end(); ite++)
632  {
633  if (TYRoute::safeDownCast((*ite)->getElement()) == pRoute)
634  {
635  return (*ite);
636  }
637  }
638 
639  return NULL;
640 }
641 #endif
643 {
644  assert(pResTransGeoNode);
645 
646  LPTYReseauTransport pReseau = TYReseauTransport::safeDownCast(pResTransGeoNode->getElement());
647 
648  assert(pReseau);
649 
650  pResTransGeoNode->setParent(this);
651  pReseau->setParent(this);
652 
653  _listResTrans.push_back(pResTransGeoNode);
654 
655  // Ajoute au calcul courant
656  addToCalcul(pResTransGeoNode);
657 
658  setIsGeometryModified(true);
659 
660  return true;
661 }
662 
664 {
665  return addResTrans(new TYReseauTransportGeoNode((LPTYElement)pResTrans));
666 }
667 
669 {
670  assert(pResTransGeoNode);
671  bool ret = false;
672  TYTabReseauTransportGeoNode::iterator ite;
673  TYProjet* pProjet = getProjet();
674 
675  for (ite = _listResTrans.begin(); ite != _listResTrans.end(); ite++)
676  {
677  if ((*ite) == pResTransGeoNode)
678  {
679  if (pProjet)
680  {
681  pProjet->remElmtFromCalculs((*ite)->getElement());
682  } // Supprime l'element des calculs
683 
684  _listResTrans.erase(ite);
685  ret = true;
686  break;
687  }
688  }
689 
690  setIsGeometryModified(true);
691 
692  return ret;
693 }
694 
696 {
697  assert(pResTrans);
698  bool ret = false;
699  TYTabReseauTransportGeoNode::iterator ite;
700 
701  for (ite = _listResTrans.begin(); ite != _listResTrans.end(); ite++)
702  {
703  if (TYReseauTransport::safeDownCast((*ite)->getElement()) == pResTrans)
704  {
705  ret = remResTrans(*ite);
706  break;
707  }
708  }
709 
710  return ret;
711 }
712 
713 bool TYInfrastructure::remResTrans(QString idResTrans)
714 {
715  bool ret = false;
716  TYTabReseauTransportGeoNode::iterator ite;
717 
718  for (ite = _listResTrans.begin(); ite != _listResTrans.end(); ite++)
719  {
720  if (TYReseauTransport::safeDownCast((*ite)->getElement())->getID().toString() == idResTrans)
721  {
722  ret = remResTrans(*ite);
723  break;
724  }
725  }
726 
727  return ret;
728 }
729 
731 {
732  TYProjet* pProjet = getProjet();
733  if (pProjet)
734  {
736  }
737 
738  _listResTrans.clear();
739  setIsGeometryModified(true);
740 }
741 
743 {
744  assert(pResTrans);
745  TYTabReseauTransportGeoNode::iterator ite;
746 
747  for (ite = _listResTrans.begin(); ite != _listResTrans.end(); ite++)
748  {
749  if (TYReseauTransport::safeDownCast((*ite)->getElement()) == pResTrans)
750  {
751  return (*ite);
752  }
753  }
754 
755  return NULL;
756 }
757 
759 {
760  assert(pMachineGeoNode);
761 
762  LPTYMachine pMachine = TYMachine::safeDownCast(pMachineGeoNode->getElement());
763 
764  assert(pMachine);
765 
766  pMachineGeoNode->setParent(this);
767  pMachine->setParent(this);
768 
769  _listMachine.push_back(pMachineGeoNode);
770 
771  // Ajoute au calcul courant
772  addToCalcul(pMachineGeoNode);
773 
774  setIsGeometryModified(true);
775 
776  return true;
777 }
778 
780 {
781  return addMachine(new TYMachineGeoNode(pos, (LPTYElement)pMachine));
782 }
783 
785 {
786  assert(pMachineGeoNode);
787  bool ret = false;
788  TYTabMachineGeoNode::iterator ite;
789  TYProjet* pProjet = getProjet();
790 
791  for (ite = _listMachine.begin(); ite != _listMachine.end(); ite++)
792  {
793  if ((*ite) == pMachineGeoNode)
794  {
795  if (pProjet)
796  {
797  pProjet->remElmtFromCalculs((*ite)->getElement());
798  } // Supprime l'element des calculs
799 
800  _listMachine.erase(ite);
801  ret = true;
802  break;
803  }
804  }
805 
806  setIsGeometryModified(true);
807 
808  return ret;
809 }
810 
812 {
813  assert(pMachine);
814  bool ret = false;
815  TYTabMachineGeoNode::iterator ite;
816 
817  for (ite = _listMachine.begin(); ite != _listMachine.end(); ite++)
818  {
819  if (TYMachine::safeDownCast((*ite)->getElement()) == pMachine)
820  {
821  ret = remMachine(*ite);
822  break;
823  }
824  }
825 
826  return ret;
827 }
828 
829 bool TYInfrastructure::remMachine(QString idMachine)
830 {
831  bool ret = false;
832  TYTabMachineGeoNode::iterator ite;
833 
834  for (ite = _listMachine.begin(); ite != _listMachine.end(); ite++)
835  {
836  if (TYMachine::safeDownCast((*ite)->getElement())->getID().toString() == idMachine)
837  {
838  ret = remMachine(*ite);
839  break;
840  }
841  }
842 
843  return ret;
844 }
845 
847 {
848  TYProjet* pProjet = getProjet();
849  if (pProjet)
850  {
852  }
853 
854  _listMachine.clear();
855  setIsGeometryModified(true);
856 }
857 
859 {
860  assert(pMachine);
861  TYTabMachineGeoNode::iterator ite;
862 
863  for (ite = _listMachine.begin(); ite != _listMachine.end(); ite++)
864  {
865  if (TYMachine::safeDownCast((*ite)->getElement()) == pMachine)
866  {
867  return (*ite);
868  }
869  }
870 
871  return NULL;
872 }
873 
875 {
876  assert(pBatimentGeoNode);
877 
878  LPTYBatiment pBatiment = TYBatiment::safeDownCast(pBatimentGeoNode->getElement());
879 
880  assert(pBatiment);
881 
882  pBatimentGeoNode->setParent(this);
883  pBatiment->setParent(this);
884 
885  _listBatiment.push_back(pBatimentGeoNode);
886 
887  // Ajoute au calcul courant s'il existe
888  addToCalcul(pBatimentGeoNode);
889 
890  setIsGeometryModified(true);
891 
892  return true;
893 }
894 
896 {
897  return addBatiment(new TYBatimentGeoNode(pos, (LPTYElement)pBatiment));
898 }
899 
901 {
902  assert(pBatimentGeoNode);
903 
904  bool ret = false;
905  TYTabBatimentGeoNode::iterator ite;
906  TYProjet* pProjet = getProjet();
907 
908  for (ite = _listBatiment.begin(); ite != _listBatiment.end(); ite++)
909  {
910  if ((*ite) == pBatimentGeoNode)
911  {
912  if (pProjet)
913  {
914  pProjet->remElmtFromCalculs((*ite)->getElement());
915  } // Supprime l'element des calculs
916 
917  _listBatiment.erase(ite);
918  ret = true;
919  break;
920  }
921  }
922 
923  setIsGeometryModified(true);
924 
925  return ret;
926 }
927 
929 {
930  bool ret = false;
931  TYTabBatimentGeoNode::iterator ite;
932 
933  for (ite = _listBatiment.begin(); ite != _listBatiment.end(); ite++)
934  {
935  if (TYBatiment::safeDownCast((*ite)->getElement()) == pBatiment)
936  {
937  ret = remBatiment(*ite);
938  break;
939  }
940  }
941 
942  return ret;
943 }
944 
945 bool TYInfrastructure::remBatiment(QString idBatiment)
946 {
947  bool ret = false;
948  TYTabBatimentGeoNode::iterator ite;
949 
950  for (ite = _listBatiment.begin(); ite != _listBatiment.end(); ite++)
951  {
952  if (TYBatiment::safeDownCast((*ite)->getElement())->getID().toString() == idBatiment)
953  {
954  ret = remBatiment(*ite);
955  break;
956  }
957  }
958 
959  return ret;
960 }
961 
963 {
964  TYProjet* pProjet = getProjet();
965  if (pProjet)
966  {
968  }
969 
970  _listBatiment.clear();
971  setIsGeometryModified(true);
972 }
973 
975 {
976  assert(pBatiment);
977  TYTabBatimentGeoNode::iterator ite;
978 
979  for (ite = _listBatiment.begin(); ite != _listBatiment.end(); ite++)
980  {
981  if (TYBatiment::safeDownCast((*ite)->getElement()) == pBatiment)
982  {
983  return (*ite);
984  }
985  }
986 
987  return NULL;
988 }
989 
991 {
992  assert(pSrcGeoNode);
993 
994  LPTYUserSourcePonctuelle pSource = TYUserSourcePonctuelle::safeDownCast(pSrcGeoNode->getElement());
995 
996  assert(pSource);
997 
998  pSrcGeoNode->setParent(this);
999  pSource->setParent(this);
1000 
1001  _listSrc.push_back(pSrcGeoNode);
1002 
1003  // Ajoute au calcul courant
1004  addToCalcul(pSrcGeoNode);
1005 
1006  setIsGeometryModified(true);
1007 
1008  return true;
1009 }
1010 
1012 {
1014 }
1015 
1017 {
1018  assert(pSrcGeoNode);
1019  bool ret = false;
1020  TYTabUserSourcePonctuelleGeoNode::iterator ite;
1021  TYProjet* pProjet = getProjet();
1022 
1023  for (ite = _listSrc.begin(); ite != _listSrc.end(); ite++)
1024  {
1025  if ((*ite) == pSrcGeoNode)
1026  {
1027  if (pProjet)
1028  {
1029  pProjet->remElmtFromCalculs((*ite)->getElement());
1030  } // Supprime l'element des calculs
1031  _listSrc.erase(ite);
1032  ret = true;
1033  break;
1034  }
1035  }
1036 
1037  setIsGeometryModified(true);
1038 
1039  return ret;
1040 }
1041 
1043 {
1044  assert(pSrc);
1045  bool ret = false;
1046  TYTabUserSourcePonctuelleGeoNode::iterator ite;
1047 
1048  for (ite = _listSrc.begin(); ite != _listSrc.end(); ite++)
1049  {
1050  if (TYUserSourcePonctuelle::safeDownCast((*ite)->getElement()) == pSrc)
1051  {
1052  ret = remSrc(*ite);
1053  break;
1054  }
1055  }
1056 
1057  return ret;
1058 }
1059 
1060 bool TYInfrastructure::remSrc(QString idSrc)
1061 {
1062  bool ret = false;
1063  TYTabUserSourcePonctuelleGeoNode::iterator ite;
1064 
1065  for (ite = _listSrc.begin(); ite != _listSrc.end(); ite++)
1066  {
1067  if ((*ite)->getID().toString() == idSrc)
1068  {
1069  ret = remSrc(*ite);
1070  break;
1071  }
1072  }
1073 
1074  return ret;
1075 }
1076 
1078 {
1079  TYProjet* pProjet = getProjet();
1080  if (pProjet)
1081  {
1082  pProjet->remTabElmtFromCalculs(_listSrc);
1083  }
1084 
1085  _listSrc.clear();
1086  setIsGeometryModified(true);
1087 }
1088 
1090 {
1091  assert(pSrc);
1092  TYTabUserSourcePonctuelleGeoNode::iterator ite;
1093 
1094  for (ite = _listSrc.begin(); ite != _listSrc.end(); ite++)
1095  {
1096  if (TYUserSourcePonctuelle::safeDownCast((*ite)->getElement()) == pSrc)
1097  {
1098  return (*ite);
1099  }
1100  }
1101 
1102  return NULL;
1103 }
1104 
1106 {
1107  // Ajoute au calcul courant s'il existe
1108  if (!getProjet() || !getProjet()->getCurrentCalcul())
1109  {
1110  return false;
1111  }
1112 
1113  if (_listSrc.size())
1114  {
1115  TYTabUserSourcePonctuelleGeoNode::iterator ite;
1116  for (ite = _listSrc.begin(); ite != _listSrc.end(); ite++)
1117  {
1118  getProjet()->getCurrentCalcul()->addToSelection((*ite)->getElement());
1119  }
1120  }
1121 
1122  if (_listMachine.size())
1123  {
1124  TYTabMachineGeoNode::iterator ite;
1125  for (ite = _listMachine.begin(); ite != _listMachine.end(); ite++)
1126  {
1127  getProjet()->getCurrentCalcul()->addToSelection((*ite)->getElement());
1128  }
1129  }
1130 
1131  if (_listBatiment.size())
1132  {
1133  TYTabBatimentGeoNode::iterator ite;
1134  for (ite = _listBatiment.begin(); ite != _listBatiment.end(); ite++)
1135  {
1136  getProjet()->getCurrentCalcul()->addToSelection((*ite)->getElement());
1137  }
1138  }
1139 
1140  if (_listResTrans.size())
1141  {
1142  TYTabReseauTransportGeoNode::iterator ite;
1143  for (ite = _listResTrans.begin(); ite != _listResTrans.end(); ite++)
1144  {
1145  getProjet()->getCurrentCalcul()->addToSelection((*ite)->getElement());
1146  }
1147  }
1148 #if WITH_NMPB
1149  if (_listRoute.size())
1150  {
1151  TYTabRouteGeoNode::iterator ite;
1152  for (ite = _listRoute.begin(); ite != _listRoute.end(); ite++)
1153  {
1154  getProjet()->getCurrentCalcul()->addToSelection((*ite)->getElement());
1155  }
1156  }
1157 #endif
1158  return true;
1159 }
1160 
1162 {
1163  LPTYProjet pProjet = getProjet();
1164  assert(pProjet);
1165  LPTYCalcul pCalcul = pProjet->getCurrentCalcul();
1166 
1167  // Ajoute au calcul courant s'il existe
1168  if (!pCalcul)
1169  {
1170  return false;
1171  }
1172 
1173  if (_listSrc.size())
1174  {
1175  TYTabUserSourcePonctuelleGeoNode::iterator ite;
1176  for (ite = _listSrc.begin(); ite != _listSrc.end(); ite++)
1177  {
1178  pCalcul->remToSelection((*ite)->getElement());
1179  }
1180  }
1181 
1182  if (_listMachine.size())
1183  {
1184  TYTabMachineGeoNode::iterator ite;
1185  for (ite = _listMachine.begin(); ite != _listMachine.end(); ite++)
1186  {
1187  pCalcul->remToSelection((*ite)->getElement());
1188  }
1189  }
1190 
1191  if (_listBatiment.size())
1192  {
1193  TYTabBatimentGeoNode::iterator ite;
1194  for (ite = _listBatiment.begin(); ite != _listBatiment.end(); ite++)
1195  {
1196  pCalcul->remToSelection((*ite)->getElement());
1197  }
1198  }
1199 
1200  if (_listResTrans.size())
1201  {
1202  TYTabReseauTransportGeoNode::iterator ite;
1203  for (ite = _listResTrans.begin(); ite != _listResTrans.end(); ite++)
1204  {
1205  pCalcul->remToSelection((*ite)->getElement());
1206  }
1207  }
1208 #if WITH_NMPB
1209  if (_listRoute.size())
1210  {
1211  TYTabRouteGeoNode::iterator ite;
1212  for (ite = _listRoute.begin(); ite != _listRoute.end(); ite++)
1213  {
1214  pCalcul->remToSelection((*ite)->getElement());
1215  }
1216  }
1217 #endif
1218  return true;
1219 }
1220 
1222 {
1223  if ((pNode == NULL) || (pNode->getElement() == NULL))
1224  {
1225  return false;
1226  }
1227 
1228  // Ajoute au calcul courant s'il existe
1229  if (getProjet() && getProjet()->getCurrentCalcul())
1230  {
1232  }
1233 
1234  return true;
1235 }
1236 
1237 bool TYInfrastructure::updateAcoustic(const TYCalcul* pCalcul, const bool& force) // force = false
1238 {
1239  bool ret = true;
1240  bool tmpRet = true;
1241  bool cancel = false;
1242  _tabUpdateNOk.clear();
1243 
1244 #if TY_USE_IHM
1245  TYProgressManager::setMessage("Mise a jour de l'acoustique des infrastructures");
1246  TYProgressManager::set(static_cast<int>(_listMachine.size()) + static_cast<int>(_listBatiment.size())
1247  #if WITH_NMPB
1248  + static_cast<int>(_listRoute.size())
1249  #endif
1250  + static_cast<int>(_listResTrans.size()));
1251 #endif // TY_USE_IHM
1252 
1253  // On recupere les tableaux associatifs decrivant l'etat des elements pour le calcul
1254  TYMapPtrElementInt mapElementRegime = pCalcul->getMapElementRegime();
1255  TYMapPtrElementBool mapElementEtat = pCalcul->getEmitAcVolNode();
1256 
1257  TYMapPtrElementInt::iterator itRegime;
1258 
1259  for (itRegime = mapElementRegime.begin(); itRegime != mapElementRegime.end(); itRegime++)
1260  {
1261 #if TY_USE_IHM
1262  TYProgressManager::step(cancel);
1263 #endif // TY_USE_IHM
1264  if (cancel)
1265  {
1266  ret = false;
1267  break;
1268  }
1269 
1270  TYElement* pElement = (*itRegime).first;
1271  int regimeNb = (*itRegime).second;
1272  bool isRayonnant = mapElementEtat[pElement];
1273 
1274  TYAcousticVolumeNode* pVolNode = dynamic_cast<TYAcousticVolumeNode*>(pElement);
1275 
1276  if (pVolNode != nullptr)
1277  {
1278  pVolNode->setIsRayonnant(isRayonnant, false);
1279 
1280  if (isRayonnant)
1281  {
1282  pVolNode->setCurRegime(regimeNb);
1283  tmpRet = pVolNode->updateAcoustic(force);
1284 
1285  if (!tmpRet)
1286  {
1287  _tabUpdateNOk.push_back((TYElement*)pVolNode);
1288  }
1289  ret &= tmpRet;
1290  }
1291  }
1292  else
1293  {
1294  TYAcousticLine* pAcLine = dynamic_cast<TYAcousticLine*>(pElement);
1295  if (pAcLine != nullptr)
1296  {
1297  pAcLine->setIsRayonnant(isRayonnant);
1298 
1299  if (isRayonnant)
1300  {
1301  tmpRet = pAcLine->updateAcoustic(force);
1302  pAcLine->setCurRegime(regimeNb);
1303 
1304  if (!tmpRet)
1305  {
1306  _tabUpdateNOk.push_back((TYElement*)pAcLine);
1307  }
1308  ret &= tmpRet;
1309  }
1310  }
1311  else if (pElement->isA("TYUserSourcePonctuelle"))
1312  {
1314  pSP->setIsRayonnant(isRayonnant);
1315 
1316  if (isRayonnant)
1317  {
1318  pSP->setCurrentRegime(regimeNb);
1319  }
1320  }
1321  }
1322  }
1323 
1324 #if TY_USE_IHM
1326 #endif // TY_USE_IHM
1327 
1328  if (ret)
1329  {
1330  setIsAcousticModified(false);
1331  }
1332 
1333  return ret;
1334 }
1335 
1336 void TYInfrastructure::getAllSrcs(const TYCalcul* pCalcul, TYMapElementTabSources& mapElementSrcs)
1337 {
1338  unsigned int i, j;
1339 
1340  if (updateAcoustic(pCalcul)) // On recupere les sources uniquement si l'ensemble des element est a jour
1341  {
1342  // Insertion de la liste des sources utilisateurs au tableau des sources retourne
1343  for (i = 0; i < _listSrc.size(); i++)
1344  {
1345  LPTYUserSourcePonctuelle pElement =
1347 
1348  if (pElement->isInCurrentCalcul() &&
1349  pElement->getIsRayonnant()) // Ajoute a la liste uniquement si utilise par calcul courant
1350  {
1352  tab.push_back(_listSrc[i]);
1353  mapElementSrcs[pElement] = tab;
1354  }
1355  }
1356 
1357  // Insertion de la liste des sources de machines au tableau retourne
1358  for (i = 0; i < _listMachine.size(); i++)
1359  {
1360  LPTYMachine pElement = TYMachine::safeDownCast(_listMachine[i]->getElement());
1361 
1362  if (pElement->isInCurrentCalcul() && pElement->getIsRayonnant())
1363  {
1364  TYTabSourcePonctuelleGeoNode tabTemp = pElement->getSrcs();
1366 
1367  // Concatenation des matrices
1368  OMatrix matrix = _listMachine[i]->getMatrix();
1369  for (j = 0; j < tabTemp.size(); j++)
1370  {
1371  tabTemp[j]->setMatrix(matrix * tabTemp[j]->getMatrix());
1372  tab.push_back(new TYSourcePonctuelleGeoNode(*tabTemp[j]));
1373  }
1374 
1375  mapElementSrcs[pElement] = tab;
1376  }
1377  }
1378 
1379  // Insertion de la liste des sources des bâtiments au tableau retourne
1380  for (i = 0; i < _listBatiment.size(); i++)
1381  {
1382  LPTYBatiment pElement = TYBatiment::safeDownCast(_listBatiment[i]->getElement());
1383  if (pElement->isInCurrentCalcul() && pElement->getIsRayonnant())
1384  {
1385  TYTabSourcePonctuelleGeoNode tabTemp = pElement->getSrcs();
1387 
1388  // Concatenation des matrices
1389  OMatrix matrix = _listBatiment[i]->getMatrix();
1390  for (j = 0; j < tabTemp.size(); j++)
1391  {
1392  tabTemp[j]->setMatrix(matrix * tabTemp[j]->getMatrix());
1393  tab.push_back(new TYSourcePonctuelleGeoNode(*tabTemp[j]));
1394  }
1395 
1396  mapElementSrcs[pElement] = tab;
1397  }
1398  }
1399 
1400  // Insertion de la liste des sources de reseau de transport au tableau retourne
1401  for (i = 0; i < _listResTrans.size(); i++)
1402  {
1404  if (pElement->isInCurrentCalcul() && pElement->getIsRayonnant())
1405  {
1406  TYTabSourcePonctuelleGeoNode tabTemp = pElement->getSrcs();
1408 
1409  // Changement de repere
1410  OMatrix matrix = _listResTrans[i]->getMatrix();
1411  for (j = 0; j < tabTemp.size(); j++)
1412  {
1413  tabTemp[j]->setMatrix(matrix * tabTemp[j]->getMatrix());
1414  tab.push_back(new TYSourcePonctuelleGeoNode(*tabTemp[j]));
1415  }
1416 
1417  mapElementSrcs[pElement] = tab;
1418  }
1419  }
1420 #if WITH_NMPB
1421  // Insertion de la liste des sources de routes au tableau retourne
1422  for (i = 0; i < _listRoute.size(); i++)
1423  {
1424  LPTYRoute pElement = TYRoute::safeDownCast(_listRoute[i]->getElement());
1425  if (pElement->isInCurrentCalcul() && pElement->getIsRayonnant())
1426  {
1427  TYTabSourcePonctuelleGeoNode tabTemp = pElement->getSrcs();
1429 
1430  // Changement de repere
1431  OMatrix matrix = _listRoute[i]->getMatrix();
1432 
1433  for (j = 0; j < tabTemp.size(); j++)
1434  {
1435  tabTemp[j]->setMatrix(matrix * tabTemp[j]->getMatrix());
1436  tab.push_back(new TYSourcePonctuelleGeoNode(*tabTemp[j]));
1437  }
1438 
1439  mapElementSrcs[pElement] = tab;
1440  }
1441  }
1442 #endif
1443  }
1444 }
1445 
1447 {
1448 #if WITH_NMPB
1449  _listRoute.clear();
1450 #endif
1451  _listResTrans.clear();
1452  _listBatiment.clear();
1453  _listSrc.clear();
1454 
1455  setIsGeometryModified(true);
1456 }
QDomDocument DOM_Document
Definition: QT2DOM.h:33
QDomElement DOM_Element
Definition: QT2DOM.h:30
TYGeometryNode TYBatimentGeoNode
Noeud geometrique de type TYBatiment.
Definition: TYBatiment.h:90
std::map< TYElement *, bool > TYMapPtrElementBool
Etat d'utilisation des elements (utilise par les calculs)
Definition: TYDefines.h:376
std::map< TYElement *, int > TYMapPtrElementInt
Tableau associatif des elements et d'un entier (utilise pour gerer les regimes)
Definition: TYDefines.h:379
std::list< TYUUID > TYListID
Collection d'identifiants.
Definition: TYDefines.h:331
std::vector< LPTYElement > LPTYElementArray
Definition: TYElement.h:345
Representation graphique d'une infrastructure (fichier header)
Outil IHM pour une infrastructure (fichier header)
TY_EXTENSION_INST(TYInfrastructure)
TY_EXT_GRAPHIC_INST(TYInfrastructure)
TYGeometryNode TYMachineGeoNode
Noeud geometrique de type TYMachine.
Definition: TYMachine.h:164
TYGeometryNode TYReseauTransportGeoNode
Noeud geometrique de type TYReseauTransport.
TYGeometryNode TYRouteGeoNode
Geometrical node of type TYRoute.
Definition: TYRoute.h:33
std::map< TYElement *, TYTabSourcePonctuelleGeoNode > TYMapElementTabSources
TYGeometryNode TYSourcePonctuelleGeoNode
Noeud geometrique de type TYSourcePonctuelle.
std::vector< LPTYSourcePonctuelleGeoNode > TYTabSourcePonctuelleGeoNode
Collection de noeuds geometriques de type TYSourcePonctuelle.
TYGeometryNode TYUserSourcePonctuelleGeoNode
Noeud geometrique de type TYSourcePonctuelle.
The 4x4 matrix class.
Definition: 3d.h:625
static OMessageManager * get()
Definition: logging.cpp:108
virtual void info(const char *message,...)
Definition: logging.cpp:143
virtual const char * getClassName() const
Definition: TYElement.h:249
static OPrototype * safeDownCast(OPrototype *pObject)
Definition: TYElement.cpp:71
bool isA(const char *className) const
Definition: TYElement.cpp:65
void setIsRayonnant(const bool &rayonnant)
virtual void setCurRegime(int regimeNumber)
virtual bool updateAcoustic(const bool &force=false)
virtual bool updateAcoustic(const bool &force=false)
virtual void setIsRayonnant(bool rayonnant=true, bool recursif=true)
virtual void setCurRegime(int regime)
virtual TYTabSourcePonctuelleGeoNode getSrcs() const
Definition: TYBatiment.cpp:122
Calculation program.
Definition: TYCalcul.h:50
bool remToSelection(TYUUID id)
Removes the item from the selection of this Calculation.
Definition: TYCalcul.cpp:961
TYMapPtrElementInt & getMapElementRegime()
Get from the regime.
Definition: TYCalcul.h:323
TYMapPtrElementBool & getEmitAcVolNode()
Get array containing the state of each volumeNode in transmission.
Definition: TYCalcul.h:304
bool addToSelection(TYUUID id)
Adds the item to the selection of this Calculation.
Definition: TYCalcul.cpp:872
virtual bool isInCurrentCalcul()
Definition: TYElement.h:541
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
TYElement * _pParent
Reference sur l'element parent.
Definition: TYElement.h:969
virtual void updateCurrentCalcul(TYListID &listID, bool recursif=true)
Definition: TYElement.cpp:460
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
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
bool remSrc(const LPTYUserSourcePonctuelle pSrc)
virtual void updateCurrentCalcul(TYListID &listID, bool recursif=true)
virtual int fromXML(DOM_Element domElement)
TYTabMachineGeoNode _listMachine
Liste des machines.
bool operator==(const TYInfrastructure &other) const
Operateur ==.
LPTYMachineGeoNode findMachine(const LPTYMachine pMachine)
TYProjet * getProjet()
TYTabReseauTransportGeoNode _listResTrans
Liste des reseaux de transport.
virtual void reparent()
std::vector< LPTYElement > _tabUpdateNOk
Liste des elements dont l'update a echoue.
TYInfrastructure & operator=(const TYInfrastructure &other)
Operateur =.
bool operator!=(const TYInfrastructure &other) const
Operateur !=.
TYTabBatimentGeoNode _listBatiment
Liste des batiments.
virtual std::string toString() const
virtual DOM_Element toXML(DOM_Element &domElement)
bool addBatiment(LPTYBatimentGeoNode pBatimentGeoNode)
virtual void getChilds(LPTYElementArray &childs, bool recursif=true)
bool addMachine(LPTYMachineGeoNode pMachineGeoNode)
void concatInfra(const TYInfrastructure *infra)
virtual ~TYInfrastructure()
LPTYBatimentGeoNode findBatiment(const LPTYBatiment pBatiment)
bool addSrc(LPTYUserSourcePonctuelle pSrc)
bool remResTrans(const LPTYReseauTransportGeoNode pResTransGeoNode)
bool remMachine(const LPTYMachine pMachine)
LPTYUserSourcePonctuelleGeoNode findSrc(const LPTYUserSourcePonctuelle pSrc)
bool remBatiment(const LPTYBatimentGeoNode pBatimentGeoNode)
bool updateAcoustic(const TYCalcul *pCalcul, const bool &force=false)
TYTabUserSourcePonctuelleGeoNode _listSrc
Liste des sources ponctuelles.
LPTYReseauTransportGeoNode findResTrans(const LPTYReseauTransport pResTrans)
void getAllSrcs(const TYCalcul *pCalcul, TYMapElementTabSources &mapElementSrcs)
bool addResTrans(LPTYReseauTransportGeoNode pResTransGeoNode)
virtual TYTabSourcePonctuelleGeoNode getSrcs() const
Definition: TYMachine.cpp:145
QString generateName(const char *classname)
Retourne le nom de la classe associe a un nombre.
static TYNameManager * get()
Retourne l'instance singleton.
static void set(int totalSteps, int stepSize=1)
static void stepToEnd()
classe de definition d'un projet.
Definition: TYProjet.h:45
void remElmtFromCalculs(TYElement *pElement)
Supprime un element de tous les calculs.
Definition: TYProjet.cpp:689
void remTabElmtFromCalculs(vector< LPTYGeometryNode > tabGeoNode)
Supprime un ensemble d'elements des calculs.
Definition: TYProjet.cpp:697
LPTYCalcul getCurrentCalcul()
Set/Get du pointeur du Calcul courant.
Definition: TYProjet.h:426
TYProjet * getProjet()
Accesseurs.
Definition: TYSiteNode.h:106
void setCurrentRegime(const int &regimeNumber)
void setIsRayonnant(const bool &rayonnant)