55 _listRoute = other._listRoute;
66 if (TYElement::operator!=(other))
83 if (!(_listRoute == other._listRoute))
114 for (i = 0; i < pOtherInfra->_listRoute.size(); i++)
117 pRouteGeoNode->deepCopy(pOtherInfra->_listRoute[i], copyId);
118 pRouteGeoNode->getElement()->setParent(
this);
119 pRouteGeoNode->setParent(
this);
120 addRoute(pRouteGeoNode);
127 pResTransGeoNode->deepCopy(pOtherInfra->
_listResTrans[i], copyId);
128 pResTransGeoNode->getElement()->setParent(
this);
129 pResTransGeoNode->setParent(
this);
137 pBatGeoNode->deepCopy(pOtherInfra->
_listBatiment[i], copyId);
138 pBatGeoNode->getElement()->setParent(
this);
139 pBatGeoNode->setParent(
this);
154 for (i = 0; i < pOtherInfra->
_listSrc.size(); i++)
157 pSrcGeoNode->deepCopy(pOtherInfra->
_listSrc[i], copyId);
158 pSrcGeoNode->getElement()->setParent(
this);
159 pSrcGeoNode->setParent(
this);
168 return "TYInfrastructure";
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);
190 for (i = 0; i < _listRoute.size(); i++)
193 _listRoute[i]->toXML(listRouteNode);
225 for (i = 0; i <
_listSrc.size(); i++)
248 unsigned int i = 0, j = 0;
251 QDomNodeList childs = domElement.childNodes();
252 unsigned int childcount = childs.length();
253 for (i = 0; i < childcount; i++)
255 elemCur = childs.item(i).toElement();
259 if (elemCur.nodeName() ==
"ListRoute")
261 QDomNodeList childs2 = elemCur.childNodes();
262 for (j = 0; j < childs2.length(); j++)
264 DOM_Element elemCur2 = childs2.item(j).toElement();
265 if (pRouteGeoNode->callFromXMLIfEqual(elemCur2))
267 addRoute(pRouteGeoNode);
273 if (elemCur.nodeName() ==
"ListResTrans")
275 QDomNodeList childs2 = elemCur.childNodes();
277 for (j = 0; j < childs2.length(); j++)
279 DOM_Element elemCur2 = childs2.item(j).toElement();
280 if (pResTransGeoNode->callFromXMLIfEqual(elemCur2))
287 else if (elemCur.nodeName() ==
"ListBatiment")
289 QDomNodeList childs2 = elemCur.childNodes();
290 unsigned int childcount = childs2.length();
291 for (j = 0; j < childcount; j++)
293 DOM_Element elemCur2 = childs2.item(j).toElement();
295 if (pBatGeoNode->callFromXMLIfEqual(elemCur2))
302 else if (elemCur.nodeName() ==
"ListMachine")
304 QDomNodeList childs2 = elemCur.childNodes();
305 unsigned int childcount = childs2.length();
306 for (j = 0; j < childcount; j++)
308 DOM_Element elemCur2 = childs2.item(j).toElement();
318 else if (elemCur.nodeName() ==
"ListSource")
320 QDomNodeList childs2 = elemCur.childNodes();
322 for (j = 0; j < childs2.length(); j++)
324 DOM_Element elemCur2 = childs2.item(j).toElement();
326 if (pSrcGeoNode->callFromXMLIfEqual(elemCur2))
328 if (pSrcGeoNode && pSrcGeoNode->getElement()->isA(
"TYSourcePonctuelle"))
334 pSrcGeoNode->setElement((
TYElement*)pUSrc);
352 for (i = 0; i < _listRoute.size(); i++)
354 childs.push_back(_listRoute[i]);
355 childs.push_back(_listRoute[i]->getElement());
376 for (i = 0; i <
_listSrc.size(); i++)
379 childs.push_back(
_listSrc[i]->getElement());
385 for (i = 0; i < _listRoute.size(); i++)
387 _listRoute[i]->getChilds(childs, recursif);
406 for (i = 0; i <
_listSrc.size(); i++)
408 _listSrc[i]->getChilds(childs, recursif);
420 for (
int i = 0; i < childs.size(); i++)
422 childs[i]->updateCurrentCalcul(listID, recursif);
435 for (i = 0; i < _listRoute.size(); i++)
437 _listRoute[i]->setParent(
this);
438 _listRoute[i]->getElement()->setParent(
this);
460 for (i = 0; i <
_listSrc.size(); i++)
463 _listSrc[i]->getElement()->setParent(
this);
497 for (i = 0; i < infra->_listRoute.size(); ++i)
499 addRoute(infra->_listRoute[i]);
518 for (i = 0; i < infra->
_listSrc.size(); ++i)
527 assert(pRouteGeoNode);
528 assert(pRouteGeoNode->getElement());
530 pRouteGeoNode->setParent(
this);
531 pRouteGeoNode->getElement()->setParent(
this);
533 _listRoute.push_back(pRouteGeoNode);
543 bool TYInfrastructure::addRoute(LPTYRoute pRoute)
550 assert(pRouteGeoNode);
553 TYTabRouteGeoNode::iterator ite;
557 for (ite = _listRoute.begin(); ite != _listRoute.end(); ite++)
559 if ((*ite) == pRouteGeoNode)
567 _listRoute.erase(ite);
578 bool TYInfrastructure::remRoute(
const LPTYRoute pRoute)
582 TYTabRouteGeoNode::iterator ite;
584 for (ite = _listRoute.begin(); ite != _listRoute.end(); ite++)
588 ret = remRoute(*ite);
596 bool TYInfrastructure::remRoute(QString idRoute)
599 TYTabRouteGeoNode::iterator ite;
601 for (ite = _listRoute.begin(); ite != _listRoute.end(); ite++)
603 if ((*ite)->getElement()->getID().toString() == idRoute)
605 ret = remRoute(*ite);
613 void TYInfrastructure::remAllRoute()
629 TYTabRouteGeoNode::iterator ite;
631 for (ite = _listRoute.begin(); ite != _listRoute.end(); ite++)
644 assert(pResTransGeoNode);
650 pResTransGeoNode->setParent(
this);
651 pReseau->setParent(
this);
670 assert(pResTransGeoNode);
672 TYTabReseauTransportGeoNode::iterator ite;
677 if ((*ite) == pResTransGeoNode)
699 TYTabReseauTransportGeoNode::iterator ite;
716 TYTabReseauTransportGeoNode::iterator ite;
745 TYTabReseauTransportGeoNode::iterator ite;
760 assert(pMachineGeoNode);
786 assert(pMachineGeoNode);
788 TYTabMachineGeoNode::iterator ite;
793 if ((*ite) == pMachineGeoNode)
815 TYTabMachineGeoNode::iterator ite;
832 TYTabMachineGeoNode::iterator ite;
861 TYTabMachineGeoNode::iterator ite;
876 assert(pBatimentGeoNode);
882 pBatimentGeoNode->setParent(
this);
902 assert(pBatimentGeoNode);
905 TYTabBatimentGeoNode::iterator ite;
910 if ((*ite) == pBatimentGeoNode)
931 TYTabBatimentGeoNode::iterator ite;
948 TYTabBatimentGeoNode::iterator ite;
977 TYTabBatimentGeoNode::iterator ite;
998 pSrcGeoNode->setParent(
this);
1018 assert(pSrcGeoNode);
1020 TYTabUserSourcePonctuelleGeoNode::iterator ite;
1025 if ((*ite) == pSrcGeoNode)
1046 TYTabUserSourcePonctuelleGeoNode::iterator ite;
1063 TYTabUserSourcePonctuelleGeoNode::iterator ite;
1067 if ((*ite)->getID().toString() == idSrc)
1092 TYTabUserSourcePonctuelleGeoNode::iterator ite;
1115 TYTabUserSourcePonctuelleGeoNode::iterator ite;
1124 TYTabMachineGeoNode::iterator ite;
1133 TYTabBatimentGeoNode::iterator ite;
1142 TYTabReseauTransportGeoNode::iterator ite;
1149 if (_listRoute.size())
1151 TYTabRouteGeoNode::iterator ite;
1152 for (ite = _listRoute.begin(); ite != _listRoute.end(); ite++)
1175 TYTabUserSourcePonctuelleGeoNode::iterator ite;
1184 TYTabMachineGeoNode::iterator ite;
1193 TYTabBatimentGeoNode::iterator ite;
1202 TYTabReseauTransportGeoNode::iterator ite;
1209 if (_listRoute.size())
1211 TYTabRouteGeoNode::iterator ite;
1212 for (ite = _listRoute.begin(); ite != _listRoute.end(); ite++)
1223 if ((pNode == NULL) || (pNode->
getElement() == NULL))
1241 bool cancel =
false;
1245 TYProgressManager::setMessage(
"Mise a jour de l'acoustique des infrastructures");
1248 +
static_cast<int>(_listRoute.size())
1257 TYMapPtrElementInt::iterator itRegime;
1259 for (itRegime = mapElementRegime.begin(); itRegime != mapElementRegime.end(); itRegime++)
1270 TYElement* pElement = (*itRegime).first;
1271 int regimeNb = (*itRegime).second;
1272 bool isRayonnant = mapElementEtat[pElement];
1276 if (pVolNode !=
nullptr)
1295 if (pAcLine !=
nullptr)
1311 else if (pElement->
isA(
"TYUserSourcePonctuelle"))
1343 for (i = 0; i <
_listSrc.size(); i++)
1353 mapElementSrcs[pElement] = tab;
1369 for (j = 0; j < tabTemp.size(); j++)
1371 tabTemp[j]->setMatrix(matrix * tabTemp[j]->getMatrix());
1375 mapElementSrcs[pElement] = tab;
1390 for (j = 0; j < tabTemp.size(); j++)
1392 tabTemp[j]->setMatrix(matrix * tabTemp[j]->getMatrix());
1396 mapElementSrcs[pElement] = tab;
1404 if (pElement->isInCurrentCalcul() && pElement->getIsRayonnant())
1411 for (j = 0; j < tabTemp.size(); j++)
1413 tabTemp[j]->setMatrix(matrix * tabTemp[j]->getMatrix());
1417 mapElementSrcs[pElement] = tab;
1422 for (i = 0; i < _listRoute.size(); i++)
1425 if (pElement->isInCurrentCalcul() && pElement->getIsRayonnant())
1431 OMatrix matrix = _listRoute[i]->getMatrix();
1433 for (j = 0; j < tabTemp.size(); j++)
1435 tabTemp[j]->setMatrix(matrix * tabTemp[j]->getMatrix());
1439 mapElementSrcs[pElement] = tab;
QDomDocument DOM_Document
TYGeometryNode TYBatimentGeoNode
Noeud geometrique de type TYBatiment.
std::map< TYElement *, bool > TYMapPtrElementBool
Etat d'utilisation des elements (utilise par les calculs)
std::map< TYElement *, int > TYMapPtrElementInt
Tableau associatif des elements et d'un entier (utilise pour gerer les regimes)
std::list< TYUUID > TYListID
Collection d'identifiants.
std::vector< LPTYElement > LPTYElementArray
Representation graphique d'une infrastructure (fichier header)
TY_EXTENSION_INST(TYInfrastructure)
TY_EXT_GRAPHIC_INST(TYInfrastructure)
TYGeometryNode TYMachineGeoNode
Noeud geometrique de type TYMachine.
TYGeometryNode TYReseauTransportGeoNode
Noeud geometrique de type TYReseauTransport.
TYGeometryNode TYRouteGeoNode
Geometrical node of type TYRoute.
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.
static OMessageManager * get()
virtual void info(const char *message,...)
virtual const char * getClassName() const
static OPrototype * safeDownCast(OPrototype *pObject)
bool isA(const char *className) const
void setIsRayonnant(const bool &rayonnant)
virtual void setCurRegime(int regimeNumber)
virtual bool updateAcoustic(const bool &force=false)
size_t getNbChild() const
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
bool remToSelection(TYUUID id)
Removes the item from the selection of this Calculation.
TYMapPtrElementInt & getMapElementRegime()
Get from the regime.
TYMapPtrElementBool & getEmitAcVolNode()
Get array containing the state of each volumeNode in transmission.
bool addToSelection(TYUUID id)
Adds the item to the selection of this Calculation.
virtual bool isInCurrentCalcul()
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
virtual DOM_Element toXML(DOM_Element &domElement)
QString _name
Nom courant de l'element.
TYElement & operator=(const TYElement &other)
bool callFromXMLIfEqual(DOM_Element &domElement, int *pRetVal=NULL)
TYElement * _pParent
Reference sur l'element parent.
virtual void updateCurrentCalcul(TYListID &listID, bool recursif=true)
virtual void getChilds(LPTYElementArray &childs, bool recursif=true)
void setParent(TYElement *pParent)
virtual int fromXML(DOM_Element domElement)
virtual void setIsAcousticModified(bool isModified)
virtual void setIsGeometryModified(bool isModified)
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)
TYTabReseauTransportGeoNode _listResTrans
Liste des reseaux de transport.
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
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)
classe de definition d'un projet.
void remElmtFromCalculs(TYElement *pElement)
Supprime un element de tous les calculs.
void remTabElmtFromCalculs(vector< LPTYGeometryNode > tabGeoNode)
Supprime un ensemble d'elements des calculs.
LPTYCalcul getCurrentCalcul()
Set/Get du pointeur du Calcul courant.
TYProjet * getProjet()
Accesseurs.
void setCurrentRegime(const int ®imeNumber)
void setIsRayonnant(const bool &rayonnant)