15 #define VP1IMPVARNAME m_d
27 #include "ui_geometrysystemcontroller.h"
28 #include "ui_settings_display_form.h"
29 #include "ui_settings_iconisedvols_form.h"
30 #include "ui_settings_interactions_form.h"
31 #include "ui_settings_misc_form.h"
32 #include "ui_settings_muonchamber_form.h"
33 #include "ui_settings_treebrowser_form.h"
35 #include <Inventor/nodes/SoPickStyle.h>
37 #include <QFileDialog>
46 Ui::GeometrySystemControllerForm
ui{};
49 Ui::GeoSysSettingsInteractionsForm
ui_int{};
51 Ui::GeoSysSettingsMuonChamberForm
ui_muon{};
75 m_d->
ui.setupUi(
this);
85 m_d->
ui_disp.widget_drawOptions->setPointSizesDisabled();
87 m_d->
ui_disp.widget_drawOptions->setComplexity(0.6);
95 m_d->
ui.groupBox_innerdetector->setVisible(
false);
96 m_d->
ui.groupBox_calorimeters->setVisible(
false);
97 m_d->
ui.groupBox_muonsystems->setVisible(
false);
98 m_d->
ui.pushButton_settings_muonchambers->setEnabled(
false);
99 m_d->
ui_misc.groupBox_pixelactivemodules->setVisible(
false);
100 m_d->
ui_misc.groupBox_sctactivemodules->setVisible(
false);
101 m_d->
ui.groupBox_misc->setVisible(
false);
102 m_d->
ui_muon.groupBox_muonchamberconfig->setVisible(
false);
103 m_d->
ui_misc.groupBox_show_NSW_chambers->setVisible(
false);
104 m_d->
ui_int.checkBox_AutomaticMuonChamberEndViews->setVisible(
false);
105 message(
"GeoModel not properly initialised.");
127 m_d->
ui_iconisedvols.listView_iconisedvolumes->setSelectionMode(QAbstractItemView::ExtendedSelection);
255 m_d->
ui_int.checkBox_geomselectable->setChecked(
b);
268 m_d->
ui_int.checkBox_zoomToVolumes->setChecked(
b);
274 m_d->
ui_int.checkBox_AutomaticMuonChamberEndViews->setChecked(
b);
280 m_d->
ui_muon.checkBox_muonadapt_autoadapt->setChecked(
b);
287 m_d->
ui_disp.matButton_lastSel->setEnabled(vh!=0);
289 QList<SoMaterial*> mats =
m_d->
ui_disp.matButton_lastSel->handledMaterials();
290 if (mats.isEmpty()||mats.at(0)!=vh->
material()) {
291 m_d->
ui_disp.matButton_lastSel->clearHandledMaterials();
295 m_d->
ui_disp.matButton_lastSel->clearHandledMaterials();
308 const bool ctrl_isdown = (Qt::ControlModifier & QApplication::keyboardModifiers());
309 const bool onlyChangedMaterials = !ctrl_isdown;
312 = QFileDialog::getSaveFileName(
this,
"Select geometry material file to save",
316 "VP1 geometry material files (*.vp1geomat)",
317 0,QFileDialog::DontResolveSymlinks);
322 if (!
filename.endsWith(
".vp1geomat"))
335 QString
filename = QFileDialog::getOpenFileName(
this,
"Select geometry material file to load",
339 "VP1 geometry material files (*.vp1geomat)",
340 0,QFileDialog::DontResolveSymlinks);
360 return m_d->
ui_disp.widget_drawOptions->drawOptionsGroup();
390 return m_d->
ui_int.checkBox_zoomToVolumes->isChecked();
396 return m_d->
ui_int.checkBox_AutomaticMuonChamberEndViews->isChecked();
402 return m_d->
ui_int.checkBox_print_shape->isChecked();
408 return m_d->
ui_int.checkBox_print_material->isChecked();
414 return m_d->
ui_int.checkBox_print_copyno->isChecked();
420 return m_d->
ui_int.checkBox_print_transform->isChecked();
426 return m_d->
ui_int.checkBox_print_tree->isChecked();
432 return m_d->
ui_int.checkBox_print_mass->isChecked();
438 return m_d->
ui_int.checkBox_print_muonstationinfo->isChecked();
444 return m_d->
ui_muon.checkBox_muonadapt_autoadapt->isChecked();
451 ? SoPickStyle::SHAPE : SoPickStyle::UNPICKABLE;
458 return (
v>=100?1.0:(
v<=0?0.0:
v/100.0));
464 return m_d->
ui_disp.checkBox_showVolumeOutLines->isChecked();
470 VP1GeoFlags::MuonChamberAdaptionStyleFlags
f;
471 if (
m_d->
ui_muon.checkBox_muonadapt_openmdtchambers->isChecked())
473 if (
m_d->
ui_muon.checkBox_muonadapt_hidetubes->isChecked())
475 if (
m_d->
ui_muon.checkBox_muonadapt_hiderpcvolumes->isChecked())
477 if (
m_d->
ui_muon.checkBox_muonadapt_opencscchambers->isChecked())
479 if (
m_d->
ui_muon.checkBox_muonadapt_opentgcchambers->isChecked())
502 m_d->
ui_disp.checkBox_labels_mooret0s,SLOT(setEnabled(
bool)));
504 m_d->
ui_disp.checkBox_labels_mboyt0s,SLOT(setEnabled(
bool)));
506 m_d->
ui_disp.checkBox_labels_mooret0s->setEnabled(
false);
507 m_d->
ui_disp.checkBox_labels_mboyt0s->setEnabled(
false);
511 m_d->
ui_disp.checkBox_labels_hits,SLOT(setEnabled(
bool)));
513 m_d->
ui_disp.checkBox_labels_hits->setEnabled(
false);
521 if (!
m_d->
ui_disp.groupBox_labels->isChecked())
return 0;
552 :
m_d->
ui_misc.checkBox_sctmod_barrel->isChecked();
554 :
m_d->
ui_misc.checkBox_sctmod_endcapA->isChecked();
556 :
m_d->
ui_misc.checkBox_sctmod_endcapC->isChecked();
557 bool bcmA =
pixel ?
m_d->
ui_misc.checkBox_bcmMod_Aside->isChecked() :
false;
558 bool bcmC =
pixel ?
m_d->
ui_misc.checkBox_bcmMod_Cside->isChecked() :
false;
569 if (sender()==
m_d->
ui_misc.toolButton_nswchambers_reset) {
572 bool stgc =
m_d->
ui_misc.checkBox_NSW_sTGC->isChecked();
574 bool pSp =
m_d->
ui_misc.checkBox_NSW_Passive_Spacer->isChecked();
575 bool pSt =
m_d->
ui_misc.checkBox_NSW_Passive_Structure->isChecked();
576 bool pAP =
m_d->
ui_misc.checkBox_NSW_Passive_APlate->isChecked();
587 bool volname(sender()==
m_d->
ui_misc.pushButton_iconify_vols_volname
588 ||sender()==
m_d->
ui_misc.lineEdit_iconify_vols_volname);
590 QString
name(volname ?
m_d->
ui_misc.lineEdit_iconify_vols_volname->text()
602 bool volname(sender()==
m_d->
ui_misc.pushButton_expand_vols_volname
603 ||sender()==
m_d->
ui_misc.lineEdit_expand_vols_volname);
604 QString
name(volname?
m_d->
ui_misc.lineEdit_expand_vols_volname->text()
605 :
m_d->
ui_misc.lineEdit_expand_vols_matname->text());
614 bool zap(sender()==
m_d->
ui_misc.pushButton_nonStandardShapes_Iconify);
638 VP1GeoFlags::SubSystemFlags
f;
639 if (sender()==
m_d->
ui_misc.toolButton_pixelmod_reset)
641 else if (sender()==
m_d->
ui_misc.toolButton_sctmod_reset)
643 else if (sender()==
m_d->
ui_muon.pushButton_muonadapt_resetToAllChambers)
661 s.save(
m_d->
ui_muon.checkBox_muonadapt_openmdtchambers);
663 s.save(
m_d->
ui_muon.checkBox_muonadapt_hiderpcvolumes);
664 s.save(
m_d->
ui_muon.checkBox_muonadapt_opencscchambers);
665 s.save(
m_d->
ui_muon.checkBox_muonadapt_opentgcchambers);
682 s.save(
m_d->
ui_int.checkBox_print_muonstationinfo);
684 s.save(
m_d->
ui_int.checkBox_AutomaticMuonChamberEndViews);
691 s.save(
m_d->
ui_disp.horizontalSlider_labels_xOffset);
692 s.save(
m_d->
ui_disp.horizontalSlider_labels_yOffset);
693 s.save(
m_d->
ui_disp.horizontalSlider_labels_zOffset);
703 s.save(
m_d->
ui_misc.checkBox_NSW_Passive_Structure);
710 s.ignoreWidget(
it->second);
717 message(
"Warning: State data in .vp1 file has unsupported version ("+
str(
s.version())+
")");
721 if (
s.version()<=1) {
722 s.ignoreObsoletePhiSectionWidgetState();
728 s.restore(
m_d->
ui_muon.checkBox_muonadapt_autoadapt);
729 s.restore(
m_d->
ui_muon.checkBox_muonadapt_openmdtchambers);
730 s.restore(
m_d->
ui_muon.checkBox_muonadapt_hidetubes);
731 s.restore(
m_d->
ui_muon.checkBox_muonadapt_hiderpcvolumes);
732 s.restore(
m_d->
ui_muon.checkBox_muonadapt_opencscchambers);
733 s.restore(
m_d->
ui_muon.checkBox_muonadapt_opentgcchambers);
741 s.restore(
m_d->
ui_misc.lineEdit_expand_vols_matname);
742 s.restore(
m_d->
ui_misc.lineEdit_expand_vols_volname);
743 s.restore(
m_d->
ui_int.checkBox_geomselectable);
745 s.restore(
m_d->
ui_int.checkBox_print_material);
746 s.restore(
m_d->
ui_int.checkBox_print_transform);
750 s.restore(
m_d->
ui_int.checkBox_print_muonstationinfo);
751 s.restore(
m_d->
ui_int.checkBox_zoomToVolumes);
752 s.restore(
m_d->
ui_int.checkBox_AutomaticMuonChamberEndViews);
754 s.restore(
m_d->
ui_disp.checkBox_showVolumeOutLines);
756 if (
s.version()>=3) {
764 s.restore(
m_d->
ui_disp.horizontalSlider_labels_xOffset);
765 s.restore(
m_d->
ui_disp.horizontalSlider_labels_yOffset);
766 s.restore(
m_d->
ui_disp.horizontalSlider_labels_zOffset);
777 s.restore(
m_d->
ui_misc.checkBox_NSW_Passive_Spacer);
778 s.restore(
m_d->
ui_misc.checkBox_NSW_Passive_Structure);
779 s.restore(
m_d->
ui_misc.checkBox_NSW_Passive_APlate);
785 s.ignoreWidget(
it->second);
787 m_d->
ui_int.groupBox_printOnSelection->setEnabled(
m_d->
ui_int.checkBox_geomselectable->isChecked());
788 m_d->
ui_int.groupBox_automaticViewReorientations->setEnabled(
m_d->
ui_int.checkBox_geomselectable->isChecked());
795 #define VP1CONTROLLERCLASSNAME GeoSysController