Code_TYMPAN
4.4.0
Industrial site acoustic simulation
Tympan
gui
gl
TYAcousticFaceSetGraphic.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 "
Tympan/models/business/geometry/TYFaceSet.h
"
22
#include "
Tympan/models/business/geoacoustic/TYAcousticFaceSet.h
"
23
#include "
Tympan/gui/gl/TYPickingTable.h
"
24
#include "
TYAcousticFaceSetGraphic.h
"
25
#include "
gui/gl/TYRenderContext.h
"
26
#include <QtOpenGL>
27
28
TYAcousticFaceSetGraphic::TYAcousticFaceSetGraphic
(
TYAcousticFaceSet
* pElement) :
TYElementGraphic
(pElement)
29
{
30
}
31
32
void
TYAcousticFaceSetGraphic::update
(
bool
force
/*=false*/
)
33
{
34
if
(
getModified
() || force)
35
{
36
TYFaceSet
* pFaces = getElement()->getFaceSet();
37
// LPTYFaceSetGraphic* pFacesGraphic= pFaces->getGraphicObject();
38
// pFacesGraphic->update();
39
pFaces->getGraphicObject()->update();
40
TYElementGraphic::update
(force);
41
}
42
}
43
44
void
TYAcousticFaceSetGraphic::display
(
TYRenderContext
& renderContext)
45
{
46
TYElementGraphic::display
(renderContext);
47
48
glColor4fv(getElement()->getColor());
49
50
if
(renderContext.
type
==
TYRenderType::Picking
)
51
{
52
TYPickingTable::addElement
(getElement());
53
glPushName((GLuint)(
TYPickingTable::getIndex
()));
54
}
55
56
TYFaceSet
* pFaces = getElement()->getFaceSet();
57
pFaces->getGraphicObject()->display(renderContext);
58
59
if
(renderContext.
type
==
TYRenderType::Picking
)
60
{
61
glPopName();
62
}
63
}
64
65
OBox
TYAcousticFaceSetGraphic::computeBoundingBox
()
const
66
{
67
OBox
boundingBox
;
68
TYTabPoint
sommets = getElement()->sommets();
69
70
size_t
nbPts = sommets.size();
71
TYPoint
pt;
72
for
(
size_t
i = 0; i < nbPts; i++)
73
{
74
pt = sommets[i];
75
boundingBox
.
Enlarge
((
float
)(pt.
_x
), (
float
)(pt.
_y
), (
float
)(pt.
_z
));
76
}
77
return
boundingBox
;
78
}
TYAcousticFaceSetGraphic.h
Representation graphique d'un ensemble de faces acoustiques (fichier header)
TYAcousticFaceSet.h
TYTabPoint
std::vector< TYPoint > TYTabPoint
Collection de TYPoint.
Definition:
TYDefines.h:340
TYFaceSet.h
TYPickingTable.h
Gestion de la table de correspondance indice/element pour le picking (fichier header)
TYRenderContext.h
Contexte de rendu utilisé par les fonctions d'affichage.
TYRenderType::Picking
@ Picking
The current render is only done for picking purpose.
OBox
The box class.
Definition:
3d.h:1346
OBox::Enlarge
virtual void Enlarge(const OPoint3D &pt)
Enlarge the box with the point if the point is outside the box.
Definition:
3d.cpp:1614
OCoord3D::_y
double _y
y coordinate of OCoord3D
Definition:
3d.h:283
OCoord3D::_z
double _z
z coordinate of OCoord3D
Definition:
3d.h:284
OCoord3D::_x
double _x
x coordinate of OCoord3D
Definition:
3d.h:282
TYAcousticFaceSetGraphic::TYAcousticFaceSetGraphic
TYAcousticFaceSetGraphic(TYAcousticFaceSet *pElement)
Definition:
TYAcousticFaceSetGraphic.cpp:28
TYAcousticFaceSetGraphic::update
virtual void update(bool force=false)
Definition:
TYAcousticFaceSetGraphic.cpp:32
TYAcousticFaceSetGraphic::display
virtual void display(TYRenderContext &renderContext)
Definition:
TYAcousticFaceSetGraphic.cpp:44
TYAcousticFaceSetGraphic::computeBoundingBox
virtual OBox computeBoundingBox() const
Definition:
TYAcousticFaceSetGraphic.cpp:65
TYAcousticFaceSet
Definition:
TYAcousticFaceSet.h:34
TYElementGraphic
classe graphique pour un element de base
Definition:
TYElementGraphic.h:66
TYElementGraphic::boundingBox
OBox boundingBox() const
Definition:
TYElementGraphic.cpp:219
TYElementGraphic::update
virtual void update(bool force=false)
Definition:
TYElementGraphic.cpp:83
TYElementGraphic::display
virtual void display(TYRenderContext &renderContext)
Definition:
TYElementGraphic.cpp:210
TYElementGraphic::getModified
bool getModified() const
Definition:
TYElementGraphic.cpp:109
TYFaceSet
Definition:
TYFaceSet.h:30
TYPickingTable::getIndex
static int getIndex()
Definition:
TYPickingTable.h:92
TYPickingTable::addElement
static void addElement(TYElement *pElt)
Definition:
TYPickingTable.cpp:38
TYPoint
Definition:
TYPoint.h:31
TYRenderContext
Definition:
TYRenderContext.h:47
TYRenderContext::type
TYRenderType type
Definition:
TYRenderContext.h:52
Generated on Thu Feb 19 2026 09:05:51 for Code_TYMPAN by
1.9.1