Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYAcousticPolygonGraphic.cpp
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 
24 
26 {
27 }
28 
29 void TYAcousticPolygonGraphic::update(bool force /*=false*/)
30 {
32 }
33 
34 void TYAcousticPolygonGraphic::getChilds(TYListPtrTYElementGraphic& childs, bool recursif /*=true*/)
35 {
36  TYElementGraphic* pTYElementGraphic = nullptr;
37  pTYElementGraphic = getElement()->getSrcSurf()->getGraphicObject();
38  childs.push_back(pTYElementGraphic);
39  if (recursif)
40  {
41  pTYElementGraphic->getChilds(childs, recursif);
42  }
43 
44  pTYElementGraphic = getElement()->getPolygon()->getGraphicObject();
45  childs.push_back(pTYElementGraphic);
46  if (recursif)
47  {
48  pTYElementGraphic->getChilds(childs, recursif);
49  }
50 }
51 
53 {
54  OBox reset;
55  _boundingBox = reset;
56 
57  getElement()->getSrcSurf()->getGraphicObject()->computeBoundingBox();
58  getElement()->getPolygon()->getGraphicObject()->computeBoundingBox();
59 
60  _boundingBox.Enlarge(getElement()->getSrcSurf()->getGraphicObject()->GetBox());
61  _boundingBox.Enlarge(getElement()->getPolygon()->getGraphicObject()->GetBox());
62 }
63 
64 void TYAcousticPolygonGraphic::display(TYElement* pModelerElement /*= nullptr*/, GLenum mode /*= GL_RENDER*/)
65 {
66  OColor color = getElement()->getColor();
67  color.a = 1.0;
68  glColor4fv(color);
69  getElement()->getSrcSurf()->getGraphicObject()->display(pModelerElement, mode);
70  getElement()->getPolygon()->getGraphicObject()->highlight(_highlight);
71 
72  if (mode == GL_SELECT)
73  {
74  TYPickingTable::addElement(getElement());
75  glPushName((GLuint)(TYPickingTable::getIndex()));
76  }
77 
78  getElement()->getPolygon()->getGraphicObject()->display(pModelerElement, mode);
79 
80  if (mode == GL_SELECT)
81  {
82  glPopName();
83  }
84 }
Representation graphique d'un polygone accoustique (fichier header)
list< TYElementGraphic * > TYListPtrTYElementGraphic
List de pointeur de TYElement.
Gestion de la table de correspondance indice/element pour le picking (fichier header)
The box class.
Definition: 3d.h:1294
virtual void Enlarge(const OPoint3D &pt)
Enlarge the box with the point if the point is outside the box.
Definition: 3d.cpp:1614
Definition: color.h:31
float a
Definition: color.h:33
virtual void display(TYElement *pModelerElement=nullptr, GLenum mode=GL_RENDER)
virtual void update(bool force=false)
TYAcousticPolygonGraphic(TYAcousticPolygon *pElement)
void getChilds(TYListPtrTYElementGraphic &childs, bool recursif=true)
classe graphique pour un element de base
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)
static int getIndex()
static void addElement(TYElement *pElt)