22 #include <qscrollarea.h>
24 #include <qlineedit.h>
27 #include <qbuttongroup.h>
28 #include <qradiobutton.h>
29 #include <qgridlayout.h>
30 #include <qcombobox.h>
31 #include <qcheckbox.h>
32 #include <qgroupbox.h>
33 #include <qpushbutton.h>
34 #include <qvalidator.h>
35 #include <qfiledialog.h>
37 #include <QMdiSubWindow>
53 #define TR(id) OLocalizator::getString("TYPreferenceDialog", (id))
58 static QLayout* wrapLayoutIntoScrollArea(QLayout* layout)
60 QScrollArea* scrollArea =
new QScrollArea();
62 QWidget* rootWidget =
new QWidget();
63 rootWidget->setLayout(layout);
64 scrollArea->setWidget(rootWidget);
65 scrollArea->setWidgetResizable(
true);
67 QLayout* parentLayout =
new QVBoxLayout();
68 parentLayout->addWidget(scrollArea);
75 setWindowTitle(
TR(
"id_caption"));
77 setMinimumSize(700, 400);
88 connect(
_buttonOK, &QPushButton::clicked,
this, &TYPreferenceDialog::accept);
93 connect(
_buttonCancel, &QPushButton::clicked,
this, &TYPreferenceDialog::reject);
98 QGridLayout* buttonLayout =
new QGridLayout();
103 QVBoxLayout* mainLayout =
new QVBoxLayout;
105 mainLayout->addLayout(buttonLayout);
107 setLayout(mainLayout);
108 TYPreferenceManager::completePreferences();
113 TYPreferenceManager::loadGeometryFromPreferences(metaObject()->className(),
this);
117 return QDialog::exec();
123 QLabel* pHistoSizeLabel =
new QLabel(
TR(
"id_label_histo_size"));
126 QGridLayout* groupBoxLayout =
new QGridLayout();
127 groupBoxLayout->addWidget(pHistoSizeLabel, 0, 0);
130 QGroupBox* groupBox =
new QGroupBox();
131 groupBox->setTitle(
TR(
"id_histo"));
132 groupBox->setLayout(groupBoxLayout);
135 QLabel* pLibraryPathLabel =
new QLabel(
TR(
"id_label_biblio_path"));
137 QPushButton* buttonBiblioDirChoice =
new QPushButton(
TR(
"id_choose_btn"),
this);
140 QGridLayout* groupBoxLibraryLayout =
new QGridLayout();
141 groupBoxLibraryLayout->addWidget(pLibraryPathLabel, 0, 0);
143 groupBoxLibraryLayout->addWidget(buttonBiblioDirChoice, 0, 2);
145 QGroupBox* groupBoxLibrary =
new QGroupBox();
146 groupBoxLibrary->setTitle(
TR(
"id_biblio"));
147 groupBoxLibrary->setLayout(groupBoxLibraryLayout);
150 QLabel* pWorkDirPathLabel =
new QLabel(
TR(
"id_label_workdir_path"));
152 QPushButton* buttonWorkDirChoice =
new QPushButton(
TR(
"id_choose_btn"),
this);
155 QGridLayout* groupBoxWorkDirLayout =
new QGridLayout();
156 groupBoxWorkDirLayout->addWidget(pWorkDirPathLabel, 0, 0);
158 groupBoxWorkDirLayout->addWidget(buttonWorkDirChoice, 0, 2);
160 QGroupBox* groupBoxWorkDir =
new QGroupBox();
161 groupBoxWorkDir->setTitle(
TR(
"id_workdir"));
162 groupBoxWorkDir->setLayout(groupBoxWorkDirLayout);
164 QVBoxLayout* pTabLayout =
new QVBoxLayout();
165 pTabLayout->addWidget(groupBoxWorkDir);
166 pTabLayout->addWidget(groupBoxLibrary);
167 pTabLayout->addWidget(groupBox);
168 pTabLayout->addStretch(1);
170 auto newLayout = wrapLayoutIntoScrollArea(pTabLayout);
171 setLayout(newLayout);
177 if (!selectedDir.isEmpty())
186 if (!selectedDir.isEmpty())
194 QString ret = currentPath;
195 QFileDialog dialog(
this,
"Choose a directory", currentPath);
196 dialog.setFileMode(QFileDialog::Directory);
197 dialog.setOption(QFileDialog::ShowDirsOnly,
true);
199 if (dialog.exec() == QDialog::Accepted)
201 QStringList selected = dialog.selectedFiles();
202 if (!selected.isEmpty())
215 QLabel* pSiteLabel =
new QLabel(
TR(
"id_site"));
216 QLabel* pBatLabel =
new QLabel(
TR(
"id_batiment"));
217 QLabel* pMacLabel =
new QLabel(
TR(
"id_machine"));
218 QLabel* pFaceLabel =
new QLabel(
TR(
"id_face"));
219 QLabel* pMailLabel =
new QLabel(
TR(
"id_maillage"));
221 QLabel* pGridDimXLabel =
new QLabel(
TR(
"id_label_dimx_grid"));
228 QLabel* pGridDimYLabel =
new QLabel(
TR(
"id_label_dimy_grid"));
235 QLabel* pGridStepLabel =
new QLabel(
TR(
"id_label_step_grid"));
242 QLabel* pGridMagnStepLabel =
new QLabel(
TR(
"id_label_step_grid_magn"));
249 QGridLayout* groupBoxLayout =
new QGridLayout();
250 groupBoxLayout->addWidget(pSiteLabel, 0, 1);
251 groupBoxLayout->addWidget(pBatLabel, 0, 2);
252 groupBoxLayout->addWidget(pMacLabel, 0, 3);
253 groupBoxLayout->addWidget(pFaceLabel, 0, 4);
254 groupBoxLayout->addWidget(pMailLabel, 0, 5);
256 groupBoxLayout->addWidget(pGridDimXLabel, 1, 0);
263 groupBoxLayout->addWidget(pGridDimYLabel, 2, 0);
270 groupBoxLayout->addWidget(pGridStepLabel, 3, 0);
277 groupBoxLayout->addWidget(pGridMagnStepLabel, 4, 0);
284 QGroupBox* groupBox =
new QGroupBox();
285 groupBox->setTitle(
TR(
"id_grid"));
286 groupBox->setLayout(groupBoxLayout);
301 QGridLayout* groupBoxAnglesLayout =
new QGridLayout();
307 QGroupBox* groupBoxAngles =
new QGroupBox();
308 groupBoxAngles->setTitle(
"Angle");
309 groupBoxAngles->setLayout(groupBoxAnglesLayout);
312 QLabel* pSourceSize =
new QLabel(
TR(
"id_label_source_size"));
314 QLabel* pPointControlSize =
new QLabel(
TR(
"id_label_pointcontrol_size"));
316 QLabel* pResoCylLabel =
new QLabel(
TR(
"id_label_nb_face_cylinder"));
318 QLabel* pSeuilDistNulLabel =
new QLabel(
TR(
"id_label_seuil_dist_nulle"));
321 QGridLayout* groupBox1Layout =
new QGridLayout();
322 groupBox1Layout->addWidget(pSourceSize, 0, 0);
324 groupBox1Layout->addWidget(pPointControlSize, 1, 0);
326 groupBox1Layout->addWidget(pResoCylLabel, 2, 0);
328 groupBox1Layout->addWidget(pSeuilDistNulLabel, 3, 0);
331 QGroupBox* groupBox1 =
new QGroupBox();
332 groupBox1->setTitle(
TR(
"id_geometry"));
333 groupBox1->setLayout(groupBox1Layout);
336 QLabel* pDelaunayToleranceLabel =
new QLabel(
TR(
"id_label_delaunay_tolerance"));
338 QLabel* pDistMinPtCrbNivLabel =
new QLabel(
TR(
"id_label_dist_min_pts_crbniv"));
340 QLabel* pDefaultDimXLabel =
new QLabel(
TR(
"id_label_def_dimx"));
342 QLabel* pDefaultDimYLabel =
new QLabel(
TR(
"id_label_def_dimy"));
345 QGridLayout* groupBox2Layout =
new QGridLayout();
346 groupBox2Layout->addWidget(pDelaunayToleranceLabel, 0, 0);
348 groupBox2Layout->addWidget(pDistMinPtCrbNivLabel, 1, 0);
350 groupBox2Layout->addWidget(pDefaultDimXLabel, 2, 0);
352 groupBox2Layout->addWidget(pDefaultDimYLabel, 3, 0);
355 QGroupBox* groupBox2 =
new QGroupBox();
356 groupBox2->setTitle(
TR(
"id_topography"));
357 groupBox2->setLayout(groupBox2Layout);
360 QLabel* pDefaultHMurLabel =
new QLabel(
TR(
"id_label_def_h_mur"));
362 QLabel* pDefaultWEcranLabel =
new QLabel(
TR(
"id_label_def_w_ecran"));
365 QGridLayout* groupBox3Layout =
new QGridLayout();
366 groupBox3Layout->addWidget(pDefaultHMurLabel, 0, 0);
368 groupBox3Layout->addWidget(pDefaultWEcranLabel, 1, 0);
371 QGroupBox* groupBox3 =
new QGroupBox();
372 groupBox3->setTitle(
TR(
"id_Ecran"));
373 groupBox3->setLayout(groupBox3Layout);
375 QVBoxLayout* pTabLayout =
new QVBoxLayout;
376 pTabLayout->addWidget(groupBox);
377 pTabLayout->addWidget(groupBoxAngles);
378 pTabLayout->addWidget(groupBox1);
379 pTabLayout->addWidget(groupBox2);
380 pTabLayout->addWidget(groupBox3);
381 pTabLayout->addStretch(1);
391 auto newLayout = wrapLayoutIntoScrollArea(pTabLayout);
392 setLayout(newLayout);
398 QLabel* pClairLabel =
new QLabel(
TR(
"id_clair"));
401 QLabel* pSombreLabel =
new QLabel(
TR(
"id_sombre"));
403 QGridLayout* groupBox1Layout =
new QGridLayout();
404 groupBox1Layout->addWidget(pSombreLabel, 0, 0);
406 groupBox1Layout->addWidget(pClairLabel, 0, 2);
408 QGroupBox* groupBox1 =
new QGroupBox();
409 groupBox1->setTitle(
TR(
"id_luminosite"));
410 groupBox1->setLayout(groupBox1Layout);
413 QLabel* pPrecisLabel =
new QLabel(
TR(
"id_precision"));
415 QGridLayout* groupPrecisLayout =
new QGridLayout();
416 groupPrecisLayout->addWidget(pPrecisLabel, 0, 0);
425 QGridLayout* groupBox2Layout =
new QGridLayout();
426 groupBox2Layout->addLayout(groupPrecisLayout, 0, 0);
430 QGroupBox* groupBox2 =
new QGroupBox();
431 groupBox2->setTitle(
TR(
"id_picking"));
432 groupBox2->setLayout(groupBox2Layout);
438 QGridLayout* groupBox2bLayout =
new QGridLayout();
441 QGroupBox* groupBox2b =
new QGroupBox();
442 groupBox2b->setTitle(
TR(
"id_wireframe"));
443 groupBox2b->setLayout(groupBox2bLayout);
446 QLabel* pZoomStepLabel =
new QLabel(
TR(
"id_step"));
449 QGridLayout* groupBox3Layout =
new QGridLayout();
450 groupBox3Layout->addWidget(pZoomStepLabel, 0, 0);
453 QGroupBox* groupBox3 =
new QGroupBox();
454 groupBox3->setTitle(
TR(
"id_zoom"));
455 groupBox3->setLayout(groupBox3Layout);
458 QLabel* p2DLabel =
new QLabel(
TR(
"id_2D"));
459 QLabel* p3DLabel =
new QLabel(
TR(
"id_3D"));
460 QLabel* pLeftLabel2D =
new QLabel(
TR(
"id_left_button"));
464 QLabel* pMiddleLabel2D =
new QLabel(
TR(
"id_middle_button"));
468 QLabel* pRightLabel2D =
new QLabel(
TR(
"id_right_button"));
477 QLabel* pMiddleLabel3D =
new QLabel(
TR(
"id_middle_button"));
489 QGridLayout* groupBoxLayout =
new QGridLayout();
490 groupBoxLayout->addWidget(p2DLabel, 0, 1);
491 groupBoxLayout->addWidget(p3DLabel, 0, 2);
492 groupBoxLayout->addWidget(pLeftLabel2D, 1, 0);
494 groupBoxLayout->addWidget(pMiddleLabel2D, 2, 0);
496 groupBoxLayout->addWidget(pRightLabel2D, 3, 0);
499 groupBoxLayout->addWidget(pMiddleLabel3D, 2, 2);
503 QGroupBox* groupBox =
new QGroupBox();
504 groupBox->setTitle(
TR(
"id_mouse_button_functions"));
505 groupBox->setLayout(groupBoxLayout);
508 QLabel* p2DLabelSht =
new QLabel(
TR(
"id_2D"));
509 QLabel* p3DLabelSht =
new QLabel(
TR(
"id_3D"));
510 QLabel* pLeftLabel2DSht =
new QLabel(
TR(
"id_left_button"));
514 QLabel* pRightLabel2DSht =
new QLabel(
TR(
"id_right_button"));
529 QGridLayout* groupBox4Layout =
new QGridLayout();
530 groupBox4Layout->addWidget(p2DLabelSht, 0, 1);
531 groupBox4Layout->addWidget(p3DLabelSht, 0, 2);
532 groupBox4Layout->addWidget(pLeftLabel2DSht, 1, 0);
534 groupBox4Layout->addWidget(pRightLabel2DSht, 2, 0);
539 QGroupBox* groupBox4 =
new QGroupBox();
540 groupBox4->setTitle(
TR(
"id_mouse_button_functions_sht"));
541 groupBox4->setLayout(groupBox4Layout);
544 QLabel* pStepLabelSht =
new QLabel(
TR(
"id_camera_step"));
545 QLabel* pTranslateLabelSht =
new QLabel(
TR(
"id_translate"));
546 QLabel* pRotateLabelSht =
new QLabel(
TR(
"id_rotate"));
547 QLabel* pZoomLabelSht =
new QLabel(
TR(
"id_zoom"));
552 QGridLayout* groupBox5Layout =
new QGridLayout();
553 groupBox5Layout->addWidget(pStepLabelSht, 1, 0);
554 groupBox5Layout->addWidget(pTranslateLabelSht, 0, 1);
555 groupBox5Layout->addWidget(pRotateLabelSht, 0, 2);
556 groupBox5Layout->addWidget(pZoomLabelSht, 0, 3);
561 QGroupBox* groupBox5 =
new QGroupBox();
562 groupBox5->setTitle(
TR(
"id_camera_step_title"));
563 groupBox5->setLayout(groupBox5Layout);
565 QVBoxLayout* pTabLayout =
new QVBoxLayout();
566 pTabLayout->addWidget(groupBox1);
567 pTabLayout->addWidget(groupBox2);
568 pTabLayout->addWidget(groupBox2b);
569 pTabLayout->addWidget(groupBox3);
570 pTabLayout->addWidget(groupBox);
571 pTabLayout->addWidget(groupBox4);
572 pTabLayout->addWidget(groupBox5);
573 pTabLayout->addStretch(1);
575 auto newLayout = wrapLayoutIntoScrollArea(pTabLayout);
576 setLayout(newLayout);
582 QLabel* pBackgroundLabel =
new QLabel(
TR(
"id_background_color"));
585 QLabel* pGridLabel =
new QLabel(
TR(
"id_grid_color"));
588 QLabel* pPoliceColorLabel =
new QLabel(
TR(
"id_police_color"));
592 QGridLayout* groupBoxLayout =
new QGridLayout();
593 groupBoxLayout->addWidget(pBackgroundLabel, 0, 0);
595 groupBoxLayout->addWidget(pGridLabel, 1, 0);
597 groupBoxLayout->addWidget(pPoliceColorLabel, 2, 0);
600 QGroupBox* groupBox =
new QGroupBox();
601 groupBox->setTitle(
TR(
"id_renderer"));
602 groupBox->setLayout(groupBoxLayout);
605 QLabel* pTerrainColorLabel =
new QLabel(
TR(
"id_terrain_color"));
608 QLabel* pPlanEauColorLabel =
new QLabel(
TR(
"id_planeau_color"));
611 QLabel* pCrsEauColorLabel =
new QLabel(
TR(
"id_crseau_color"));
614 QLabel* pCrbNivColorLabel =
new QLabel(
TR(
"id_crbniv_color"));
617 QLabel* pVegColorLabel =
new QLabel(
TR(
"id_veg_color"));
621 QGridLayout* groupBox1Layout =
new QGridLayout();
622 groupBox1Layout->addWidget(pTerrainColorLabel, 0, 0);
624 groupBox1Layout->addWidget(pPlanEauColorLabel, 1, 0);
626 groupBox1Layout->addWidget(pCrsEauColorLabel, 2, 0);
628 groupBox1Layout->addWidget(pCrbNivColorLabel, 3, 0);
630 groupBox1Layout->addWidget(pVegColorLabel, 4, 0);
633 QGroupBox* groupBox1 =
new QGroupBox();
634 groupBox1->setTitle(
TR(
"id_topography"));
635 groupBox1->setLayout(groupBox1Layout);
638 QLabel* pCylindreColorLabel =
new QLabel(
TR(
"id_cylindre_color"));
641 QLabel* pBoxColorLabel =
new QLabel(
TR(
"id_box_color"));
644 QLabel* pSubRectColorLabel =
new QLabel(
TR(
"id_bouche_color"));
648 QGridLayout* groupBox2Layout =
new QGridLayout();
649 groupBox2Layout->addWidget(pCylindreColorLabel, 0, 0);
651 groupBox2Layout->addWidget(pBoxColorLabel, 1, 0);
653 groupBox2Layout->addWidget(pSubRectColorLabel, 2, 0);
656 QGroupBox* groupBox2 =
new QGroupBox();
657 groupBox2->setTitle(
TR(
"id_machine"));
658 groupBox2->setLayout(groupBox2Layout);
661 QLabel* pMurColorLabel =
new QLabel(
TR(
"id_mur_color"));
664 QLabel* pDalleColorLabel =
new QLabel(
TR(
"id_dalle_color"));
667 QLabel* pEcranColorLabel =
new QLabel(
TR(
"id_ecran_color"));
671 QGridLayout* groupBox3Layout =
new QGridLayout();
672 groupBox3Layout->addWidget(pMurColorLabel, 0, 0);
674 groupBox3Layout->addWidget(pDalleColorLabel, 1, 0);
676 groupBox3Layout->addWidget(pEcranColorLabel, 2, 0);
679 QGroupBox* groupBox3 =
new QGroupBox();
680 groupBox3->setTitle(
TR(
"id_batiment"));
681 groupBox3->setLayout(groupBox3Layout);
684 QLabel* pRouteColorLabel =
new QLabel(
TR(
"id_route_color"));
687 QLabel* pResTranspColorLabel =
new QLabel(
TR(
"id_restransp_color"));
691 QGridLayout* groupBox5Layout =
new QGridLayout();
692 groupBox5Layout->addWidget(pRouteColorLabel, 0, 0);
694 groupBox5Layout->addWidget(pResTranspColorLabel, 1, 0);
697 QGroupBox* groupBox5 =
new QGroupBox();
698 groupBox5->setTitle(
TR(
"id_infrastructure"));
699 groupBox5->setLayout(groupBox5Layout);
702 QLabel* pPointControlColorLabel =
new QLabel(
TR(
"id_pointcontrol_color"));
706 QGridLayout* groupBox7Layout =
new QGridLayout();
707 groupBox7Layout->addWidget(pPointControlColorLabel, 0, 0);
710 QGroupBox* groupBox7 =
new QGroupBox();
711 groupBox7->setTitle(
TR(
"id_group_calcul_name"));
712 groupBox7->setLayout(groupBox7Layout);
715 QLabel* pSourcePonctColorLabel =
new QLabel(
TR(
"id_sourceponct_color"));
719 QGridLayout* groupBox8Layout =
new QGridLayout();
720 groupBox8Layout->addWidget(pSourcePonctColorLabel, 0, 0);
723 QGroupBox* groupBox8 =
new QGroupBox();
724 groupBox8->setTitle(
TR(
"id_group_source_name"));
725 groupBox8->setLayout(groupBox8Layout);
730 QFrame* pLine =
new QFrame();
731 pLine->setProperty(
"frameShape", (
int)QFrame::HLine);
732 pLine->setFrameShadow(QFrame::Sunken);
733 pLine->setFrameShape(QFrame::HLine);
737 QGridLayout* groupBox6Layout =
new QGridLayout();
739 groupBox6Layout->addWidget(pLine, 0, 1, 1, 2);
742 QGroupBox* groupBox6 =
new QGroupBox();
743 groupBox6->setTitle(
TR(
"id_alti_color_map"));
744 groupBox6->setLayout(groupBox6Layout);
747 QLabel* pMailOpacityLabel =
new QLabel(
TR(
"id_maillage_opacity"));
756 QGridLayout* groupBox4Layout =
new QGridLayout();
757 groupBox4Layout->addWidget(pMailOpacityLabel, 0, 0);
761 QGroupBox* groupBox4 =
new QGroupBox();
762 groupBox4->setTitle(
TR(
"id_maillage"));
763 groupBox4->setLayout(groupBox4Layout);
766 QLabel* pWinOpacityLabel =
new QLabel(
TR(
"id_win_opacity"));
772 QLabel* pAltOpacityLabel =
new QLabel(
TR(
"id_atm_opacity"));
779 QGridLayout* groupBox9Layout =
new QGridLayout();
780 groupBox9Layout->addWidget(pWinOpacityLabel, 0, 0);
782 groupBox9Layout->addWidget(pAltOpacityLabel, 2, 0);
785 QGroupBox* groupBox9 =
new QGroupBox();
786 groupBox9->setTitle(
TR(
"id_opacity"));
787 groupBox9->setLayout(groupBox9Layout);
789 QGridLayout* pTabLayout =
new QGridLayout();
790 pTabLayout->addWidget(groupBox, 0, 0);
791 pTabLayout->addWidget(groupBox1, 1, 0, 2, 1);
792 pTabLayout->addWidget(groupBox2, 0, 1);
793 pTabLayout->addWidget(groupBox3, 1, 1);
794 pTabLayout->addWidget(groupBox5, 2, 1);
795 pTabLayout->addWidget(groupBox7, 3, 0);
796 pTabLayout->addWidget(groupBox8, 3, 1);
797 pTabLayout->addWidget(groupBox6, 4, 0, 1, 2);
798 pTabLayout->addWidget(groupBox4, 5, 0, 1, 1);
799 pTabLayout->addWidget(groupBox9, 5, 1, 1, 1);
801 auto newLayout = wrapLayoutIntoScrollArea(pTabLayout);
802 setLayout(newLayout);
815 QLabel* pLabelResistivite =
new QLabel(
TR(
"id_resistivite_label"));
817 QLabel* pUnitResis =
new QLabel(
TR(
"id_unite_resistivite"));
818 QLabel* pLabelFacteurSol =
new QLabel(
TR(
"id_facteur_sol_label"));
819 pLabelFacteurSol->setToolTip(
TR(
"id_facteur_sol_tooltip"));
821 QLabel* pUnitFacteurSol =
new QLabel(
"-");
822 QLabel* pLabelEpaisseur =
new QLabel(
TR(
"id_epaisseur_label"));
824 QLabel* pUnitEpais =
new QLabel(
TR(
"id_unite_epaisseur"));
825 QLabel* pLabelEcartType =
new QLabel(
TR(
"id_ecarttype_label"));
827 QLabel* pUnitET =
new QLabel(
TR(
"id_unite_ecarttype"));
828 QLabel* pLabelLongueur =
new QLabel(
TR(
"id_longueur_label"));
830 QLabel* pUnitLong =
new QLabel(
TR(
"id_unite_longueur"));
831 QGridLayout* groupBoxResistEpaiLayout =
new QGridLayout();
832 groupBoxResistEpaiLayout->addWidget(pLabelResistivite, 0, 0);
834 groupBoxResistEpaiLayout->addWidget(pUnitResis, 0, 2);
835 groupBoxResistEpaiLayout->addWidget(pLabelFacteurSol, 1, 0);
837 groupBoxResistEpaiLayout->addWidget(pUnitFacteurSol, 1, 2);
838 groupBoxResistEpaiLayout->addWidget(pLabelEpaisseur, 2, 0);
840 groupBoxResistEpaiLayout->addWidget(pUnitEpais, 2, 2);
841 groupBoxResistEpaiLayout->addWidget(pLabelEcartType, 3, 0);
843 groupBoxResistEpaiLayout->addWidget(pUnitET, 3, 2);
844 groupBoxResistEpaiLayout->addWidget(pLabelLongueur, 4, 0);
846 groupBoxResistEpaiLayout->addWidget(pUnitLong, 4, 2);
848 QPushButton* pPushButtonResistivite =
new QPushButton(
TR(
"id_edit_resistivite"));
851 QGridLayout* groupBox1Layout =
new QGridLayout();
852 groupBox1Layout->addLayout(groupBoxResistEpaiLayout, 0, 0);
853 groupBox1Layout->addWidget(pPushButtonResistivite, 1, 0);
855 QGroupBox* groupBox1 =
new QGroupBox();
856 groupBox1->setTitle(
TR(
"id_default_sol"));
857 groupBox1->setLayout(groupBox1Layout);
860 QLabel* pLabelMasseVol =
new QLabel(
TR(
"id_masse_vol_label"));
862 QLabel* pUnitMasseVol =
new QLabel(
TR(
"id_unite_masse_vol"));
863 QGridLayout* groupBoxMasseLayout =
new QGridLayout();
864 groupBoxMasseLayout->addWidget(pLabelMasseVol, 0, 0);
866 groupBoxMasseLayout->addWidget(pUnitMasseVol, 0, 2);
868 QPushButton* pPushButtonSpectreAbso =
new QPushButton(
TR(
"id_edit_spectre_abso"));
869 QPushButton* pPushButtonSpectreAtt =
new QPushButton(
TR(
"id_edit_spectre_att"));
872 QGridLayout* groupBoxSpectreLayout =
new QGridLayout();
873 groupBoxSpectreLayout->addWidget(pPushButtonSpectreAbso, 0, 0);
874 groupBoxSpectreLayout->addWidget(pPushButtonSpectreAtt, 0, 1);
876 QGridLayout* groupBox3Layout =
new QGridLayout();
877 groupBox3Layout->addLayout(groupBoxMasseLayout, 0, 0);
878 groupBox3Layout->addLayout(groupBoxSpectreLayout, 1, 0);
880 QGroupBox* groupBox3 =
new QGroupBox();
881 groupBox3->setTitle(
TR(
"id_default_materiau"));
882 groupBox3->setLayout(groupBox3Layout);
885 QPushButton* pPushButtonMaillage =
new QPushButton(
TR(
"id_edit_maillage"));
888 QGridLayout* groupBox4Layout =
new QGridLayout();
889 groupBox4Layout->addWidget(pPushButtonMaillage, 0, 0);
891 QGroupBox* groupBox4 =
new QGroupBox();
892 groupBox4->setTitle(
TR(
"id_default_maillage"));
893 groupBox4->setLayout(groupBox4Layout);
896 QLabel* pLabelContribution =
new QLabel(
TR(
"id_label_contribution"));
902 QGridLayout* groupBoxContribLayout =
new QGridLayout();
903 groupBoxContribLayout->addWidget(pLabelContribution, 0, 0);
905 groupBoxContribLayout->addWidget(
new QLabel(
"dB"), 0, 2, Qt::AlignLeft);
908 groupBoxContribLayout->addWidget(
new QLabel(
"dB"), 0, 4, Qt::AlignLeft);
911 groupBoxContribLayout->addWidget(
new QLabel(
"dB"), 0, 6, Qt::AlignLeft);
913 QGroupBox* groupBox5 =
new QGroupBox();
914 groupBox5->setTitle(
TR(
"id_label_contribution"));
915 groupBox5->setLayout(groupBoxContribLayout);
917 QVBoxLayout* pTabLayout =
new QVBoxLayout();
918 pTabLayout->addWidget(groupBox1);
919 pTabLayout->addWidget(groupBox3);
920 pTabLayout->addWidget(groupBox4);
921 pTabLayout->addWidget(groupBox5);
922 pTabLayout->addStretch(1);
924 auto newLayout = wrapLayoutIntoScrollArea(pTabLayout);
925 setLayout(newLayout);
940 int ret = pDialog->exec();
942 if (ret == QDialog::Accepted)
966 QString oldDir = TYPreferenceManager::getCurrentDirectory();
972 if (TYPreferenceManager::exists(
"HistoSize"))
975 ((QIntValidator*)lineEditInt->validator())->setRange(1, 256);
976 lineEditInt->setText(QString().setNum(TYPreferenceManager::getInt(
"HistoSize")));
983 if (TYPreferenceManager::exists(
"BiblioPath"))
986 ->_pLibraryPathEdit->setText(TYPreferenceManager::getString(
"BiblioPath"));
991 QString dirPath = QDir::toNativeSeparators(
getTYApp()->tympanUserDir() +
"/library/");
995 if (TYPreferenceManager::exists(
"WorkDirPath"))
998 ->_pWorkDirPathEdit->setText(TYPreferenceManager::getString(
"WorkDirPath"));
1003 QString dirPath = QDir::toNativeSeparators(
getTYApp()->getSettingsDir() +
"/echange/");
1008 if (TYPreferenceManager::exists(
"GridDimXSite"))
1011 ((QDoubleValidator*)lineEdit->validator())->setRange(1, 256000, 0);
1012 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridDimXSite")));
1014 if (TYPreferenceManager::exists(
"GridDimYSite"))
1017 ((QDoubleValidator*)lineEdit->validator())->setRange(1, 256000, 0);
1018 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridDimYSite")));
1020 if (TYPreferenceManager::exists(
"GridStepSite"))
1023 ((QDoubleValidator*)lineEdit->validator())->setRange(0.1, 256000, 2);
1024 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridStepSite")));
1026 if (TYPreferenceManager::exists(
"GridMagnStepSite"))
1029 ((QDoubleValidator*)lineEdit->validator())->setRange(0.1, 256000, 2);
1030 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridMagnStepSite")));
1033 if (TYPreferenceManager::exists(
"GridDimXBatiment"))
1036 ((QDoubleValidator*)lineEdit->validator())->setRange(1, 256000, 0);
1037 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridDimXBatiment")));
1039 if (TYPreferenceManager::exists(
"GridDimYBatiment"))
1042 ((QDoubleValidator*)lineEdit->validator())->setRange(1, 256000, 0);
1043 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridDimYBatiment")));
1045 if (TYPreferenceManager::exists(
"GridStepBatiment"))
1048 ((QDoubleValidator*)lineEdit->validator())->setRange(0.1, 256000, 2);
1049 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridStepBatiment")));
1051 if (TYPreferenceManager::exists(
"GridMagnStepBatiment"))
1054 ((QDoubleValidator*)lineEdit->validator())->setRange(0.1, 256000, 2);
1055 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridMagnStepBatiment")));
1058 if (TYPreferenceManager::exists(
"GridDimXMachine"))
1061 ((QDoubleValidator*)lineEdit->validator())->setRange(1, 256000, 0);
1062 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridDimXMachine")));
1064 if (TYPreferenceManager::exists(
"GridDimYMachine"))
1067 ((QDoubleValidator*)lineEdit->validator())->setRange(1, 256000, 0);
1068 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridDimYMachine")));
1070 if (TYPreferenceManager::exists(
"GridStepMachine"))
1073 ((QDoubleValidator*)lineEdit->validator())->setRange(0.1, 256000, 2);
1074 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridStepMachine")));
1076 if (TYPreferenceManager::exists(
"GridMagnStepMachine"))
1079 ((QDoubleValidator*)lineEdit->validator())->setRange(0.1, 256000, 2);
1080 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridMagnStepMachine")));
1083 if (TYPreferenceManager::exists(
"GridDimXFace"))
1086 ((QDoubleValidator*)lineEdit->validator())->setRange(1, 256000, 0);
1087 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridDimXFace")));
1089 if (TYPreferenceManager::exists(
"GridDimYFace"))
1092 ((QDoubleValidator*)lineEdit->validator())->setRange(1, 256000, 0);
1093 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridDimYFace")));
1095 if (TYPreferenceManager::exists(
"GridStepFace"))
1098 ((QDoubleValidator*)lineEdit->validator())->setRange(0.1, 256000, 2);
1099 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridStepFace")));
1101 if (TYPreferenceManager::exists(
"GridMagnStepFace"))
1104 ((QDoubleValidator*)lineEdit->validator())->setRange(0.1, 256000, 2);
1105 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridMagnStepFace")));
1108 if (TYPreferenceManager::exists(
"GridDimXMaillage"))
1111 ((QDoubleValidator*)lineEdit->validator())->setRange(1, 256000, 0);
1112 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridDimXMaillage")));
1114 if (TYPreferenceManager::exists(
"GridDimYMaillage"))
1117 ((QDoubleValidator*)lineEdit->validator())->setRange(1, 256000, 0);
1118 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridDimYMaillage")));
1120 if (TYPreferenceManager::exists(
"GridStepMaillage"))
1123 ((QDoubleValidator*)lineEdit->validator())->setRange(0.1, 256000, 2);
1124 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridStepMaillage")));
1126 if (TYPreferenceManager::exists(
"GridMagnStepMaillage"))
1129 ((QDoubleValidator*)lineEdit->validator())->setRange(0.1, 256000, 2);
1130 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridMagnStepMaillage")));
1133 if (TYPreferenceManager::exists(
"Angle"))
1135 switch (
ROUND(TYPreferenceManager::getFloat(
"Angle")))
1162 if (TYPreferenceManager::exists(
"UserSrcPonctGraphicSize"))
1165 ((QDoubleValidator*)lineEdit->validator())->setRange(0.5, 50.0, 2);
1166 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"UserSrcPonctGraphicSize")));
1169 if (TYPreferenceManager::exists(
"PointControlGraphicSize"))
1172 ((QDoubleValidator*)lineEdit->validator())->setRange(0.5, 50.0, 2);
1173 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"PointControlGraphicSize")));
1176 if (TYPreferenceManager::exists(
"ResolutionCircle"))
1179 ((QDoubleValidator*)lineEdit->validator())->setRange(3.0, 50.0, 2);
1180 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"ResolutionCircle")));
1182 if (TYPreferenceManager::exists(
"DistMinPtCrbNiv"))
1185 ((QDoubleValidator*)lineEdit->validator())->setRange(0.001, 1000.0, 3);
1186 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"DistMinPtCrbNiv")));
1188 if (TYPreferenceManager::exists(
"DelaunayTolerance"))
1191 ((QDoubleValidator*)lineEdit->validator())->setRange(0, 1000.0, 5);
1192 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"DelaunayTolerance")));
1194 if (TYPreferenceManager::exists(
"DefaultDimX"))
1197 ((QDoubleValidator*)lineEdit->validator())->setRange(1.0, 256000.0, 0);
1198 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"DefaultDimX")));
1200 if (TYPreferenceManager::exists(
"DefaultDimY"))
1203 ((QDoubleValidator*)lineEdit->validator())->setRange(1.0, 256000.0, 0);
1204 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"DefaultDimY")));
1206 if (TYPreferenceManager::exists(
"DefaultHMur"))
1209 ((QDoubleValidator*)lineEdit->validator())->setRange(0.1, 256000.0, 2);
1210 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"DefaultHMur")));
1212 if (TYPreferenceManager::exists(
"DefaultWidthEcran"))
1215 ((QDoubleValidator*)lineEdit->validator())->setRange(0.1, 256000.0, 2);
1216 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"DefaultWidthEcran")));
1220 if (TYPreferenceManager::exists(
"MouseLeftButtonFunct2D"))
1223 ->_pLeftButton2DComboBox->setCurrentIndex(TYPreferenceManager::getInt(
"MouseLeftButtonFunct2D"));
1225 if (TYPreferenceManager::exists(
"MouseRightButtonFunct2D"))
1228 ->_pRightButton2DComboBox->setCurrentIndex(
1229 TYPreferenceManager::getInt(
"MouseRightButtonFunct2D"));
1231 if (TYPreferenceManager::exists(
"MouseMiddleButtonFunct2D"))
1234 ->_pMiddleButton2DComboBox->setCurrentIndex(
1235 TYPreferenceManager::getInt(
"MouseMiddleButtonFunct2D"));
1237 if (TYPreferenceManager::exists(
"MouseLeftButtonFunct3D"))
1240 ->_pLeftButton3DComboBox->setCurrentIndex(TYPreferenceManager::getInt(
"MouseLeftButtonFunct3D"));
1242 if (TYPreferenceManager::exists(
"MouseRightButtonFunct3D"))
1245 ->_pRightButton3DComboBox->setCurrentIndex(
1246 TYPreferenceManager::getInt(
"MouseRightButtonFunct3D"));
1248 if (TYPreferenceManager::exists(
"MouseMiddleButtonFunct3D"))
1251 ->_pMiddleButton3DComboBox->setCurrentIndex(
1252 TYPreferenceManager::getInt(
"MouseMiddleButtonFunct3D"));
1254 if (TYPreferenceManager::exists(
"MouseShiftLeftButtonFunct2D"))
1257 ->_pLeftButton2DShtComboBox->setCurrentIndex(
1258 TYPreferenceManager::getInt(
"MouseShiftLeftButtonFunct2D"));
1260 if (TYPreferenceManager::exists(
"MouseShiftRightButtonFunct2D"))
1263 ->_pRightButton2DShtComboBox->setCurrentIndex(
1264 TYPreferenceManager::getInt(
"MouseShiftRightButtonFunct2D"));
1266 if (TYPreferenceManager::exists(
"MouseShiftLeftButtonFunct3D"))
1269 ->_pLeftButton3DShtComboBox->setCurrentIndex(
1270 TYPreferenceManager::getInt(
"MouseShiftLeftButtonFunct3D"));
1272 if (TYPreferenceManager::exists(
"MouseShiftRightButtonFunct3D"))
1275 ->_pRightButton3DShtComboBox->setCurrentIndex(
1276 TYPreferenceManager::getInt(
"MouseShiftRightButtonFunct3D"));
1278 if (TYPreferenceManager::exists(
"ZoomStep"))
1281 ((QDoubleValidator*)lineEdit->validator())->setBottom(0.001);
1282 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"ZoomStep")));
1284 if (TYPreferenceManager::exists(
"PrecisPick"))
1287 ((QDoubleValidator*)lineEdit->validator())->setBottom(0.001);
1288 lineEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"PrecisPick")));
1290 if (TYPreferenceManager::exists(
"Luminosite"))
1293 ->_pLightSlider->setValue(
ROUND(TYPreferenceManager::getFloat(
"Luminosite") * 100.0f));
1295 if (TYPreferenceManager::exists(
"ViewOnlyHighlight"))
1298 ->_pViewOnlyHighlightCheckBox->setChecked(TYPreferenceManager::getBool(
"ViewOnlyHighlight"));
1300 if (TYPreferenceManager::exists(
"CenterOnLocate"))
1303 ->_pCenterOnLocateCheckBox->setChecked(TYPreferenceManager::getBool(
"CenterOnLocate"));
1305 if (TYPreferenceManager::exists(
"WireframeOnMovingCamera"))
1308 ->_pWireframeOnMovingCameraCheckBox->setChecked(
1309 TYPreferenceManager::getBool(
"WireframeOnMovingCamera"));
1311 if (TYPreferenceManager::exists(
"CameraTranslateStep"))
1314 ->_pCameraStepTranslateEdit->setText(
1315 QString().setNum(TYPreferenceManager::getFloat(
"CameraTranslateStep")));
1317 if (TYPreferenceManager::exists(
"CameraRotateStep"))
1320 ->_pCameraStepRotateEdit->setText(
1321 QString().setNum(TYPreferenceManager::getFloat(
"CameraRotateStep")));
1323 if (TYPreferenceManager::exists(
"CameraZoomStep"))
1326 ->_pCameraStepZoomEdit->setText(
1327 QString().setNum(TYPreferenceManager::getFloat(
"CameraZoomStep")));
1331 float r = NAN, g = NAN, b = NAN;
1332 if (TYPreferenceManager::exists(
"BackgroundColorR"))
1334 TYPreferenceManager::getColor(
"BackgroundColor", r, g, b);
1336 ->_pBackgroundColorToolButton->setColor(
1337 QColor(
int(r), int(g), int(b)));
1341 if (TYPreferenceManager::exists(
"AltiGraphicColorMinR"))
1343 TYPreferenceManager::getColor(
"AltiGraphicColorMin", r, g, b);
1345 color.setHsv(
int(r),
int(g),
int(b));
1348 if (TYPreferenceManager::exists(
"AltiGraphicColorMaxR"))
1350 TYPreferenceManager::getColor(
"AltiGraphicColorMax", r, g, b);
1352 color.setHsv(
int(r),
int(g),
int(b));
1355 if (TYPreferenceManager::exists(
"TYReseauTransportGraphicColorR"))
1357 TYPreferenceManager::getColor(
"TYReseauTransportGraphicColor", r, g, b);
1359 ->_pResTranspColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1362 if (TYPreferenceManager::exists(
"TYRouteGraphicColorR"))
1364 TYPreferenceManager::getColor(
"TYRouteGraphicColor", r, g, b);
1365 ((
ColorsTab*)
tabWidget->widget(2))->_pRouteColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1368 if (TYPreferenceManager::exists(
"TYMurGraphicColorR"))
1370 TYPreferenceManager::getColor(
"TYMurGraphicColor", r, g, b);
1371 ((
ColorsTab*)
tabWidget->widget(2))->_pMurColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1373 if (TYPreferenceManager::exists(
"TYEcranGraphicColorR"))
1375 TYPreferenceManager::getColor(
"TYEcranGraphicColor", r, g, b);
1376 ((
ColorsTab*)
tabWidget->widget(2))->_pEcranColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1378 if (TYPreferenceManager::exists(
"TYDalleGraphicColorR"))
1380 TYPreferenceManager::getColor(
"TYDalleGraphicColor", r, g, b);
1381 ((
ColorsTab*)
tabWidget->widget(2))->_pDalleColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1383 if (TYPreferenceManager::exists(
"SubRectColorR"))
1385 TYPreferenceManager::getColor(
"SubRectColor", r, g, b);
1387 ->_pSubRectColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1389 if (TYPreferenceManager::exists(
"TYAcousticCylinderGraphicColorR"))
1391 TYPreferenceManager::getColor(
"TYAcousticCylinderGraphicColor", r, g, b);
1393 ->_pCylindreColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1395 if (TYPreferenceManager::exists(
"TYAcousticBoxGraphicColorR"))
1397 TYPreferenceManager::getColor(
"TYAcousticBoxGraphicColor", r, g, b);
1398 ((
ColorsTab*)
tabWidget->widget(2))->_pBoxColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1400 if (TYPreferenceManager::exists(
"TYVegetationGraphicColorR"))
1402 TYPreferenceManager::getColor(
"TYVegetationGraphicColor", r, g, b);
1403 ((
ColorsTab*)
tabWidget->widget(2))->_pVegColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1405 if (TYPreferenceManager::exists(
"TYCourbeNiveauGraphicColorR"))
1407 TYPreferenceManager::getColor(
"TYCourbeNiveauGraphicColor", r, g, b);
1408 ((
ColorsTab*)
tabWidget->widget(2))->_pCrbNivColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1410 if (TYPreferenceManager::exists(
"TYCoursEauGraphicColorR"))
1412 TYPreferenceManager::getColor(
"TYCoursEauGraphicColor", r, g, b);
1413 ((
ColorsTab*)
tabWidget->widget(2))->_pCrsEauColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1415 if (TYPreferenceManager::exists(
"TYPlanEauGraphicColorR"))
1417 TYPreferenceManager::getColor(
"TYPlanEauGraphicColor", r, g, b);
1419 ->_pPlanEauColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1421 if (TYPreferenceManager::exists(
"TYTerrainGraphicColorR"))
1423 TYPreferenceManager::getColor(
"TYTerrainGraphicColor", r, g, b);
1425 ->_pTerrainColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1427 if (TYPreferenceManager::exists(
"FontColorR"))
1429 TYPreferenceManager::getColor(
"FontColor", r, g, b);
1430 ((
ColorsTab*)
tabWidget->widget(2))->_pPoliceColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1432 if (TYPreferenceManager::exists(
"GridColorR"))
1434 TYPreferenceManager::getColor(
"GridColor", r, g, b);
1435 ((
ColorsTab*)
tabWidget->widget(2))->_pGridColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1438 if (TYPreferenceManager::exists(
"PointControlGraphicColorR"))
1440 TYPreferenceManager::getColor(
"PointControlGraphicColor", r, g, b);
1442 ->_pPointControlColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1445 if (TYPreferenceManager::exists(
"SrcPonctGraphicColorR"))
1447 TYPreferenceManager::getColor(
"SrcPonctGraphicColor", r, g, b);
1449 ->_pSourcePonctColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1452 if (TYPreferenceManager::exists(
"WinOpacity"))
1455 ->_pWinOpacitySlider->setValue(
ROUND(TYPreferenceManager::getFloat(
"WinOpacity") * 100.0f));
1457 if (TYPreferenceManager::exists(
"AltOpacity"))
1460 ->_pAltOpacitySlider->setValue(
ROUND(TYPreferenceManager::getFloat(
"AltOpacity") * 100.0f));
1462 if (TYPreferenceManager::exists(
"MaillageOpacity"))
1465 ->_pMailOpacitySlider->setValue(
ROUND(TYPreferenceManager::getFloat(
"MaillageOpacity") * 100.0f));
1467 if (TYPreferenceManager::exists(
"Antialiasing"))
1470 ->_pMailAntiAliasingCheckBox->setChecked(TYPreferenceManager::getBool(
"Antialiasing"));
1474 if (TYPreferenceManager::exists(
"ResisSolDefault"))
1477 ->_pLineEditResistivite->setText(
1478 QString().setNum(TYPreferenceManager::getDouble(
"ResisSolDefault")));
1480 if (TYPreferenceManager::exists(
"FacteurSolDefault"))
1483 ((QDoubleValidator*)lineEdit->validator())->setRange(0, 1, 2);
1484 lineEdit->setText(QString().setNum(TYPreferenceManager::getDouble(
"FacteurSolDefault")));
1486 if (TYPreferenceManager::exists(
"EpaisSolDefault"))
1489 ((QDoubleValidator*)lineEdit->validator())->setBottom(0.001);
1490 lineEdit->setText(QString().setNum(TYPreferenceManager::getDouble(
"EpaisSolDefault")));
1492 if (TYPreferenceManager::exists(
"EcartTypeDefault"))
1495 ->_pLineEditEcartType->setText(
1496 QString().setNum(TYPreferenceManager::getDouble(
"EcartTypeDefault")));
1498 if (TYPreferenceManager::exists(
"LongueurDefault"))
1501 ->_pLineEditLongueur->setText(
1502 QString().setNum(TYPreferenceManager::getDouble(
"LongueurDefault")));
1504 if (TYPreferenceManager::exists(
"MasseVolMatDefault"))
1507 ->_pLineEditMasseVol->setText(
1508 QString().setNum(TYPreferenceManager::getDouble(
"MasseVolMatDefault")));
1510 if (TYPreferenceManager::exists(
"SpectreTransmDefault0"))
1512 TYSpectre* pTmpSpectre = TYPreferenceManager::getSpectre(
"SpectreTransmDefault");
1523 if (TYPreferenceManager::exists(
"SpectreAbsoDefault0"))
1525 TYSpectre* pTmpSpectre = TYPreferenceManager::getSpectre(
"SpectreAbsoDefault");
1538 QString pref =
"MaillageDefault";
1539 if (TYPreferenceManager::exists(pref +
"Hauteur"))
1542 ->_pMaillage->setHauteur(TYPreferenceManager::getFloat(pref +
"Hauteur"));
1544 ->_pMaillage->setDataType(TYPreferenceManager::getInt(pref +
"DataType"));
1546 ->_pMaillage->setDataFreq(TYPreferenceManager::getFloat(pref +
"DataFreq"));
1548 pref =
"PaletteDefault";
1549 if (TYPreferenceManager::exists(pref +
"Min"))
1554 const size_t nb_colors = TYPreferenceManager::getFloat(pref +
"NbColors");
1555 const float valueMin = TYPreferenceManager::getFloat(pref +
"Min");
1556 const float valueMax = TYPreferenceManager::getFloat(pref +
"Max");
1559 legacyTable.resize(nb_colors);
1560 for (
size_t i = 0; i < nb_colors; ++i)
1562 TYPreferenceManager::getColor(pref +
"Color" + QString(
uintToStr(i).c_str()), color.
r,
1564 legacyTable[i] =
OColor(color.
r, color.
g, color.
b);
1569 pref =
"TYAcousticSeuilContrib";
1570 if (TYPreferenceManager::exists(pref +
"Bas"))
1573 ->_pContributionLineEditBas->setText(
1574 QString().setNum(TYPreferenceManager::getDouble(pref +
"Bas")));
1576 ->_pContributionLineEditMoy->setText(
1577 QString().setNum(TYPreferenceManager::getDouble(pref +
"Moy")));
1579 ->_pContributionLineEditHaut->setText(
1580 QString().setNum(TYPreferenceManager::getDouble(pref +
"Haut")));
1583 TYPreferenceManager::setCurrentDirectory(oldDir);
1594 QString oldDir = TYPreferenceManager::getCurrentDirectory();
1601 TYPreferenceManager::setInt(
"HistoSize",
1610 if (libraryPath.exists())
1612 TYPreferenceManager::setString(
"BiblioPath",
1618 if (workDirPath.exists())
1620 TYPreferenceManager::setString(
"WorkDirPath",
1627 TYPreferenceManager::setFloat(
1632 TYPreferenceManager::setFloat(
1637 TYPreferenceManager::setFloat(
1642 TYPreferenceManager::setFloat(
1649 TYPreferenceManager::setFloat(
1654 TYPreferenceManager::setFloat(
1659 TYPreferenceManager::setFloat(
1660 "GridMagnStepBatiment",
1665 TYPreferenceManager::setFloat(
1671 TYPreferenceManager::setFloat(
1676 TYPreferenceManager::setFloat(
1681 TYPreferenceManager::setFloat(
1686 TYPreferenceManager::setFloat(
1687 "GridMagnStepMachine",
1693 TYPreferenceManager::setFloat(
1698 TYPreferenceManager::setFloat(
1703 TYPreferenceManager::setFloat(
1704 "GridMagnStepMaillage",
1709 TYPreferenceManager::setFloat(
1715 TYPreferenceManager::setFloat(
1720 TYPreferenceManager::setFloat(
1725 TYPreferenceManager::setFloat(
1730 TYPreferenceManager::setFloat(
1737 TYPreferenceManager::setFloat(
1742 TYPreferenceManager::setFloat(
1747 TYPreferenceManager::setFloat(
1752 TYPreferenceManager::setFloat(
1759 TYPreferenceManager::setFloat(
1760 "UserSrcPonctGraphicSize",
1766 TYPreferenceManager::setFloat(
1767 "PointControlGraphicSize",
1773 TYPreferenceManager::setFloat(
"ResolutionCircle",
1778 TYPreferenceManager::setFloat(
1784 TYPreferenceManager::setFloat(
1785 "DelaunayTolerance",
1790 TYPreferenceManager::setFloat(
1795 TYPreferenceManager::setFloat(
1800 TYPreferenceManager::setFloat(
1805 TYPreferenceManager::setFloat(
1806 "DefaultWidthEcran",
1811 TYPreferenceManager::setFloat(
"Luminosite",
1815 TYPreferenceManager::setFloat(
"ZoomStep",
1820 TYPreferenceManager::setFloat(
"PrecisPick",
1823 TYPreferenceManager::setInt(
"MouseLeftButtonFunct2D",
1825 TYPreferenceManager::setInt(
"MouseRightButtonFunct2D",
1827 TYPreferenceManager::setInt(
"MouseMiddleButtonFunct2D",
1829 TYPreferenceManager::setInt(
"MouseLeftButtonFunct3D",
1831 TYPreferenceManager::setInt(
"MouseRightButtonFunct3D",
1833 TYPreferenceManager::setInt(
"MouseMiddleButtonFunct3D",
1835 TYPreferenceManager::setInt(
1836 "MouseShiftLeftButtonFunct2D",
1838 TYPreferenceManager::setInt(
1839 "MouseShiftRightButtonFunct2D",
1841 TYPreferenceManager::setInt(
1842 "MouseShiftLeftButtonFunct3D",
1844 TYPreferenceManager::setInt(
1845 "MouseShiftRightButtonFunct3D",
1847 TYPreferenceManager::setBool(
1848 "ViewOnlyHighlight", ((
pref3DTab*)
tabWidget->widget(1))->_pViewOnlyHighlightCheckBox->isChecked());
1849 TYPreferenceManager::setBool(
"CenterOnLocate",
1851 TYPreferenceManager::setBool(
1852 "WireframeOnMovingCamera",
1854 TYPreferenceManager::setFloat(
1855 "CameraTranslateStep",
1857 TYPreferenceManager::setFloat(
1858 "CameraRotateStep", ((
pref3DTab*)
tabWidget->widget(1))->_pCameraStepRotateEdit->text().toFloat());
1859 TYPreferenceManager::setFloat(
"CameraZoomStep",
1863 TYPreferenceManager::setColor(
1864 "BackgroundColor", ((
ColorsTab*)
tabWidget->widget(2))->_pBackgroundColorToolButton->getColor().red(),
1867 TYPreferenceManager::setColor(
1868 "GridColor", ((
ColorsTab*)
tabWidget->widget(2))->_pGridColorToolButton->getColor().red(),
1871 TYPreferenceManager::setColor(
1872 "FontColor", ((
ColorsTab*)
tabWidget->widget(2))->_pPoliceColorToolButton->getColor().red(),
1875 TYPreferenceManager::setColor(
1876 "TYTerrainGraphicColor",
1880 TYPreferenceManager::setColor(
1881 "TYPlanEauGraphicColor",
1885 TYPreferenceManager::setColor(
1886 "TYCoursEauGraphicColor",
1890 TYPreferenceManager::setColor(
1891 "TYCourbeNiveauGraphicColor",
1895 TYPreferenceManager::setColor(
1896 "TYVegetationGraphicColor",
1900 TYPreferenceManager::setColor(
1901 "TYAcousticBoxGraphicColor",
1905 TYPreferenceManager::setColor(
1906 "TYAcousticCylinderGraphicColor",
1910 TYPreferenceManager::setColor(
1911 "TYAcousticSemiCylinderGraphicColor",
1915 TYPreferenceManager::setColor(
1916 "TYAcousticCircleGraphicColor",
1920 TYPreferenceManager::setColor(
1921 "TYAcousticSemiCircleGraphicColor",
1925 TYPreferenceManager::setColor(
1926 "SubRectColor", ((
ColorsTab*)
tabWidget->widget(2))->_pSubRectColorToolButton->getColor().red(),
1929 TYPreferenceManager::setColor(
1930 "TYMurGraphicColor", ((
ColorsTab*)
tabWidget->widget(2))->_pMurColorToolButton->getColor().red(),
1933 TYPreferenceManager::setColor(
1934 "TYDalleGraphicColor", ((
ColorsTab*)
tabWidget->widget(2))->_pDalleColorToolButton->getColor().red(),
1937 TYPreferenceManager::setColor(
1938 "TYEcranGraphicColor", ((
ColorsTab*)
tabWidget->widget(2))->_pEcranColorToolButton->getColor().red(),
1942 TYPreferenceManager::setColor(
1943 "TYRouteGraphicColor", ((
ColorsTab*)
tabWidget->widget(2))->_pRouteColorToolButton->getColor().red(),
1947 TYPreferenceManager::setColor(
1948 "TYReseauTransportGraphicColor",
1953 TYPreferenceManager::setColor(
1954 "PointControlGraphicColor",
1956 ((
ColorsTab*)
tabWidget->widget(2))->_pPointControlColorToolButton->getColor().green(),
1957 ((
ColorsTab*)
tabWidget->widget(2))->_pPointControlColorToolButton->getColor().blue());
1959 TYPreferenceManager::setColor(
1960 "SrcPonctGraphicColor",
1962 ((
ColorsTab*)
tabWidget->widget(2))->_pSourcePonctColorToolButton->getColor().green(),
1963 ((
ColorsTab*)
tabWidget->widget(2))->_pSourcePonctColorToolButton->getColor().blue());
1967 ->_pAltiColorMinToolButton->getColor()
1968 .getHsv(&hsvColor[0], &hsvColor[1], &hsvColor[2]);
1969 TYPreferenceManager::setColor(
"AltiGraphicColorMin", hsvColor[0], hsvColor[1], hsvColor[2]);
1971 ->_pAltiColorMaxToolButton->getColor()
1972 .getHsv(&hsvColor[0], &hsvColor[1], &hsvColor[2]);
1973 TYPreferenceManager::setColor(
"AltiGraphicColorMax", hsvColor[0], hsvColor[1], hsvColor[2]);
1975 TYPreferenceManager::setFloat(
1976 "WinOpacity",
float(((
ColorsTab*)
tabWidget->widget(2))->_pWinOpacitySlider->value()) / 100.0f);
1977 TYPreferenceManager::setFloat(
1978 "AltOpacity",
float(((
ColorsTab*)
tabWidget->widget(2))->_pAltOpacitySlider->value()) / 100.0f);
1979 TYPreferenceManager::setFloat(
1980 "MaillageOpacity",
float(((
ColorsTab*)
tabWidget->widget(2))->_pMailOpacitySlider->value()) / 100.0f);
1981 TYPreferenceManager::setBool(
"Antialiasing",
1985 TYPreferenceManager::setDouble(
1989 TYPreferenceManager::setDouble(
1990 "FacteurSolDefault",
1995 TYPreferenceManager::setDouble(
1999 TYPreferenceManager::setDouble(
2001 TYPreferenceManager::setDouble(
2003 TYPreferenceManager::setDouble(
2005 TYPreferenceManager::setSpectre(
"SpectreTransmDefault",
2007 TYPreferenceManager::setSpectre(
"SpectreAbsoDefault",
2010 QString pref =
"MaillageDefault";
2011 TYPreferenceManager::setFloat(pref +
"Hauteur",
2013 TYPreferenceManager::setInt(pref +
"DataType",
2015 TYPreferenceManager::setFloat(pref +
"DataFreq",
2018 pref =
"PaletteDefault";
2020 TYPreferenceManager::setFloat(pref +
"Min", pPalette->
getValueMin());
2021 TYPreferenceManager::setFloat(pref +
"Max", pPalette->
getValueMax());
2022 TYPreferenceManager::setUInt(pref +
"NbColors", pPalette->
getNbColors());
2025 uint colorIndice = 0;
2029 "getNbColors() should be the number of colors in the color map.");
2030 const OColor& color = it->second;
2031 TYPreferenceManager::setColor(pref +
"Color" + QString(
uintToStr(colorIndice).c_str()), color.
r,
2036 pref =
"TYAcousticSeuilContrib";
2037 TYPreferenceManager::setFloat(
2039 TYPreferenceManager::setFloat(
2041 TYPreferenceManager::setFloat(
2045 TYPreferenceManager::setCurrentDirectory(oldDir);
2049 for (
int i = 0; i < int(windows.count()); ++i)
2051 QWidget* internal_window = windows.at(i)->widget();
2067 TYPreferenceManager::saveGeometryToPreferences(metaObject()->className(),
this);
int ROUND(double a)
Compute the rounded value of a number.
TYApplication * getTYApp()
Retourne le pointeur sur l'application.
TYMainWindow * getTYMainWnd()
Retourne le pointeur sur la fenetre principale.
pour l'application Tympan (fichier header)
#define TYDIRPREFERENCEMANAGER
outil IHM pour une entrée utilisateur de type int (fichier header)
Fenetre principale de l'application Tympan (fichier header)
Classe generique pour une fenetre de modeleur (fichier header)
Tables pour le dialogue de la gestion des preferences (fichier header)
Outil IHM pour la saisie de la resisitivite du sol (fichier header)
Table Acoustique dans le dialog de la gestion des preferences.
TYLineEdit * _pContributionLineEditBas
TYLineEdit * _pLineEditEcartType
TYLineEdit * _pLineEditFacteurSol
TYMaillage * _pMaillage
Maillage par defaut.
TYLineEdit * _pLineEditResistivite
TYLineEdit * _pContributionLineEditHaut
TYSpectre * _pSpectreAbsoMatConst
Spectre d'absorption par defaut des materiaux de construction.
TYLineEdit * _pLineEditLongueur
TYLineEdit * _pContributionLineEditMoy
AcoustiqueTab(QWidget *parent=0)
TYLineEdit * _pLineEditEpaisseur
TYLineEdit * _pLineEditMasseVol
TYSpectre * _pSpectreAttMatConst
Spectre d'attenuation par default des materiaux de construction.
Table Colors dans le dialog de la gestion des preferences.
TYToolButton * _pBoxColorToolButton
TYToolButton * _pCrbNivColorToolButton
TYToolButton * _pGridColorToolButton
TYToolButton * _pEcranColorToolButton
QCheckBox * _pMailAntiAliasingCheckBox
TYToolButton * _pCrsEauColorToolButton
TYToolButton * _pTerrainColorToolButton
QSlider * _pAltOpacitySlider
TYToolButton * _pSubRectColorToolButton
TYToolButton * _pMurColorToolButton
TYToolButton * _pBackgroundColorToolButton
ColorsTab(QWidget *parent=0)
QSlider * _pWinOpacitySlider
TYToolButton * _pVegColorToolButton
TYToolButton * _pPlanEauColorToolButton
TYToolButton * _pRouteColorToolButton
TYToolButton * _pSourcePonctColorToolButton
QSlider * _pMailOpacitySlider
TYToolButton * _pResTranspColorToolButton
TYToolButton * _pAltiColorMinToolButton
TYToolButton * _pAltiColorMaxToolButton
TYToolButton * _pDalleColorToolButton
TYToolButton * _pPointControlColorToolButton
TYToolButton * _pPoliceColorToolButton
TYToolButton * _pCylindreColorToolButton
Table generale dans le dialog de la gestion des preferences.
QString selectDirectory(const QString ¤tPath)
TYLineEditInt * _pHistoSizeEdit
QLineEdit * _pLibraryPathEdit
QLineEdit * _pWorkDirPathEdit
GeneralTab(QWidget *parent=0)
Table Geometrie dans le dialogue de la gestion des preferences.
TYLineEdit * _pGridStepSiteEdit
QRadioButton * _p45RadioButton
TYLineEdit * _pPointControlSizeEdit
TYLineEdit * _pGridDimXSiteEdit
TYLineEdit * _pGridDimYFaceEdit
QRadioButton * _p30RadioButton
TYLineEdit * _pGridDimXFaceEdit
TYLineEdit * _pGridDimXBatEdit
TYLineEdit * _pGridMagnStepFaceEdit
TYLineEdit * _pResoCylEdit
TYLineEdit * _pDefaultHMurEdit
TYLineEdit * _pGridDimXMacEdit
TYLineEdit * _pSeuilDistNulEdit
TYLineEdit * _pGridMagnStepBatEdit
TYLineEdit * _pDefaultDimYEdit
TYLineEdit * _pGridMagnStepSiteEdit
TYLineEdit * _pGridDimYMacEdit
TYLineEdit * _pDefaultDimXEdit
QButtonGroup * _pAnglesButtonGroup
TYLineEdit * _pSourceSizeEdit
TYLineEdit * _pDelaunayToleranceEdit
QRadioButton * _p90RadioButton
TYLineEdit * _pGridDimXMailEdit
TYLineEdit * _pGridMagnStepMailEdit
TYLineEdit * _pGridStepMacEdit
GeometrieTab(QWidget *parent=0)
TYLineEdit * _pGridDimYSiteEdit
TYLineEdit * _pGridStepMailEdit
TYLineEdit * _pGridStepBatEdit
TYLineEdit * _pDefaultWEcranEdit
TYLineEdit * _pGridDimYBatEdit
TYLineEdit * _pGridStepFaceEdit
TYLineEdit * _pDistMinPtCrbNivEdit
TYLineEdit * _pGridDimYMailEdit
TYLineEdit * _pGridMagnStepMacEdit
QRadioButton * _p15RadioButton
void setDefaultValue(const double &valeur=TY_SPECTRE_DEFAULT_VALUE)
void setHistorySize(int size)
Definit la taille de l'historique.
TYActionManager * getActionManager()
Get du gestionnaire d'actions (historique pour les undos).
Classe de definition d'un maillage.
QMdiArea * getWorkspace()
Generic class for a modeler window.
TYRenderWindowInteractor * getView()
TYActionManager * getActionManager()
virtual void updatePreferences()
virtual void updateView(bool clipping=true, bool axesAndGrid=true)
void invalidateScene(void)
Classe de definition d'une palette.
const color_map_type & getColorMap() const
Get de la lookup table.
size_t getNbColors() const
Getter for the number of colors.
values_type getValueMax() const
Get de la valeur max.
color_map_type::const_iterator color_map_const_iter
void resetcolorMapFromColors(values_type valueMin, values_type valueMax, const std::vector< OColor > &lookupTable)
Reset the colormap as a linear scale with the given colors between minValue and maxValue.
values_type getValueMin() const
Get de la valeur min.
QPushButton * _buttonApply
TYPreferenceDialog(QWidget *parent=0, const char *name=0, Qt::WindowFlags f=QFlag(0))
QPushButton * _buttonCancel
virtual void hideEvent(QHideEvent *pEvent)
TYOpenGLRenderer * getRenderer()
Objet IHM pour la saisie de la resisitivite du sol.
Table 3D dans le dialogue de la gestion des preferences.
TYLineEdit * _pPrecisPickEdit
QComboBox * _pLeftButton3DComboBox
QComboBox * _pRightButton2DShtComboBox
TYLineEdit * _pCameraStepRotateEdit
QCheckBox * _pCenterOnLocateCheckBox
TYLineEdit * _pCameraStepZoomEdit
QComboBox * _pLeftButton2DComboBox
TYLineEdit * _pCameraStepTranslateEdit
QComboBox * _pMiddleButton2DComboBox
QCheckBox * _pViewOnlyHighlightCheckBox
QComboBox * _pRightButton3DComboBox
QComboBox * _pRightButton3DShtComboBox
QComboBox * _pRightButton2DComboBox
QComboBox * _pMiddleButton3DComboBox
TYLineEdit * _pZoomStepEdit
QComboBox * _pLeftButton3DShtComboBox
QComboBox * _pLeftButton2DShtComboBox
QCheckBox * _pWireframeOnMovingCameraCheckBox
pref3DTab(QWidget *parent=0)
std::vector< OColor > OLookupTable
Collection de OColor.
std::string uintToStr(unsigned int val)