Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYSourceSurfacicGraphic.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 
27 
29 
30 void TYSourceSurfacicGraphic::update(bool force) //=false
31 {
33 }
34 
35 void TYSourceSurfacicGraphic::getChilds(TYListPtrTYElementGraphic& childs, bool recursif /*=true*/)
36 {
37  unsigned int i = 0;
38  LPTYSourcePonctuelle pSrcPonct = NULL;
39 
40  for (i = 0; i < getElement()->getNbSrcs(); i++)
41  {
42  // On recupere la source
43  pSrcPonct = getElement()->getSrc(i);
44  TYElementGraphic* pTYElementGraphic = pSrcPonct->getGraphicObject();
45  childs.push_back(pTYElementGraphic);
46  if (recursif)
47  {
48  pTYElementGraphic->getChilds(childs, recursif);
49  }
50  }
51 }
52 
54 {
56 
57  unsigned int i = 0;
58  LPTYSourcePonctuelle pSrcPonct = NULL;
59 
60  for (i = 0; i < getElement()->getNbSrcs(); i++)
61  {
62  // On recupere la source
63  pSrcPonct = getElement()->getSrc(i);
64  boundingBox.Enlarge(pSrcPonct->getGraphicObject()->boundingBox());
65  }
66  return boundingBox;
67 }
68 
70 {
71  unsigned int i = 0;
72  LPTYSourcePonctuelle pSrcPonct = NULL;
73 
74  if (_visible && renderContext.showDistributedSources)
75  {
76  for (i = 0; i < getElement()->getNbSrcs(); i++)
77  {
78  // On recupere la source
79  pSrcPonct = getElement()->getSrc(i);
80  pSrcPonct->getGraphicObject()->display(renderContext);
81  }
82  }
83 }
list< TYElementGraphic * > TYListPtrTYElementGraphic
List de pointeur de TYElement.
Contexte de rendu utilisé par les fonctions d'affichage.
Representation graphique d'une surface de source (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)
TYSourceSurfacicGraphic(TYSourceSurfacic *pElement)
virtual void display(TYRenderContext &renderContext)
virtual void getChilds(TYListPtrTYElementGraphic &childs, bool recursif=true)
virtual OBox computeBoundingBox() const