Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYCourbeNiveauEditor.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 
21 #include <qinputdialog.h>
22 
34 #include "TYCourbeNiveauEditor.h"
35 
36 #define TR(id) OLocalizator::getString("TYCourbeNiveauEditor", (id))
37 
39 {
40  _pCrbNiv = NULL;
41  QObject::connect(this, &TYCourbeNiveauEditor::endedSavingPoints, this,
43 }
44 
46 
48 {
49  ((TYSiteModelerFrame*)_pModeler)->showCrbNiv(true);
50 
52 }
53 
55 {
56  switch (key)
57  {
58  case Qt::Key_Space:
59  if (_active)
60  {
61  ((TYSiteModelerFrame*)_pModeler)->getSite()->updateGraphic();
63  }
64  break;
65  default:
67  }
68 }
69 
71 {
72 
73  if (!(getSavedPoints().size() > 1) || (!_pModeler->askForResetResultat()))
74  {
75  return;
76  }
77 
78  _pCrbNiv = new TYCourbeNiveau();
80 
81  if (_pCrbNiv->edit(_pModeler) == QDialog::Accepted)
82  {
83  TYSiteNode* pSite = ((TYSiteModelerFrame*)_pModeler)->getSite();
84 
85  if (pSite->getTopographie()->addCrbNiv(_pCrbNiv))
86  {
88  _pModeler, TR("id_action_addcrbniv"));
90 
91  TYProjet* pProjet = getTYApp()->getCurProjet();
92  if (pProjet)
93  {
94  pProjet->getSite()->getTopographie()->updateGraphicTree();
95  }
96 
99 
101  }
102 
103  // repasse en mode camera selection
105  }
106 }
fichier contenant differents types d'actions (fichier header)
TYApplication * getTYApp()
Retourne le pointeur sur l'application.
TYMainWindow * getTYMainWnd()
Retourne le pointeur sur la fenetre principale.
pour l'application Tympan (fichier header)
#define TR(id)
Construit une courbe de niveau a partir des points saisis (fichier header)
Representation graphique d'une courbe de niveau (fichier header)
Fenetre principale de l'application Tympan (fichier header)
Classe generique pour une fenetre de modeleur (fichier header)
Le role de cette classe est limite a emettre des signaux pouvant etre utilise pour interagir sur le r...
Classe Modeler specialisee pour l'edition des sites (fichier header)
void updateSiteFrame()
Reconstruit l'arborescence du TYSiteFrame.
TYModelerFrame * _pModeler
Le modeler associe a cet editor.
TYRenderWindowInteractor * _pInteractor
La vue graphique associee a cet editor.
void addAction(TYAction *pAction)
Ajoute une nouvelle action a l'historique.
Definit une action, necessaire pour la gestion de l'undo.
Definition: TYAction.h:37
Ajout d'un element a la topographie.
Definition: TYActions.h:336
LPTYProjet getCurProjet()
Set/Get du projet courant.
void endCourbeNiveau()
Construit une courbe de niveau a partir des points saisis.
TYCourbeNiveauEditor(TYModelerFrame *pModeler)
virtual void slotKeyPressed(int key)
LPTYCourbeNiveau _pCrbNiv
La derniere courbe de niveau creee.
void setListPoints(const TYTabPoint &pts)
void setDefaultCameraMode()
Classe generique pour une fenetre de modeleur.
TYRenderWindowInteractor * getView()
TYActionManager * getActionManager()
bool askForResetResultat()
virtual void updateView(bool clipping=true, bool axesAndGrid=true)
void updateDisplayList(void)
gestion de l'edition d'une polyligne
void endedSavingPoints()
TYTabPoint & getSavedPoints()
virtual void init()
virtual void slotKeyPressed(int key)
bool _active
Indique si cet editor est actif.
classe de definition d'un projet.
Definition: TYProjet.h:45
LPTYSiteNode getSite()
Get du site.
Definition: TYProjet.h:169
virtual void updateGL()
TYOpenGLRenderer * getRenderer()
Classe Modeler specialisee pour l'edition des sites.
LPTYTopographie getTopographie()
Definition: TYSiteNode.h:148
bool addCrbNiv(LPTYCourbeNiveauGeoNode pCrbNivGeoNode)