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
TYFaceSet
* pFaces = getElement()->getFaceSet();
35
// LPTYFaceSetGraphic* pFacesGraphic= pFaces->getGraphicObject();
36
// pFacesGraphic->update();
37
pFaces->getGraphicObject()->update();
38
39
TYElementGraphic::update
(force);
40
}
41
42
void
TYAcousticFaceSetGraphic::display
(
TYRenderContext
& renderContext)
43
{
44
TYElementGraphic::display
(renderContext);
45
46
glColor4fv(getElement()->
getColor
());
47
48
if
(renderContext.
type
==
TYRenderType::Picking
)
49
{
50
TYPickingTable::addElement
(getElement());
51
glPushName((GLuint)(
TYPickingTable::getIndex
()));
52
}
53
54
TYFaceSet
* pFaces = getElement()->getFaceSet();
55
pFaces->getGraphicObject()->display(renderContext);
56
57
if
(renderContext.
type
==
TYRenderType::Picking
)
58
{
59
glPopName();
60
}
61
}
62
63
OBox
TYAcousticFaceSetGraphic::computeBoundingBox
()
const
64
{
65
OBox
boundingBox
;
66
TYTabPoint
sommets = getElement()->sommets();
67
68
size_t
nbPts = sommets.size();
69
TYPoint
pt;
70
for
(
size_t
i = 0; i < nbPts; i++)
71
{
72
pt = sommets[i];
73
boundingBox
.
Enlarge
((
float
)(pt.
_x
), (
float
)(pt.
_y
), (
float
)(pt.
_z
));
74
}
75
return
boundingBox
;
76
}
getColor
QColor getColor
Definition:
OGLSimpleMaterial.cpp:18
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:42
TYAcousticFaceSetGraphic::computeBoundingBox
virtual OBox computeBoundingBox() const
Definition:
TYAcousticFaceSetGraphic.cpp:63
TYAcousticFaceSet
Definition:
TYAcousticFaceSet.h:34
TYElementGraphic
classe graphique pour un element de base
Definition:
TYElementGraphic.h:63
TYElementGraphic::boundingBox
OBox boundingBox() const
Definition:
TYElementGraphic.cpp:227
TYElementGraphic::update
virtual void update(bool force=false)
Definition:
TYElementGraphic.cpp:83
TYElementGraphic::display
virtual void display(TYRenderContext &renderContext)
Definition:
TYElementGraphic.cpp:206
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:45
TYRenderContext::type
const TYRenderType type
Definition:
TYRenderContext.h:52
Generated on Thu Jan 29 2026 14:35:53 for Code_TYMPAN by
1.9.1