Code_TYMPAN
4.4.0
Industrial site acoustic simulation
Tympan
gui
gl
TYSourceLineicGraphic.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/TYSourceLineic.h
"
24
25
#include "
TYSourceLineicGraphic.h
"
26
#include "
Tympan/gui/gl/TYRenderContext.h
"
27
28
bool
TYSourceLineicGraphic::_gVisible
=
false
;
29
30
TYSourceLineicGraphic::TYSourceLineicGraphic
(
TYSourceLineic
* pElement) :
TYElementGraphic
(pElement)
31
{
32
_srcVisible
=
false
;
33
}
34
35
void
TYSourceLineicGraphic::update
(
bool
force
/*=false*/
)
36
{
37
TYElementGraphic::update
(force);
38
}
39
40
void
TYSourceLineicGraphic::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
TYSourceLineicGraphic::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
TYSourceLineicGraphic::display
(
TYRenderContext
& renderContext)
75
{
76
unsigned
int
i = 0;
77
LPTYSourcePonctuelle
pSrcPonct = NULL;
78
if
(
_visible
)
79
{
80
for
(i = 0; i < getElement()->getNbSrcs(); i++)
81
{
82
// On recupere la source
83
pSrcPonct = getElement()->getSrc(i);
84
pSrcPonct->getGraphicObject()->display(renderContext);
85
}
86
}
87
}
TYListPtrTYElementGraphic
list< TYElementGraphic * > TYListPtrTYElementGraphic
List de pointeur de TYElement.
Definition:
TYElementGraphic.h:52
TYRenderContext.h
Contexte de rendu utilisé par les fonctions d'affichage.
TYSourceLineicGraphic.h
Representation graphique d'une source lineique (fichier header)
TYSourceLineic.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
TYSourceLineicGraphic::update
virtual void update(bool force=false)
Mise a jour.
Definition:
TYSourceLineicGraphic.cpp:35
TYSourceLineicGraphic::display
virtual void display(TYRenderContext &renderContext)
Definition:
TYSourceLineicGraphic.cpp:74
TYSourceLineicGraphic::_srcVisible
bool _srcVisible
Indique si cette instance est visible.
Definition:
TYSourceLineicGraphic.h:82
TYSourceLineicGraphic::computeBoundingBox
virtual OBox computeBoundingBox() const
calcul de la boite englobante
Definition:
TYSourceLineicGraphic.cpp:58
TYSourceLineicGraphic::getChilds
virtual void getChilds(TYListPtrTYElementGraphic &childs, bool recursif=true)
Definition:
TYSourceLineicGraphic.cpp:40
TYSourceLineicGraphic::_gVisible
static bool _gVisible
Indique si toutes les instances sont visibles.
Definition:
TYSourceLineicGraphic.h:84
TYSourceLineicGraphic::TYSourceLineicGraphic
TYSourceLineicGraphic(TYSourceLineic *pElement)
Definition:
TYSourceLineicGraphic.cpp:30
TYSourceLineic
Definition:
TYSourceLineic.h:31
Generated on Mon Dec 22 2025 10:42:02 for Code_TYMPAN by
1.9.1