Code_TYMPAN
4.4.0
Industrial site acoustic simulation
Tympan
gui
gl
TYSourceSurfacicGraphic.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/acoustic/TYSourceSurfacic.h
"
24
25
#include "
TYSourceSurfacicGraphic.h
"
26
#include "
Tympan/gui/gl/TYRenderContext.h
"
27
28
bool
TYSourceSurfacicGraphic::_gVisible
=
false
;
29
30
TYSourceSurfacicGraphic::TYSourceSurfacicGraphic
(
TYSourceSurfacic
* pElement) :
TYElementGraphic
(pElement)
31
{
32
_srcVisible
=
false
;
33
}
34
35
void
TYSourceSurfacicGraphic::update
(
bool
force)
//=false
36
{
37
TYElementGraphic::update
(force);
38
}
39
40
void
TYSourceSurfacicGraphic::getChilds
(
TYListPtrTYElementGraphic
& childs,
bool
recursif
/*=true*/
)
41
{
42
unsigned
int
i = 0;
43
LPTYSourcePonctuelle
pSrcPonct = NULL;
44
45
for
(i = 0; i < getElement()->getNbSrcs(); i++)
46
{
47
// On recupere la source
48
pSrcPonct = getElement()->getSrc(i);
49
TYElementGraphic
* pTYElementGraphic = pSrcPonct->getGraphicObject();
50
childs.push_back(pTYElementGraphic);
51
if
(recursif)
52
{
53
pTYElementGraphic->
getChilds
(childs, recursif);
54
}
55
}
56
}
57
58
OBox
TYSourceSurfacicGraphic::computeBoundingBox
()
const
59
{
60
OBox
boundingBox
;
61
62
unsigned
int
i = 0;
63
LPTYSourcePonctuelle
pSrcPonct = NULL;
64
65
for
(i = 0; i < getElement()->getNbSrcs(); i++)
66
{
67
// On recupere la source
68
pSrcPonct = getElement()->getSrc(i);
69
boundingBox
.
Enlarge
(pSrcPonct->getGraphicObject()->boundingBox());
70
}
71
return
boundingBox
;
72
}
73
74
void
TYSourceSurfacicGraphic::display
(
TYRenderContext
& renderContext)
75
{
76
unsigned
int
i = 0;
77
LPTYSourcePonctuelle
pSrcPonct = NULL;
78
79
if
((
_visible
) && (
_srcVisible
||
_gVisible
))
80
{
81
for
(i = 0; i < getElement()->getNbSrcs(); i++)
82
{
83
// On recupere la source
84
pSrcPonct = getElement()->getSrc(i);
85
pSrcPonct->getGraphicObject()->display(renderContext);
86
}
87
}
88
}
TYListPtrTYElementGraphic
list< TYElementGraphic * > TYListPtrTYElementGraphic
List de pointeur de TYElement.
Definition:
TYElementGraphic.h:52
TYRenderContext.h
Contexte de rendu utilisé par les fonctions d'affichage.
TYSourceSurfacicGraphic.h
Representation graphique d'une surface de source (fichier header)
TYSourceSurfacic.h
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
SmartPtr< TYSourcePonctuelle >
TYElementGraphic
classe graphique pour un element de base
Definition:
TYElementGraphic.h:63
TYElementGraphic::_visible
bool _visible
Inique si l'element est visible.
Definition:
TYElementGraphic.h:270
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
TYRenderContext
Definition:
TYRenderContext.h:45
TYSourceSurfacicGraphic::update
virtual void update(bool force=false)
Definition:
TYSourceSurfacicGraphic.cpp:35
TYSourceSurfacicGraphic::_srcVisible
bool _srcVisible
Indique si cette instance est visible.
Definition:
TYSourceSurfacicGraphic.h:91
TYSourceSurfacicGraphic::TYSourceSurfacicGraphic
TYSourceSurfacicGraphic(TYSourceSurfacic *pElement)
Definition:
TYSourceSurfacicGraphic.cpp:30
TYSourceSurfacicGraphic::display
virtual void display(TYRenderContext &renderContext)
Definition:
TYSourceSurfacicGraphic.cpp:74
TYSourceSurfacicGraphic::getChilds
virtual void getChilds(TYListPtrTYElementGraphic &childs, bool recursif=true)
Definition:
TYSourceSurfacicGraphic.cpp:40
TYSourceSurfacicGraphic::_gVisible
static bool _gVisible
Indique si toutes les instances sont visibles.
Definition:
TYSourceSurfacicGraphic.h:93
TYSourceSurfacicGraphic::computeBoundingBox
virtual OBox computeBoundingBox() const
Definition:
TYSourceSurfacicGraphic.cpp:58
TYSourceSurfacic
Definition:
TYSourceSurfacic.h:30
Generated on Wed May 13 2026 12:41:17 for Code_TYMPAN by
1.9.1