Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYAcousticLineGraphic.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 
21 #include <boost/foreach.hpp>
22 
25 #include "TYAcousticLineGraphic.h"
26 #include "gui/gl/TYRenderContext.h"
27 #include <QtOpenGL>
28 
30 {
32  _pPolyLineGraphic->setElement(pElement);
33 }
34 
35 void TYAcousticLineGraphic::update(bool force /*=false*/)
36 {
38 }
39 
40 void TYAcousticLineGraphic::getChilds(TYListPtrTYElementGraphic& childs, bool recursif /*=true*/)
41 {
42  TYElementGraphic* pTYElementGraphic = _pPolyLineGraphic;
43  childs.push_back(pTYElementGraphic);
44  if (recursif)
45  {
46  pTYElementGraphic->getChilds(childs, recursif);
47  }
48 }
49 
51 {
53 }
54 
56 {
57  if (!getElement()->isInCurrentCalcul())
58  {
59  return;
60  }
61 
63 
65  tabpts.clear();
66  tabpts.reserve(getElement()->getTabPoint().size()); //->getSrcLineic()->getNbSrcs());
67 
68  BOOST_FOREACH (TYPoint pt, getElement()->getTabPoint()) //->getSrcLineic()->getSrcs())
69  {
70  tabpts.push_back(pt);
71  }
72 
74 
75  if (renderContext.type == TYRenderType::Picking)
76  {
77  TYPickingTable::addElement(getElement());
78  glPushName((GLuint)(TYPickingTable::getIndex()));
79  }
80 
81  glColor4fv(getElement()->getColor());
82  _pPolyLineGraphic->display(renderContext);
83 
84  if (renderContext.type == TYRenderType::Picking)
85  {
86  glPopName();
87  }
88 }
Representation graphique d'une ligne acoustique (fichier header)
std::vector< TYPoint > TYTabPoint
Collection de TYPoint.
Definition: TYDefines.h:340
list< TYElementGraphic * > TYListPtrTYElementGraphic
List de pointeur de TYElement.
Gestion de la table de correspondance indice/element pour le picking (fichier header)
Contexte de rendu utilisé par les fonctions d'affichage.
@ Picking
The current render is only done for picking purpose.
The box class.
Definition: 3d.h:1346
virtual OBox computeBoundingBox() const
virtual void getChilds(TYListPtrTYElementGraphic &childs, bool recursif=true)
virtual void display(TYRenderContext &renderContext)
TYAcousticLineGraphic(TYAcousticLine *pElement)
LPTYPolyLineGraphic _pPolyLineGraphic
virtual void update(bool force=false)
classe graphique pour un element de base
OBox boundingBox() const
void setBoundingBoxVisible(bool state=true)
bool _highlight
Indique si le highlight est active pour cet element.
virtual void update(bool force=false)
virtual void getChilds(TYListPtrTYElementGraphic &childs, bool recursif=true)
void setElement(TYElement *pElt)
static int getIndex()
static void addElement(TYElement *pElt)
classe graphique pour representer une polyligne a partir d'un tableau de points.
void setTabPoint(const TYTabPoint &tabPts)
virtual void display(TYRenderContext &renderContext)
TYTabPoint & getTabPoint()
TYRenderType type