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
TYSourceSurfacicGraphic::TYSourceSurfacicGraphic
(
TYSourceSurfacic
* pElement) :
TYElementGraphic
(pElement) {}
29
30
void
TYSourceSurfacicGraphic::update
(
bool
force)
//=false
31
{
32
TYElementGraphic::update
(force);
33
}
34
35
void
TYSourceSurfacicGraphic::getChilds
(
TYListPtrTYElementGraphic
& childs,
bool
recursif
/*=true*/
)
36
{
37
unsigned
int
i = 0;
38
LPTYSourcePonctuelle
pSrcPonct = NULL;
39
40
for
(i = 0; i < getElement()->getNbSrcs(); i++)
41
{
42
// On recupere la source
43
pSrcPonct = getElement()->getSrc(i);
44
TYElementGraphic
* pTYElementGraphic = pSrcPonct->getGraphicObject();
45
childs.push_back(pTYElementGraphic);
46
if
(recursif)
47
{
48
pTYElementGraphic->
getChilds
(childs, recursif);
49
}
50
}
51
}
52
53
OBox
TYSourceSurfacicGraphic::computeBoundingBox
()
const
54
{
55
OBox
boundingBox
;
56
57
unsigned
int
i = 0;
58
LPTYSourcePonctuelle
pSrcPonct = NULL;
59
60
for
(i = 0; i < getElement()->getNbSrcs(); i++)
61
{
62
// On recupere la source
63
pSrcPonct = getElement()->getSrc(i);
64
boundingBox
.
Enlarge
(pSrcPonct->getGraphicObject()->boundingBox());
65
}
66
return
boundingBox
;
67
}
68
69
void
TYSourceSurfacicGraphic::display
(
TYRenderContext
& renderContext)
70
{
71
unsigned
int
i = 0;
72
LPTYSourcePonctuelle
pSrcPonct = NULL;
73
74
if
(
_visible
&& renderContext.
showDistributedSources
)
75
{
76
for
(i = 0; i < getElement()->getNbSrcs(); i++)
77
{
78
// On recupere la source
79
pSrcPonct = getElement()->getSrc(i);
80
pSrcPonct->getGraphicObject()->display(renderContext);
81
}
82
}
83
}
TYListPtrTYElementGraphic
list< TYElementGraphic * > TYListPtrTYElementGraphic
List de pointeur de TYElement.
Definition:
TYElementGraphic.h:55
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:66
TYElementGraphic::_visible
bool _visible
Inique si l'element est visible.
Definition:
TYElementGraphic.h:283
TYElementGraphic::boundingBox
OBox boundingBox() const
Definition:
TYElementGraphic.cpp:219
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:173
TYRenderContext
Definition:
TYRenderContext.h:47
TYRenderContext::showDistributedSources
bool showDistributedSources
Definition:
TYRenderContext.h:61
TYSourceSurfacicGraphic::update
virtual void update(bool force=false)
Definition:
TYSourceSurfacicGraphic.cpp:30
TYSourceSurfacicGraphic::TYSourceSurfacicGraphic
TYSourceSurfacicGraphic(TYSourceSurfacic *pElement)
Definition:
TYSourceSurfacicGraphic.cpp:28
TYSourceSurfacicGraphic::display
virtual void display(TYRenderContext &renderContext)
Definition:
TYSourceSurfacicGraphic.cpp:69
TYSourceSurfacicGraphic::getChilds
virtual void getChilds(TYListPtrTYElementGraphic &childs, bool recursif=true)
Definition:
TYSourceSurfacicGraphic.cpp:35
TYSourceSurfacicGraphic::computeBoundingBox
virtual OBox computeBoundingBox() const
Definition:
TYSourceSurfacicGraphic.cpp:53
TYSourceSurfacic
Definition:
TYSourceSurfacic.h:30
Generated on Thu Feb 19 2026 09:05:52 for Code_TYMPAN by
1.9.1