Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYSourceLineicGraphic.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012-2024> <EDF-DTG> <FRANCE>
3  * This file is part of Code_TYMPAN (R).
4  * Code_TYMPAN (R) is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * Code_TYMPAN (R) is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  * You should have received a copy of the GNU General Public License along
13  * with Code_TYMPAN (R). If not, see <https://www.gnu.org/licenses/>.
14  */
15 
24 
25 #include "TYSourceLineicGraphic.h"
27 
29 
31 {
32  _srcVisible = false;
33 }
34 
35 void TYSourceLineicGraphic::update(bool force /*=false*/)
36 {
38 }
39 
40 void TYSourceLineicGraphic::getChilds(TYListPtrTYElementGraphic& childs, bool recursif /*=true*/)
41 {
42  unsigned int i = 0;
43  LPTYSourcePonctuelle pSrcPonct = NULL;
44 
45  for (i = 0; i < getElement()->getNbSrcs(); i++)
46  {
47  // On recupere la source
48  pSrcPonct = getElement()->getSrc(i);
49  TYElementGraphic* pTYElementGraphic = pSrcPonct->getGraphicObject();
50  childs.push_back(pTYElementGraphic);
51  if (recursif)
52  {
53  pTYElementGraphic->getChilds(childs, recursif);
54  }
55  }
56 }
57 
59 {
61 
62  unsigned int i = 0;
63  LPTYSourcePonctuelle pSrcPonct = NULL;
64 
65  for (i = 0; i < getElement()->getNbSrcs(); i++)
66  {
67  // On recupere la source
68  pSrcPonct = getElement()->getSrc(i);
69  boundingBox.Enlarge(pSrcPonct->getGraphicObject()->boundingBox());
70  }
71  return boundingBox;
72 }
73 
75 {
76  unsigned int i = 0;
77  LPTYSourcePonctuelle pSrcPonct = NULL;
78  if (_visible)
79  {
80  for (i = 0; i < getElement()->getNbSrcs(); i++)
81  {
82  // On recupere la source
83  pSrcPonct = getElement()->getSrc(i);
84  pSrcPonct->getGraphicObject()->display(renderContext);
85  }
86  }
87 }
list< TYElementGraphic * > TYListPtrTYElementGraphic
List de pointeur de TYElement.
Contexte de rendu utilisé par les fonctions d'affichage.
Representation graphique d'une source lineique (fichier header)
The box class.
Definition: 3d.h:1346
virtual void Enlarge(const OPoint3D &pt)
Enlarge the box with the point if the point is outside the box.
Definition: 3d.cpp:1614
classe graphique pour un element de base
bool _visible
Inique si l'element est visible.
OBox boundingBox() const
virtual void update(bool force=false)
virtual void getChilds(TYListPtrTYElementGraphic &childs, bool recursif=true)
virtual void update(bool force=false)
Mise a jour.
virtual void display(TYRenderContext &renderContext)
bool _srcVisible
Indique si cette instance est visible.
virtual OBox computeBoundingBox() const
calcul de la boite englobante
virtual void getChilds(TYListPtrTYElementGraphic &childs, bool recursif=true)
static bool _gVisible
Indique si toutes les instances sont visibles.
TYSourceLineicGraphic(TYSourceLineic *pElement)