9 #include "ui_periparticlecollectionsettings_form.h"
10 #include "ui_jet_settings_display_form.h"
19 #include "Inventor/nodes/SoDrawStyle.h"
20 #include "Inventor/nodes/SoLightModel.h"
21 #include "Inventor/nodes/SoMaterial.h"
27 #include <QDataStream>
28 #include <QMouseEvent>
29 #include <QDragEnterEvent>
97 SoMaterial *
createMaterial(
int r,
int g,
int b,
float brightness,
float transparency)
const;
116 float transparency)
const
126 theclass->messageVerbose(
"Initialising material editor dialog");
129 editwindow =
new QWidget(0,Qt::WindowStaysOnTopHint);
134 editwindow_ui.setupUi(editwindow);
135 auto jetsettings =
new QWidget();
136 editwindow_ui.verticalLayout_additional_widgets->addWidget(jetsettings);
137 ui_disp.setupUi(jetsettings);
141 editwindow_ui.groupBox_cuts_momentum->setTitle(
"Energy cuts");
142 editwindow_ui.checkBox_cut_minpt->setText(
"Min Energy");
143 editwindow_ui.checkBox_cut_maxpt->setText(
"Max Energy");
144 editwindow_ui.comboBox_momtype->setItemText(0,
"Et");
145 editwindow_ui.comboBox_momtype->setItemText(1,
"E");
147 editwindow_ui.doubleSpinBox_cut_minpt_gev->setValue(10.00);
148 editwindow_ui.doubleSpinBox_cut_maxpt_gev->setValue(100.00);
151 matButton = editwindow_ui.pushButton_matButton;
154 editwindow_ui.verticalLayout_additional_widgets->layout()->addWidget( ui_disp.groupBox_jet_display );
157 ui_disp.bTaggingComboBox->clear();
159 QStringList bTagList;
163 bTagList <<
"MV2c20" <<
"MV2c10" <<
"MV2c00";
164 ui_disp.bTaggingComboBox->insertItems(0, bTagList);
167 ui_disp.radioButton_material->setChecked(
true);
170 ui_disp.groupBox_IDprojection->setEnabled(
false);
174 if (ui_disp.bTaggingCheckBox->isChecked())
175 theclass->possibleChange_bTaggingEnabled(
true);
177 theclass->possibleChange_bTaggingEnabled(
false);
194 double val =
m_d->
ui_disp.doubleSpinBox_lengthOf100GeV->value();
195 bool isEt =
m_d->
ui_disp.comboBox_energytype->currentText()==
"Et";
196 val =
val * ( isEt ? 1:-1);
216 return m_d->
ui_disp.bTaggingComboBox->currentText();
220 return m_d->
ui_disp.skinsComboBox->currentText();
228 return m_d->
ui_disp.bTaggingCheckBox->isChecked();
232 return m_d->
ui_disp.radioButton_skins->isChecked();
236 return m_d->
ui_disp.radioButton_material->isChecked();
242 return m_d->
ui_disp.radioButton_skins->isChecked();
248 return m_d->
ui_disp.radioButton_material->isChecked();
351 setAcceptDrops(
true);
389 if (objectName().isEmpty())
390 setObjectName(
"JetCollectionSettingsButton");
549 if (
event->button() == Qt::LeftButton)
551 QPushButton::mousePressEvent(
event);
557 if (
event->source()!=
this &&
event->mimeData()->hasFormat(
"vp1/material"))
558 event->acceptProposedAction();
564 if (!(
event->buttons() & Qt::LeftButton))
567 < QApplication::startDragDistance())
570 QDrag *drag =
new QDrag(
this);
571 QMimeData *mimeData =
new QMimeData;
580 mimeData->setData(
"vp1/material", byteArray);
609 drag->setMimeData(mimeData);
610 drag->exec(Qt::CopyAction | Qt::MoveAction);
616 QByteArray
data =
event->mimeData()->data(
"vp1/material");
617 event->acceptProposedAction();
624 messageDebug(
"JetCollectionSettingsButton::saveState()");
674 messageDebug(
"JetCollectionSettingsButton::restoreFromState()");
735 messageDebug(
"JetCollectionSettingsButton::checkSelection()");
739 if (
m_d->
ui_disp.bTaggingCheckBox->isChecked()) {
742 if (
m_d->
ui_disp.radioButton_material->isChecked())
744 else if (
m_d->
ui_disp.radioButton_skins->isChecked())
777 const double minFromInterface=
m_d->
editwindow_ui.doubleSpinBox_cut_minpt_gev->value()*1000;
778 const double maxFromInterface=
m_d->
editwindow_ui.doubleSpinBox_cut_maxpt_gev->value()*1000;
783 min = (
m_d->
editwindow_ui.checkBox_cut_minpt->isChecked() ? minFromInterface : -std::numeric_limits<double>::infinity());
784 max = (
m_d->
editwindow_ui.checkBox_cut_maxpt->isChecked() ? maxFromInterface : std::numeric_limits<double>::infinity());
786 min = (
m_d->
editwindow_ui.checkBox_cut_maxpt->isChecked() ? -maxFromInterface : -std::numeric_limits<double>::infinity());
787 max = (
m_d->
editwindow_ui.checkBox_cut_minpt->isChecked() ? -minFromInterface : std::numeric_limits<double>::infinity());
867 m_d->
ui_disp.pushButton_colourbyrandom_rerandomise->setEnabled(bb);
873 return m_d->
ui_disp.checkBox_randomColours->isChecked();
880 messageVerbose(
"JetCollectionSettingsButton - Emitting rerandomise");
894 m_d->
ui_disp.doubleSpinBox_maxR->setEnabled(bb);
902 if ( !
m_d->
ui_disp.checkBox_maxR->isChecked() ) {
903 messageVerbose(
"maxR unchecked --> setting maxR=0.0 and returning");
918 m_d->
ui_disp.bTaggingAlgLabel->setEnabled(bb);
919 m_d->
ui_disp.bTagginWeightCutLabel->setEnabled(bb);
920 m_d->
ui_disp.bTaggingComboBox->setEnabled(bb);
922 m_d->
ui_disp.groupBox_btagging_render->setEnabled(bb);
923 m_d->
ui_disp.matButton_btaggedJets->setEnabled(bb);