Code_TYMPAN
4.4.0
Industrial site acoustic simulation
Tympan
gui
gl
TYAcousticBoxGraphic.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
23
#include "
Tympan/models/business/geoacoustic/TYAcousticBox.h
"
24
25
#include "
TYAcousticBoxGraphic.h
"
26
#include "
gui/gl/TYRenderContext.h
"
27
28
TYAcousticBoxGraphic::TYAcousticBoxGraphic
(
TYAcousticBox
* pElement) :
TYElementGraphic
(pElement) {}
29
30
void
TYAcousticBoxGraphic::update
(
bool
force
/*=false*/
)
31
{
32
TYElementGraphic::update
(force);
33
}
34
35
void
TYAcousticBoxGraphic::getChilds
(
TYListPtrTYElementGraphic
& childs,
bool
recursif
/*=true*/
)
36
{
37
for
(
int
i = 0; i < 6; i++)
38
{
39
// On recupere la face
40
LPTYAcousticRectangleNodeGeoNode
pAccRectNodeGeoNode = getElement()->getFace(i);
41
TYElementGraphic
* pTYElementGraphic = pAccRectNodeGeoNode->getGraphicObject().getRealPointer();
42
childs.push_back(pTYElementGraphic);
43
if
(recursif)
44
{
45
pTYElementGraphic->
getChilds
(childs, recursif);
46
}
47
}
48
}
49
50
OBox
TYAcousticBoxGraphic::computeBoundingBox
()
const
51
{
52
OBox
boundingBox
;
53
54
// CLM-NT35 : Correction calcul BB des machines
55
// Attention les bb des faces sont orientes dans leur repere local
56
// --> Utilisation de 2 Faces pour calculer la bb d'une box
57
LPTYAcousticRectangleNodeGeoNode
pAccRectNodeGeoNode1 = getElement()->getFace(0);
58
OBox
rect_bb1 = pAccRectNodeGeoNode1->getGraphicObject()->boundingBox();
59
60
LPTYAcousticRectangleNodeGeoNode
pAccRectNodeGeoNode2 = getElement()->getFace(1);
61
OBox
rect_bb2 = pAccRectNodeGeoNode2->getGraphicObject()->boundingBox();
62
boundingBox
.
_min
.
_x
= rect_bb2.
_min
.
_x
;
63
boundingBox
.
_max
.
_x
= rect_bb2.
_max
.
_x
;
64
boundingBox
.
_min
.
_y
= rect_bb1.
_min
.
_x
;
65
boundingBox
.
_max
.
_y
= rect_bb1.
_max
.
_x
;
66
boundingBox
.
_min
.
_z
= rect_bb1.
_min
.
_y
;
67
boundingBox
.
_max
.
_z
= rect_bb1.
_max
.
_y
;
68
return
boundingBox
;
69
}
70
71
void
TYAcousticBoxGraphic::display
(
TYRenderContext
& renderContext)
72
{
73
TYElementGraphic::display
(renderContext);
74
75
int
i = 0;
76
77
// CLM-NT35: En overlay, affiche seulement le nom de l'élément localisé
78
if
(renderContext.
pass
==
TYRenderPass::Overlay
)
79
{
80
drawName
(renderContext);
81
}
82
else
83
{
84
for
(i = 0; i < 6; i++)
85
{
86
// On recupere la face
87
LPTYAcousticRectangleNodeGeoNode
pAccRectNodeGeoNode = getElement()->getFace(i);
88
pAccRectNodeGeoNode->getGraphicObject()->display(renderContext);
89
}
90
}
91
}
TYAcousticBoxGraphic.h
Representation graphique d'une boite acoustique (fichier header)
TYAcousticBox.h
TYListPtrTYElementGraphic
list< TYElementGraphic * > TYListPtrTYElementGraphic
List de pointeur de TYElement.
Definition:
TYElementGraphic.h:52
TYRenderContext.h
Contexte de rendu utilisé par les fonctions d'affichage.
TYRenderPass::Overlay
@ Overlay
The current render pass is for overlay elements.
OBox
The box class.
Definition:
3d.h:1346
OBox::_min
OPoint3D _min
Minimal coordinates of the OBox.
Definition:
3d.h:1423
OBox::_max
OPoint3D _max
Maximal coordinates of the OBox.
Definition:
3d.h:1424
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
SmartPtr< TYAcousticRectangleNodeGeoNode >
TYAcousticBoxGraphic::getChilds
virtual void getChilds(TYListPtrTYElementGraphic &childs, bool recursif=true)
Definition:
TYAcousticBoxGraphic.cpp:35
TYAcousticBoxGraphic::display
virtual void display(TYRenderContext &renderContext) override
Definition:
TYAcousticBoxGraphic.cpp:71
TYAcousticBoxGraphic::TYAcousticBoxGraphic
TYAcousticBoxGraphic(TYAcousticBox *pElement)
Definition:
TYAcousticBoxGraphic.cpp:28
TYAcousticBoxGraphic::computeBoundingBox
virtual OBox computeBoundingBox() const
Definition:
TYAcousticBoxGraphic.cpp:50
TYAcousticBoxGraphic::update
virtual void update(bool force=false)
Definition:
TYAcousticBoxGraphic.cpp:30
TYAcousticBox
Definition:
TYAcousticBox.h:30
TYElementGraphic
classe graphique pour un element de base
Definition:
TYElementGraphic.h:63
TYElementGraphic::drawName
void drawName(TYRenderContext &renderContext)
Definition:
TYElementGraphic.cpp:138
TYElementGraphic::boundingBox
OBox boundingBox() const
Definition:
TYElementGraphic.cpp:227
TYElementGraphic::update
virtual void update(bool force=false)
Definition:
TYElementGraphic.cpp:83
TYElementGraphic::getChilds
virtual void getChilds(TYListPtrTYElementGraphic &childs, bool recursif=true)
Definition:
TYElementGraphic.h:181
TYElementGraphic::display
virtual void display(TYRenderContext &renderContext)
Definition:
TYElementGraphic.cpp:206
TYRenderContext
Definition:
TYRenderContext.h:45
TYRenderContext::pass
const TYRenderPass pass
Definition:
TYRenderContext.h:53
Generated on Thu Jan 29 2026 14:35:53 for Code_TYMPAN by
1.9.1