Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYProjetGraphic.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012> <EDF-R&D> <FRANCE>
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License along
12  * with this program; if not, write to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
14  */
15 
24 #include "TYProjetGraphic.h"
25 
27 
29 
30 void TYProjetGraphic::update(bool force /*=false*/)
31 {
33 }
34 
35 void TYProjetGraphic::getChilds(TYListPtrTYElementGraphic& childs, bool recursif /*=true*/)
36 {
37  TYElementGraphic* pTYElementGraphic = getElement()->getSite()->getGraphicObject().getRealPointer();
38  childs.push_back(pTYElementGraphic);
39  if (recursif)
40  {
41  pTYElementGraphic->getChilds(childs, recursif);
42  }
43  if (getElement()->getCurrentCalcul())
44  {
45  pTYElementGraphic = getElement()->getCurrentCalcul()->getGraphicObject().getRealPointer();
46  childs.push_back(pTYElementGraphic);
47  if (recursif)
48  {
49  pTYElementGraphic->getChilds(childs, recursif);
50  }
51  }
52 
53  // Points de controle
54  unsigned int i = 0;
55  for (i = 0; i < getElement()->getPointsControl().size(); i++)
56  {
57  pTYElementGraphic = getElement()->getPointControl(i)->getGraphicObject().getRealPointer();
58  childs.push_back(pTYElementGraphic);
59  if (recursif)
60  {
61  pTYElementGraphic->getChilds(childs, recursif);
62  }
63  }
64 
65  // Maillage
66  TYTabMaillageGeoNode* pTabMaillage = &getElement()->getMaillages();
67  LPTYMaillageGeoNode pMaillageGeoNode;
68  for (i = 0; i < pTabMaillage->size(); i++)
69  {
70  pMaillageGeoNode = pTabMaillage->operator[](i);
71  pTYElementGraphic = pMaillageGeoNode->getGraphicObject().getRealPointer();
72  childs.push_back(pTYElementGraphic);
73  if (recursif)
74  {
75  pTYElementGraphic->getChilds(childs, recursif);
76  }
77  }
78 }
79 
80 void TYProjetGraphic::display(TYElement* pModelerElement /*= nullptr*/, GLenum mode /*= GL_RENDER*/)
81 {
82  TYElementGraphic::display(pModelerElement, mode);
83 
84  // Site
85  getElement()->getSite()->getGraphicObject()->display(pModelerElement, mode);
86 
87  // Points de controle
88  unsigned int i = 0;
89  for (i = 0; i < getElement()->getPointsControl().size(); i++)
90  {
91  getElement()->getPointControl(i)->getGraphicObject()->display(pModelerElement, mode);
92  }
93 
94  // Maillage
95  TYTabMaillageGeoNode* pTabMaillage = &getElement()->getMaillages();
96  TYMaillageGeoNode* pMaillageGeoNode = NULL;
97  for (i = 0; i < pTabMaillage->size(); i++)
98  {
99  pMaillageGeoNode = pTabMaillage->operator[](i);
100  pMaillageGeoNode->getGraphicObject()->display(pModelerElement, mode);
101  }
102 
103  // Calcul courant
104  if (getElement()->getCurrentCalcul())
105  {
106  getElement()->getCurrentCalcul()->getGraphicObject()->display(pModelerElement, mode);
107  }
108 
109  activateSignal();
110 }
111 
112 #if TY_USE_IHM
113 void TYProjetGraphic::connectUpdateSignal(QObject* pReceiver, const char* member)
114 {
115  // _pUpdateSignal->connect(pReceiver, member);
116 }
117 #endif // TY_USE_IHM
118 
119 #if TY_USE_IHM
120 void TYProjetGraphic::disconnectUpdateSignal(QObject* pReceiver, const char* member)
121 {
122  // _pUpdateSignal->disconnect(pReceiver, member);
123 }
124 #endif // TY_USE_IHM
list< TYElementGraphic * > TYListPtrTYElementGraphic
List de pointeur de TYElement.
std::vector< LPTYMaillageGeoNode > TYTabMaillageGeoNode
Collection de noeuds geometriques de type TYMaillage.
Definition: TYMaillage.h:438
Representation graphique d'un projet (fichier header)
classe graphique pour un element de base
virtual void update(bool force=false)
virtual void getChilds(TYListPtrTYElementGraphic &childs, bool recursif=true)
virtual void display(TYElement *pModelerElement=nullptr, GLenum mode=GL_RENDER)
virtual ~TYProjetGraphic()
virtual void display(TYElement *pModelerElement=nullptr, GLenum mode=GL_RENDER)
virtual void update(bool force=false)
TYProjetGraphic(TYProjet *pElement)
virtual void getChilds(TYListPtrTYElementGraphic &childs, bool recursif=true)
classe de definition d'un projet.
Definition: TYProjet.h:45