23 #include <QCloseEvent>
27 #include <qstatusbar.h>
33 #include <qfiledialog.h>
34 #include <qfileinfo.h>
35 #include <qtoolbutton.h>
36 #include <qbuttongroup.h>
37 #include <qmessagebox.h>
39 #include <qmainwindow.h>
41 #include <qtextbrowser.h>
42 #include <qtextstream.h>
43 #include <QDockWidget>
45 #include <QMdiSubWindow>
47 #include <qeventloop.h>
49 #include "Tympan/core/config.h"
83 #define TR(id) OLocalizator::getString("TYMainWindow", (id))
84 #define IMG(id) OLocalizator::getPicture("TYMainWindow", (id))
107 _pWorkspace->setActivationOrder(QMdiArea::ActivationHistoryOrder);
120 if (QFile::exists(help_index_file))
143 _pOpenAction =
new QAction(QPixmap(
IMG(
"id_icon_open")),
TR(
"id_menuitem_open"),
this);
146 QObject::connect(
_pOpenAction, &QAction::triggered,
this, tyMainWindow_open);
148 _pCloseAction =
new QAction(QPixmap(
IMG(
"id_icon_close")),
TR(
"id_menuitem_close"),
this);
153 _pSaveAction =
new QAction(QPixmap(
IMG(
"id_icon_save")),
TR(
"id_menuitem_save"),
this);
156 QObject::connect(
_pSaveAction, &QAction::triggered,
this, tyMainWindow_save);
158 _pSaveAsAction =
new QAction(QPixmap(
IMG(
"id_icon_save")),
TR(
"id_menuitem_saveas"),
this);
160 QObject::connect(
_pSaveAsAction, &QAction::triggered,
this, tyMainWindow_saveAs);
163 new QAction(QPixmap(
IMG(
"id_icon_save")),
TR(
"id_menuitem_saveas_noresult"),
this);
172 _pPrintAction =
new QAction(QPixmap(
IMG(
"id_icon_print")),
TR(
"id_menuitem_print"),
this);
178 _pUndoAction =
new QAction(QPixmap(
IMG(
"id_icon_undo")),
TR(
"id_menuitem_undo_na"),
this);
184 _pRedoAction =
new QAction(QPixmap(
IMG(
"id_icon_redo")),
TR(
"id_menuitem_redo_na"),
this);
190 _pCutAction =
new QAction(QPixmap(
IMG(
"id_icon_cut")),
TR(
"id_menuitem_cut"),
this);
196 _pCopyAction =
new QAction(QPixmap(
IMG(
"id_icon_copy")),
TR(
"id_menuitem_copy"),
this);
202 _pPasteAction =
new QAction(QPixmap(
IMG(
"id_icon_paste")),
TR(
"id_menuitem_paste"),
this);
209 new QAction(QPixmap(
IMG(
"id_icon_show_spectremngr")),
TR(
"id_menuitem_show_spectremngr"),
this);
217 new QAction(QPixmap(
IMG(
"id_icon_show_maillagemngr")),
TR(
"id_menuitem_show_maillagemngr"),
this);
225 new QAction(QPixmap(
IMG(
"id_icon_show_biblio")),
TR(
"id_menuitem_show_biblio"),
this);
232 new QAction(QPixmap(
IMG(
"id_icon_show_output")),
TR(
"id_menuitem_show_output"),
this);
238 new QAction(QPixmap(
IMG(
"id_icon_edit_curcalcul")),
TR(
"id_menuitem_edit_curcalcul"),
this);
244 new QAction(QPixmap(
IMG(
"id_icon_go_curcalcul")),
TR(
"id_menuitem_go_curcalcul"),
this);
249 QAction* pPrefDialogAction =
250 new QAction(QPixmap(
IMG(
"id_icon_prefdlg")),
TR(
"id_menuitem_prefdlg"),
this);
254 QMenu* pFileMenu =
new QMenu(
TR(
"id_menu_file"),
this);
255 menuBar()->addMenu(pFileMenu);
257 QMenu* pNewMenu =
new QMenu(
TR(
"id_menuitem_new"),
this);
258 pNewMenu->setTearOffEnabled(
true);
266 pFileMenu->addMenu(pNewMenu);
269 pFileMenu->addSeparator();
273 pFileMenu->addSeparator();
275 pFileMenu->addSeparator();
277 pFileMenu->addSeparator();
280 QMenu* pEditMenu =
new QMenu(
TR(
"id_menu_edit"),
this);
281 menuBar()->addMenu(pEditMenu);
284 pEditMenu->addSeparator();
288 pEditMenu->addSeparator();
289 pEditMenu->addAction(QPixmap(
IMG(
"id_icon_prefdlg")),
TR(
"id_menuitem_prefdlg"),
this,
296 menuBar()->addSeparator();
298 QMenu* pHelpMenu =
new QMenu(
TR(
"id_menu_help"),
this);
299 menuBar()->addMenu(pHelpMenu);
301 pHelpMenu->addSeparator();
307 QToolButton* pToolNewFile =
new QToolButton(
this);
308 pToolNewFile->setIcon(QPixmap(
IMG(
"id_icon_new")));
309 pToolNewFile->setToolTip(
TR(
"id_menuitem_new"));
310 pToolNewFile->setMenu(pNewMenu);
311 pToolNewFile->setPopupMode(QToolButton::InstantPopup);
427 QObject::connect(
_pOutputDockWnd, &QDockWidget::visibilityChanged,
this,
438 QShortcut* shortcut =
new QShortcut(QKeySequence(Qt::Key_Escape),
this);
456 statusBar()->showMessage(
TR(
"id_status_ready"));
470 QMenu* returnedMenu = QMainWindow::createPopupMenu();
472 myMenu->addActions(returnedMenu->actions());
480 TYPreferenceManager::saveGeometryToPreferences(metaObject()->className(),
this);
483 QObjectList objectsList = children();
484 QWidget* pDockWnd = NULL;
485 QObject* pObject = NULL;
487 for (
int _i = 0; _i < objectsList.size(); _i++)
489 pObject = objectsList[_i];
490 if ((pObject->objectName() ==
"ProjetDockWnd") || (pObject->objectName() ==
"SiteDockWnd") ||
491 (pObject->objectName() ==
"OutputDockWnd") ||
492 (strcmp(pObject->metaObject()->className(),
"QToolBar") == 0) ||
493 (
dynamic_cast<QToolBar*
>(pObject) !=
nullptr))
496 pDockWnd = (QWidget*)pObject;
497 QString key = pDockWnd->objectName();
500 TYPreferenceManager::saveGeometryToPreferences(key, pDockWnd);
512 statusBar()->showMessage(
TR(
"id_status_load_settings"), 3000);
516 QString userDir = QDir::toNativeSeparators(
getTYApp()->tympanUserDir());
519 QString(
"Settings4.[0-9]MainWindowIHM.bin"));
521 if (inFile !=
nullptr && inFile->open(QIODevice::ReadOnly))
523 QByteArray byteArray = inFile->readAll();
524 if (!byteArray.isEmpty())
526 restoreState(byteArray);
532 bool isCopiedFromDefaultSettings =
false;
534 searchSettingsFile(userDir, fileName, QString(
".xml"), QString(
"Settings4.[0-9].xml"));
538 TYPreferenceManager::init(fileName +
".xml", isCopiedFromDefaultSettings, std::move(settingsFile));
542 res = res && TYPreferenceManager::read();
547 if (isCopiedFromDefaultSettings)
550 QString libraryDir = QDir::toNativeSeparators(userDir +
"/library/");
555 TYPreferenceManager::loadGeometryFromPreferences(metaObject()->className(),
this);
558 QObjectList objectsList = children();
559 QWidget* pDockWnd = NULL;
560 QObject* pObject = NULL;
562 for (
int _i = 0; _i < objectsList.size(); _i++)
564 pObject = objectsList[_i];
565 if ((pObject->objectName() ==
"ProjetDockWnd") || (pObject->objectName() ==
"SiteDockWnd") ||
566 (pObject->objectName() ==
"OutputDockWnd") ||
567 (strcmp(pObject->metaObject()->className(),
"QToolBar") == 0) ||
568 (
dynamic_cast<QToolBar*
>(pObject) !=
nullptr))
570 pDockWnd = (QWidget*)pObject;
571 QString key = pDockWnd->objectName();
573 TYPreferenceManager::loadGeometryFromPreferences(key, pDockWnd);
583 const QString& fileNameBegin,
584 const QString& fileNameEnd,
585 const QString& fileNamePattern)
588 auto regularFile = std::make_unique<QFile>(QString(fileNameBegin) + QString(fileNameEnd));
589 if (regularFile->exists())
591 qDebug() <<
"Regular file" << QString(fileNameBegin + fileNameEnd) <<
"found.";
597 qDebug() <<
"Regular file" << QString(fileNameBegin + fileNameEnd)
598 <<
"NOT found, searching for oldest files";
601 QDir folder(TympanUserDir);
604 QStringList matchingFiles = folder.entryList(QStringList(fileNamePattern), QDir::Files);
607 if (!matchingFiles.isEmpty())
609 qDebug() <<
"File(s) macthing" << fileNamePattern <<
"pattern found in the folder.";
611 QString selectedFile;
615 for (
const QString& matchingFile : matchingFiles)
618 int digit = matchingFile.mid(10, 1).toInt();
621 if (digit > maxDigit)
624 selectedFile = matchingFile;
629 qDebug() <<
"Selected file: " << selectedFile;
630 return std::make_unique<QFile>(QDir::toNativeSeparators(TympanUserDir +
"/" + selectedFile));
635 qDebug() <<
"No matching files found in the folder.";
645 QByteArray byteArray = saveState();
646 QFile* outFile =
new QFile(QString(fileName) + QString(
"MainWindowIHM.bin"));
647 if (outFile->open(QIODevice::WriteOnly))
649 outFile->write(byteArray);
656 QString finalFileName = QString(fileName) + QString(
".xml");
657 TYPreferenceManager::setFileName(finalFileName);
658 res = TYPreferenceManager::write();
671 QMessageBox* pAboutTympan =
new QMessageBox(NULL);
672 pAboutTympan->setWindowTitle(windowTitle());
673 QString msg =
TR(
"id_about_msg");
674 msg = msg.arg(TY_PRODUCT_NAME_);
675 msg = msg.arg(TY_CURRENT_RELEASE_);
677 msg = msg.arg(TY_PRODUCT_COPYRIGHT_);
678 msg = msg.arg(TY_BUILD_DATE_);
679 msg = msg.arg(TY_BUILD_TIME_);
680 msg = msg.arg(TY_CUSTOMER_);
681 msg = msg.arg(TY_LICENCE_NUMBER_);
682 msg = msg.arg(TY_TIME_LIMIT_);
683 pAboutTympan->setText(msg);
684 pAboutTympan->setIconPixmap(
IMG(
"id_logo_about"));
687 pAboutTympan->exec();
702 if (pProj !=
nullptr)
707 else if (pElt->
isA(
"TYSiteNode"))
712 else if (pElt->
isA(
"TYBatiment"))
716 else if (pElt->
isA(
"TYMachine"))
731 pBatimentModeler->setAttribute(Qt::WA_DeleteOnClose);
732 _pWorkspace->addSubWindow(pBatimentModeler)->setObjectName(
"TYBatimentModelerFrame");
746 pBatimentModeler->showMaximized();
747 pBatimentModeler->
fit();
770 pMachineModeler->setAttribute(Qt::WA_DeleteOnClose);
772 _pWorkspace->addSubWindow(pMachineModeler)->setObjectName(
"TYMachineModelerFrame");
786 pMachineModeler->showMaximized();
787 pMachineModeler->
fit();
808 pSiteModeler->setAttribute(Qt::WA_DeleteOnClose);
810 _pWorkspace->addSubWindow(pSiteModeler)->setObjectName(
"TYSiteModelerFrame");
818 pSiteModeler->showMaximized();
825 pSiteModeler->setAttribute(Qt::WA_DeleteOnClose);
827 _pWorkspace->addSubWindow(pSiteModeler)->setObjectName(
"TYSiteModelerFrame");
835 pSiteModeler->showMaximized();
867 QList<QMdiSubWindow*> windows =
_pWorkspace->subWindowList();
869 for (
int i = 0; i < int(windows.count()); ++i)
871 QWidget* internal_window = windows.at(i)->widget();
883 if (pModelerFrame !=
nullptr)
886 bool keepRays =
false;
894 if (pSiteModelerFrame !=
nullptr)
897 bool enableAltimetrieButton =
false;
904 if (!enableAltimetrieButton)
911 ((
TYModelerFrame*)internal_window)->updateView(clipping, axesAndGrid);
924 QList<QMdiSubWindow*> windows =
_pWorkspace->subWindowList();
926 for (
int i = 0; i < int(windows.count()); ++i)
928 QWidget* internal_window = windows.at(i)->widget();
940 QList<QMdiSubWindow*> windows =
_pWorkspace->subWindowList();
942 for (
int i = 0; i < int(windows.count()); ++i)
944 QWidget* internal_window = windows.at(i)->widget();
950 QString windowTitle = internal_window->windowTitle();
955 if (pInW->isActiveWindow())
960 if (psiteframe !=
nullptr)
972 if (pbatimentframe !=
nullptr)
977 if (newElement !=
nullptr)
983 if (pmachineframe !=
nullptr)
988 if (newElement !=
nullptr)
1004 QList<QMdiSubWindow*> windows =
_pWorkspace->subWindowList();
1006 for (
int i = 0; i < int(windows.count()); ++i)
1008 QWidget* internal_window = windows.at(i)->widget();
1009 QWidget* container_window = windows.at(i);
1016 container_window->close();
1024 QList<QMdiSubWindow*> windows =
_pWorkspace->subWindowList();
1026 for (
int i = 0; i < int(windows.count()); ++i)
1028 QWidget* container_window = windows.at(i);
1029 container_window->close();
1050 QAction* cascadeId =
1055 QList<QMdiSubWindow*> windows =
_pWorkspace->subWindowList();
1057 if (windows.isEmpty())
1059 cascadeId->setEnabled(
false);
1060 tileId->setEnabled(
false);
1066 viewMenu->setTitle(
TR(
"id_menuitem_views"));
1071 for (
int i = 0; i < int(windows.count()); ++i)
1073 QWidget* internal_window = windows.at(i)->widget();
1075 if (!internal_window)
1080 QAction*
id =
_pWindowsMenu->addAction(internal_window->windowTitle(),
this,
1083 id->setChecked(
_pWorkspace->activeSubWindow() == windows.at(i));
1089 QAction* action = (QAction*)sender();
1090 int id = action->data().toInt();
1092 QWidget* pWidget =
_pWorkspace->subWindowList().at(
id)->widget();
1096 pWidget->showNormal();
1097 pWidget->setFocus();
1099 if (QString(pWidget->metaObject()->className()).compare(
"TYSpectreManager") == 0)
1103 else if (QString(pWidget->metaObject()->className()).compare(
"TYDataBaseFrame") == 0)
1107 else if (QString(pWidget->metaObject()->className()).compare(
"TYMaillageManager") == 0)
1126 QMdiSubWindow* subWindow =
_pWorkspace->activeSubWindow();
1127 if (
_pWorkspace->subWindowList().count() > 0 && subWindow)
1129 pW = subWindow->widget();
1162 void (QButtonGroup::*qButtonGroup_clicked)(int) = &QButtonGroup::idClicked;
1195 if (QString(pW->metaObject()->className()).compare(
"TYSiteModelerFrame") == 0)
1204 bool bActiveCalculToolBar =
false;
1209 bActiveCalculToolBar =
true;
1215 bActiveCalculToolBar =
true;
1241 else if (QString(pW->metaObject()->className()).compare(
"TYMachineModelerFrame") == 0)
1267 else if (QString(pW->metaObject()->className()).compare(
"TYBatimentModelerFrame") == 0)
1292 else if (QString(pW->metaObject()->className()).compare(
"TYFaceModelerFrame") == 0)
1296 QObject::disconnect(pF, tyFaceModelerFrame_editorModeChanged,
this,
1360 const QString& redoCmd)
1365 if (!undoCmd.isEmpty())
1374 if (!redoCmd.isEmpty())
1419 if (QMessageBox::warning(
this,
"Tympan",
TR(
"id_msg_solver_out"), QMessageBox::Yes,
1420 QMessageBox::No) == QMessageBox::Yes)
1484 bool hasMockSucceeded;
1486 if (!hasMockSucceeded)
1489 <<
"Mocking IGN Geoplatform resources has failed. Please check mock resources availability.";
1515 QFileInfo fileInfo(
getTYApp()->getCurrentFileName());
1516 QString imageFilePath = fileInfo.path().replace(
"\\",
"/") +
"/" + fileInfo.baseName() +
"." +
"png";
1520 qInfo() <<
"Impossible to save image file to " << imageFilePath;
1528 imageFilePath =
"C:/projects/tympan/issues/530 - Mock IGN/image.png";
1537 QString dirName = QFileInfo(imageFilePath).absolutePath();
1538 QDir::setCurrent(dirName);
1545 if (coord.isEmpty())
1547 qDebug() <<
"Error getting selected zone coords, aborting project creation";
1552 QStringList listCoords = coord.split(
",");
1553 const int len = listCoords.size();
1556 qDebug() <<
"The zone must be a box, aborting project creation";
1563 OBox selectedZone{coordsDouble[0], coordsDouble[1], 0.0, coordsDouble[2], coordsDouble[3], 0.0};
1564 OCoord3D SIGCoords{(selectedZone._min._x + selectedZone._max._x) * 0.5,
1565 (selectedZone._min._y + selectedZone._max._y) * 0.5, 0.0};
1568 double imageWidth = imageWidthString.toDouble();
1570 qInfo() <<
"scaleFactorString : " << scaleFactorString;
1571 double scaleFactor = scaleFactorString.toDouble();
1572 qInfo() <<
"scaleFactor : " << scaleFactor;
1573 mainSite->
setEchelle(abs(coordsDouble[2] - coordsDouble[0]) * scaleFactor / imageWidth);
1579 std::vector<TYPoint> coords(4);
1580 double demiX = abs(coordsDouble[2] - coordsDouble[0]) * scaleFactor / 2;
1581 double demiY = abs(coordsDouble[3] - coordsDouble[1]) * scaleFactor / 2;
1582 coords[0] =
TYPoint(demiX, demiY, 0,
false);
1583 coords[1] =
TYPoint(demiX, -demiY, 0,
false);
1584 coords[2] =
TYPoint(-demiX, -demiY, 0,
false);
1585 coords[3] =
TYPoint(-demiX, demiY, 0,
false);
1645 if (pDlg->result() == QDialog::Accepted)
1657 TYApplication::setOverrideCursor(Qt::WaitCursor);
1659 QString strExtend =
"";
1662 strExtend =
TR(
"id_status_file_ro");
1668 ") : " + fileName +
' ' + strExtend);
1675 TYApplication::restoreOverrideCursor();
1688 if (pDlg->result() == QDialog::Accepted)
1708 switch (QMessageBox::warning(
this,
"Attention",
TR(
"id_file_not_saved"), QMessageBox::Yes,
1711 case QMessageBox::Yes:
1722 case QMessageBox::No:
1734 QList<QMdiSubWindow*> windows =
_pWorkspace->subWindowList();
1736 for (
int i = 0; i < int(windows.count()); ++i)
1738 windows.at(i)->close();
1749 QString fileName =
"";
1794 QWidget* pW = this->focusWidget();
1829 QMessageBox::warning(
this,
"Tympan",
TR(
"id_nothingtoexport"));
1834 QString fileName =
getFileName(
"XML (*.xml)", dirName);
1836 bRet =
save(dirName, fileName, pElement);
1840 QMessageBox::information(
this,
"Tympan",
TR(
"id_export_ok").arg(fileName));
1848 QMessageBox::warning(
this,
"Tympan",
TR(
"id_export_failed").arg(fileName));
1857 if (!pElement || fileName.isEmpty())
1861 if (dirName.isEmpty())
1873 QString version(TY_CURRENT_RELEASE_);
1874 QString tiret(
" - ");
1875 QString licencie(TY_CUSTOMER_);
1876 QString licenceNumber(TY_LICENCE_NUMBER_);
1878 QString messageVersion = version + tiret + licencie + tiret + licenceNumber;
1881 xmlManager.
createDoc(TY_PRODUCT_XMLTAG_, messageVersion);
1884 if (xmlManager.
save(fileName) == 0)
1900 QMessageBox::warning(
this,
"Tympan",
TR(
"id_nothingtoexport"));
1905 QString fileName =
getFileName(
"XML (*.xml)", dirName,
true);
1909 bRet =
save(dirName, fileName, pElement);
1913 QMessageBox::information(
this,
"Tympan",
TR(
"id_export_ok").arg(fileName));
1921 QMessageBox::warning(
this,
"Tympan",
TR(
"id_export_failed").arg(fileName));
1936 QMessageBox::warning(
this,
"Tympan",
TR(
"id_nothingtoexport"));
1941 QString fileName =
getFileName(
"XML (*.xml)", dirName,
true);
1946 bRet =
save(dirName, fileName, pProjet);
1950 QMessageBox::information(
this,
"Tympan",
TR(
"id_export_ok").arg(fileName));
1954 QMessageBox::warning(
this,
"Tympan",
TR(
"id_export_failed").arg(fileName));
1967 if (pElement == NULL)
1973 QString fileName =
getFileName(
"XML (*.xml)", dirName,
true);
1977 bRet =
save(dirName, fileName, pElement);
1981 QMessageBox::information(
this,
"Tympan",
TR(
"id_export_ok").arg(fileName));
1985 QMessageBox::warning(
this,
"Tympan",
TR(
"id_export_failed").arg(fileName));
2004 QFileInfo fi(fileName);
2006 QString nomFichier = fi.absolutePath() +
'/' + fi.baseName() +
".bak";
2009 QFile fileToSave(fileName);
2010 bool bOpen = fileToSave.open(QIODevice::ReadOnly);
2019 bOpen =
backupFile.open(QIODevice::WriteOnly);
2054 QFileInfo fi(fileName);
2059 QFile* file =
new QFile(fileName);
2061 QMessageBox::warning(
this,
"Attention",
TR(
"id_file_exist"), QMessageBox::Yes, QMessageBox::No))
2063 case QMessageBox::Yes:
2064 if (!file->remove())
2066 QMessageBox::warning(
this,
"Attention",
TR(
"id_file_cannot_be_clear"));
2071 case QMessageBox::No:
2084 const bool& forceNewName )
2090 if (!forceNewName && !fileName.isEmpty())
2096 short index = filter.indexOf(
".");
2097 QString end = filter.mid(index, 4);
2099 QFileDialog* pDialog =
new QFileDialog(parentWidget(),
"Choose a file", dirName, filter);
2100 pDialog->setFileMode(QFileDialog::AnyFile);
2101 pDialog->setAcceptMode(QFileDialog::AcceptSave);
2102 pDialog->setWindowModality(Qt::WindowModal);
2105 QStringList list = pDialog->selectedFiles();
2106 if ((pDialog->result() == QDialog::Accepted) && (!list.isEmpty()))
2108 fileName = list.first();
2110 QDir dir = pDialog->directory();
2111 dirName = dir.absolutePath();
2115 if (!fileName.endsWith(end))
2130 QWidget* pW = this->focusWidget();
2187 QProcess* pImporterLauncher =
new QProcess(
this);
2196 pImporterLauncher->start(
"Importer", QStringList(
""));
2198 if (pImporterLauncher->state() == QProcess::Running)
void writeOutputMsg(QString msg)
Affiche un message dans la fenetre de sortie.
TYApplication * getTYApp()
Retourne le pointeur sur l'application.
pour l'application Tympan (fichier header)
Modeler specialisee pour l'edition des batiments (fichier header)
Boite de dialogue pour la creation d'un nouvel element metier. L'element cree peut etre sauvegarde en...
#define TYDIRPREFERENCEMANAGER
Classe Modeler specialisee pour l'edition des faces (fichier header)
Modeler specialisee pour l'edition des machines (fichier header)
Fenetre principale de l'application Tympan (fichier header)
Classe generique pour une fenetre de modeleur (fichier header)
Boite de dialogue pour le chargement d'un element metier (fichier header)
Frame pour les messages de retour (fichier header)
Gestion de la table de correspondance indice/element pour le picking (fichier header)
Boite de dialogue pour la selection du plugin de calcul (fichier header)
#define DEFAULT_SOLVER_UUID
Tables pour le dialogue de la gestion des preferences (fichier header)
Frame pour la gestion de projet (fichier header)
Frame pour la gestion de site (fichier header)
Classe Modeler specialisee pour l'edition des sites (fichier header)
virtual void debug(const char *message,...)
static OMessageManager * get()
static OPrototype * safeDownCast(OPrototype *pObject)
bool isA(const char *className) const
size_t getNbChild() const
void redo()
Effectue a nouveau la derniere action annulee.
void undo()
Annule la derniere action.
void emitUndoRedo()
Envoie un signal informant sur l'etat de ce ActionManager.
void undoRedoChanged(bool undoAvailable, bool redoAvailable, const QString &undoCmd, const QString &redoCmd)
Indique l'etat de ce ActionManager.
void setCurSiteNode(LPTYSiteNode pSiteNode)
Set/Get du site node courant.
static const QString & getCurrentDirName()
LPTYProjet getCurProjet()
Set/Get du projet courant.
static QString tympanAppDir()
Retourne le chemin du dossier de l'application.
TYCalculManager * getCalculManager()
Get du gestionnaire de calculs.
static const QString & getCurrentFileName()
Retourne le nom du fichier en cours d'utilisation.
void curSiteNodeChanged(LPTYSiteNode pCurSiteNode)
Signal que le site node courant a change.
void curProjetChanged(LPTYProjet pCurProjet)
Signal que le projet courant a change.
static void setCurrentFileName(const QString &fileName)
Enregistre le nom du fichier de travail courant.
static QString tympanUserDir()
Retourne le chemin du dossier de sauvegarde de l'utilisateur courant. Celui-ci est donne par la varia...
void setCurProjet(LPTYProjet pProjet)
Set/Get du projet courant.
static void setCurrentDirName(const QString &dirName)
Get/Set du repertoire de travail courant.
Classe Modeler specialisee pour l'edition des batiments.
void setBatiment(LPTYBatiment pBatiment)
Set/Get du bâtiment a editer.
LPTYBatiment getBatiment()
virtual void setEditorMode(int mode)
bool launchCurrent()
Execute le calcul courant.
void setCurrent(LPTYCalcul pCalcul)
Set du Calcul et Projet courant.
int getState()
Get calculation state.
void setSolverId(const OGenID &iD)
Set solver ID.
void setState(int state)
Set editable attribute.
bool getKeepRays() const
Returns if computation contains rays or not \ returns true if computation contains rays else returns ...
Boite de dialogue pour la creation d'un nouvel element metier. L'element cree peut etre sauvegarde en...
void createElement(QString eltType)
Gere la creation d'un nouvel element au sein de l'application.
TYElement * getParent() const
static void setLogInstances(bool log)
static void setIsSavedOk(const bool &toSave)
const TYUUID & getID() const
static void setRegenerateID(const bool &bRegenerate)
static bool getIsSavedOk()
static TYElement * getInstance(TYUUID uuid)
Classe Modeler specialisee pour l'edition des faces.
virtual void setEditorMode(int mode)
This class holds a singleton instance which is an entry point for accessing IGN Geoplatform in order ...
std::shared_ptr< TYIGNLevelCurvesParser > _parser
const QString getLandtakeCoord()
const QString getImageWidth()
static TYIGNGeoProvider * getInstance()
void geoProjectCreationRequested()
std::vector< double > coordinatesToDouble(const QString &coord)
void buildLevelCurves(const OCoord3D &SIGCoords, const OBox &selectedZone, double scaleFactor)
void openModalWindow(QWidget *mainWindow)
bool mockGeoPf()
Mocks IGN Geoplatform web services when they are down.
bool saveImageToFile(const QString &filePath)
const QString getScaleFactor()
void courbeNiveauCreated(LPTYCourbeNiveau courbeNiveau)
Classe Modeler specialisee pour l'edition des machines.
void setMachine(LPTYMachine pMachine)
virtual void setEditorMode(int mode)
Main window of the Tympan application.
void updateModelersAfterComputation(LPTYProjet &result)
void updateHideOrShowOutputAction(bool visibilityChanged)
QDockWidget * _pOutputDockWnd
Dockable window for feedback messages.
TYProjetFrame * _pProjetFrame
Frame for project management.
TYInfraToolbar * _pToolbarInfra
Infrastructure toolbar.
TYElement * elementToSave()
void updateCurrentAppFile(const QString &dirName, const QString &fileName)
TYFaceToolbar * _pToolbarFace
Face toolbar.
QString getFileName(const QString &filter, QString &dirName, const bool &forceNewName=false)
Produces a valid file name (or nothing!)
QButtonGroup * _pBatimentBtnGroup
Button group for building toolbar.
QAction * _pOpenAction
Action to open the library manager.
QDockWidget * _pSiteDockWnd
Dockable window for site management.
void updateCurrentFileName(const QString &fileName)
void saveCurBatimentMode(int mode)
TYSiteFrame * _pSiteFrame
Frame for site management.
void saveCurFaceMode(int mode)
TYTopoToolbar * _pToolbarTopo
Topography toolbar.
void setCurSiteNode(LPTYSiteNode pSiteNode)
QAction * _pCreateNewAction
Action to create a new element.
void onCourbeNiveauCreated(LPTYCourbeNiveau courbeNiveau)
bool loadSettings(const QString &fileName)
void makeSiteModeler(LPTYSiteNode pSite=NULL)
bool _closeAndQuit
Indicator for canceling the exit command.
TYCalculToolbar * _pToolbarCalcul
Calculation toolbar.
void formatFileName(QString &fileName)
bool backupFile(const QString &fileName)
QAction * _pSaveAsAction
Action to save an element with a specific name.
void updateUndoRedo(bool undoAvailable, bool redoAvailable, const QString &undoCmd, const QString &redoCmd)
bool makeBatimentModeler(LPTYBatiment pBatiment=NULL)
QAction * _pUndoAction
Action to perform an undo.
int _curSiteMode
Preserves the current mode of SiteModeler windows.
QAction * _pPrintAction
Action to print.
QAction * _pRedoAction
Action to perform a redo.
void windowsMenuActivated()
QButtonGroup * _pFaceBtnGroup
Button group for face toolbar.
QAction * _pSaveAction
Action to save an element.
QAction * _pHideOrShowOutputAction
Shows or hides the output messages window.
QMdiArea * _pWorkspace
Workspace for MDI management.
TYProjetFrame * getProjetFrame()
QAction * _pPasteAction
Action to perform a paste.
bool makeModeler(TYElement *pElt)
void saveCurMachineMode(int mode)
QAction * _pCloseAction
Action to close the current project or site.
void createNewGeoProjet()
QButtonGroup * _pMachineBtnGroup
Button group for machine toolbar.
void updateModelers(bool clipping=true, bool axesAndGrid=true, bool displayList=true)
void connectActionManager(TYActionManager *pActionManager)
TYSiteFrame * getSiteFrame()
TYModelerToolbar * _pToolbarModeler
General toolbar for modelers.
void showBiblio(bool show)
QAction * _pHideOrShowSpectreMngrAction
Shows or hides the Spectrum Manager.
int _curFaceMode
Preserves the current mode of FaceModeler windows.
TYMachineToolbar * _pToolbarMachine
Machine toolbar.
QMenu * _pWindowsMenu
Spectra manager.
void refreshWindowTitle()
void showPreferenceDialog()
QAction * _pHideOrShowMaillageMngrAction
Shows or hides the Mesh Manager.
void showZoneSelectPage()
void makeProjetModeler(LPTYProjet pProjet=NULL)
virtual void closeEvent(QCloseEvent *pEvent)
void showMaillageManager(bool show)
bool saveSettings(const QString &fileName)
TYModelerFrame * _pCurrentModeler
Currently displayed modeler.
void connectDefaultActionManager()
QOpenGLWidget * _pDummyQOpenGLWidget
QAction * _pGoCurCalculAction
Action to start the current calculation.
void updateModelersElementGraphic(bool force=false)
QToolBar * _pCalculAcousticToolbar
Toolbar for acoustic calculations.
QAction * _pCutAction
Action to perform a cut.
bool makeMachineModeler(LPTYMachine pMachine=NULL)
QAction * _pEditCurCalculAction
Action to edit the preferences of the current calculation.
void setCurProjet(LPTYProjet pProjet)
QAction * _pSaveAsNoResultAction
Action to save an element with a specific name without calculation results.
void showOutput(bool show)
virtual QMenu * createPopupMenu()
bool testFile(const QString &fileName)
Tests the existence and the possibility of writing the file.
QTextBrowser * _pHelpBrowser
Help browser.
void saveGeometryToPreferences()
save geometry of windows to preferences
int _curMachineMode
Preserves the current mode of MachineModeler windows.
std::unique_ptr< QFile > searchSettingsFile(const QString &TympanUserDir, const QString &fileNameBegin, const QString &fileNameEnd, const QString &fileNamePattern)
Returns a regular file name or the most recent file matching the file name pattern in the Tympan user...
void windowsMenuAboutToShow()
QToolBar * _pWindowToolbar
Toolbar for window management.
TYOutputFrame * _pOutputFrame
Frame for feedback messages.
void saveCurSiteMode(int mode)
void closeModeler(const TYElement *pElement)
QButtonGroup * _pSiteBtnGroup
Button group for site toolbars.
QAction * _pCopyAction
Action to perform a copy.
QToolBar * _pMainToolbar
Main toolbar.
QAction * _pShowPluginManagerAction
Action to display the plug-in manager.
TYBatimentToolbar * _pToolbarBatiment
Building toolbar.
void subWindowActivated()
int _curBatimentMode
Preserves the current mode of BatimentModeler windows.
QDockWidget * _pProjetDockWnd
Dockable window for project management.
void showSpectreManager(bool show)
QAction * _pHideOrShowBiblioAction
Shows or hides the Library of elements.
void setDefaultCameraMode()
Generic class for a modeler window.
void updateElementGraphic(bool force=false)
TYRenderWindowInteractor * getView()
void setEditorModeToCamera()
void setKeepRays(bool keepRays)
void editorModeChanged(int mode)
void viewTypeChanged(int)
TYActionManager * getActionManager()
virtual void updateView(bool clipping=true, bool axesAndGrid=true)
Boite de dialogue pour le chargement d'un element metier. L'element peut etre ouvert dans un modeleur...
void openElement(LPTYElement pElt)
void setDirName(const QString &value)
Set du nom du repertoire de travail.
void setMultiSelect(const bool &b)
QString getDirName()
Get du nom du repertoire de travail.
std::vector< LPTYElement > getTabElem()
LPTYElementArray getAvailableElements()
Realise le rendu VTK et le rendu OpenGL.
void invalidateScene(void)
void clearTabSelectedElement()
Frame pour les messages de retour.
classe graphique pour la gestion de la table de correspondanceindice/element pour le picking
Boite de dialogue pour la selection du plugin de calcul.
Boite de dialogue pour la gestion des preferences.
Frame pour la gestion de projet.
void changeSite(LPTYSiteNode pSite)
void setProjet(LPTYProjet pProjet)
void changeCurrentCalcul(LPTYCalcul pCalcul)
classe de definition d'un projet.
void setStatusSolver(const bool &bStatus)
bool getStatusSolver()
Get/Set du statut de disponibilite du solveur du calcul courant.
LPTYSiteNode getSite()
Get du site.
LPTYCalcul getCurrentCalcul()
Set/Get du pointeur du Calcul courant.
Le role de cette classe est limite a emettre des signaux pouvant etre utilise pour interagir sur le r...
TYOpenGLRenderer * getRenderer()
Frame pour la gestion de site.
TYSiteNode * getSiteNodeRoot()
void setSiteNodeRoot(LPTYSiteNode pSiteNode)
void setCurrentCalcul(LPTYCalcul pCalcul)
Classe Modeler specialisee pour l'edition des sites.
virtual void setEditorMode(int mode)
void setProjet(LPTYProjet pProjet)
virtual void setMaillageRenderModeSlot()
void showAltimetrie(bool show)
void enableAltimetrieButton(bool enable)
virtual void updateView(bool clipping=true, bool axesAndGrid=true)
LPTYAltimetrie getAltimetry() const
LPTYTopographie getTopographie()
void setEmprise(TYTabPoint points)
void setTopoFileName(const QString &name)
void setUseEmpriseAsCrbNiv(bool b)
void loadTopoFile(const QString &fileName)
void setUseTopoFile(bool flag)
bool addCrbNiv(LPTYCourbeNiveauGeoNode pCrbNivGeoNode)
int save(QString fileName)
void createDoc(QString docName, QString version)
int addElement(TYElement *pElt)
static void setSavedFileName(QString savedFileName)
#define TY_PRODUCT_PLATFORM_