ATLAS Offline Software
Classes | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | Private Slots | Private Attributes | Static Private Attributes | List of all members
IParticleCollectionSettingsButton Class Reference

#include <IParticleCollectionSettingsButton.h>

Inheritance diagram for IParticleCollectionSettingsButton:
Collaboration diagram for IParticleCollectionSettingsButton:

Classes

class  Imp
 

Public Slots

void showEditMaterialDialog ()
 
virtual void setText (const QString &)
 

Signals

void lastAppliedChanged ()
 
void cutAllowedPtChanged (const VP1Interval &)
 
void cutAllowedEtaChanged (const VP1Interval &)
 
void cutAllowedPhiChanged (const QList< VP1Interval > &)
 

Public Member Functions

 IParticleCollectionSettingsButton (QWidget *parent=0, int dim=25)
 
virtual ~IParticleCollectionSettingsButton ()
 
void setDimension (int dim)
 
void initEditWindow ()
 
virtual bool setMaterial (SoMaterial *)
 
virtual void copyValuesFromMaterial (SoMaterial *)
 
virtual double lastAppliedTransparency () const
 
virtual double lastAppliedShininess () const
 
virtual double lastAppliedBrightness () const
 
VP1Interval cutAllowedPt () const
 
VP1Interval cutAllowedEta () const
 
QList< VP1IntervalcutAllowedPhi () const
 
SoDrawStyle * drawStyle () const
 
SoLightModel * lightModel () const
 
QByteArray saveState () const
 fill out with the state of the object (used for drag and drop etc) More...
 
void restoreFromState (const QByteArray &)
 
void setSystemBasePointer (IVP1System *sys)
 
void message (const QString &) const
 
void message (const QStringList &, const QString &addtoend="") const
 
void message (const QString &addtostart, const QStringList &, const QString &addtoend="") const
 
void messageDebug (const QString &) const
 
void messageDebug (const QStringList &, const QString &addtoend="") const
 
void messageDebug (const QString &addtostart, const QStringList &, const QString &addtoend="") const
 
void messageVerbose (const QString &) const
 
void messageVerbose (const QStringList &, const QString &addtoend="") const
 
void messageVerbose (const QString &addtostart, const QStringList &, const QString &addtoend="") const
 
IVP1SystemsystemBase () const
 
QString helperClassName () const
 

Static Public Member Functions

static bool verbose ()
 
static void warnUndeletedInstances ()
 
static QString str (const QString &s)
 
static QString str (const char *c)
 
static QString str (const bool b)
 
static QString str (const QColor &)
 
static QString str (const SbColor &)
 
static QString str (const VP1Interval &)
 
static QString str (const SbVec2d &)
 
static QString str (const SbVec2f &)
 
static QString str (const SbVec2s &)
 
static QString str (const SbVec3d &)
 
static QString str (const SbVec3f &)
 
static QString str (const SbVec3s &)
 
static QString str (const SbVec4d &)
 
static QString str (const SbVec4f &)
 
static QString str (short int n)
 
static QString str (unsigned short int n)
 
static QString str (long n)
 
static QString str (ulong n)
 
static QString str (int n)
 
static QString str (uint n)
 
static QString str (qlonglong n)
 
static QString str (qulonglong n)
 
static QString str (const double &d)
 
static QString str (const float &f)
 
static QString str (const void *)
 
template<class T >
static QString str (const T *t)
 
template<class T >
static QString str (const QFlags< T > &f)
 
template<class T >
static QString str (const HepGeom::BasicVector3D< T > &t)
 
static QString str (const Amg::Vector3D &t)
 
template<class T >
static QString str (const QList< T > &t)
 

Protected Slots

void updateButton ()
 

Protected Member Functions

void mousePressEvent (QMouseEvent *event)
 
void mouseMoveEvent (QMouseEvent *event)
 
void dropEvent (QDropEvent *event)
 
void dragEnterEvent (QDragEnterEvent *event)
 
void setHelperClassName (const QString &n)
 

Private Slots

void updateDrawStyle ()
 
void updateLightModel (bool)
 
void possibleChange_cutAllowedPt ()
 
void possibleChange_cutAllowedEta ()
 
void possibleChange_cutAllowedPhi ()
 

Private Attributes

Impm_d
 
QString m_helpername
 
IVP1Systemm_system
 

Static Private Attributes

static const bool s_vp1verbose = VP1QtUtils::environmentVariableIsOn("VP1_VERBOSE_OUTPUT")
 

Detailed Description

Definition at line 13 of file IParticleCollectionSettingsButton.h.

Constructor & Destructor Documentation

◆ IParticleCollectionSettingsButton()

IParticleCollectionSettingsButton::IParticleCollectionSettingsButton ( QWidget *  parent = 0,
int  dim = 25 
)

Definition at line 90 of file IParticleCollectionSettingsButton.cxx.

91  : VP1MaterialButtonBase(parent,0,"VP1MaterialButton"), m_d(new Imp)
92 {
93  m_d->dim = dim;
94 
95  m_d->theclass = this;
97 
98  // -> cutAllowedP/Pt
99  connect(m_d->editwindow_ui.checkBox_cut_minpt,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutAllowedPt()));
100  connect(m_d->editwindow_ui.checkBox_cut_maxpt,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutAllowedPt()));
101  connect(m_d->editwindow_ui.doubleSpinBox_cut_minpt_gev,SIGNAL(valueChanged(double)),this,SLOT(possibleChange_cutAllowedPt()));
102  connect(m_d->editwindow_ui.doubleSpinBox_cut_maxpt_gev,SIGNAL(valueChanged(double)),this,SLOT(possibleChange_cutAllowedPt()));
103  connect(m_d->editwindow_ui.checkBox_cut_minpt,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutAllowedPt()));
104  connect(m_d->editwindow_ui.comboBox_momtype,SIGNAL(currentIndexChanged(int)),this,SLOT(possibleChange_cutAllowedPt()));
105 
106  // -> cutAllowedEta
107  connect(m_d->editwindow_ui.etaPhiCutWidget,SIGNAL(allowedEtaChanged(const VP1Interval&)),this,SLOT(possibleChange_cutAllowedEta()));
108 
109  // -> cutAllowedPhi
110  connect(m_d->editwindow_ui.etaPhiCutWidget,SIGNAL(allowedPhiChanged(const QList<VP1Interval>&)),this,SLOT(possibleChange_cutAllowedPhi()));
111 
112  connect(this,SIGNAL(clicked()),this,SLOT(showEditMaterialDialog()));
113  connect(m_d->editwindow_ui.pushButton_close,SIGNAL(clicked()),this,SLOT(showEditMaterialDialog()));
114  connect(m_d->matButton,SIGNAL(lastAppliedChanged()),this,SLOT(updateButton()));
115  connect(m_d->matButton,SIGNAL(lastAppliedChanged()),this,SIGNAL(lastAppliedChanged()));
116  setAcceptDrops(true);
117 
118  QTimer::singleShot(0, this, SLOT(updateButton()));
119 
120 }

◆ ~IParticleCollectionSettingsButton()

IParticleCollectionSettingsButton::~IParticleCollectionSettingsButton ( )
virtual

Definition at line 127 of file IParticleCollectionSettingsButton.cxx.

128 {
129  delete m_d->editwindow;
130  m_d->trackDrawStyle->unref();
131  m_d->lightModel->unref();
132  delete m_d;
133 }

Member Function Documentation

◆ copyValuesFromMaterial()

void IParticleCollectionSettingsButton::copyValuesFromMaterial ( SoMaterial *  mat)
virtual

Implements VP1MaterialButtonBase.

Definition at line 169 of file IParticleCollectionSettingsButton.cxx.

170 {
171  if (!m_d->matButton) m_d->initEditWindow();
173 }

◆ cutAllowedEta()

VP1Interval IParticleCollectionSettingsButton::cutAllowedEta ( ) const

Definition at line 359 of file IParticleCollectionSettingsButton.cxx.

360 {
361  return m_d->editwindow_ui.etaPhiCutWidget->allowedEta();
362 }

◆ cutAllowedEtaChanged

void IParticleCollectionSettingsButton::cutAllowedEtaChanged ( const VP1Interval )
signal

◆ cutAllowedPhi()

QList< VP1Interval > IParticleCollectionSettingsButton::cutAllowedPhi ( ) const

Definition at line 365 of file IParticleCollectionSettingsButton.cxx.

366 {
367  return m_d->editwindow_ui.etaPhiCutWidget->allowedPhi();
368 }

◆ cutAllowedPhiChanged

void IParticleCollectionSettingsButton::cutAllowedPhiChanged ( const QList< VP1Interval > &  )
signal

◆ cutAllowedPt()

VP1Interval IParticleCollectionSettingsButton::cutAllowedPt ( ) const

Definition at line 325 of file IParticleCollectionSettingsButton.cxx.

326 {
327  if (!m_d->editwindow_ui.checkBox_cut_minpt)
328  return VP1Interval();
329 
330  // will set range to negative if we have momcut=P
331  // if minCut unset then min=-inf
332  // if minCut set, and Pt selected, then min=-minCut
333  // if minCut set, and P selected, then min=-maxCut
334  // etc
335  bool isPCut = m_d->editwindow_ui.comboBox_momtype->currentText()=="P";
336 
337  const double minFromInterface=m_d->editwindow_ui.doubleSpinBox_cut_minpt_gev->value()*1000;
338  const double maxFromInterface=m_d->editwindow_ui.doubleSpinBox_cut_maxpt_gev->value()*1000;
339 
340  double min=0.0,max=0.0;
341  if (!isPCut) {
342  //Pt cut
343  min = (m_d->editwindow_ui.checkBox_cut_minpt->isChecked() ? minFromInterface : -std::numeric_limits<double>::infinity());
344  max = (m_d->editwindow_ui.checkBox_cut_maxpt->isChecked() ? maxFromInterface : std::numeric_limits<double>::infinity());
345  } else {
346  min = (m_d->editwindow_ui.checkBox_cut_maxpt->isChecked() ? -maxFromInterface : -std::numeric_limits<double>::infinity());
347  max = (m_d->editwindow_ui.checkBox_cut_minpt->isChecked() ? -minFromInterface : std::numeric_limits<double>::infinity());
348  }
349 
350  //message("cutAllowedPt: min,max="+QString::number(min)+","+QString::number(max));
351 
352  if (max<min)
353  return VP1Interval();
354 
355  return VP1Interval( min, max );//fixme: closed interval??
356 }

◆ cutAllowedPtChanged

void IParticleCollectionSettingsButton::cutAllowedPtChanged ( const VP1Interval )
signal

◆ dragEnterEvent()

void IParticleCollectionSettingsButton::dragEnterEvent ( QDragEnterEvent *  event)
protected

Definition at line 231 of file IParticleCollectionSettingsButton.cxx.

232 {
233  if (event->source()!=this && event->mimeData()->hasFormat("vp1/material"))
234  event->acceptProposedAction();
235 }

◆ drawStyle()

SoDrawStyle * IParticleCollectionSettingsButton::drawStyle ( ) const

Definition at line 211 of file IParticleCollectionSettingsButton.cxx.

212 {
213  return m_d->trackDrawStyle;
214 }

◆ dropEvent()

void IParticleCollectionSettingsButton::dropEvent ( QDropEvent *  event)
protected

Definition at line 290 of file IParticleCollectionSettingsButton.cxx.

291 {
292  QByteArray data = event->mimeData()->data("vp1/material");
293  event->acceptProposedAction();
295 }

◆ helperClassName()

QString VP1HelperClassBase::helperClassName ( ) const
inlineinherited

Definition at line 51 of file VP1HelperClassBase.h.

51 { return m_helpername; }

◆ initEditWindow()

void IParticleCollectionSettingsButton::initEditWindow ( )

Definition at line 76 of file IParticleCollectionSettingsButton.cxx.

76  {
78 }

◆ lastAppliedBrightness()

double IParticleCollectionSettingsButton::lastAppliedBrightness ( ) const
virtual

Implements VP1MaterialButtonBase.

Definition at line 184 of file IParticleCollectionSettingsButton.cxx.

185 {
186  if (!m_d->matButton) m_d->initEditWindow();
188 }

◆ lastAppliedChanged

void IParticleCollectionSettingsButton::lastAppliedChanged ( )
signal

◆ lastAppliedShininess()

double IParticleCollectionSettingsButton::lastAppliedShininess ( ) const
virtual

Implements VP1MaterialButtonBase.

Definition at line 179 of file IParticleCollectionSettingsButton.cxx.

180 {
181  if (!m_d->matButton) m_d->initEditWindow();
183 }

◆ lastAppliedTransparency()

double IParticleCollectionSettingsButton::lastAppliedTransparency ( ) const
virtual

Implements VP1MaterialButtonBase.

Definition at line 174 of file IParticleCollectionSettingsButton.cxx.

175 {
176  if (!m_d->matButton) m_d->initEditWindow();
178 }

◆ lightModel()

SoLightModel * IParticleCollectionSettingsButton::lightModel ( ) const

Definition at line 216 of file IParticleCollectionSettingsButton.cxx.

217 {
218  return m_d->lightModel;
219 }

◆ message() [1/3]

void VP1HelperClassBase::message ( const QString &  str) const
inherited

Definition at line 49 of file VP1HelperClassBase.cxx.

50 {
51  if (m_helpername.isEmpty()) {
52  if (m_system)
54  else
55  std::cout<<VP1Msg::prefix_msg()<<" [nameless helper class]: "<<str.toStdString()<<std::endl;
56  } else {
57  if (m_system)
58  m_system->message("["+m_helpername+"] " + str);
59  else
60  std::cout<<VP1Msg::prefix_msg()<<" ["<<m_helpername.toStdString()<<"]: "<<str.toStdString()<<std::endl;
61  }
62 }

◆ message() [2/3]

void VP1HelperClassBase::message ( const QString &  addtostart,
const QStringList &  l,
const QString &  addtoend = "" 
) const
inherited

Definition at line 131 of file VP1HelperClassBase.cxx.

132 {
133  if (addtostart.isEmpty()) {
134  message(l,addtoend);
135  return;
136  }
137  if (addtoend.isEmpty()) {
138  for (QString s : l)
139  message(addtostart+s);
140  } else {
141  for (QString s : l)
142  message(addtostart+s+addtoend);
143  }
144 }

◆ message() [3/3]

void VP1HelperClassBase::message ( const QStringList &  l,
const QString &  addtoend = "" 
) const
inherited

Definition at line 91 of file VP1HelperClassBase.cxx.

92 {
93  if (addtoend.isEmpty()) {
94  for (QString s : l)
95  message(s);
96  } else {
97  for (QString s : l)
98  message(s+addtoend);
99  }
100 }

◆ messageDebug() [1/3]

void VP1HelperClassBase::messageDebug ( const QString &  str) const
inherited

Definition at line 65 of file VP1HelperClassBase.cxx.

66 {
67  if (!VP1Msg::debug())
68  return;
69  std::string sysstring(m_system ? " in "+m_system->name().toStdString() : std::string(""));
70  if (m_helpername.isEmpty()) {
71  std::cout<<VP1Msg::prefix_debug()<<" [helper"<<sysstring<<"]: "<<str.toStdString()<<std::endl;
72  } else {
73  std::cout<<VP1Msg::prefix_debug()<<" ["<<m_helpername.toStdString()<<sysstring<<"]: "<<str.toStdString()<<std::endl;
74  }
75 }

◆ messageDebug() [2/3]

void VP1HelperClassBase::messageDebug ( const QString &  addtostart,
const QStringList &  l,
const QString &  addtoend = "" 
) const
inherited

Definition at line 147 of file VP1HelperClassBase.cxx.

148 {
149  if (!VP1Msg::debug())
150  return;
151  if (addtostart.isEmpty()) {
152  messageDebug(l,addtoend);
153  return;
154  }
155  if (addtoend.isEmpty()) {
156  for (QString s : l)
157  messageDebug(addtostart+s);
158  } else {
159  for (QString s : l)
160  messageDebug(addtostart+s+addtoend);
161  }
162 }

◆ messageDebug() [3/3]

void VP1HelperClassBase::messageDebug ( const QStringList &  l,
const QString &  addtoend = "" 
) const
inherited

Definition at line 103 of file VP1HelperClassBase.cxx.

104 {
105  if (!VP1Msg::debug())
106  return;
107  if (addtoend.isEmpty()) {
108  for (QString s : l)
109  messageDebug(s);
110  } else {
111  for (QString s : l)
112  messageDebug(s+addtoend);
113  }
114 }

◆ messageVerbose() [1/3]

void VP1HelperClassBase::messageVerbose ( const QString &  str) const
inherited

Definition at line 78 of file VP1HelperClassBase.cxx.

79 {
80  if (!VP1Msg::verbose())
81  return;
82  std::string sysstring(m_system ? " in "+m_system->name().toStdString() : std::string(""));
83  if (m_helpername.isEmpty()) {
84  std::cout<<VP1Msg::prefix_verbose()<<" [helper"<<sysstring<<"]: "<<str.toStdString()<<std::endl;
85  } else {
86  std::cout<<VP1Msg::prefix_verbose()<<" ["<<m_helpername.toStdString()<<sysstring<<"]: "<<str.toStdString()<<std::endl;
87  }
88 }

◆ messageVerbose() [2/3]

void VP1HelperClassBase::messageVerbose ( const QString &  addtostart,
const QStringList &  l,
const QString &  addtoend = "" 
) const
inherited

Definition at line 165 of file VP1HelperClassBase.cxx.

166 {
167  if (!VP1Msg::verbose())
168  return;
169  if (addtostart.isEmpty()) {
170  messageVerbose(l,addtoend);
171  return;
172  }
173  if (addtoend.isEmpty()) {
174  for (QString s : l)
175  messageVerbose(addtostart+s);
176  } else {
177  for (QString s : l)
178  messageVerbose(addtostart+s+addtoend);
179  }
180 }

◆ messageVerbose() [3/3]

void VP1HelperClassBase::messageVerbose ( const QStringList &  l,
const QString &  addtoend = "" 
) const
inherited

Definition at line 117 of file VP1HelperClassBase.cxx.

118 {
119  if (!VP1Msg::verbose())
120  return;
121  if (addtoend.isEmpty()) {
122  for (QString s : l)
123  messageVerbose(s);
124  } else {
125  for (QString s : l)
126  messageVerbose(s+addtoend);
127  }
128 }

◆ mouseMoveEvent()

void IParticleCollectionSettingsButton::mouseMoveEvent ( QMouseEvent *  event)
protected

Definition at line 238 of file IParticleCollectionSettingsButton.cxx.

239 {
240  if (!(event->buttons() & Qt::LeftButton))
241  return;
242  if ((event->pos() - m_d->dragStartPosition).manhattanLength()
243  < QApplication::startDragDistance())
244  return;
245 
246  QDrag *drag = new QDrag(this);
247  QMimeData *mimeData = new QMimeData;
248 
250  // For dragging state onto other material buttons: //
252 
253  QByteArray byteArray = saveState();
254 
255  // buffer.close();
256  mimeData->setData("vp1/material", byteArray);
257 
258  // ////////////////////////////////////////////////////////
259  // // For dragging c++ code for defining this material //
260  // // into e.g. an editor: //
261  // ////////////////////////////////////////////////////////
262  //
263  // QString s = "SoMaterial * mat = new SoMaterial;\n";
264  // QString str_ambient = m_d->toSbColTxt(m_d->lastapplied_ambient);
265  // if (str_ambient!="SbColor(0.2,0.2,0.2)")
266  // s += "mat->ambientColor.setValue("+str_ambient+");\n";
267  // QString str_diffuse = m_d->toSbColTxt(m_d->lastapplied_diffuse);
268  // if (str_diffuse!="SbColor(0.8,0.8,0.8)")
269  // s += "mat->diffuseColor.setValue("+str_diffuse+");\n";
270  // QString str_specular = m_d->toSbColTxt(m_d->lastapplied_specular);
271  // if (str_specular!="SbColor(0,0,0)")
272  // s += "mat->specularColor.setValue("+str_specular+");\n";
273  // QString str_emissive = m_d->toSbColTxt(m_d->lastapplied_emissive);
274  // if (str_emissive!="SbColor(0,0,0)")
275  // s += "mat->emissiveColor.setValue("+str_emissive+");\n";
276  // QString str_shininess = m_d->printFloat(m_d->lastapplied_shininess/100.0);
277  // if (str_shininess!="0.2")
278  // s += "mat->shininess.setValue("+str_shininess+");\n";
279  // QString str_transparency = m_d->printFloat(m_d->lastapplied_transparency/100.0);
280  // if (str_transparency!="0")
281  // s += "mat->transparency.setValue("+str_transparency+");\n";
282  // mimeData->setText(s);
283 
284  //Execute drag:
285  drag->setMimeData(mimeData);//drag assumes ownership of mimeData
286  drag->exec(Qt::CopyAction | Qt::MoveAction);
287 }

◆ mousePressEvent()

void IParticleCollectionSettingsButton::mousePressEvent ( QMouseEvent *  event)
protected

Definition at line 223 of file IParticleCollectionSettingsButton.cxx.

224 {
225  if (event->button() == Qt::LeftButton)
226  m_d->dragStartPosition = event->pos();
227  QPushButton::mousePressEvent(event);
228 }

◆ possibleChange_cutAllowedEta

void IParticleCollectionSettingsButton::possibleChange_cutAllowedEta ( )
privateslot

Definition at line 380 of file IParticleCollectionSettingsButton.cxx.

381 {
382  if (m_d->last_cutAllowedEta==cutAllowedEta()) return;
383  messageVerbose("cutAllowedEta() changed");
386 }

◆ possibleChange_cutAllowedPhi

void IParticleCollectionSettingsButton::possibleChange_cutAllowedPhi ( )
privateslot

Definition at line 388 of file IParticleCollectionSettingsButton.cxx.

389 {
390  if (m_d->last_cutAllowedPhi==cutAllowedPhi()) return;
391  messageVerbose("cutAllowedPhi() changed");
394 }

◆ possibleChange_cutAllowedPt

void IParticleCollectionSettingsButton::possibleChange_cutAllowedPt ( )
privateslot

Definition at line 370 of file IParticleCollectionSettingsButton.cxx.

371 {
372  messageVerbose("IParticleCollectionSettingsButton::possibleChange_cutAllowedPt() ");
373 
374  if (m_d->last_cutAllowedPt==cutAllowedPt()) return;
375  messageVerbose("cutAllowedPt() changed");
378 }

◆ restoreFromState()

void IParticleCollectionSettingsButton::restoreFromState ( const QByteArray &  ba)
virtual

Implements VP1MaterialButtonBase.

Definition at line 312 of file IParticleCollectionSettingsButton.cxx.

312  {
313 
314  VP1Deserialise state(ba,systemBase());
315  if (state.version()<0||state.version()>1)
316  return;//Ignore silently
317  state.restore(m_d->matButton);
318  state.widgetHandled(this);
319  state.warnUnrestored(this);
320  updateButton();
321  //FIXME - anything else need updating?
322 }

◆ saveState()

QByteArray IParticleCollectionSettingsButton::saveState ( ) const
virtual

fill out with the state of the object (used for drag and drop etc)

Implements VP1MaterialButtonBase.

Definition at line 298 of file IParticleCollectionSettingsButton.cxx.

298  {
299  // messageVerbose("getState");
300  // if (m_d->editwindow_ui.checkBox_tracksUseBaseLightModel->isChecked()) messageVerbose("checked!");
301  VP1Serialise serialise(1/*version*/);
302 
303  serialise.save(m_d->matButton);
304  // serialise.disableUnsavedChecks();
305  // FIXME - what about eta/phi?
306 
307  serialise.widgetHandled(this);
308  serialise.warnUnsaved(this);
309  return serialise.result();
310 }

◆ setDimension()

void IParticleCollectionSettingsButton::setDimension ( int  dim)

Definition at line 143 of file IParticleCollectionSettingsButton.cxx.

144 {
145  if (m_d->dim == dim)
146  return;
147  m_d->dim = dim;
148  updateButton();
149 }

◆ setHelperClassName()

void VP1HelperClassBase::setHelperClassName ( const QString &  n)
inlineprotectedinherited

Definition at line 59 of file VP1HelperClassBase.h.

59 { m_helpername = n; }

◆ setMaterial()

bool IParticleCollectionSettingsButton::setMaterial ( SoMaterial *  mat)
virtual

Implements VP1MaterialButtonBase.

Definition at line 162 of file IParticleCollectionSettingsButton.cxx.

163 {
164  if (!m_d->matButton) m_d->initEditWindow();
166  return true;
167 }

◆ setSystemBasePointer()

void VP1HelperClassBase::setSystemBasePointer ( IVP1System sys)
inherited

Definition at line 197 of file VP1HelperClassBase.cxx.

198 {
199  m_system = sys;
200  if (VP1Msg::verbose()){
201  vp1helperclassbase_instanceMap[this] = (m_system?m_system->name():QString(""));
202  }
203 }

◆ setText

void IParticleCollectionSettingsButton::setText ( const QString &  t)
virtualslot

Definition at line 82 of file IParticleCollectionSettingsButton.cxx.

83 {
84  if (m_d->editwindow)
85  m_d->editwindow->setWindowTitle(t);
86  setToolTip(t);
87 }

◆ showEditMaterialDialog

void IParticleCollectionSettingsButton::showEditMaterialDialog ( )
slot

Definition at line 151 of file IParticleCollectionSettingsButton.cxx.

152 {
153  if (!m_d->editwindow)
154  m_d->initEditWindow();
155 
156  if (m_d->editwindow->isHidden())
157  m_d->editwindow->show();
158  else
159  m_d->editwindow->hide();
160 }

◆ str() [1/30]

static QString VP1String::str ( const Amg::Vector3D t)
inlinestaticinherited

Definition at line 98 of file VP1String.h.

98 { return "("+str(t.x())+", "+str(t.y())+", "+str(t.z())+")"; }

◆ str() [2/30]

static QString VP1String::str ( const bool  b)
inlinestaticinherited

Definition at line 53 of file VP1String.h.

53 { return b?"True":"False"; }

◆ str() [3/30]

static QString VP1String::str ( const char *  c)
inlinestaticinherited

Definition at line 50 of file VP1String.h.

50 { return c; }

◆ str() [4/30]

static QString VP1String::str ( const double &  d)
inlinestaticinherited

Definition at line 81 of file VP1String.h.

81 { return QString::number(d); }

◆ str() [5/30]

static QString VP1String::str ( const float &  f)
inlinestaticinherited

Definition at line 82 of file VP1String.h.

82 { return QString::number(f); }

◆ str() [6/30]

template<class T >
static QString VP1String::str ( const HepGeom::BasicVector3D< T > &  t)
inlinestaticinherited

Definition at line 95 of file VP1String.h.

95 { return "("+str(t.x())+", "+str(t.y())+", "+str(t.z())+")"; }

◆ str() [7/30]

QString VP1String::str ( const QColor &  c)
staticinherited

Definition at line 30 of file VP1String.cxx.

31 {
32  return c.isValid() ? c.name() : "Invalid";
33 }

◆ str() [8/30]

template<class T >
static QString VP1String::str ( const QFlags< T > &  f)
inlinestaticinherited

Definition at line 91 of file VP1String.h.

91 { return "0x"+QString::number(f, 16).toUpper().rightJustified(8,'0'); }

◆ str() [9/30]

template<class T >
static QString VP1String::str ( const QList< T > &  t)
inlinestaticinherited

Definition at line 102 of file VP1String.h.

102 { return "QList of size"+QString::number(t.size()); }

◆ str() [10/30]

static QString VP1String::str ( const QString &  s)
inlinestaticinherited

Definition at line 49 of file VP1String.h.

49 { return s; }

◆ str() [11/30]

QString VP1String::str ( const SbColor &  c)
staticinherited

Definition at line 36 of file VP1String.cxx.

37 {
39 }

◆ str() [12/30]

QString VP1String::str ( const SbVec2d &  v)
staticinherited

Definition at line 61 of file VP1String.cxx.

61 { double x,y; v.getValue(x,y); return "("+str(x)+", "+str(y)+")"; }

◆ str() [13/30]

QString VP1String::str ( const SbVec2f &  v)
staticinherited

Definition at line 62 of file VP1String.cxx.

62 { float x,y; v.getValue(x,y); return "("+str(x)+", "+str(y)+")"; }

◆ str() [14/30]

QString VP1String::str ( const SbVec2s &  v)
staticinherited

Definition at line 63 of file VP1String.cxx.

63 { short x,y; v.getValue(x,y); return "("+str(x)+", "+str(y)+")"; }

◆ str() [15/30]

QString VP1String::str ( const SbVec3d &  v)
staticinherited

Definition at line 64 of file VP1String.cxx.

64 { double x,y,z; v.getValue(x,y,z); return "("+str(x)+", "+str(y)+", "+str(z)+")"; }

◆ str() [16/30]

QString VP1String::str ( const SbVec3f &  v)
staticinherited

Definition at line 65 of file VP1String.cxx.

65 { float x,y,z; v.getValue(x,y,z); return "("+str(x)+", "+str(y)+", "+str(z)+")"; }

◆ str() [17/30]

QString VP1String::str ( const SbVec3s &  v)
staticinherited

Definition at line 66 of file VP1String.cxx.

66 { short x,y,z; v.getValue(x,y,z); return "("+str(x)+", "+str(y)+", "+str(z)+")"; }

◆ str() [18/30]

QString VP1String::str ( const SbVec4d &  v)
staticinherited

Definition at line 67 of file VP1String.cxx.

67 { double x,y,z,t; v.getValue(x,y,z,t); return "("+str(x)+", "+str(y)+", "+str(z)+", "+str(t)+")"; }

◆ str() [19/30]

QString VP1String::str ( const SbVec4f &  v)
staticinherited

Definition at line 68 of file VP1String.cxx.

68 { float x,y,z,t; v.getValue(x,y,z,t); return "("+str(x)+", "+str(y)+", "+str(z)+", "+str(t)+")"; }

◆ str() [20/30]

template<class T >
static QString VP1String::str ( const T *  t)
inlinestaticinherited

Definition at line 87 of file VP1String.h.

87 { return str(static_cast<const void* >(t)); }

◆ str() [21/30]

QString VP1String::str ( const void *  p)
staticinherited

Definition at line 48 of file VP1String.cxx.

49 {
50  if (p) {
51  std::ostringstream s;
52  s << p;
53  // Explicitly naming QString here avoids a cppcheck warning.
54  return QString (s.str().c_str());
55  } else {
56  return "NULL";
57  }
58 }

◆ str() [22/30]

QString VP1String::str ( const VP1Interval i)
staticinherited

Definition at line 42 of file VP1String.cxx.

43 {
44  return i.toString();
45 }

◆ str() [23/30]

static QString VP1String::str ( int  n)
inlinestaticinherited

Definition at line 77 of file VP1String.h.

77 { return QString::number(n); }

◆ str() [24/30]

static QString VP1String::str ( long  n)
inlinestaticinherited

Definition at line 75 of file VP1String.h.

75 { return QString::number(n); }

◆ str() [25/30]

static QString VP1String::str ( qlonglong  n)
inlinestaticinherited

Definition at line 79 of file VP1String.h.

79 { return QString::number(n); }

◆ str() [26/30]

static QString VP1String::str ( qulonglong  n)
inlinestaticinherited

Definition at line 80 of file VP1String.h.

80 { return QString::number(n); }

◆ str() [27/30]

static QString VP1String::str ( short int  n)
inlinestaticinherited

Definition at line 73 of file VP1String.h.

73 { return QString::number(n); }

◆ str() [28/30]

static QString VP1String::str ( uint  n)
inlinestaticinherited

Definition at line 78 of file VP1String.h.

78 { return QString::number(n); }

◆ str() [29/30]

static QString VP1String::str ( ulong  n)
inlinestaticinherited

Definition at line 76 of file VP1String.h.

76 { return QString::number(n); }

◆ str() [30/30]

static QString VP1String::str ( unsigned short int  n)
inlinestaticinherited

Definition at line 74 of file VP1String.h.

74 { return QString::number(n); }

◆ systemBase()

IVP1System* VP1HelperClassBase::systemBase ( ) const
inlineinherited

Definition at line 50 of file VP1HelperClassBase.h.

50 { return m_system; }

◆ updateButton

void IParticleCollectionSettingsButton::updateButton ( )
protectedslot

Definition at line 135 of file IParticleCollectionSettingsButton.cxx.

136 {
137  if (objectName().isEmpty())
138  setObjectName("IParticleCollectionSettingsButton");
139  messageVerbose("setColButtonProperties: color=" + str(m_d->matButton->lastAppliedDiffuseColour()));
141 }

◆ updateDrawStyle

void IParticleCollectionSettingsButton::updateDrawStyle ( )
privateslot

Definition at line 191 of file IParticleCollectionSettingsButton.cxx.

192 {
193  // double val = VP1QtInventorUtils::getValueLineWidthSlider(m_d->editwindow_ui.horizontalSlider_trackWidth);
194  // if (m_d->trackDrawStyle->lineWidth.getValue()!=val)
195  // m_d->trackDrawStyle->lineWidth = val;
196 }

◆ updateLightModel

void IParticleCollectionSettingsButton::updateLightModel ( bool  base)
privateslot

Definition at line 198 of file IParticleCollectionSettingsButton.cxx.

199 {
200  if (m_d->lightModel->model.getValue()!=(base?SoLightModel::BASE_COLOR:SoLightModel::PHONG)) {
201  messageVerbose("lightModel changed (base = "+str(base));
202  if (base)
203  m_d->lightModel->model.setValue(SoLightModel::BASE_COLOR);
204  else
205  m_d->lightModel->model.setValue(SoLightModel::PHONG);
206  }
207 }

◆ verbose()

static bool VP1HelperClassBase::verbose ( )
inlinestaticinherited

Definition at line 32 of file VP1HelperClassBase.h.

32 { return s_vp1verbose; } // Returns true if env var VP1_VERBOSE_OUTPUT=1

◆ warnUndeletedInstances()

void VP1HelperClassBase::warnUndeletedInstances ( )
staticinherited

Definition at line 183 of file VP1HelperClassBase.cxx.

184 {
185  if (vp1helperclassbase_instanceMap.empty())
186  return;
187  std::cout << "WARNING: Detected "<<vp1helperclassbase_instanceMap.size()<<" undeleted helper class instances:"<<std::endl;
188 
189  std::map<VP1HelperClassBase*,QString>::iterator it,itE(vp1helperclassbase_instanceMap.end());
190  for (it = vp1helperclassbase_instanceMap.begin();it!=itE;++it) {
191  std::cout << " ==> "<<it->first<<": "<<it->first->m_helpername.toStdString()
192  << (it->second.isEmpty()?QString(""):" (in system "+it->second+")").toStdString()<<std::endl;
193  }
194 }

Member Data Documentation

◆ m_d

Imp* IParticleCollectionSettingsButton::m_d
private

Definition at line 68 of file IParticleCollectionSettingsButton.h.

◆ m_helpername

QString VP1HelperClassBase::m_helpername
privateinherited

Definition at line 67 of file VP1HelperClassBase.h.

◆ m_system

IVP1System* VP1HelperClassBase::m_system
privateinherited

Definition at line 68 of file VP1HelperClassBase.h.

◆ s_vp1verbose

const bool VP1HelperClassBase::s_vp1verbose = VP1QtUtils::environmentVariableIsOn("VP1_VERBOSE_OUTPUT")
staticprivateinherited

Definition at line 69 of file VP1HelperClassBase.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
base
std::string base
Definition: hcg.cxx:78
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
VP1MaterialButtonBase::VP1MaterialButtonBase
VP1MaterialButtonBase(QWidget *parent, IVP1System *sys=0, QString helpername="")
Definition: VP1MaterialButton.h:28
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
yodamerge_tmp.dim
dim
Definition: yodamerge_tmp.py:239
VP1Serialise
Definition: VP1Serialise.h:45
max
#define max(a, b)
Definition: cfImp.cxx:41
IParticleCollectionSettingsButton::cutAllowedEtaChanged
void cutAllowedEtaChanged(const VP1Interval &)
RoiUtil::serialise
void serialise(const std::vector< const IRoiDescriptor * > &rois, roiserial_type &s)
serialise an entire vector of IRoiDescriptors
Definition: RoiSerialise.cxx:45
hist_file_dump.d
d
Definition: hist_file_dump.py:137
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:55
IParticleCollectionSettingsButton::cutAllowedPt
VP1Interval cutAllowedPt() const
Definition: IParticleCollectionSettingsButton.cxx:325
VP1HelperClassBase::m_helpername
QString m_helpername
Definition: VP1HelperClassBase.h:67
VP1HelperClassBase::messageVerbose
void messageVerbose(const QString &) const
Definition: VP1HelperClassBase.cxx:78
IParticleCollectionSettingsButton::Imp::trackDrawStyle
SoDrawStyle * trackDrawStyle
Definition: IParticleCollectionSettingsButton.cxx:45
VP1HelperClassBase::s_vp1verbose
static const bool s_vp1verbose
Definition: VP1HelperClassBase.h:69
fillPileUpNoiseLumi.connect
string connect
Definition: fillPileUpNoiseLumi.py:70
skel.it
it
Definition: skel.GENtoEVGEN.py:396
VP1Msg::debug
static bool debug()
Definition: VP1Msg.h:32
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
VP1HelperClassBase::m_system
IVP1System * m_system
Definition: VP1HelperClassBase.h:68
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
VP1MaterialButton::lastAppliedDiffuseColour
QColor lastAppliedDiffuseColour() const
Definition: VP1MaterialButton.cxx:167
x
#define x
VP1String::str
static QString str(const QString &s)
Definition: VP1String.h:49
VP1HelperClassBase::messageDebug
void messageDebug(const QString &) const
Definition: VP1HelperClassBase.cxx:65
VP1ColorSelectButton::setColButtonProperties
static void setColButtonProperties(QPushButton *, const QColor &col, int dim)
Definition: VP1ColorSelectButton.cxx:49
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
TruthTest.itE
itE
Definition: TruthTest.py:25
IParticleCollectionSettingsButton::saveState
QByteArray saveState() const
fill out with the state of the object (used for drag and drop etc)
Definition: IParticleCollectionSettingsButton.cxx:298
IParticleCollectionSettingsButton::Imp::lightModel
SoLightModel * lightModel
Definition: IParticleCollectionSettingsButton.cxx:46
IParticleCollectionSettingsButton::Imp::last_cutAllowedPt
VP1Interval last_cutAllowedPt
Definition: IParticleCollectionSettingsButton.cxx:49
IParticleCollectionSettingsButton::updateButton
void updateButton()
Definition: IParticleCollectionSettingsButton.cxx:135
IParticleCollectionSettingsButton::Imp::last_cutAllowedPhi
QList< VP1Interval > last_cutAllowedPhi
Definition: IParticleCollectionSettingsButton.cxx:52
IParticleCollectionSettingsButton::possibleChange_cutAllowedPt
void possibleChange_cutAllowedPt()
Definition: IParticleCollectionSettingsButton.cxx:370
IParticleCollectionSettingsButton::Imp::dragStartPosition
QPoint dragStartPosition
Definition: IParticleCollectionSettingsButton.cxx:54
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
IParticleCollectionSettingsButton::m_d
Imp * m_d
Definition: IParticleCollectionSettingsButton.h:67
VP1Msg::prefix_msg
static const char * prefix_msg()
Definition: VP1Msg.h:56
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
beamspotman.n
n
Definition: beamspotman.py:731
IParticleCollectionSettingsButton::cutAllowedEta
VP1Interval cutAllowedEta() const
Definition: IParticleCollectionSettingsButton.cxx:359
VP1MaterialButton::lastAppliedBrightness
double lastAppliedBrightness() const
Definition: VP1MaterialButton.cxx:173
IParticleCollectionSettingsButton::Imp::last_cutAllowedEta
VP1Interval last_cutAllowedEta
Definition: IParticleCollectionSettingsButton.cxx:51
test_pyathena.parent
parent
Definition: test_pyathena.py:15
IVP1System::name
const QString & name() const
Definition: IVP1System.cxx:50
IParticleCollectionSettingsButton::Imp::editwindow_ui
Ui::IParticleCollectionSettingsForm editwindow_ui
Definition: IParticleCollectionSettingsButton.cxx:41
IParticleCollectionSettingsButton::cutAllowedPhi
QList< VP1Interval > cutAllowedPhi() const
Definition: IParticleCollectionSettingsButton.cxx:365
hist_file_dump.f
f
Definition: hist_file_dump.py:135
VP1Deserialise
Definition: VP1Deserialise.h:44
min
#define min(a, b)
Definition: cfImp.cxx:40
IParticleCollectionSettingsButton::possibleChange_cutAllowedPhi
void possibleChange_cutAllowedPhi()
Definition: IParticleCollectionSettingsButton.cxx:388
VP1QtInventorUtils::sbcol2qcol
static QColor sbcol2qcol(const SbColor &)
Definition: VP1QtInventorUtils.cxx:1142
IParticleCollectionSettingsButton::possibleChange_cutAllowedEta
void possibleChange_cutAllowedEta()
Definition: IParticleCollectionSettingsButton.cxx:380
VP1MaterialButton::setMaterial
bool setMaterial(SoMaterial *)
Definition: VP1MaterialButton.cxx:447
VP1HelperClassBase::systemBase
IVP1System * systemBase() const
Definition: VP1HelperClassBase.h:50
python.selection.number
number
Definition: selection.py:20
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
VP1Msg::prefix_debug
static const char * prefix_debug()
Definition: VP1Msg.h:57
IParticleCollectionSettingsButton::Imp::theclass
IParticleCollectionSettingsButton * theclass
Definition: IParticleCollectionSettingsButton.cxx:39
VP1MaterialButton::lastAppliedShininess
double lastAppliedShininess() const
Definition: VP1MaterialButton.cxx:172
python.PyAthena.v
v
Definition: PyAthena.py:154
VP1Msg::prefix_verbose
static const char * prefix_verbose()
Definition: VP1Msg.h:59
IParticleCollectionSettingsButton::restoreFromState
void restoreFromState(const QByteArray &)
Definition: IParticleCollectionSettingsButton.cxx:312
VP1Interval
Definition: VP1Interval.h:23
IParticleCollectionSettingsButton::cutAllowedPtChanged
void cutAllowedPtChanged(const VP1Interval &)
y
#define y
IParticleCollectionSettingsButton::Imp::dim
int dim
Definition: IParticleCollectionSettingsButton.cxx:53
IParticleCollectionSettingsButton::lastAppliedChanged
void lastAppliedChanged()
VP1HelperClassBase::message
void message(const QString &) const
Definition: VP1HelperClassBase.cxx:49
IParticleCollectionSettingsButton::showEditMaterialDialog
void showEditMaterialDialog()
Definition: IParticleCollectionSettingsButton.cxx:151
IParticleCollectionSettingsButton::cutAllowedPhiChanged
void cutAllowedPhiChanged(const QList< VP1Interval > &)
str
Definition: BTagTrackIpAccessor.cxx:11
VP1Msg::verbose
static bool verbose()
Definition: VP1Msg.h:31
IParticleCollectionSettingsButton::Imp::matButton
VP1MaterialButton * matButton
Definition: IParticleCollectionSettingsButton.cxx:43
IParticleCollectionSettingsButton::Imp::editwindow
QWidget * editwindow
Definition: IParticleCollectionSettingsButton.cxx:40
VP1MaterialButton::lastAppliedTransparency
double lastAppliedTransparency() const
Definition: VP1MaterialButton.cxx:171
python.compressB64.c
def c
Definition: compressB64.py:93
IVP1System::message
void message(const QString &) const
Definition: IVP1System.cxx:336
IParticleCollectionSettingsButton::Imp::initEditWindow
void initEditWindow()
Definition: IParticleCollectionSettingsButton.cxx:60