Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYCoursEauEditor.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 <qdialog.h>
22 
31 #include "TYCoursEauEditor.h"
32 
33 #define TR(id) OLocalizator::getString("TYCoursEauEditor", (id))
34 
36 {
38 }
39 
41 
43 {
44  if (!(getSavedPoints().size() > 1) || (!_pModeler->askForResetResultat()))
45  {
46  return;
47  }
48 
49  LPTYCoursEau pCoursEau = new TYCoursEau();
50  pCoursEau->setTabPoint(getSavedPoints());
51 
52  if (pCoursEau->edit(_pModeler) == QDialog::Accepted)
53  {
54  TYSiteNode* pSite = ((TYSiteModelerFrame*)_pModeler)->getSite();
55 
56  if (pSite->getTopographie()->addCrsEau(pCoursEau))
57  {
58  TYAction* pAction = new TYAddElementToTopoAction((LPTYElement&)pCoursEau, pSite->getTopographie(),
59  _pModeler, TR("id_action_addcrseau"));
61 
62  pSite->getTopographie()->updateGraphicTree();
63 
66 
68  }
69 
70  // repasse en mode camera selection
72  }
73 }
fichier contenant differents types d'actions (fichier header)
TYMainWindow * getTYMainWnd()
Retourne le pointeur sur la fenetre principale.
pour l'application Tympan (fichier header)
#define TR(id)
Construit un CoursEau a partir des points saisis (fichier header)
Fenetre principale de l'application Tympan (fichier header)
Classe generique pour une fenetre de modeleur (fichier header)
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.
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
void endCoursEau()
Construit un CoursEau a partir des points saisis.
TYCoursEauEditor(TYModelerFrame *pModeler)
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()
TYOpenGLRenderer * getRenderer()
Classe Modeler specialisee pour l'edition des sites.
LPTYTopographie getTopographie()
Definition: TYSiteNode.h:148
bool addCrsEau(LPTYCoursEauGeoNode pCoursEauGeoNode)