Code_TYMPAN
4.4.0
Industrial site acoustic simulation
Tympan
gui
app
TYCoursEauEditor.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
21
#include <qdialog.h>
22
23
#include "
Tympan/models/business/OLocalizator.h
"
24
#include "
Tympan/models/business/infrastructure/TYSiteNode.h
"
25
#include "
Tympan/models/business/topography/TYCoursEau.h
"
26
#include "
Tympan/gui/app/TYModelerFrame.h
"
27
#include "
Tympan/gui/app/TYSiteModelerFrame.h
"
28
#include "
Tympan/gui/app/TYActions.h
"
29
#include "
Tympan/gui/app/TYApplication.h
"
30
#include "
Tympan/gui/app/TYMainWindow.h
"
31
#include "
TYCoursEauEditor.h
"
32
33
#define TR(id) OLocalizator::getString("TYCoursEauEditor"
, (id))
34
35
TYCoursEauEditor::TYCoursEauEditor
(
TYModelerFrame
* pModeler) :
TYPolyLineEditor
(pModeler)
36
{
37
QObject::connect(
this
, &
TYCoursEauEditor::endedSavingPoints
,
this
, &
TYCoursEauEditor::endCoursEau
);
38
}
39
40
TYCoursEauEditor::~TYCoursEauEditor
() {}
41
42
void
TYCoursEauEditor::endCoursEau
()
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"
));
60
_pModeler
->
getActionManager
()->
addAction
(pAction);
61
62
pSite->
getTopographie
()->updateGraphicTree();
63
64
updateSiteFrame
();
65
_pModeler
->
getView
()->
getRenderer
()->
invalidateScene
();
66
67
_pModeler
->
updateView
();
68
}
69
70
// repasse en mode camera selection
71
getTYMainWnd
()->
setDefaultCameraMode
();
72
}
73
}
OLocalizator.h
TYActions.h
fichier contenant differents types d'actions (fichier header)
getTYMainWnd
TYMainWindow * getTYMainWnd()
Retourne le pointeur sur la fenetre principale.
Definition:
TYApplication.cpp:63
TYApplication.h
pour l'application Tympan (fichier header)
TR
#define TR(id)
Definition:
TYCoursEauEditor.cpp:33
TYCoursEauEditor.h
Construit un CoursEau a partir des points saisis (fichier header)
TYCoursEau.h
TYMainWindow.h
Fenetre principale de l'application Tympan (fichier header)
TYModelerFrame.h
Classe generique pour une fenetre de modeleur (fichier header)
TYSiteModelerFrame.h
Classe Modeler specialisee pour l'edition des sites (fichier header)
TYSiteNode.h
SmartPtr
Definition:
smartptr.h:106
TYAbstractSceneEditor::updateSiteFrame
void updateSiteFrame()
Reconstruit l'arborescence du TYSiteFrame.
Definition:
TYAbstractSceneEditor.cpp:69
TYAbstractSceneEditor::_pModeler
TYModelerFrame * _pModeler
Le modeler associe a cet editor.
Definition:
TYAbstractSceneEditor.h:256
TYActionManager::addAction
void addAction(TYAction *pAction)
Ajoute une nouvelle action a l'historique.
Definition:
TYActionManager.cpp:38
TYAction
Definit une action, necessaire pour la gestion de l'undo.
Definition:
TYAction.h:37
TYAddElementToTopoAction
Ajout d'un element a la topographie.
Definition:
TYActions.h:337
TYCoursEauEditor::endCoursEau
void endCoursEau()
Construit un CoursEau a partir des points saisis.
Definition:
TYCoursEauEditor.cpp:42
TYCoursEauEditor::TYCoursEauEditor
TYCoursEauEditor(TYModelerFrame *pModeler)
Definition:
TYCoursEauEditor.cpp:35
TYCoursEauEditor::~TYCoursEauEditor
~TYCoursEauEditor()
Definition:
TYCoursEauEditor.cpp:40
TYCoursEau
Definition:
TYCoursEau.h:29
TYMainWindow::setDefaultCameraMode
void setDefaultCameraMode()
Definition:
TYMainWindow.cpp:1114
TYModelerFrame
Generic class for a modeler window.
Definition:
TYModelerFrame.h:66
TYModelerFrame::getView
TYRenderWindowInteractor * getView()
Definition:
TYModelerFrame.h:118
TYModelerFrame::getActionManager
TYActionManager * getActionManager()
Definition:
TYModelerFrame.h:199
TYModelerFrame::askForResetResultat
bool askForResetResultat()
Definition:
TYModelerFrame.cpp:599
TYModelerFrame::updateView
virtual void updateView(bool clipping=true, bool axesAndGrid=true)
Definition:
TYModelerFrame.cpp:1352
TYOpenGLRenderer::invalidateScene
void invalidateScene(void)
Definition:
TYOpenGLRenderer.cpp:208
TYPolyLineEditor
gestion de l'edition d'une polyligne
Definition:
TYPolyLineEditor.h:41
TYPolyLineEditor::endedSavingPoints
void endedSavingPoints()
TYPolyLineEditor::getSavedPoints
TYTabPoint & getSavedPoints()
Definition:
TYPolyLineEditor.h:52
TYRenderWindow::getRenderer
TYOpenGLRenderer * getRenderer()
Definition:
TYRenderWindow.cpp:101
TYSiteModelerFrame
Classe Modeler specialisee pour l'edition des sites.
Definition:
TYSiteModelerFrame.h:39
TYSiteNode
Definition:
TYSiteNode.h:43
TYSiteNode::getTopographie
LPTYTopographie getTopographie()
Definition:
TYSiteNode.h:149
TYTopographie::addCrsEau
bool addCrsEau(LPTYCoursEauGeoNode pCoursEauGeoNode)
Definition:
TYTopographie.cpp:658
Generated on Mon Feb 2 2026 12:03:42 for Code_TYMPAN by
1.9.1