Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYInfrastructure.h
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 #ifndef __TY_INFRASTRUCTURE__
21 #define __TY_INFRASTRUCTURE__
22 
25 #if WITH_NMPB
27 #endif
29 
34 {
38 
39  // Methodes
40 public:
48  TYInfrastructure(const TYInfrastructure& other);
52  virtual ~TYInfrastructure();
53 
57  bool operator==(const TYInfrastructure& other) const;
59  bool operator!=(const TYInfrastructure& other) const;
60 
69  virtual bool deepCopy(const TYElement* pOther, bool copyId = true, bool pUseCopyTag = false);
70 
71  virtual std::string toString() const;
72 
73  virtual DOM_Element toXML(DOM_Element& domElement);
74  virtual int fromXML(DOM_Element domElement);
75 
76  virtual void getChilds(LPTYElementArray& childs, bool recursif = true);
77 
79 
84 
93  virtual void updateCurrentCalcul(TYListID& listID, bool recursif = true);
94 
100 
104  virtual void reparent();
105 
109  void purge();
110 
111 #if WITH_NMPB
115  TYTabRouteGeoNode& getListRoute()
116  {
117  return _listRoute;
118  }
119 
123  const TYTabRouteGeoNode& getListRoute() const
124  {
125  return _listRoute;
126  }
127 
131  void setListRoute(const TYTabRouteGeoNode& list)
132  {
133  _listRoute = list;
134  }
135 #endif
136 
140  void concatInfra(const TYInfrastructure* infra);
141 
142 #if WITH_NMPB
146  bool addRoute(LPTYRouteGeoNode pRouteGeoNode);
147 
151  bool addRoute(LPTYRoute pRoute);
152 
156  bool remRoute(const LPTYRouteGeoNode pRouteGeoNode);
157 
161  bool remRoute(const LPTYRoute pRoute);
162 
167  bool remRoute(QString idRoute);
168 
172  void remAllRoute();
173 
177  LPTYRoute getRoute(int index)
178  {
179  return TYRoute::safeDownCast(_listRoute.at(index)->getElement());
180  }
181 
189  LPTYRouteGeoNode findRoute(const LPTYRoute pRoute);
190 #endif
191 
196  {
197  return _listResTrans;
198  }
199 
204  {
205  return _listResTrans;
206  }
207 
212  {
213  _listResTrans = list;
214  }
215 
219  bool addResTrans(LPTYReseauTransportGeoNode pResTransGeoNode);
220 
224  bool addResTrans(LPTYReseauTransport pResTrans);
225 
229  bool remResTrans(const LPTYReseauTransportGeoNode pResTransGeoNode);
230 
234  bool remResTrans(const LPTYReseauTransport pResTrans);
235 
240  bool remResTrans(QString idResTrans);
241 
245  void remAllResTrans();
246 
251  {
252  return TYReseauTransport::safeDownCast(_listResTrans.at(index)->getElement());
253  }
254 
263 
268  {
269  return _listBatiment;
270  }
271 
276  {
277  return _listBatiment;
278  }
279 
284  {
285  _listBatiment = list;
286  }
287 
291  bool addBatiment(LPTYBatimentGeoNode pBatimentGeoNode);
292 
296  bool addBatiment(LPTYBatiment pBatiment, const TYRepere& pos);
297 
301  bool remBatiment(const LPTYBatimentGeoNode pBatimentGeoNode);
302 
306  bool remBatiment(const LPTYBatiment pBatiment);
307 
312  bool remBatiment(QString idBatiment);
313 
317  void remAllBatiment();
318 
323  {
324  return _listBatiment.at(index);
325  }
326 
335 
340  {
341  return _listMachine;
342  }
343 
348  {
349  return _listMachine;
350  }
351 
356  {
357  _listMachine = list;
358  }
359 
363  bool addMachine(LPTYMachineGeoNode pMachineGeoNode);
364 
368  bool addMachine(LPTYMachine pMachine, const TYRepere& pos);
369 
373  bool remMachine(const LPTYMachine pMachine);
374 
378  bool remMachine(const LPTYMachineGeoNode pMachineGeoNode);
379 
384  bool remMachine(QString idMachine);
385 
389  void remAllMachine();
390 
395  {
396  return _listMachine.at(index);
397  }
398 
407 
412  {
413  return _listSrc;
414  }
415 
420  {
421  return _listSrc;
422  }
423 
428  {
429  _listSrc = list;
430  }
431 
435  bool addSrc(LPTYUserSourcePonctuelle pSrc);
436 
440  bool addSrc(LPTYUserSourcePonctuelleGeoNode pSrcGeoNode);
441 
445  bool remSrc(const LPTYUserSourcePonctuelle pSrc);
446 
450  bool remSrc(const LPTYUserSourcePonctuelleGeoNode pSrcGeoNode);
451 
456  bool remSrc(QString idSrc);
457 
461  void remAllSrc();
462 
467  {
468  return _listSrc.at(index);
469  }
470 
479 
483  void getAllSrcs(const TYCalcul* pCalcul, TYMapElementTabSources& mapElementSrcs);
484 
488  bool updateAcoustic(const TYCalcul* pCalcul, const bool& force = false);
489 
493  void clean();
494 
498  std::vector<LPTYElement> getTabElemNOk()
499  {
500  return _tabUpdateNOk;
501  }
502 
506  bool addToCalcul(TYGeometryNode* pNode);
507 
511  bool addToCalcul();
512 
516  bool remFromCalcul();
517 
518  // Membres
519 protected:
520 #if WITH_NMPB
522  TYTabRouteGeoNode _listRoute;
523 #endif
526 
529 
532 
535 
537  std::vector<LPTYElement> _tabUpdateNOk;
538 };
539 
545 typedef std::vector<LPTYInfrastructureGeoNode> TYTabInfrastructureGeoNode;
546 
547 #endif // __TY_INFRASTRUCTURE__
QDomElement DOM_Element
Definition: QT2DOM.h:30
std::vector< LPTYBatimentGeoNode > TYTabBatimentGeoNode
Collection de noeuds geometriques de type TYBatiment.
Definition: TYBatiment.h:94
std::list< TYUUID > TYListID
Collection d'identifiants.
Definition: TYDefines.h:331
#define TY_EXT_GRAPHIC_DECL_ONLY(classname)
Definition: TYElement.h:432
std::vector< LPTYElement > LPTYElementArray
Definition: TYElement.h:345
#define OPROTODECL(classname)
Definition: TYElement.h:65
#define TY_EXTENSION_DECL_ONLY(classname)
Definition: TYElement.h:386
TYGeometryNode TYInfrastructureGeoNode
Noeud geometrique de type TYInfrastructure.
std::vector< LPTYInfrastructureGeoNode > TYTabInfrastructureGeoNode
Collection de noeuds geometriques de type TYInfrastructure.
SmartPtr< TYInfrastructureGeoNode > LPTYInfrastructureGeoNode
Smart Pointer sur TYInfrastructureGeoNode.
std::vector< LPTYMachineGeoNode > TYTabMachineGeoNode
Collection de noeuds geometriques de type TYMachine.
Definition: TYMachine.h:168
std::vector< LPTYReseauTransportGeoNode > TYTabReseauTransportGeoNode
Collection de noeuds geometriques de type TYReseauTransport.
std::vector< LPTYRouteGeoNode > TYTabRouteGeoNode
Collection of geometrical nodes of type TYRoute.
Definition: TYRoute.h:37
std::map< TYElement *, TYTabSourcePonctuelleGeoNode > TYMapElementTabSources
std::vector< LPTYUserSourcePonctuelleGeoNode > TYTabUserSourcePonctuelleGeoNode
Collection de noeuds geometriques de type TYSourcePonctuelle.
static OPrototype * safeDownCast(OPrototype *pObject)
Definition: TYElement.cpp:71
Calculation program.
Definition: TYCalcul.h:50
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
TYTabBatimentGeoNode & getListBatiment()
void setListMachine(const TYTabMachineGeoNode &list)
void setSrcs(const TYTabUserSourcePonctuelleGeoNode &list)
bool remSrc(const LPTYUserSourcePonctuelle pSrc)
std::vector< LPTYElement > getTabElemNOk()
virtual void updateCurrentCalcul(TYListID &listID, bool recursif=true)
virtual int fromXML(DOM_Element domElement)
LPTYUserSourcePonctuelleGeoNode getSrc(int index)
TYTabMachineGeoNode _listMachine
Liste des machines.
bool operator==(const TYInfrastructure &other) const
Operateur ==.
void setListBatiment(const TYTabBatimentGeoNode &list)
LPTYMachineGeoNode findMachine(const LPTYMachine pMachine)
TYProjet * getProjet()
LPTYMachineGeoNode getMachine(int index)
TYTabReseauTransportGeoNode _listResTrans
Liste des reseaux de transport.
virtual void reparent()
const TYTabBatimentGeoNode & getListBatiment() const
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.
LPTYReseauTransport getResTrans(int index)
const TYTabUserSourcePonctuelleGeoNode & getSrcs() const
virtual std::string toString() const
const TYTabMachineGeoNode & getListMachine() const
TYTabUserSourcePonctuelleGeoNode & getSrcs()
LPTYBatimentGeoNode getBatiment(int index)
TYTabReseauTransportGeoNode & getListResTrans()
virtual DOM_Element toXML(DOM_Element &domElement)
void setListResTrans(const TYTabReseauTransportGeoNode &list)
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)
const TYTabReseauTransportGeoNode & getListResTrans() const
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.
TYTabMachineGeoNode & getListMachine()
LPTYReseauTransportGeoNode findResTrans(const LPTYReseauTransport pResTrans)
void getAllSrcs(const TYCalcul *pCalcul, TYMapElementTabSources &mapElementSrcs)
bool addResTrans(LPTYReseauTransportGeoNode pResTransGeoNode)
classe de definition d'un projet.
Definition: TYProjet.h:45