23 #include <qlineedit.h>
26 #include <qbuttongroup.h>
27 #include <qradiobutton.h>
28 #include <qgridlayout.h>
29 #include <qcombobox.h>
30 #include <qcheckbox.h>
31 #include <qgroupbox.h>
32 #include <qpushbutton.h>
33 #include <qvalidator.h>
34 #include <qfiledialog.h>
36 #include <QMdiSubWindow>
52 #define TR(id) OLocalizator::getString("TYPreferenceDialog", (id))
57 setWindowTitle(
TR(
"id_caption"));
68 connect(
_buttonOK, &QPushButton::clicked,
this, &TYPreferenceDialog::accept);
73 connect(
_buttonCancel, &QPushButton::clicked,
this, &TYPreferenceDialog::reject);
78 QGridLayout* buttonLayout =
new QGridLayout();
83 QVBoxLayout* mainLayout =
new QVBoxLayout;
85 mainLayout->addLayout(buttonLayout);
87 setLayout(mainLayout);
92 TYPreferenceManager::loadGeometryFromPreferences(metaObject()->className(),
this);
96 return QDialog::exec();
102 QLabel* pHistoSizeLabel =
new QLabel(
TR(
"id_label_histo_size"));
105 QGridLayout* groupBoxLayout =
new QGridLayout();
106 groupBoxLayout->addWidget(pHistoSizeLabel, 0, 0);
109 QGroupBox* groupBox =
new QGroupBox();
110 groupBox->setTitle(
TR(
"id_histo"));
111 groupBox->setLayout(groupBoxLayout);
114 QLabel* pLibraryPathLabel =
new QLabel(
TR(
"id_label_biblio_path"));
116 QPushButton* buttonBiblioDirChoice =
new QPushButton(
TR(
"id_choose_btn"),
this);
119 QGridLayout* groupBoxLibraryLayout =
new QGridLayout();
120 groupBoxLibraryLayout->addWidget(pLibraryPathLabel, 0, 0);
122 groupBoxLibraryLayout->addWidget(buttonBiblioDirChoice, 0, 2);
124 QGroupBox* groupBoxLibrary =
new QGroupBox();
125 groupBoxLibrary->setTitle(
TR(
"id_biblio"));
126 groupBoxLibrary->setLayout(groupBoxLibraryLayout);
129 QLabel* pWorkDirPathLabel =
new QLabel(
TR(
"id_label_workdir_path"));
131 QPushButton* buttonWorkDirChoice =
new QPushButton(
TR(
"id_choose_btn"),
this);
134 QGridLayout* groupBoxWorkDirLayout =
new QGridLayout();
135 groupBoxWorkDirLayout->addWidget(pWorkDirPathLabel, 0, 0);
137 groupBoxWorkDirLayout->addWidget(buttonWorkDirChoice, 0, 2);
139 QGroupBox* groupBoxWorkDir =
new QGroupBox();
140 groupBoxWorkDir->setTitle(
TR(
"id_workdir"));
141 groupBoxWorkDir->setLayout(groupBoxWorkDirLayout);
143 QVBoxLayout* pTabLayout =
new QVBoxLayout();
144 pTabLayout->addWidget(groupBoxWorkDir);
145 pTabLayout->addWidget(groupBoxLibrary);
146 pTabLayout->addWidget(groupBox);
147 pTabLayout->addStretch(1);
149 setLayout(pTabLayout);
155 QFileDialog* pDialog =
new QFileDialog(
this,
"Choose a directory", strDir);
156 pDialog->setFileMode(QFileDialog::Directory);
157 pDialog->setOption(QFileDialog::ShowDirsOnly,
true);
161 if (pDialog->result() == QDialog::Accepted)
163 QDir dir = pDialog->directory();
173 QFileDialog* pDialog =
new QFileDialog(
this,
"Choose a directory", strDir);
174 pDialog->setFileMode(QFileDialog::Directory);
175 pDialog->setOption(QFileDialog::ShowDirsOnly,
true);
179 if (pDialog->result() == QDialog::Accepted)
181 QDir dir = pDialog->directory();
193 QLabel* pSiteLabel =
new QLabel(
TR(
"id_site"));
194 QLabel* pBatLabel =
new QLabel(
TR(
"id_batiment"));
195 QLabel* pMacLabel =
new QLabel(
TR(
"id_machine"));
196 QLabel* pFaceLabel =
new QLabel(
TR(
"id_face"));
197 QLabel* pMailLabel =
new QLabel(
TR(
"id_maillage"));
199 QLabel* pGridDimXLabel =
new QLabel(
TR(
"id_label_dimx_grid"));
206 QLabel* pGridDimYLabel =
new QLabel(
TR(
"id_label_dimy_grid"));
213 QLabel* pGridStepLabel =
new QLabel(
TR(
"id_label_step_grid"));
220 QLabel* pGridMagnStepLabel =
new QLabel(
TR(
"id_label_step_grid_magn"));
227 QGridLayout* groupBoxLayout =
new QGridLayout();
228 groupBoxLayout->addWidget(pSiteLabel, 0, 1);
229 groupBoxLayout->addWidget(pBatLabel, 0, 2);
230 groupBoxLayout->addWidget(pMacLabel, 0, 3);
231 groupBoxLayout->addWidget(pFaceLabel, 0, 4);
232 groupBoxLayout->addWidget(pMailLabel, 0, 5);
234 groupBoxLayout->addWidget(pGridDimXLabel, 1, 0);
241 groupBoxLayout->addWidget(pGridDimYLabel, 2, 0);
248 groupBoxLayout->addWidget(pGridStepLabel, 3, 0);
255 groupBoxLayout->addWidget(pGridMagnStepLabel, 4, 0);
262 QGroupBox* groupBox =
new QGroupBox();
263 groupBox->setTitle(
TR(
"id_grid"));
264 groupBox->setLayout(groupBoxLayout);
279 QGridLayout* groupBoxAnglesLayout =
new QGridLayout();
285 QGroupBox* groupBoxAngles =
new QGroupBox();
286 groupBoxAngles->setTitle(
"Angle");
287 groupBoxAngles->setLayout(groupBoxAnglesLayout);
290 QLabel* pSourceSize =
new QLabel(
TR(
"id_label_source_size"));
292 QLabel* pPointControlSize =
new QLabel(
TR(
"id_label_pointcontrol_size"));
294 QLabel* pResoCylLabel =
new QLabel(
TR(
"id_label_nb_face_cylinder"));
296 QLabel* pSeuilDistNulLabel =
new QLabel(
TR(
"id_label_seuil_dist_nulle"));
299 QGridLayout* groupBox1Layout =
new QGridLayout();
300 groupBox1Layout->addWidget(pSourceSize, 0, 0);
302 groupBox1Layout->addWidget(pPointControlSize, 1, 0);
304 groupBox1Layout->addWidget(pResoCylLabel, 2, 0);
306 groupBox1Layout->addWidget(pSeuilDistNulLabel, 3, 0);
309 QGroupBox* groupBox1 =
new QGroupBox();
310 groupBox1->setTitle(
TR(
"id_geometry"));
311 groupBox1->setLayout(groupBox1Layout);
314 QLabel* pDelaunayToleranceLabel =
new QLabel(
TR(
"id_label_delaunay_tolerance"));
316 QLabel* pDistMinPtCrbNivLabel =
new QLabel(
TR(
"id_label_dist_min_pts_crbniv"));
318 QLabel* pDefaultDimXLabel =
new QLabel(
TR(
"id_label_def_dimx"));
320 QLabel* pDefaultDimYLabel =
new QLabel(
TR(
"id_label_def_dimy"));
323 QGridLayout* groupBox2Layout =
new QGridLayout();
324 groupBox2Layout->addWidget(pDelaunayToleranceLabel, 0, 0);
326 groupBox2Layout->addWidget(pDistMinPtCrbNivLabel, 1, 0);
328 groupBox2Layout->addWidget(pDefaultDimXLabel, 2, 0);
330 groupBox2Layout->addWidget(pDefaultDimYLabel, 3, 0);
333 QGroupBox* groupBox2 =
new QGroupBox();
334 groupBox2->setTitle(
TR(
"id_topography"));
335 groupBox2->setLayout(groupBox2Layout);
338 QLabel* pDefaultHMurLabel =
new QLabel(
TR(
"id_label_def_h_mur"));
340 QLabel* pDefaultWEcranLabel =
new QLabel(
TR(
"id_label_def_w_ecran"));
343 QGridLayout* groupBox3Layout =
new QGridLayout();
344 groupBox3Layout->addWidget(pDefaultHMurLabel, 0, 0);
346 groupBox3Layout->addWidget(pDefaultWEcranLabel, 1, 0);
349 QGroupBox* groupBox3 =
new QGroupBox();
350 groupBox3->setTitle(
TR(
"id_Ecran"));
351 groupBox3->setLayout(groupBox3Layout);
353 QVBoxLayout* pTabLayout =
new QVBoxLayout;
354 pTabLayout->addWidget(groupBox);
355 pTabLayout->addWidget(groupBoxAngles);
356 pTabLayout->addWidget(groupBox1);
357 pTabLayout->addWidget(groupBox2);
358 pTabLayout->addWidget(groupBox3);
359 pTabLayout->addStretch(1);
369 setLayout(pTabLayout);
375 QLabel* pClairLabel =
new QLabel(
TR(
"id_clair"));
378 QLabel* pSombreLabel =
new QLabel(
TR(
"id_sombre"));
380 QGridLayout* groupBox1Layout =
new QGridLayout();
381 groupBox1Layout->addWidget(pSombreLabel, 0, 0);
383 groupBox1Layout->addWidget(pClairLabel, 0, 2);
385 QGroupBox* groupBox1 =
new QGroupBox();
386 groupBox1->setTitle(
TR(
"id_luminosite"));
387 groupBox1->setLayout(groupBox1Layout);
390 QLabel* pPrecisLabel =
new QLabel(
TR(
"id_precision"));
392 QGridLayout* groupPrecisLayout =
new QGridLayout();
393 groupPrecisLayout->addWidget(pPrecisLabel, 0, 0);
402 QGridLayout* groupBox2Layout =
new QGridLayout();
403 groupBox2Layout->addLayout(groupPrecisLayout, 0, 0);
407 QGroupBox* groupBox2 =
new QGroupBox();
408 groupBox2->setTitle(
TR(
"id_picking"));
409 groupBox2->setLayout(groupBox2Layout);
415 QGridLayout* groupBox2bLayout =
new QGridLayout();
418 QGroupBox* groupBox2b =
new QGroupBox();
419 groupBox2b->setTitle(
TR(
"id_wireframe"));
420 groupBox2b->setLayout(groupBox2bLayout);
423 QLabel* pZoomStepLabel =
new QLabel(
TR(
"id_step"));
426 QGridLayout* groupBox3Layout =
new QGridLayout();
427 groupBox3Layout->addWidget(pZoomStepLabel, 0, 0);
430 QGroupBox* groupBox3 =
new QGroupBox();
431 groupBox3->setTitle(
TR(
"id_zoom"));
432 groupBox3->setLayout(groupBox3Layout);
435 QLabel* p2DLabel =
new QLabel(
TR(
"id_2D"));
436 QLabel* p3DLabel =
new QLabel(
TR(
"id_3D"));
437 QLabel* pLeftLabel2D =
new QLabel(
TR(
"id_left_button"));
441 QLabel* pMiddleLabel2D =
new QLabel(
TR(
"id_middle_button"));
445 QLabel* pRightLabel2D =
new QLabel(
TR(
"id_right_button"));
454 QLabel* pMiddleLabel3D =
new QLabel(
TR(
"id_middle_button"));
466 QGridLayout* groupBoxLayout =
new QGridLayout();
467 groupBoxLayout->addWidget(p2DLabel, 0, 1);
468 groupBoxLayout->addWidget(p3DLabel, 0, 2);
469 groupBoxLayout->addWidget(pLeftLabel2D, 1, 0);
471 groupBoxLayout->addWidget(pMiddleLabel2D, 2, 0);
473 groupBoxLayout->addWidget(pRightLabel2D, 3, 0);
476 groupBoxLayout->addWidget(pMiddleLabel3D, 2, 2);
480 QGroupBox* groupBox =
new QGroupBox();
481 groupBox->setTitle(
TR(
"id_mouse_button_functions"));
482 groupBox->setLayout(groupBoxLayout);
485 QLabel* p2DLabelSht =
new QLabel(
TR(
"id_2D"));
486 QLabel* p3DLabelSht =
new QLabel(
TR(
"id_3D"));
487 QLabel* pLeftLabel2DSht =
new QLabel(
TR(
"id_left_button"));
491 QLabel* pRightLabel2DSht =
new QLabel(
TR(
"id_right_button"));
506 QGridLayout* groupBox4Layout =
new QGridLayout();
507 groupBox4Layout->addWidget(p2DLabelSht, 0, 1);
508 groupBox4Layout->addWidget(p3DLabelSht, 0, 2);
509 groupBox4Layout->addWidget(pLeftLabel2DSht, 1, 0);
511 groupBox4Layout->addWidget(pRightLabel2DSht, 2, 0);
516 QGroupBox* groupBox4 =
new QGroupBox();
517 groupBox4->setTitle(
TR(
"id_mouse_button_functions_sht"));
518 groupBox4->setLayout(groupBox4Layout);
521 QLabel* pStepLabelSht =
new QLabel(
TR(
"id_camera_step"));
522 QLabel* pTranslateLabelSht =
new QLabel(
TR(
"id_translate"));
523 QLabel* pRotateLabelSht =
new QLabel(
TR(
"id_rotate"));
524 QLabel* pZoomLabelSht =
new QLabel(
TR(
"id_zoom"));
529 QGridLayout* groupBox5Layout =
new QGridLayout();
530 groupBox5Layout->addWidget(pStepLabelSht, 1, 0);
531 groupBox5Layout->addWidget(pTranslateLabelSht, 0, 1);
532 groupBox5Layout->addWidget(pRotateLabelSht, 0, 2);
533 groupBox5Layout->addWidget(pZoomLabelSht, 0, 3);
538 QGroupBox* groupBox5 =
new QGroupBox();
539 groupBox5->setTitle(
TR(
"id_camera_step_title"));
540 groupBox5->setLayout(groupBox5Layout);
542 QVBoxLayout* pTabLayout =
new QVBoxLayout();
543 pTabLayout->addWidget(groupBox1);
544 pTabLayout->addWidget(groupBox2);
545 pTabLayout->addWidget(groupBox2b);
546 pTabLayout->addWidget(groupBox3);
547 pTabLayout->addWidget(groupBox);
548 pTabLayout->addWidget(groupBox4);
549 pTabLayout->addWidget(groupBox5);
550 pTabLayout->addStretch(1);
552 setLayout(pTabLayout);
558 QLabel* pBackgroundLabel =
new QLabel(
TR(
"id_background_color"));
561 QLabel* pGridLabel =
new QLabel(
TR(
"id_grid_color"));
564 QLabel* pPoliceColorLabel =
new QLabel(
TR(
"id_police_color"));
568 QGridLayout* groupBoxLayout =
new QGridLayout();
569 groupBoxLayout->addWidget(pBackgroundLabel, 0, 0);
571 groupBoxLayout->addWidget(pGridLabel, 1, 0);
573 groupBoxLayout->addWidget(pPoliceColorLabel, 2, 0);
576 QGroupBox* groupBox =
new QGroupBox();
577 groupBox->setTitle(
TR(
"id_renderer"));
578 groupBox->setLayout(groupBoxLayout);
581 QLabel* pTerrainColorLabel =
new QLabel(
TR(
"id_terrain_color"));
584 QLabel* pPlanEauColorLabel =
new QLabel(
TR(
"id_planeau_color"));
587 QLabel* pCrsEauColorLabel =
new QLabel(
TR(
"id_crseau_color"));
590 QLabel* pCrbNivColorLabel =
new QLabel(
TR(
"id_crbniv_color"));
593 QLabel* pVegColorLabel =
new QLabel(
TR(
"id_veg_color"));
597 QGridLayout* groupBox1Layout =
new QGridLayout();
598 groupBox1Layout->addWidget(pTerrainColorLabel, 0, 0);
600 groupBox1Layout->addWidget(pPlanEauColorLabel, 1, 0);
602 groupBox1Layout->addWidget(pCrsEauColorLabel, 2, 0);
604 groupBox1Layout->addWidget(pCrbNivColorLabel, 3, 0);
606 groupBox1Layout->addWidget(pVegColorLabel, 4, 0);
609 QGroupBox* groupBox1 =
new QGroupBox();
610 groupBox1->setTitle(
TR(
"id_topography"));
611 groupBox1->setLayout(groupBox1Layout);
614 QLabel* pCylindreColorLabel =
new QLabel(
TR(
"id_cylindre_color"));
617 QLabel* pBoxColorLabel =
new QLabel(
TR(
"id_box_color"));
620 QLabel* pSubRectColorLabel =
new QLabel(
TR(
"id_bouche_color"));
624 QGridLayout* groupBox2Layout =
new QGridLayout();
625 groupBox2Layout->addWidget(pCylindreColorLabel, 0, 0);
627 groupBox2Layout->addWidget(pBoxColorLabel, 1, 0);
629 groupBox2Layout->addWidget(pSubRectColorLabel, 2, 0);
632 QGroupBox* groupBox2 =
new QGroupBox();
633 groupBox2->setTitle(
TR(
"id_machine"));
634 groupBox2->setLayout(groupBox2Layout);
637 QLabel* pMurColorLabel =
new QLabel(
TR(
"id_mur_color"));
640 QLabel* pDalleColorLabel =
new QLabel(
TR(
"id_dalle_color"));
643 QLabel* pEcranColorLabel =
new QLabel(
TR(
"id_ecran_color"));
647 QGridLayout* groupBox3Layout =
new QGridLayout();
648 groupBox3Layout->addWidget(pMurColorLabel, 0, 0);
650 groupBox3Layout->addWidget(pDalleColorLabel, 1, 0);
652 groupBox3Layout->addWidget(pEcranColorLabel, 2, 0);
655 QGroupBox* groupBox3 =
new QGroupBox();
656 groupBox3->setTitle(
TR(
"id_batiment"));
657 groupBox3->setLayout(groupBox3Layout);
660 QLabel* pRouteColorLabel =
new QLabel(
TR(
"id_route_color"));
663 QLabel* pResTranspColorLabel =
new QLabel(
TR(
"id_restransp_color"));
667 QGridLayout* groupBox5Layout =
new QGridLayout();
668 groupBox5Layout->addWidget(pRouteColorLabel, 0, 0);
670 groupBox5Layout->addWidget(pResTranspColorLabel, 1, 0);
673 QGroupBox* groupBox5 =
new QGroupBox();
674 groupBox5->setTitle(
TR(
"id_infrastructure"));
675 groupBox5->setLayout(groupBox5Layout);
678 QLabel* pPointControlColorLabel =
new QLabel(
TR(
"id_pointcontrol_color"));
682 QGridLayout* groupBox7Layout =
new QGridLayout();
683 groupBox7Layout->addWidget(pPointControlColorLabel, 0, 0);
686 QGroupBox* groupBox7 =
new QGroupBox();
687 groupBox7->setTitle(
TR(
"id_group_calcul_name"));
688 groupBox7->setLayout(groupBox7Layout);
691 QLabel* pSourcePonctColorLabel =
new QLabel(
TR(
"id_sourceponct_color"));
695 QGridLayout* groupBox8Layout =
new QGridLayout();
696 groupBox8Layout->addWidget(pSourcePonctColorLabel, 0, 0);
699 QGroupBox* groupBox8 =
new QGroupBox();
700 groupBox8->setTitle(
TR(
"id_group_source_name"));
701 groupBox8->setLayout(groupBox8Layout);
706 QFrame* pLine =
new QFrame();
707 pLine->setProperty(
"frameShape", (
int)QFrame::HLine);
708 pLine->setFrameShadow(QFrame::Sunken);
709 pLine->setFrameShape(QFrame::HLine);
713 QGridLayout* groupBox6Layout =
new QGridLayout();
715 groupBox6Layout->addWidget(pLine, 0, 1, 1, 2);
718 QGroupBox* groupBox6 =
new QGroupBox();
719 groupBox6->setTitle(
TR(
"id_alti_color_map"));
720 groupBox6->setLayout(groupBox6Layout);
723 QLabel* pMailOpacityLabel =
new QLabel(
TR(
"id_maillage_opacity"));
732 QGridLayout* groupBox4Layout =
new QGridLayout();
733 groupBox4Layout->addWidget(pMailOpacityLabel, 0, 0);
737 QGroupBox* groupBox4 =
new QGroupBox();
738 groupBox4->setTitle(
TR(
"id_maillage"));
739 groupBox4->setLayout(groupBox4Layout);
742 QLabel* pWinOpacityLabel =
new QLabel(
TR(
"id_win_opacity"));
748 QLabel* pAltOpacityLabel =
new QLabel(
TR(
"id_atm_opacity"));
755 QGridLayout* groupBox9Layout =
new QGridLayout();
756 groupBox9Layout->addWidget(pWinOpacityLabel, 0, 0);
758 groupBox9Layout->addWidget(pAltOpacityLabel, 2, 0);
761 QGroupBox* groupBox9 =
new QGroupBox();
762 groupBox9->setTitle(
TR(
"id_opacity"));
763 groupBox9->setLayout(groupBox9Layout);
765 QGridLayout* pTabLayout =
new QGridLayout();
766 pTabLayout->addWidget(groupBox, 0, 0);
767 pTabLayout->addWidget(groupBox1, 1, 0, 2, 1);
768 pTabLayout->addWidget(groupBox2, 0, 1);
769 pTabLayout->addWidget(groupBox3, 1, 1);
770 pTabLayout->addWidget(groupBox5, 2, 1);
771 pTabLayout->addWidget(groupBox7, 3, 0);
772 pTabLayout->addWidget(groupBox8, 3, 1);
773 pTabLayout->addWidget(groupBox6, 4, 0, 1, 2);
774 pTabLayout->addWidget(groupBox4, 5, 0, 1, 1);
775 pTabLayout->addWidget(groupBox9, 5, 1, 1, 1);
777 setLayout(pTabLayout);
790 QLabel* pLabelResistivite =
new QLabel(
TR(
"id_resistivite_label"));
792 QLabel* pUnitResis =
new QLabel(
TR(
"id_unite_resistivite"));
793 QLabel* pLabelEpaisseur =
new QLabel(
TR(
"id_epaisseur_label"));
795 QLabel* pUnitEpais =
new QLabel(
TR(
"id_unite_epaisseur"));
796 QLabel* pLabelEcartType =
new QLabel(
TR(
"id_ecarttype_label"));
798 QLabel* pUnitET =
new QLabel(
TR(
"id_unite_ecarttype"));
799 QLabel* pLabelLongueur =
new QLabel(
TR(
"id_longueur_label"));
801 QLabel* pUnitLong =
new QLabel(
TR(
"id_unite_longueur"));
802 QGridLayout* groupBoxResistEpaiLayout =
new QGridLayout();
803 groupBoxResistEpaiLayout->addWidget(pLabelResistivite, 0, 0);
805 groupBoxResistEpaiLayout->addWidget(pUnitResis, 0, 2);
806 groupBoxResistEpaiLayout->addWidget(pLabelEpaisseur, 1, 0);
808 groupBoxResistEpaiLayout->addWidget(pUnitEpais, 1, 2);
809 groupBoxResistEpaiLayout->addWidget(pLabelEcartType, 2, 0);
811 groupBoxResistEpaiLayout->addWidget(pUnitET, 2, 2);
812 groupBoxResistEpaiLayout->addWidget(pLabelLongueur, 3, 0);
814 groupBoxResistEpaiLayout->addWidget(pUnitLong, 3, 2);
816 QPushButton* pPushButtonResistivite =
new QPushButton(
TR(
"id_edit_resistivite"));
819 QGridLayout* groupBox1Layout =
new QGridLayout();
820 groupBox1Layout->addLayout(groupBoxResistEpaiLayout, 0, 0);
821 groupBox1Layout->addWidget(pPushButtonResistivite, 1, 0);
823 QGroupBox* groupBox1 =
new QGroupBox();
824 groupBox1->setTitle(
TR(
"id_default_sol"));
825 groupBox1->setLayout(groupBox1Layout);
828 QLabel* pLabelMasseVol =
new QLabel(
TR(
"id_masse_vol_label"));
830 QLabel* pUnitMasseVol =
new QLabel(
TR(
"id_unite_masse_vol"));
831 QGridLayout* groupBoxMasseLayout =
new QGridLayout();
832 groupBoxMasseLayout->addWidget(pLabelMasseVol, 0, 0);
834 groupBoxMasseLayout->addWidget(pUnitMasseVol, 0, 2);
836 QPushButton* pPushButtonSpectreAbso =
new QPushButton(
TR(
"id_edit_spectre_abso"));
837 QPushButton* pPushButtonSpectreAtt =
new QPushButton(
TR(
"id_edit_spectre_att"));
840 QGridLayout* groupBoxSpectreLayout =
new QGridLayout();
841 groupBoxSpectreLayout->addWidget(pPushButtonSpectreAbso, 0, 0);
842 groupBoxSpectreLayout->addWidget(pPushButtonSpectreAtt, 0, 1);
844 QGridLayout* groupBox3Layout =
new QGridLayout();
845 groupBox3Layout->addLayout(groupBoxMasseLayout, 0, 0);
846 groupBox3Layout->addLayout(groupBoxSpectreLayout, 1, 0);
848 QGroupBox* groupBox3 =
new QGroupBox();
849 groupBox3->setTitle(
TR(
"id_default_materiau"));
850 groupBox3->setLayout(groupBox3Layout);
853 QPushButton* pPushButtonMaillage =
new QPushButton(
TR(
"id_edit_maillage"));
856 QGridLayout* groupBox4Layout =
new QGridLayout();
857 groupBox4Layout->addWidget(pPushButtonMaillage, 0, 0);
859 QGroupBox* groupBox4 =
new QGroupBox();
860 groupBox4->setTitle(
TR(
"id_default_maillage"));
861 groupBox4->setLayout(groupBox4Layout);
863 QVBoxLayout* pTabLayout =
new QVBoxLayout();
864 pTabLayout->addWidget(groupBox1);
865 pTabLayout->addWidget(groupBox3);
866 pTabLayout->addWidget(groupBox4);
867 pTabLayout->addStretch(1);
869 setLayout(pTabLayout);
884 int ret = pDialog->exec();
886 if (ret == QDialog::Accepted)
910 QString oldDir = TYPreferenceManager::getCurrentDirectory();
914 if (TYPreferenceManager::exists(
"HistoSize"))
917 ->_pHistoSizeEdit->setText(QString().setNum(TYPreferenceManager::getInt(
"HistoSize")));
924 if (TYPreferenceManager::exists(
"BiblioPath"))
927 ->_pLibraryPathEdit->setText(TYPreferenceManager::getString(
"BiblioPath"));
932 QString dirPath = QDir::toNativeSeparators(
getTYApp()->tympanUserDir() +
"/library/");
936 if (TYPreferenceManager::exists(
"WorkDirPath"))
939 ->_pWorkDirPathEdit->setText(TYPreferenceManager::getString(
"WorkDirPath"));
944 QString dirPath = QDir::toNativeSeparators(
getTYApp()->getSettingsDir() +
"/echange/");
949 if (TYPreferenceManager::exists(
"GridDimXSite"))
952 ->_pGridDimXSiteEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridDimXSite")));
954 if (TYPreferenceManager::exists(
"GridDimYSite"))
957 ->_pGridDimYSiteEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridDimYSite")));
959 if (TYPreferenceManager::exists(
"GridStepSite"))
962 ->_pGridStepSiteEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridStepSite")));
964 if (TYPreferenceManager::exists(
"GridMagnStepSite"))
967 ->_pGridMagnStepSiteEdit->setText(
968 QString().setNum(TYPreferenceManager::getFloat(
"GridMagnStepSite")));
971 if (TYPreferenceManager::exists(
"GridDimXBatiment"))
974 ->_pGridDimXBatEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridDimXBatiment")));
976 if (TYPreferenceManager::exists(
"GridDimYBatiment"))
979 ->_pGridDimYBatEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridDimYBatiment")));
981 if (TYPreferenceManager::exists(
"GridStepBatiment"))
984 ->_pGridStepBatEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridStepBatiment")));
986 if (TYPreferenceManager::exists(
"GridMagnStepBatiment"))
989 ->_pGridMagnStepBatEdit->setText(
990 QString().setNum(TYPreferenceManager::getFloat(
"GridMagnStepBatiment")));
993 if (TYPreferenceManager::exists(
"GridDimXMachine"))
996 ->_pGridDimXMacEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridDimXMachine")));
998 if (TYPreferenceManager::exists(
"GridDimYMachine"))
1001 ->_pGridDimYMacEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridDimYMachine")));
1003 if (TYPreferenceManager::exists(
"GridStepMachine"))
1006 ->_pGridStepMacEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridStepMachine")));
1008 if (TYPreferenceManager::exists(
"GridMagnStepMachine"))
1011 ->_pGridMagnStepMacEdit->setText(
1012 QString().setNum(TYPreferenceManager::getFloat(
"GridMagnStepMachine")));
1015 if (TYPreferenceManager::exists(
"GridDimXFace"))
1018 ->_pGridDimXFaceEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridDimXFace")));
1020 if (TYPreferenceManager::exists(
"GridDimYFace"))
1023 ->_pGridDimYFaceEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridDimYFace")));
1025 if (TYPreferenceManager::exists(
"GridStepFace"))
1028 ->_pGridStepFaceEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"GridStepFace")));
1030 if (TYPreferenceManager::exists(
"GridMagnStepFace"))
1033 ->_pGridMagnStepFaceEdit->setText(
1034 QString().setNum(TYPreferenceManager::getFloat(
"GridMagnStepFace")));
1037 if (TYPreferenceManager::exists(
"GridDimXMaillage"))
1040 ->_pGridDimXMailEdit->setText(
1041 QString().setNum(TYPreferenceManager::getFloat(
"GridDimXMaillage")));
1043 if (TYPreferenceManager::exists(
"GridDimYMaillage"))
1046 ->_pGridDimYMailEdit->setText(
1047 QString().setNum(TYPreferenceManager::getFloat(
"GridDimYMaillage")));
1049 if (TYPreferenceManager::exists(
"GridStepMaillage"))
1052 ->_pGridStepMailEdit->setText(
1053 QString().setNum(TYPreferenceManager::getFloat(
"GridStepMaillage")));
1055 if (TYPreferenceManager::exists(
"GridMagnStepMaillage"))
1058 ->_pGridMagnStepMailEdit->setText(
1059 QString().setNum(TYPreferenceManager::getFloat(
"GridMagnStepMaillage")));
1062 if (TYPreferenceManager::exists(
"Angle"))
1064 switch (
ROUND(TYPreferenceManager::getFloat(
"Angle")))
1091 if (TYPreferenceManager::exists(
"UserSrcPonctGraphicSize"))
1094 ->_pSourceSizeEdit->setText(
1095 QString().setNum(TYPreferenceManager::getFloat(
"UserSrcPonctGraphicSize")));
1098 if (TYPreferenceManager::exists(
"PointControlGraphicSize"))
1101 ->_pPointControlSizeEdit->setText(
1102 QString().setNum(TYPreferenceManager::getFloat(
"PointControlGraphicSize")));
1105 if (TYPreferenceManager::exists(
"ResolutionCircle"))
1108 ->_pResoCylEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"ResolutionCircle")));
1110 if (TYPreferenceManager::exists(
"DistMinPtCrbNiv"))
1113 ->_pDistMinPtCrbNivEdit->setText(
1114 QString().setNum(TYPreferenceManager::getFloat(
"DistMinPtCrbNiv")));
1116 if (TYPreferenceManager::exists(
"DelaunayTolerance"))
1119 ->_pDelaunayToleranceEdit->setText(
1120 QString().setNum(TYPreferenceManager::getFloat(
"DelaunayTolerance")));
1122 if (TYPreferenceManager::exists(
"DefaultDimX"))
1125 ->_pDefaultDimXEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"DefaultDimX")));
1127 if (TYPreferenceManager::exists(
"DefaultDimY"))
1130 ->_pDefaultDimYEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"DefaultDimY")));
1132 if (TYPreferenceManager::exists(
"DefaultHMur"))
1135 ->_pDefaultHMurEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"DefaultHMur")));
1137 if (TYPreferenceManager::exists(
"DefaultWidthEcran"))
1140 ->_pDefaultWEcranEdit->setText(
1141 QString().setNum(TYPreferenceManager::getFloat(
"DefaultWidthEcran")));
1145 if (TYPreferenceManager::exists(
"MouseLeftButtonFunct2D"))
1148 ->_pLeftButton2DComboBox->setCurrentIndex(TYPreferenceManager::getInt(
"MouseLeftButtonFunct2D"));
1150 if (TYPreferenceManager::exists(
"MouseRightButtonFunct2D"))
1153 ->_pRightButton2DComboBox->setCurrentIndex(
1154 TYPreferenceManager::getInt(
"MouseRightButtonFunct2D"));
1156 if (TYPreferenceManager::exists(
"MouseMiddleButtonFunct2D"))
1159 ->_pMiddleButton2DComboBox->setCurrentIndex(
1160 TYPreferenceManager::getInt(
"MouseMiddleButtonFunct2D"));
1162 if (TYPreferenceManager::exists(
"MouseLeftButtonFunct3D"))
1165 ->_pLeftButton3DComboBox->setCurrentIndex(TYPreferenceManager::getInt(
"MouseLeftButtonFunct3D"));
1167 if (TYPreferenceManager::exists(
"MouseRightButtonFunct3D"))
1170 ->_pRightButton3DComboBox->setCurrentIndex(
1171 TYPreferenceManager::getInt(
"MouseRightButtonFunct3D"));
1173 if (TYPreferenceManager::exists(
"MouseMiddleButtonFunct3D"))
1176 ->_pMiddleButton3DComboBox->setCurrentIndex(
1177 TYPreferenceManager::getInt(
"MouseMiddleButtonFunct3D"));
1179 if (TYPreferenceManager::exists(
"MouseShiftLeftButtonFunct2D"))
1182 ->_pLeftButton2DShtComboBox->setCurrentIndex(
1183 TYPreferenceManager::getInt(
"MouseShiftLeftButtonFunct2D"));
1185 if (TYPreferenceManager::exists(
"MouseShiftRightButtonFunct2D"))
1188 ->_pRightButton2DShtComboBox->setCurrentIndex(
1189 TYPreferenceManager::getInt(
"MouseShiftRightButtonFunct2D"));
1191 if (TYPreferenceManager::exists(
"MouseShiftLeftButtonFunct3D"))
1194 ->_pLeftButton3DShtComboBox->setCurrentIndex(
1195 TYPreferenceManager::getInt(
"MouseShiftLeftButtonFunct3D"));
1197 if (TYPreferenceManager::exists(
"MouseShiftRightButtonFunct3D"))
1200 ->_pRightButton3DShtComboBox->setCurrentIndex(
1201 TYPreferenceManager::getInt(
"MouseShiftRightButtonFunct3D"));
1203 if (TYPreferenceManager::exists(
"ZoomStep"))
1206 ->_pZoomStepEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"ZoomStep")));
1208 if (TYPreferenceManager::exists(
"PrecisPick"))
1211 ->_pPrecisPickEdit->setText(QString().setNum(TYPreferenceManager::getFloat(
"PrecisPick")));
1213 if (TYPreferenceManager::exists(
"Luminosite"))
1216 ->_pLightSlider->setValue(
ROUND(TYPreferenceManager::getFloat(
"Luminosite") * 100.0f));
1218 if (TYPreferenceManager::exists(
"ViewOnlyHighlight"))
1221 ->_pViewOnlyHighlightCheckBox->setChecked(TYPreferenceManager::getBool(
"ViewOnlyHighlight"));
1223 if (TYPreferenceManager::exists(
"CenterOnLocate"))
1226 ->_pCenterOnLocateCheckBox->setChecked(TYPreferenceManager::getBool(
"CenterOnLocate"));
1228 if (TYPreferenceManager::exists(
"WireframeOnMovingCamera"))
1231 ->_pWireframeOnMovingCameraCheckBox->setChecked(
1232 TYPreferenceManager::getBool(
"WireframeOnMovingCamera"));
1234 if (TYPreferenceManager::exists(
"CameraTranslateStep"))
1237 ->_pCameraStepTranslateEdit->setText(
1238 QString().setNum(TYPreferenceManager::getFloat(
"CameraTranslateStep")));
1240 if (TYPreferenceManager::exists(
"CameraRotateStep"))
1243 ->_pCameraStepRotateEdit->setText(
1244 QString().setNum(TYPreferenceManager::getFloat(
"CameraRotateStep")));
1246 if (TYPreferenceManager::exists(
"CameraZoomStep"))
1249 ->_pCameraStepZoomEdit->setText(
1250 QString().setNum(TYPreferenceManager::getFloat(
"CameraZoomStep")));
1254 float r = NAN, g = NAN, b = NAN;
1255 if (TYPreferenceManager::exists(
"BackgroundColorR"))
1257 TYPreferenceManager::getColor(
"BackgroundColor", r, g, b);
1259 ->_pBackgroundColorToolButton->setColor(
1260 QColor(
int(r), int(g), int(b)));
1264 if (TYPreferenceManager::exists(
"AltiGraphicColorMinR"))
1266 TYPreferenceManager::getColor(
"AltiGraphicColorMin", r, g, b);
1268 color.setHsv(
int(r),
int(g),
int(b));
1271 if (TYPreferenceManager::exists(
"AltiGraphicColorMaxR"))
1273 TYPreferenceManager::getColor(
"AltiGraphicColorMax", r, g, b);
1275 color.setHsv(
int(r),
int(g),
int(b));
1278 if (TYPreferenceManager::exists(
"TYReseauTransportGraphicColorR"))
1280 TYPreferenceManager::getColor(
"TYReseauTransportGraphicColor", r, g, b);
1282 ->_pResTranspColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1285 if (TYPreferenceManager::exists(
"TYRouteGraphicColorR"))
1287 TYPreferenceManager::getColor(
"TYRouteGraphicColor", r, g, b);
1288 ((
ColorsTab*)
tabWidget->widget(2))->_pRouteColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1291 if (TYPreferenceManager::exists(
"TYMurGraphicColorR"))
1293 TYPreferenceManager::getColor(
"TYMurGraphicColor", r, g, b);
1294 ((
ColorsTab*)
tabWidget->widget(2))->_pMurColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1296 if (TYPreferenceManager::exists(
"TYEcranGraphicColorR"))
1298 TYPreferenceManager::getColor(
"TYEcranGraphicColor", r, g, b);
1299 ((
ColorsTab*)
tabWidget->widget(2))->_pEcranColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1301 if (TYPreferenceManager::exists(
"TYDalleGraphicColorR"))
1303 TYPreferenceManager::getColor(
"TYDalleGraphicColor", r, g, b);
1304 ((
ColorsTab*)
tabWidget->widget(2))->_pDalleColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1306 if (TYPreferenceManager::exists(
"SubRectColorR"))
1308 TYPreferenceManager::getColor(
"SubRectColor", r, g, b);
1310 ->_pSubRectColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1312 if (TYPreferenceManager::exists(
"TYAcousticCylinderGraphicColorR"))
1314 TYPreferenceManager::getColor(
"TYAcousticCylinderGraphicColor", r, g, b);
1316 ->_pCylindreColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1318 if (TYPreferenceManager::exists(
"TYAcousticBoxGraphicColorR"))
1320 TYPreferenceManager::getColor(
"TYAcousticBoxGraphicColor", r, g, b);
1321 ((
ColorsTab*)
tabWidget->widget(2))->_pBoxColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1323 if (TYPreferenceManager::exists(
"TYVegetationGraphicColorR"))
1325 TYPreferenceManager::getColor(
"TYVegetationGraphicColor", r, g, b);
1326 ((
ColorsTab*)
tabWidget->widget(2))->_pVegColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1328 if (TYPreferenceManager::exists(
"TYCourbeNiveauGraphicColorR"))
1330 TYPreferenceManager::getColor(
"TYCourbeNiveauGraphicColor", r, g, b);
1331 ((
ColorsTab*)
tabWidget->widget(2))->_pCrbNivColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1333 if (TYPreferenceManager::exists(
"TYCoursEauGraphicColorR"))
1335 TYPreferenceManager::getColor(
"TYCoursEauGraphicColor", r, g, b);
1336 ((
ColorsTab*)
tabWidget->widget(2))->_pCrsEauColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1338 if (TYPreferenceManager::exists(
"TYPlanEauGraphicColorR"))
1340 TYPreferenceManager::getColor(
"TYPlanEauGraphicColor", r, g, b);
1342 ->_pPlanEauColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1344 if (TYPreferenceManager::exists(
"TYTerrainGraphicColorR"))
1346 TYPreferenceManager::getColor(
"TYTerrainGraphicColor", r, g, b);
1348 ->_pTerrainColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1350 if (TYPreferenceManager::exists(
"FontColorR"))
1352 TYPreferenceManager::getColor(
"FontColor", r, g, b);
1353 ((
ColorsTab*)
tabWidget->widget(2))->_pPoliceColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1355 if (TYPreferenceManager::exists(
"GridColorR"))
1357 TYPreferenceManager::getColor(
"GridColor", r, g, b);
1358 ((
ColorsTab*)
tabWidget->widget(2))->_pGridColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1361 if (TYPreferenceManager::exists(
"PointControlGraphicColorR"))
1363 TYPreferenceManager::getColor(
"PointControlGraphicColor", r, g, b);
1365 ->_pPointControlColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1368 if (TYPreferenceManager::exists(
"SrcPonctGraphicColorR"))
1370 TYPreferenceManager::getColor(
"SrcPonctGraphicColor", r, g, b);
1372 ->_pSourcePonctColorToolButton->setColor(QColor(
int(r), int(g), int(b)));
1375 if (TYPreferenceManager::exists(
"WinOpacity"))
1378 ->_pWinOpacitySlider->setValue(
ROUND(TYPreferenceManager::getFloat(
"WinOpacity") * 100.0f));
1380 if (TYPreferenceManager::exists(
"AltOpacity"))
1383 ->_pAltOpacitySlider->setValue(
ROUND(TYPreferenceManager::getFloat(
"AltOpacity") * 100.0f));
1385 if (TYPreferenceManager::exists(
"MaillageOpacity"))
1388 ->_pMailOpacitySlider->setValue(
ROUND(TYPreferenceManager::getFloat(
"MaillageOpacity") * 100.0f));
1390 if (TYPreferenceManager::exists(
"Antialiasing"))
1393 ->_pMailAntiAliasingCheckBox->setChecked(TYPreferenceManager::getBool(
"Antialiasing"));
1397 if (TYPreferenceManager::exists(
"ResisSolDefault"))
1400 ->_pLineEditResistivite->setText(
1401 QString().setNum(TYPreferenceManager::getDouble(
"ResisSolDefault")));
1403 if (TYPreferenceManager::exists(
"EpaisSolDefault"))
1406 ->_pLineEditEpaisseur->setText(
1407 QString().setNum(TYPreferenceManager::getDouble(
"EpaisSolDefault")));
1409 if (TYPreferenceManager::exists(
"EcartTypeDefault"))
1412 ->_pLineEditEcartType->setText(
1413 QString().setNum(TYPreferenceManager::getDouble(
"EcartTypeDefault")));
1415 if (TYPreferenceManager::exists(
"LongueurDefault"))
1418 ->_pLineEditLongueur->setText(
1419 QString().setNum(TYPreferenceManager::getDouble(
"LongueurDefault")));
1421 if (TYPreferenceManager::exists(
"MasseVolMatDefault"))
1424 ->_pLineEditMasseVol->setText(
1425 QString().setNum(TYPreferenceManager::getDouble(
"MasseVolMatDefault")));
1427 if (TYPreferenceManager::exists(
"SpectreTransmDefault0"))
1429 TYSpectre* pTmpSpectre = TYPreferenceManager::getSpectre(
"SpectreTransmDefault");
1440 if (TYPreferenceManager::exists(
"SpectreAbsoDefault0"))
1442 TYSpectre* pTmpSpectre = TYPreferenceManager::getSpectre(
"SpectreAbsoDefault");
1455 QString pref =
"MaillageDefault";
1456 if (TYPreferenceManager::exists(pref +
"Hauteur"))
1459 ->_pMaillage->setHauteur(TYPreferenceManager::getFloat(pref +
"Hauteur"));
1461 ->_pMaillage->setDataType(TYPreferenceManager::getInt(pref +
"DataType"));
1463 ->_pMaillage->setDataFreq(TYPreferenceManager::getFloat(pref +
"DataFreq"));
1465 pref =
"PaletteDefault";
1466 if (TYPreferenceManager::exists(pref +
"Min"))
1471 const size_t nb_colors = TYPreferenceManager::getFloat(pref +
"NbColors");
1472 const float valueMin = TYPreferenceManager::getFloat(pref +
"Min");
1473 const float valueMax = TYPreferenceManager::getFloat(pref +
"Max");
1476 legacyTable.resize(nb_colors);
1477 for (
size_t i = 0; i < nb_colors; ++i)
1479 TYPreferenceManager::getColor(pref +
"Color" + QString(
uintToStr(i).c_str()), color.
r,
1481 legacyTable[i] =
OColor(color.
r, color.
g, color.
b);
1488 TYPreferenceManager::setCurrentDirectory(oldDir);
1499 QString oldDir = TYPreferenceManager::getCurrentDirectory();
1501 QDoubleValidator qValidator(NULL);
1506 qValidator.setBottom(1);
1507 qValidator.setTop(256);
1508 qValidator.setLocale(QLocale(QLocale::English));
1509 if (qValidator.validate(aQString = ((
GeneralTab*)
tabWidget->widget(4))->_pHistoSizeEdit->text(), res) ==
1510 QValidator::Acceptable)
1512 TYPreferenceManager::setInt(
"HistoSize",
1521 if (libraryPath.exists())
1523 TYPreferenceManager::setString(
"BiblioPath",
1529 if (workDirPath.exists())
1531 TYPreferenceManager::setString(
"WorkDirPath",
1536 qValidator.setTop(256000);
1537 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pGridDimXSiteEdit->text(),
1538 res) == QValidator::Acceptable)
1540 TYPreferenceManager::setFloat(
1543 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pGridDimYSiteEdit->text(),
1544 res) == QValidator::Acceptable)
1546 TYPreferenceManager::setFloat(
1549 qValidator.setBottom(0.1);
1550 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pGridStepSiteEdit->text(),
1551 res) == QValidator::Acceptable)
1553 TYPreferenceManager::setFloat(
1556 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pGridMagnStepSiteEdit->text(),
1557 res) == QValidator::Acceptable)
1559 TYPreferenceManager::setFloat(
1564 qValidator.setBottom(1);
1565 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pGridDimXBatEdit->text(),
1566 res) == QValidator::Acceptable)
1568 TYPreferenceManager::setFloat(
1571 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pGridDimYBatEdit->text(),
1572 res) == QValidator::Acceptable)
1574 TYPreferenceManager::setFloat(
1577 qValidator.setBottom(0.1);
1578 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pGridMagnStepBatEdit->text(),
1579 res) == QValidator::Acceptable)
1581 TYPreferenceManager::setFloat(
1582 "GridMagnStepBatiment",
1585 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pGridStepBatEdit->text(),
1586 res) == QValidator::Acceptable)
1588 TYPreferenceManager::setFloat(
1592 qValidator.setBottom(1);
1593 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pGridDimXMacEdit->text(),
1594 res) == QValidator::Acceptable)
1596 TYPreferenceManager::setFloat(
1599 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pGridDimYMacEdit->text(),
1600 res) == QValidator::Acceptable)
1602 TYPreferenceManager::setFloat(
1605 qValidator.setBottom(0.1);
1606 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pGridStepMacEdit->text(),
1607 res) == QValidator::Acceptable)
1609 TYPreferenceManager::setFloat(
1612 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pGridMagnStepMacEdit->text(),
1613 res) == QValidator::Acceptable)
1615 TYPreferenceManager::setFloat(
1616 "GridMagnStepMachine",
1620 qValidator.setBottom(1);
1621 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pGridDimXMailEdit->text(),
1622 res) == QValidator::Acceptable)
1624 TYPreferenceManager::setFloat(
1627 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pGridDimYMailEdit->text(),
1628 res) == QValidator::Acceptable)
1630 TYPreferenceManager::setFloat(
1633 qValidator.setBottom(0.1);
1634 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pGridMagnStepMailEdit->text(),
1635 res) == QValidator::Acceptable)
1637 TYPreferenceManager::setFloat(
1638 "GridMagnStepMaillage",
1641 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pGridStepMailEdit->text(),
1642 res) == QValidator::Acceptable)
1644 TYPreferenceManager::setFloat(
1648 qValidator.setBottom(1);
1649 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pGridDimXFaceEdit->text(),
1650 res) == QValidator::Acceptable)
1652 TYPreferenceManager::setFloat(
1655 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pGridDimYFaceEdit->text(),
1656 res) == QValidator::Acceptable)
1658 TYPreferenceManager::setFloat(
1661 qValidator.setBottom(0.1);
1662 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pGridStepFaceEdit->text(),
1663 res) == QValidator::Acceptable)
1665 TYPreferenceManager::setFloat(
1668 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pGridMagnStepFaceEdit->text(),
1669 res) == QValidator::Acceptable)
1671 TYPreferenceManager::setFloat(
1678 TYPreferenceManager::setFloat(
1683 TYPreferenceManager::setFloat(
1688 TYPreferenceManager::setFloat(
1693 TYPreferenceManager::setFloat(
1698 qValidator.setBottom(0.5);
1700 res) == QValidator::Acceptable)
1702 TYPreferenceManager::setFloat(
1703 "UserSrcPonctGraphicSize",
1707 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pPointControlSizeEdit->text(),
1708 res) == QValidator::Acceptable)
1710 TYPreferenceManager::setFloat(
1711 "PointControlGraphicSize",
1715 qValidator.setBottom(3);
1716 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pResoCylEdit->text(), res) ==
1717 QValidator::Acceptable)
1719 TYPreferenceManager::setFloat(
"ResolutionCircle",
1722 qValidator.setBottom(0.001);
1723 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pDistMinPtCrbNivEdit->text(),
1724 res) == QValidator::Acceptable)
1726 TYPreferenceManager::setFloat(
1730 qValidator.setBottom(0);
1731 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pDelaunayToleranceEdit->text(),
1732 res) == QValidator::Acceptable)
1734 TYPreferenceManager::setFloat(
1735 "DelaunayTolerance",
1738 qValidator.setBottom(1);
1739 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pDefaultDimXEdit->text(),
1740 res) == QValidator::Acceptable)
1742 TYPreferenceManager::setFloat(
1745 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pDefaultDimYEdit->text(),
1746 res) == QValidator::Acceptable)
1748 TYPreferenceManager::setFloat(
1751 qValidator.setBottom(0.1);
1752 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pDefaultHMurEdit->text(),
1753 res) == QValidator::Acceptable)
1755 TYPreferenceManager::setFloat(
1758 if (qValidator.validate(aQString = ((
GeometrieTab*)
tabWidget->widget(0))->_pDefaultWEcranEdit->text(),
1759 res) == QValidator::Acceptable)
1761 TYPreferenceManager::setFloat(
1762 "DefaultWidthEcran",
1767 TYPreferenceManager::setFloat(
"Luminosite",
1769 qValidator.setBottom(0.001);
1770 if (qValidator.validate(aQString = ((
pref3DTab*)
tabWidget->widget(1))->_pZoomStepEdit->text(), res) ==
1771 QValidator::Acceptable)
1773 TYPreferenceManager::setFloat(
"ZoomStep",
1776 if (qValidator.validate(aQString = ((
pref3DTab*)
tabWidget->widget(1))->_pPrecisPickEdit->text(), res) ==
1777 QValidator::Acceptable)
1779 TYPreferenceManager::setFloat(
"PrecisPick",
1782 TYPreferenceManager::setInt(
"MouseLeftButtonFunct2D",
1784 TYPreferenceManager::setInt(
"MouseRightButtonFunct2D",
1786 TYPreferenceManager::setInt(
"MouseMiddleButtonFunct2D",
1788 TYPreferenceManager::setInt(
"MouseLeftButtonFunct3D",
1790 TYPreferenceManager::setInt(
"MouseRightButtonFunct3D",
1792 TYPreferenceManager::setInt(
"MouseMiddleButtonFunct3D",
1794 TYPreferenceManager::setInt(
1795 "MouseShiftLeftButtonFunct2D",
1797 TYPreferenceManager::setInt(
1798 "MouseShiftRightButtonFunct2D",
1800 TYPreferenceManager::setInt(
1801 "MouseShiftLeftButtonFunct3D",
1803 TYPreferenceManager::setInt(
1804 "MouseShiftRightButtonFunct3D",
1806 TYPreferenceManager::setBool(
1807 "ViewOnlyHighlight", ((
pref3DTab*)
tabWidget->widget(1))->_pViewOnlyHighlightCheckBox->isChecked());
1808 TYPreferenceManager::setBool(
"CenterOnLocate",
1810 TYPreferenceManager::setBool(
1811 "WireframeOnMovingCamera",
1813 TYPreferenceManager::setFloat(
1814 "CameraTranslateStep",
1816 TYPreferenceManager::setFloat(
1817 "CameraRotateStep", ((
pref3DTab*)
tabWidget->widget(1))->_pCameraStepRotateEdit->text().toFloat());
1818 TYPreferenceManager::setFloat(
"CameraZoomStep",
1822 TYPreferenceManager::setColor(
1823 "BackgroundColor", ((
ColorsTab*)
tabWidget->widget(2))->_pBackgroundColorToolButton->getColor().red(),
1826 TYPreferenceManager::setColor(
1827 "GridColor", ((
ColorsTab*)
tabWidget->widget(2))->_pGridColorToolButton->getColor().red(),
1830 TYPreferenceManager::setColor(
1831 "FontColor", ((
ColorsTab*)
tabWidget->widget(2))->_pPoliceColorToolButton->getColor().red(),
1834 TYPreferenceManager::setColor(
1835 "TYTerrainGraphicColor",
1839 TYPreferenceManager::setColor(
1840 "TYPlanEauGraphicColor",
1844 TYPreferenceManager::setColor(
1845 "TYCoursEauGraphicColor",
1849 TYPreferenceManager::setColor(
1850 "TYCourbeNiveauGraphicColor",
1854 TYPreferenceManager::setColor(
1855 "TYVegetationGraphicColor",
1859 TYPreferenceManager::setColor(
1860 "TYAcousticBoxGraphicColor",
1864 TYPreferenceManager::setColor(
1865 "TYAcousticCylinderGraphicColor",
1869 TYPreferenceManager::setColor(
1870 "TYAcousticSemiCylinderGraphicColor",
1874 TYPreferenceManager::setColor(
1875 "TYAcousticCircleGraphicColor",
1879 TYPreferenceManager::setColor(
1880 "TYAcousticSemiCircleGraphicColor",
1884 TYPreferenceManager::setColor(
1885 "SubRectColor", ((
ColorsTab*)
tabWidget->widget(2))->_pSubRectColorToolButton->getColor().red(),
1888 TYPreferenceManager::setColor(
1889 "TYMurGraphicColor", ((
ColorsTab*)
tabWidget->widget(2))->_pMurColorToolButton->getColor().red(),
1892 TYPreferenceManager::setColor(
1893 "TYDalleGraphicColor", ((
ColorsTab*)
tabWidget->widget(2))->_pDalleColorToolButton->getColor().red(),
1896 TYPreferenceManager::setColor(
1897 "TYEcranGraphicColor", ((
ColorsTab*)
tabWidget->widget(2))->_pEcranColorToolButton->getColor().red(),
1901 TYPreferenceManager::setColor(
1902 "TYRouteGraphicColor", ((
ColorsTab*)
tabWidget->widget(2))->_pRouteColorToolButton->getColor().red(),
1906 TYPreferenceManager::setColor(
1907 "TYReseauTransportGraphicColor",
1912 TYPreferenceManager::setColor(
1913 "PointControlGraphicColor",
1915 ((
ColorsTab*)
tabWidget->widget(2))->_pPointControlColorToolButton->getColor().green(),
1916 ((
ColorsTab*)
tabWidget->widget(2))->_pPointControlColorToolButton->getColor().blue());
1918 TYPreferenceManager::setColor(
1919 "SrcPonctGraphicColor",
1921 ((
ColorsTab*)
tabWidget->widget(2))->_pSourcePonctColorToolButton->getColor().green(),
1922 ((
ColorsTab*)
tabWidget->widget(2))->_pSourcePonctColorToolButton->getColor().blue());
1926 ->_pAltiColorMinToolButton->getColor()
1927 .getHsv(&hsvColor[0], &hsvColor[1], &hsvColor[2]);
1928 TYPreferenceManager::setColor(
"AltiGraphicColorMin", hsvColor[0], hsvColor[1], hsvColor[2]);
1930 ->_pAltiColorMaxToolButton->getColor()
1931 .getHsv(&hsvColor[0], &hsvColor[1], &hsvColor[2]);
1932 TYPreferenceManager::setColor(
"AltiGraphicColorMax", hsvColor[0], hsvColor[1], hsvColor[2]);
1934 TYPreferenceManager::setFloat(
1935 "WinOpacity",
float(((
ColorsTab*)
tabWidget->widget(2))->_pWinOpacitySlider->value()) / 100.0f);
1936 TYPreferenceManager::setFloat(
1937 "AltOpacity",
float(((
ColorsTab*)
tabWidget->widget(2))->_pAltOpacitySlider->value()) / 100.0f);
1938 TYPreferenceManager::setFloat(
1939 "MaillageOpacity",
float(((
ColorsTab*)
tabWidget->widget(2))->_pMailOpacitySlider->value()) / 100.0f);
1940 TYPreferenceManager::setBool(
"Antialiasing",
1944 qValidator.setBottom(0.001);
1945 TYPreferenceManager::setDouble(
1948 res) == QValidator::Acceptable)
1950 TYPreferenceManager::setDouble(
1954 TYPreferenceManager::setDouble(
1956 TYPreferenceManager::setDouble(
1958 TYPreferenceManager::setDouble(
1960 TYPreferenceManager::setSpectre(
"SpectreTransmDefault",
1962 TYPreferenceManager::setSpectre(
"SpectreAbsoDefault",
1965 QString pref =
"MaillageDefault";
1966 TYPreferenceManager::setFloat(pref +
"Hauteur",
1968 TYPreferenceManager::setInt(pref +
"DataType",
1970 TYPreferenceManager::setFloat(pref +
"DataFreq",
1973 pref =
"PaletteDefault";
1975 TYPreferenceManager::setFloat(pref +
"Min", pPalette->
getValueMin());
1976 TYPreferenceManager::setFloat(pref +
"Max", pPalette->
getValueMax());
1977 TYPreferenceManager::setUInt(pref +
"NbColors", pPalette->
getNbColors());
1980 uint colorIndice = 0;
1984 "getNbColors() should be the number of colors in the color map.");
1985 const OColor& color = it->second;
1986 TYPreferenceManager::setColor(pref +
"Color" + QString(
uintToStr(colorIndice).c_str()), color.
r,
1992 TYPreferenceManager::setCurrentDirectory(oldDir);
1996 for (
int i = 0; i < int(windows.count()); ++i)
1998 QWidget* internal_window = windows.at(i)->widget();
2014 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 (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 * _pLineEditEcartType
TYMaillage * _pMaillage
Maillage par defaut.
TYLineEdit * _pLineEditResistivite
TYSpectre * _pSpectreAbsoMatConst
Spectre d'absorption par defaut des materiaux de construction.
TYLineEdit * _pLineEditLongueur
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.
TYLineEdit * _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()
Classe generique pour une fenetre de modeleur.
TYRenderWindowInteractor * getView()
TYActionManager * getActionManager()
virtual void updatePreferences()
virtual void updateView(bool clipping=true, bool axesAndGrid=true)
void updateDisplayList(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)