ATLAS Offline Software
Loading...
Searching...
No Matches
VertexCollectionSettingsButton Class Reference

#include <VertexCollectionSettingsButton.h>

Inheritance diagram for VertexCollectionSettingsButton:
Collaboration diagram for VertexCollectionSettingsButton:

Classes

class  Imp

Public Slots

void showEditMaterialDialog ()
void setMaterialText (const QString &)

Signals

void lastAppliedChanged ()
void cutAllowedRChanged (const VP1Interval &)
void cutAllowedYChanged (const VP1Interval &)
void cutAllowedZChanged (const VP1Interval &)
void vertexSizeChanged (int)

Public Member Functions

 VertexCollectionSettingsButton (QWidget *parent=0, int dim=25)
virtual ~VertexCollectionSettingsButton ()
void setDimension (int dim)
virtual bool setMaterial (SoMaterial *)
virtual void copyValuesFromMaterial (SoMaterial *)
virtual double lastAppliedTransparency () const
virtual double lastAppliedShininess () const
virtual double lastAppliedBrightness () const
VP1Interval cutAllowedR () const
VP1Interval cutAllowedY () const
VP1Interval cutAllowedZ () const
SoDrawStyle * vertexDrawStyle () const
SoLightModel * vertexLightModel () const
int vertexSize () const
QByteArray saveState () const
 fill out with the state of the object (used for drag and drop etc)
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
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 updateVertexDrawStyle ()
void updateVertexLightModel (bool)
void possibleChange_cutAllowedR ()
void possibleChange_cutAllowedY ()
void possibleChange_cutAllowedZ ()

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 14 of file VertexCollectionSettingsButton.h.

Constructor & Destructor Documentation

◆ VertexCollectionSettingsButton()

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

Definition at line 86 of file VertexCollectionSettingsButton.cxx.

87 : VP1MaterialButtonBase(parent,0,"VP1MaterialButton"), m_d(new Imp)
88{
89 m_d->dim = dim;
90
91 m_d->theclass = this;
92 m_d->initEditWindow();
93
94 //Draw Styles / Complexity:
95
96 m_d->vertexDrawStyle = new SoDrawStyle;
97 m_d->vertexDrawStyle->setName("VertexDrawStyle");
98 m_d->vertexDrawStyle->pointSize=5.0;
99 m_d->vertexDrawStyle->ref();
101 connect(m_d->editwindow_ui.horizontalSlider_vertexSize,SIGNAL(valueChanged(int)),this,SIGNAL(vertexSizeChanged(int)));
102
103 m_d->vertexLightModel = new SoLightModel;
104 m_d->vertexLightModel->setName("VertexLightModel");
105 m_d->vertexLightModel->ref();
107 connect(m_d->editwindow_ui.checkBox_verticesUseBaseLightModel,SIGNAL(toggled(bool)),this,SLOT(updateVertexLightModel(bool)));
108
109 // R
110 connect(m_d->editwindow_ui.checkBox_cut_r,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutAllowedR()));
111 connect(m_d->editwindow_ui.checkBox_cut_r_range_forcesymmetric,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutAllowedR()));
112 connect(m_d->editwindow_ui.checkBox_cut_r_excludeRange,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutAllowedR()));
113 connect(m_d->editwindow_ui.doubleSpinBox_cut_r_lower,SIGNAL(valueChanged(double)),this,SLOT(possibleChange_cutAllowedR()));
114 connect(m_d->editwindow_ui.doubleSpinBox_cut_r_upper,SIGNAL(valueChanged(double)),this,SLOT(possibleChange_cutAllowedR()));
115
116 // Y
117 connect(m_d->editwindow_ui.checkBox_cut_y,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutAllowedY()));
118 connect(m_d->editwindow_ui.checkBox_cut_y_range_forcesymmetric,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutAllowedY()));
119 connect(m_d->editwindow_ui.checkBox_cut_y_excludeRange,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutAllowedY()));
120 connect(m_d->editwindow_ui.doubleSpinBox_cut_y_lower,SIGNAL(valueChanged(double)),this,SLOT(possibleChange_cutAllowedY()));
121 connect(m_d->editwindow_ui.doubleSpinBox_cut_y_upper,SIGNAL(valueChanged(double)),this,SLOT(possibleChange_cutAllowedY()));
122 // Z
123 connect(m_d->editwindow_ui.checkBox_cut_z,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutAllowedZ()));
124 connect(m_d->editwindow_ui.checkBox_cut_z_range_forcesymmetric,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutAllowedZ()));
125 connect(m_d->editwindow_ui.checkBox_cut_z_excludeRange,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutAllowedZ()));
126 connect(m_d->editwindow_ui.doubleSpinBox_cut_z_lower,SIGNAL(valueChanged(double)),this,SLOT(possibleChange_cutAllowedZ()));
127 connect(m_d->editwindow_ui.doubleSpinBox_cut_z_upper,SIGNAL(valueChanged(double)),this,SLOT(possibleChange_cutAllowedZ()));
128
129
130
131 connect(this,SIGNAL(clicked()),this,SLOT(showEditMaterialDialog()));
132 connect(m_d->editwindow_ui.pushButton_close,SIGNAL(clicked()),this,SLOT(showEditMaterialDialog()));
133 connect(m_d->matButton,SIGNAL(lastAppliedChanged()),this,SLOT(updateButton()));
134 connect(m_d->matButton,SIGNAL(lastAppliedChanged()),this,SIGNAL(lastAppliedChanged()));
135 setAcceptDrops(true);
136
137 QTimer::singleShot(0, this, SLOT(updateButton()));
138
139}
VP1MaterialButtonBase(QWidget *parent, IVP1System *sys=0, const QString &helpername="")

◆ ~VertexCollectionSettingsButton()

VertexCollectionSettingsButton::~VertexCollectionSettingsButton ( )
virtual

Definition at line 146 of file VertexCollectionSettingsButton.cxx.

147{
148 delete m_d->editwindow;
149 m_d->vertexDrawStyle->unref();
150 m_d->vertexLightModel->unref();
151 delete m_d;
152}

Member Function Documentation

◆ copyValuesFromMaterial()

void VertexCollectionSettingsButton::copyValuesFromMaterial ( SoMaterial * mat)
virtual

Implements VP1MaterialButtonBase.

Definition at line 189 of file VertexCollectionSettingsButton.cxx.

190{
191 if (!m_d->matButton) m_d->initEditWindow();
192 m_d->matButton->setMaterial(mat);
193}

◆ cutAllowedR()

VP1Interval VertexCollectionSettingsButton::cutAllowedR ( ) const

Definition at line 403 of file VertexCollectionSettingsButton.cxx.

404{
405 if (!m_d->editwindow)
406 m_d->initEditWindow();
407 if (!m_d->editwindow_ui.checkBox_cut_r)
408 return VP1Interval();
409
410 const double minFromInterface=m_d->editwindow_ui.doubleSpinBox_cut_r_lower->value()*1000;
411 const double maxFromInterface=m_d->editwindow_ui.doubleSpinBox_cut_r_upper->value()*1000;
412
413 double min=0.0,max=0.0;
414
415 min = (m_d->editwindow_ui.checkBox_cut_r->isChecked() ? minFromInterface : -std::numeric_limits<double>::infinity());
416 max = (m_d->editwindow_ui.checkBox_cut_r->isChecked() ? maxFromInterface : std::numeric_limits<double>::infinity());
417
418 // FIXME - add symmetry logic
419
420 //message("cutAllowedPt: min,max="+QString::number(min)+","+QString::number(max));
421
422 if (max<min)
423 return VP1Interval();
424
425 return VP1Interval( min, max );//fixme: closed interval??
426}
#define min(a, b)
Definition cfImp.cxx:40
#define max(a, b)
Definition cfImp.cxx:41

◆ cutAllowedRChanged

void VertexCollectionSettingsButton::cutAllowedRChanged ( const VP1Interval & )
signal

◆ cutAllowedY()

VP1Interval VertexCollectionSettingsButton::cutAllowedY ( ) const

Definition at line 429 of file VertexCollectionSettingsButton.cxx.

430{
431 if (!m_d->editwindow)
432 m_d->initEditWindow();
433 if (!m_d->editwindow_ui.checkBox_cut_y)
434 return VP1Interval();
435
436 const double minFromInterface = m_d->editwindow_ui.doubleSpinBox_cut_y_lower->value();//*1000;
437 const double maxFromInterface = m_d->editwindow_ui.doubleSpinBox_cut_y_upper->value();//*1000;
438
439 double min=0.0,max=0.0;
440
441 min = (m_d->editwindow_ui.checkBox_cut_y->isChecked() ? minFromInterface : -std::numeric_limits<double>::infinity());
442 max = (m_d->editwindow_ui.checkBox_cut_y->isChecked() ? maxFromInterface : std::numeric_limits<double>::infinity());
443
444 // FIXME - add symmetry logic
445
446 //message("cutAllowedPt: min,max="+QString::number(min)+","+QString::number(max));
447
448 if (max < min)
449 return VP1Interval();
450
451 return VP1Interval( min, max );//fixme: closed interval??
452}

◆ cutAllowedYChanged

void VertexCollectionSettingsButton::cutAllowedYChanged ( const VP1Interval & )
signal

◆ cutAllowedZ()

VP1Interval VertexCollectionSettingsButton::cutAllowedZ ( ) const

Definition at line 454 of file VertexCollectionSettingsButton.cxx.

455{
456 if (!m_d->editwindow)
457 m_d->initEditWindow();
458 if (!m_d->editwindow_ui.checkBox_cut_z)
459 return VP1Interval();
460
461 const double minFromInterface=m_d->editwindow_ui.doubleSpinBox_cut_z_lower->value();//*1000;
462 const double maxFromInterface=m_d->editwindow_ui.doubleSpinBox_cut_z_upper->value();//*1000;
463
464 double min=0.0,max=0.0;
465
466 min = (m_d->editwindow_ui.checkBox_cut_z->isChecked() ? minFromInterface : -std::numeric_limits<double>::infinity());
467 max = (m_d->editwindow_ui.checkBox_cut_z->isChecked() ? maxFromInterface : std::numeric_limits<double>::infinity());
468
469 // FIXME - add symmetry logic
470
471 //message("cutAllowedPt: min,max="+QString::number(min)+","+QString::number(max));
472
473 if (max<min)
474 return VP1Interval();
475
476 return VP1Interval( min, max );//fixme: closed interval??
477}

◆ cutAllowedZChanged

void VertexCollectionSettingsButton::cutAllowedZChanged ( const VP1Interval & )
signal

◆ dragEnterEvent()

void VertexCollectionSettingsButton::dragEnterEvent ( QDragEnterEvent * event)
protected

Definition at line 254 of file VertexCollectionSettingsButton.cxx.

255{
256 if (event->source()!=this && event->mimeData()->hasFormat("vp1/material"))
257 event->acceptProposedAction();
258}

◆ dropEvent()

void VertexCollectionSettingsButton::dropEvent ( QDropEvent * event)
protected

Definition at line 313 of file VertexCollectionSettingsButton.cxx.

314{
315 QByteArray data = event->mimeData()->data("vp1/material");
316 event->acceptProposedAction();
318}
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11

◆ helperClassName()

const QString & VP1HelperClassBase::helperClassName ( ) const
inlineinherited

Definition at line 51 of file VP1HelperClassBase.h.

51{ return m_helpername; }

◆ lastAppliedBrightness()

double VertexCollectionSettingsButton::lastAppliedBrightness ( ) const
virtual

Implements VP1MaterialButtonBase.

Definition at line 204 of file VertexCollectionSettingsButton.cxx.

205{
206 if (!m_d->matButton) m_d->initEditWindow();
207 return m_d->matButton->lastAppliedBrightness();
208}

◆ lastAppliedChanged

void VertexCollectionSettingsButton::lastAppliedChanged ( )
signal

◆ lastAppliedShininess()

double VertexCollectionSettingsButton::lastAppliedShininess ( ) const
virtual

Implements VP1MaterialButtonBase.

Definition at line 199 of file VertexCollectionSettingsButton.cxx.

200{
201 if (!m_d->matButton) m_d->initEditWindow();
202 return m_d->matButton->lastAppliedShininess();
203}

◆ lastAppliedTransparency()

double VertexCollectionSettingsButton::lastAppliedTransparency ( ) const
virtual

Implements VP1MaterialButtonBase.

Definition at line 194 of file VertexCollectionSettingsButton.cxx.

195{
196 if (!m_d->matButton) m_d->initEditWindow();
197 return m_d->matButton->lastAppliedTransparency();
198}

◆ 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)
53 m_system->message(str);
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}
static const char * prefix_msg()
Definition VP1Msg.h:56
static QString str(const QString &s)
Definition VP1String.h:49

◆ 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 (const QString& s : l)
139 message(addtostart+s);
140 } else {
141 for (const QString& s : l)
142 message(addtostart+s+addtoend);
143 }
144}
void message(const QString &) const

◆ 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 (const QString& s : l)
95 message(s);
96 } else {
97 for (const 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}
static bool debug()
Definition VP1Msg.h:32
static const char * prefix_debug()
Definition VP1Msg.h:57

◆ 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 (const QString& s : l)
157 messageDebug(addtostart+s);
158 } else {
159 for (const QString& s : l)
160 messageDebug(addtostart+s+addtoend);
161 }
162}
void messageDebug(const QString &) const

◆ 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 (const QString& s : l)
109 messageDebug(s);
110 } else {
111 for (const 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}
static bool verbose()
Definition VP1Msg.h:31
static const char * prefix_verbose()
Definition VP1Msg.h:59

◆ 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 (const QString& s : l)
175 messageVerbose(addtostart+s);
176 } else {
177 for (const QString& s : l)
178 messageVerbose(addtostart+s+addtoend);
179 }
180}
void messageVerbose(const QString &) const

◆ 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 (const QString& s : l)
124 } else {
125 for (const QString& s : l)
126 messageVerbose(s+addtoend);
127 }
128}

◆ mouseMoveEvent()

void VertexCollectionSettingsButton::mouseMoveEvent ( QMouseEvent * event)
protected

Definition at line 261 of file VertexCollectionSettingsButton.cxx.

262{
263 if (!(event->buttons() & Qt::LeftButton))
264 return;
265 if ((event->pos() - m_d->dragStartPosition).manhattanLength()
266 < QApplication::startDragDistance())
267 return;
268
269 QDrag *drag = new QDrag(this);
270 QMimeData *mimeData = new QMimeData;
271
273 // For dragging state onto other material buttons: //
275
276 QByteArray byteArray = saveState();
277
278 // buffer.close();
279 mimeData->setData("vp1/material", byteArray);
280
281 // ////////////////////////////////////////////////////////
282 // // For dragging c++ code for defining this material //
283 // // into e.g. an editor: //
284 // ////////////////////////////////////////////////////////
285 //
286 // QString s = "SoMaterial * mat = new SoMaterial;\n";
287 // QString str_ambient = m_d->toSbColTxt(m_d->lastapplied_ambient);
288 // if (str_ambient!="SbColor(0.2,0.2,0.2)")
289 // s += "mat->ambientColor.setValue("+str_ambient+");\n";
290 // QString str_diffuse = m_d->toSbColTxt(m_d->lastapplied_diffuse);
291 // if (str_diffuse!="SbColor(0.8,0.8,0.8)")
292 // s += "mat->diffuseColor.setValue("+str_diffuse+");\n";
293 // QString str_specular = m_d->toSbColTxt(m_d->lastapplied_specular);
294 // if (str_specular!="SbColor(0,0,0)")
295 // s += "mat->specularColor.setValue("+str_specular+");\n";
296 // QString str_emissive = m_d->toSbColTxt(m_d->lastapplied_emissive);
297 // if (str_emissive!="SbColor(0,0,0)")
298 // s += "mat->emissiveColor.setValue("+str_emissive+");\n";
299 // QString str_shininess = m_d->printFloat(m_d->lastapplied_shininess/100.0);
300 // if (str_shininess!="0.2")
301 // s += "mat->shininess.setValue("+str_shininess+");\n";
302 // QString str_transparency = m_d->printFloat(m_d->lastapplied_transparency/100.0);
303 // if (str_transparency!="0")
304 // s += "mat->transparency.setValue("+str_transparency+");\n";
305 // mimeData->setText(s);
306
307 //Execute drag:
308 drag->setMimeData(mimeData);//drag assumes ownership of mimeData
309 drag->exec(Qt::CopyAction | Qt::MoveAction);
310}
QByteArray saveState() const
fill out with the state of the object (used for drag and drop etc)

◆ mousePressEvent()

void VertexCollectionSettingsButton::mousePressEvent ( QMouseEvent * event)
protected

Definition at line 246 of file VertexCollectionSettingsButton.cxx.

247{
248 if (event->button() == Qt::LeftButton)
249 m_d->dragStartPosition = event->pos();
250 QPushButton::mousePressEvent(event);
251}

◆ possibleChange_cutAllowedR

void VertexCollectionSettingsButton::possibleChange_cutAllowedR ( )
privateslot

Definition at line 479 of file VertexCollectionSettingsButton.cxx.

480{
481 messageVerbose("possibleChange_cutAllowedR() ");
482
483 if (m_d->last_cutAllowedR==cutAllowedR()) return;
484 messageVerbose("cutAllowedR() changed");
485 m_d->last_cutAllowedR= cutAllowedR();
486 emit cutAllowedRChanged(m_d->last_cutAllowedR);
487}
void cutAllowedRChanged(const VP1Interval &)

◆ possibleChange_cutAllowedY

void VertexCollectionSettingsButton::possibleChange_cutAllowedY ( )
privateslot

Definition at line 489 of file VertexCollectionSettingsButton.cxx.

490{
491 messageVerbose("possibleChange_cutAllowedY() ");
492
493 if (m_d->last_cutAllowedY == cutAllowedY()) return;
494 messageVerbose("cutAllowedY() changed");
495 m_d->last_cutAllowedY = cutAllowedY();
496 emit cutAllowedYChanged(m_d->last_cutAllowedY);
497}
void cutAllowedYChanged(const VP1Interval &)

◆ possibleChange_cutAllowedZ

void VertexCollectionSettingsButton::possibleChange_cutAllowedZ ( )
privateslot

Definition at line 499 of file VertexCollectionSettingsButton.cxx.

500{
501 messageVerbose("possibleChange_cutAllowedZ() ");
502
503 if (m_d->last_cutAllowedZ==cutAllowedZ()) return;
504 messageVerbose("cutAllowedZ() changed");
505 m_d->last_cutAllowedZ= cutAllowedZ();
506 emit cutAllowedZChanged(m_d->last_cutAllowedZ);
507}
void cutAllowedZChanged(const VP1Interval &)

◆ restoreFromState()

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

Implements VP1MaterialButtonBase.

Definition at line 360 of file VertexCollectionSettingsButton.cxx.

360 {
361
362 VP1Deserialise state(ba,systemBase());
363 if (state.version()<0||state.version()>1)
364 return;//Ignore silently
365
366 // MATERIAL BUTTON (color,...)
367 state.restore(m_d->matButton);
368
369 // VERTEX SETTINGS
370 state.restore(m_d->editwindow_ui.horizontalSlider_vertexSize);
371 state.restore(m_d->editwindow_ui.checkBox_verticesUseBaseLightModel);
372
373 // R
374 state.restore(m_d->editwindow_ui.checkBox_cut_r);
375 state.restore(m_d->editwindow_ui.checkBox_cut_r_range_forcesymmetric);
376 state.restore(m_d->editwindow_ui.checkBox_cut_r_excludeRange);
377 state.restore(m_d->editwindow_ui.doubleSpinBox_cut_r_lower);
378 state.restore(m_d->editwindow_ui.doubleSpinBox_cut_r_upper);
379
380 // Y
381 state.restore(m_d->editwindow_ui.checkBox_cut_y);
382 state.restore(m_d->editwindow_ui.checkBox_cut_y_range_forcesymmetric);
383 state.restore(m_d->editwindow_ui.checkBox_cut_y_excludeRange);
384 state.restore(m_d->editwindow_ui.doubleSpinBox_cut_y_lower);
385 state.restore(m_d->editwindow_ui.doubleSpinBox_cut_y_upper);
386 // Z
387 state.restore(m_d->editwindow_ui.checkBox_cut_z);
388 state.restore(m_d->editwindow_ui.checkBox_cut_z_range_forcesymmetric);
389 state.restore(m_d->editwindow_ui.checkBox_cut_z_excludeRange);
390 state.restore(m_d->editwindow_ui.doubleSpinBox_cut_z_lower);
391 state.restore(m_d->editwindow_ui.doubleSpinBox_cut_z_upper);
392
393 state.widgetHandled(this);
394 state.warnUnrestored(this);
395
397 updateVertexLightModel(m_d->editwindow_ui.checkBox_verticesUseBaseLightModel);
398 updateButton();
399 //FIXME - anything else need updating?
400}
IVP1System * systemBase() const

◆ saveState()

QByteArray VertexCollectionSettingsButton::saveState ( ) const
virtual

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

Implements VP1MaterialButtonBase.

Definition at line 321 of file VertexCollectionSettingsButton.cxx.

321 {
322 // messageVerbose("getState");
323 // if (m_d->editwindow_ui.checkBox_tracksUseBaseLightModel->isChecked()) messageVerbose("checked!");
324 VP1Serialise serialise(1/*version*/);
325
326 // MATERIAL BUTTON (color,...)
327 serialise.save(m_d->matButton);
328
329 // serialise.disableUnsavedChecks();
330
331 // VERTEX SETTINGS
332 serialise.save(m_d->editwindow_ui.horizontalSlider_vertexSize);
333 serialise.save(m_d->editwindow_ui.checkBox_verticesUseBaseLightModel);
334
335 // R
336 serialise.save(m_d->editwindow_ui.checkBox_cut_r);
337 serialise.save(m_d->editwindow_ui.checkBox_cut_r_range_forcesymmetric);
338 serialise.save(m_d->editwindow_ui.checkBox_cut_r_excludeRange);
339 serialise.save(m_d->editwindow_ui.doubleSpinBox_cut_r_lower);
340 serialise.save(m_d->editwindow_ui.doubleSpinBox_cut_r_upper);
341
342 // Y
343 serialise.save(m_d->editwindow_ui.checkBox_cut_y);
344 serialise.save(m_d->editwindow_ui.checkBox_cut_y_range_forcesymmetric);
345 serialise.save(m_d->editwindow_ui.checkBox_cut_y_excludeRange);
346 serialise.save(m_d->editwindow_ui.doubleSpinBox_cut_y_lower);
347 serialise.save(m_d->editwindow_ui.doubleSpinBox_cut_y_upper);
348 // Z
349 serialise.save(m_d->editwindow_ui.checkBox_cut_z);
350 serialise.save(m_d->editwindow_ui.checkBox_cut_z_range_forcesymmetric);
351 serialise.save(m_d->editwindow_ui.checkBox_cut_z_excludeRange);
352 serialise.save(m_d->editwindow_ui.doubleSpinBox_cut_z_lower);
353 serialise.save(m_d->editwindow_ui.doubleSpinBox_cut_z_upper);
354
355 serialise.widgetHandled(this);
356 serialise.warnUnsaved(this);
357 return serialise.result();
358}
void serialise(const std::vector< const IRoiDescriptor * > &rois, roiserial_type &s)
serialise an entire vector of IRoiDescriptors

◆ setDimension()

void VertexCollectionSettingsButton::setDimension ( int dim)

Definition at line 162 of file VertexCollectionSettingsButton.cxx.

163{
164 if (m_d->dim == dim)
165 return;
166 m_d->dim = dim;
167 updateButton();
168}

◆ setHelperClassName()

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

Definition at line 59 of file VP1HelperClassBase.h.

◆ setMaterial()

bool VertexCollectionSettingsButton::setMaterial ( SoMaterial * mat)
virtual

Implements VP1MaterialButtonBase.

Definition at line 181 of file VertexCollectionSettingsButton.cxx.

182{
183 // std::cout<<"VertexCollectionSettingsButton::setMaterial with mat="<<mat<<std::endl;
184 if (!m_d->matButton) m_d->initEditWindow();
185 m_d->matButton->setMaterial(mat);
186 return true;
187}

◆ setMaterialText

void VertexCollectionSettingsButton::setMaterialText ( const QString & t)
slot

Definition at line 78 of file VertexCollectionSettingsButton.cxx.

79{
80 if (m_d->editwindow)
81 m_d->editwindow->setWindowTitle(t);
82 setToolTip(t);
83}

◆ 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}
static std::map< VP1HelperClassBase *, QString > vp1helperclassbase_instanceMap

◆ showEditMaterialDialog

void VertexCollectionSettingsButton::showEditMaterialDialog ( )
slot

Definition at line 170 of file VertexCollectionSettingsButton.cxx.

171{
172 if (!m_d->editwindow)
173 m_d->initEditWindow();
174
175 if (m_d->editwindow->isHidden())
176 m_d->editwindow->show();
177 else
178 m_d->editwindow->hide();
179}

◆ str() [1/30]

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]

QString VP1String::str ( const bool b)
inlinestaticinherited

Definition at line 53 of file VP1String.h.

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

◆ str() [3/30]

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

Definition at line 50 of file VP1String.h.

50{ return c; }

◆ str() [4/30]

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

Definition at line 81 of file VP1String.h.

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

◆ str() [5/30]

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>
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>
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>
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]

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}
static QColor sbcol2qcol(const SbColor &)

◆ 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)+")"; }
#define y
#define x

◆ 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)+")"; }
#define 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>
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]

QString VP1String::str ( int n)
inlinestaticinherited

Definition at line 77 of file VP1String.h.

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

◆ str() [24/30]

QString VP1String::str ( long n)
inlinestaticinherited

Definition at line 75 of file VP1String.h.

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

◆ str() [25/30]

QString VP1String::str ( qlonglong n)
inlinestaticinherited

Definition at line 79 of file VP1String.h.

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

◆ str() [26/30]

QString VP1String::str ( qulonglong n)
inlinestaticinherited

Definition at line 80 of file VP1String.h.

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

◆ str() [27/30]

QString VP1String::str ( short int n)
inlinestaticinherited

Definition at line 73 of file VP1String.h.

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

◆ str() [28/30]

QString VP1String::str ( uint n)
inlinestaticinherited

Definition at line 78 of file VP1String.h.

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

◆ str() [29/30]

QString VP1String::str ( ulong n)
inlinestaticinherited

Definition at line 76 of file VP1String.h.

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

◆ str() [30/30]

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 VertexCollectionSettingsButton::updateButton ( )
protectedslot

Definition at line 154 of file VertexCollectionSettingsButton.cxx.

155{
156 if (objectName().isEmpty())
157 setObjectName("VertexCollectionSettingsButton");
158 messageVerbose("setColButtonProperties: color=" + str(m_d->matButton->lastAppliedDiffuseColour()));
159 VP1ColorSelectButton::setColButtonProperties(this,m_d->matButton->lastAppliedDiffuseColour(),m_d->dim);
160}
static void setColButtonProperties(QPushButton *, const QColor &col, int dim)

◆ updateVertexDrawStyle

void VertexCollectionSettingsButton::updateVertexDrawStyle ( )
privateslot

Definition at line 211 of file VertexCollectionSettingsButton.cxx.

212{
213 // double val = VP1QtInventorUtils::getValueLineWidthSlider(m_d->editwindow_ui.horizontalSlider_vertexSize);
214 // if (m_d->vertexDrawStyle->lineWidth.getValue()!=val)
215 // m_d->vertexDrawStyle->lineWidth = val;
216}

◆ updateVertexLightModel

void VertexCollectionSettingsButton::updateVertexLightModel ( bool base)
privateslot

Definition at line 218 of file VertexCollectionSettingsButton.cxx.

219{
220 if (m_d->vertexLightModel->model.getValue()!=(base?SoLightModel::BASE_COLOR:SoLightModel::PHONG)) {
221 messageVerbose("VertexLightModel changed (base = "+str(base));
222 if (base)
223 m_d->vertexLightModel->model.setValue(SoLightModel::BASE_COLOR);
224 else
225 m_d->vertexLightModel->model.setValue(SoLightModel::PHONG);
226 }
227}
std::string base
Definition hcg.cxx:81

◆ verbose()

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
static const bool s_vp1verbose

◆ vertexDrawStyle()

SoDrawStyle * VertexCollectionSettingsButton::vertexDrawStyle ( ) const

Definition at line 230 of file VertexCollectionSettingsButton.cxx.

231{
232 return m_d->vertexDrawStyle;
233}

◆ vertexLightModel()

SoLightModel * VertexCollectionSettingsButton::vertexLightModel ( ) const

Definition at line 235 of file VertexCollectionSettingsButton.cxx.

236{
237 return m_d->vertexLightModel;
238}

◆ vertexSize()

int VertexCollectionSettingsButton::vertexSize ( ) const

Definition at line 240 of file VertexCollectionSettingsButton.cxx.

241{
242 return m_d->editwindow_ui.horizontalSlider_vertexSize->value();
243}

◆ vertexSizeChanged

void VertexCollectionSettingsButton::vertexSizeChanged ( int )
signal

◆ warnUndeletedInstances()

void VP1HelperClassBase::warnUndeletedInstances ( )
staticinherited

Definition at line 183 of file VP1HelperClassBase.cxx.

184{
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* VertexCollectionSettingsButton::m_d
private

Definition at line 69 of file VertexCollectionSettingsButton.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: