#include <VP1Serialise.h>
|
| | VP1Serialise (qint32 version, IVP1System *sys=0) |
| virtual | ~VP1Serialise () |
| const QByteArray & | result () |
| qint32 | version () const |
| void | ignoreWidget (const QWidget *) |
| void | widgetHandled (const QWidget *) |
| void | warnUnsaved (const QObject *) |
| void | disableUnsavedChecks () |
| void | save (bool) |
| void | save (QCheckBox *) |
| void | save (QGroupBox *) |
| void | save (const QString &) |
| void | save (QComboBox *) |
| void | save (QLineEdit *) |
| void | saveByTitle (QToolBox *) |
| void | save (const double &) |
| void | save (QDoubleSpinBox *, const double &unit=1.0) |
| void | save (qint32) |
| void | save (QSpinBox *) |
| void | save (QSlider *) |
| void | save (QToolBox *) |
| void | save (QRadioButton *rb0, QRadioButton *rb1, QRadioButton *rb2=0, QRadioButton *rb3=0, QRadioButton *rb4=0, QRadioButton *rb5=0, QRadioButton *rb6=0, QRadioButton *rb7=0, QRadioButton *rb8=0, QRadioButton *rb9=0) |
| void | save (const QByteArray &) |
| void | save (const VP1MaterialButton *) |
| void | save (SoMaterial *) |
| void | save (const VP1CollectionWidget *) |
| void | save (const VP1CollectionSettingsButtonBase *jcb) |
| void | save (const VP1EtaPhiCutWidget *) |
| void | save (const VP1DrawOptionsWidget *) |
| void | save (const PhiSectionWidget *) |
| void | save (const QColor &) |
| void | save (VP1ColorSelectButton *) |
| template<class T> |
| void | save (const T &t) |
| template<class T> |
| void | save (T *t) |
| 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 |
| IVP1System * | systemBase () const |
| const QString & | helperClassName () const |
Definition at line 45 of file VP1Serialise.h.
◆ VP1Serialise()
| VP1Serialise::VP1Serialise |
( |
qint32 | version, |
|
|
IVP1System * | sys = 0 ) |
Definition at line 86 of file VP1Serialise.cxx.
88{
90
91 m_d->byteArray.clear();
92 m_d->buffer =
new QBuffer(&
m_d->byteArray);
93 m_d->buffer->open(QIODevice::WriteOnly);
94 m_d->state =
new QDataStream(
m_d->buffer);
97}
VP1HelperClassBase(IVP1System *sys=0, QString helpername="")
static unsigned numberOfInstantiations
◆ ~VP1Serialise()
| VP1Serialise::~VP1Serialise |
( |
| ) |
|
|
virtual |
Definition at line 100 of file VP1Serialise.cxx.
101{
102 if (!
m_d->checkedUnused)
103 message(
"WARNING: warnUnsaved(..) was never called!");
104
105 m_d->buffer->close();
111}
void message(const QString &) const
◆ decrementNumberOfInstantiations()
| void VP1Serialise::decrementNumberOfInstantiations |
( |
| ) |
|
|
static |
◆ disableUnsavedChecks()
| void VP1Serialise::disableUnsavedChecks |
( |
| ) |
|
◆ helperClassName()
| const QString & VP1HelperClassBase::helperClassName |
( |
| ) |
const |
|
inlineinherited |
◆ ignoreWidget()
| void VP1Serialise::ignoreWidget |
( |
const QWidget * | w | ) |
|
Definition at line 432 of file VP1Serialise.cxx.
433{
435 messageDebug(
"\nVP1Serialise::ignoreWidget(QWidget) - name: " +
w->objectName());
436 }
437 if (w)
438 m_d->ignoredWidgets.insert(w);
439}
void messageDebug(const QString &) const
◆ message() [1/3]
| void VP1HelperClassBase::message |
( |
const QString & | str | ) |
const |
|
inherited |
Definition at line 49 of file VP1HelperClassBase.cxx.
50{
54 else
56 } else {
59 else
61 }
62}
static const char * prefix_msg()
static QString str(const QString &s)
◆ 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()) {
135 return;
136 }
137 if (addtoend.isEmpty()) {
138 for (const QString& s : l)
140 } else {
141 for (const 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 (const QString& s : l)
96 } else {
97 for (const QString& s : l)
99 }
100}
◆ messageDebug() [1/3]
| void VP1HelperClassBase::messageDebug |
( |
const QString & | str | ) |
const |
|
inherited |
Definition at line 65 of file VP1HelperClassBase.cxx.
66{
68 return;
69 std::string sysstring(
m_system ?
" in "+
m_system->name().toStdString() : std::string(
""));
72 } else {
74 }
75}
static const char * prefix_debug()
◆ 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{
150 return;
151 if (addtostart.isEmpty()) {
153 return;
154 }
155 if (addtoend.isEmpty()) {
156 for (const QString& s : l)
158 } else {
159 for (const QString& s : l)
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{
106 return;
107 if (addtoend.isEmpty()) {
108 for (const QString& s : l)
110 } else {
111 for (const QString& s : l)
113 }
114}
◆ messageVerbose() [1/3]
| void VP1HelperClassBase::messageVerbose |
( |
const QString & | str | ) |
const |
|
inherited |
Definition at line 78 of file VP1HelperClassBase.cxx.
79{
81 return;
82 std::string sysstring(
m_system ?
" in "+
m_system->name().toStdString() : std::string(
""));
85 } else {
87 }
88}
static const char * prefix_verbose()
◆ 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{
168 return;
169 if (addtostart.isEmpty()) {
171 return;
172 }
173 if (addtoend.isEmpty()) {
174 for (const QString& s : l)
176 } else {
177 for (const QString& s : l)
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{
120 return;
121 if (addtoend.isEmpty()) {
122 for (const QString& s : l)
124 } else {
125 for (const QString& s : l)
127 }
128}
◆ numberOfInstantiations()
| unsigned VP1Serialise::numberOfInstantiations |
( |
| ) |
|
|
static |
◆ result()
| const QByteArray & VP1Serialise::result |
( |
| ) |
|
◆ save() [1/25]
| void VP1Serialise::save |
( |
bool | b | ) |
|
◆ save() [2/25]
| void VP1Serialise::save |
( |
const double & | dbl | ) |
|
◆ save() [3/25]
Definition at line 320 of file VP1Serialise.cxx.
321{
323 messageDebug(
"\nVP1Serialise::save(PhiSectionWidget) - name: " +
phi->objectName());
324 }
328 }
329 (*(
m_d->state)) << (
phi ?
phi->state() : QByteArray());
330}
Scalar phi() const
phi method
◆ save() [4/25]
| void VP1Serialise::save |
( |
const QByteArray & | ba | ) |
|
◆ save() [5/25]
| void VP1Serialise::save |
( |
const QColor & | c | ) |
|
◆ save() [6/25]
| void VP1Serialise::save |
( |
const QString & | s | ) |
|
◆ save() [7/25]
template<class T>
| void VP1Serialise::save |
( |
const T & | t | ) |
|
◆ save() [8/25]
Definition at line 394 of file VP1Serialise.cxx.
395{
397 messageDebug(
"\nVP1Serialise::save(VP1CollectionSettingsButtonBase) - name: " + jcb->objectName());
398 messageDebug(
"VP1Serialise::save(VP1CollectionSettingsButtonBase)- start...");
399 }
404 messageDebug(
"VP1Serialise::save(VP1CollectionSettingsButtonBase)- end.");
405 }
406}
void ignoreWidget(const QWidget *)
◆ save() [9/25]
Definition at line 365 of file VP1Serialise.cxx.
366{
368 messageDebug(
"\nVP1Serialise::save(VP1CollectionWidget) - name: " + cw->objectName());
369 messageDebug(
"VP1Serialise::save(VP1CollectionWidget)- start...");
370 }
373 QByteArray ba;
375 buffer.open(QIODevice::WriteOnly);
376 QDataStream
out(&buffer);
382 messageDebug(
"VP1Serialise::save(VP1CollectionWidget)- end.");
383 }
384}
◆ save() [10/25]
Definition at line 421 of file VP1Serialise.cxx.
422{
424 messageDebug(
"\nVP1Serialise::save(VP1DrawOptionsWidget) - name: " +
w->objectName());
425 }
428 save(w ?
w->state() : QByteArray());
429}
◆ save() [11/25]
Definition at line 410 of file VP1Serialise.cxx.
411{
413 messageDebug(
"\nVP1Serialise::save(VP1EtaPhiCutWidget) - name: " +
w->objectName());
414 }
417 save(w ?
w->saveState() : QByteArray());
418}
◆ save() [12/25]
Definition at line 287 of file VP1Serialise.cxx.
288{
290 messageDebug(
"\nVP1Serialise::save(VP1MaterialButton) - name: " +
mb->objectName());
291 }
293 QList<SoMaterial*> mats =
mb ?
mb->handledMaterials() : QList<SoMaterial*>();
294 save(mats.isEmpty() ? 0 : mats.at(0));
295}
const double mb
1mb to cm2
◆ save() [13/25]
| void VP1Serialise::save |
( |
QCheckBox * | cb | ) |
|
◆ save() [14/25]
| void VP1Serialise::save |
( |
QComboBox * | cb | ) |
|
Definition at line 156 of file VP1Serialise.cxx.
157{
159 messageDebug(
"VP1Serialise::save(QComboBox) - name: " + cb->objectName());
160 }
162 save( cb->count() > 0 ? cb->currentText() : QString() );
163}
◆ save() [15/25]
| void VP1Serialise::save |
( |
QDoubleSpinBox * | sb, |
|
|
const double & | unit = 1.0 ) |
Definition at line 176 of file VP1Serialise.cxx.
177{
179 messageDebug(
"\nVP1Serialise::save(QDoubleSpinBox) - name: " +
sb->objectName());
180 }
183}
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
◆ save() [16/25]
| void VP1Serialise::save |
( |
QGroupBox * | gb | ) |
|
Definition at line 144 of file VP1Serialise.cxx.
145{
147 messageDebug(
"VP1Serialise::save(QGroupBox) - name: " + gb->objectName());
148 }
149 if (!gb->isCheckable())
150 message(
"WARNING: Asked to handled GroupBox which is not checkable: "+gb->objectName());
152 save(gb->isChecked());
153}
◆ save() [17/25]
| void VP1Serialise::save |
( |
qint32 | i | ) |
|
◆ save() [18/25]
| void VP1Serialise::save |
( |
QLineEdit * | le | ) |
|
◆ save() [19/25]
| void VP1Serialise::save |
( |
QRadioButton * | rb0, |
|
|
QRadioButton * | rb1, |
|
|
QRadioButton * | rb2 = 0, |
|
|
QRadioButton * | rb3 = 0, |
|
|
QRadioButton * | rb4 = 0, |
|
|
QRadioButton * | rb5 = 0, |
|
|
QRadioButton * | rb6 = 0, |
|
|
QRadioButton * | rb7 = 0, |
|
|
QRadioButton * | rb8 = 0, |
|
|
QRadioButton * | rb9 = 0 ) |
Definition at line 333 of file VP1Serialise.cxx.
343{
344 QList<QRadioButton *>
l;
345 l << rb0 << rb1 << rb2 << rb3 << rb4 << rb5 << rb6 << rb7 << rb8 << rb9;
346 for (qint32 i = 0;
i <
l.count(); ++
i) {
349 messageDebug(
"\nVP1Serialise::save(QRadioButton) - name: " +
l.at(i)->objectName());
350 }
351 m_d->handle(
l.at(i));
352 }
353 }
354 qint32 ichecked(-1);
355 for (qint32 i = 0;
i <
l.count(); ++
i) {
356 if (
l.at(i)&&
l.at(i)->isChecked()) {
358 break;
359 }
360 }
362}
l
Printing final latex table to .tex output file.
◆ save() [20/25]
| void VP1Serialise::save |
( |
QSlider * | s | ) |
|
◆ save() [21/25]
| void VP1Serialise::save |
( |
QSpinBox * | sb | ) |
|
◆ save() [22/25]
| void VP1Serialise::save |
( |
QToolBox * | tb | ) |
|
Definition at line 251 of file VP1Serialise.cxx.
252{
254 messageDebug(
"\nVP1Serialise::save(QToolBox) - name: " +
tb->objectName());
255 }
257 save( tb &&
tb->count() > 0 ?
tb->currentIndex() : -1 );
258}
◆ save() [23/25]
| void VP1Serialise::save |
( |
SoMaterial * | m | ) |
|
Definition at line 272 of file VP1Serialise.cxx.
273{
276 }
277 if (!m) {
279 return;
280 }
284}
static QByteArray serialiseSoMaterial(SoMaterial *)
◆ save() [24/25]
template<class T>
| void VP1Serialise::save |
( |
T * | t | ) |
|
◆ save() [25/25]
Definition at line 310 of file VP1Serialise.cxx.
311{
313 messageDebug(
"\nVP1Serialise::save(VP1ColorSelectButton) - name: " + cb->objectName());
314 }
317}
◆ saveByTitle()
| void VP1Serialise::saveByTitle |
( |
QToolBox * | tb | ) |
|
Definition at line 261 of file VP1Serialise.cxx.
262{
264 messageDebug(
"\nVP1Serialise::save(QToolBox) - name: " +
tb->objectName());
265 }
267 int i =
tb ?
tb->currentIndex() : -1;
268 save( i>=0 && i<tb->
count() ?
tb->itemText(i) : QString() );
269}
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
◆ setHelperClassName()
| void VP1HelperClassBase::setHelperClassName |
( |
const QString & | n | ) |
|
|
inlineprotectedinherited |
◆ setSystemBasePointer()
| void VP1HelperClassBase::setSystemBasePointer |
( |
IVP1System * | sys | ) |
|
|
inherited |
Definition at line 197 of file VP1HelperClassBase.cxx.
198{
202 }
203}
static std::map< VP1HelperClassBase *, QString > vp1helperclassbase_instanceMap
◆ str() [1/30]
◆ 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 |
◆ 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]
◆ 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 |
◆ 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 |
◆ str() [13/30]
| QString VP1String::str |
( |
const SbVec2f & | v | ) |
|
|
staticinherited |
◆ str() [14/30]
| QString VP1String::str |
( |
const SbVec2s & | v | ) |
|
|
staticinherited |
◆ str() [15/30]
| QString VP1String::str |
( |
const SbVec3d & | v | ) |
|
|
staticinherited |
◆ str() [16/30]
| QString VP1String::str |
( |
const SbVec3f & | v | ) |
|
|
staticinherited |
◆ str() [17/30]
| QString VP1String::str |
( |
const SbVec3s & | v | ) |
|
|
staticinherited |
◆ str() [18/30]
| QString VP1String::str |
( |
const SbVec4d & | v | ) |
|
|
staticinherited |
◆ str() [19/30]
| QString VP1String::str |
( |
const SbVec4f & | v | ) |
|
|
staticinherited |
◆ 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) {
53
54 return QString (
s.str().c_str());
55 } else {
56 return "NULL";
57 }
58}
◆ str() [22/30]
◆ 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); }
◆ stream()
| QDataStream * VP1Serialise::stream |
( |
| ) |
|
|
private |
◆ systemBase()
| IVP1System * VP1HelperClassBase::systemBase |
( |
| ) |
const |
|
inlineinherited |
◆ verbose()
| bool VP1HelperClassBase::verbose |
( |
| ) |
|
|
inlinestaticinherited |
◆ version()
| qint32 VP1Serialise::version |
( |
| ) |
const |
◆ warnUndeletedInstances()
| void VP1HelperClassBase::warnUndeletedInstances |
( |
| ) |
|
|
staticinherited |
Definition at line 183 of file VP1HelperClassBase.cxx.
184{
186 return;
188
191 std::cout <<
" ==> "<<
it->first<<
": "<<
it->first->m_helpername.toStdString()
192 << (
it->second.isEmpty()?QString(
""):
" (in system "+
it->second+
")").toStdString()<<std::endl;
193 }
194}
◆ warnUnsaved()
| void VP1Serialise::warnUnsaved |
( |
const QObject * | object | ) |
|
Definition at line 480 of file VP1Serialise.cxx.
481{
482
483
484 if (!
m_d->checkedUnused)
485 m_d->checkedUnused =
true;
486
487 if (!object)
488 return;
489
490 if (
object->isWidgetType()&&
m_d->ignoredWidgets.contains(
static_cast<const QWidget*
>(
object)))
491 return;
492
493 if (
object->isWidgetType()&&!
object->objectName().startsWith(
"qt_")) {
494 const QWidget * wid =
static_cast<const QWidget*
>(
object);
495 if (!
m_d->handledWidgets.contains(wid)&&
m_d->expectsPersistification(wid)) {
496 QString
s(
"WARNING Unsaved widget of type: "+QString(wid->metaObject()->className())+
" and object name = "+wid->objectName());
499 }
502 }
503 }
504 }
505
506 for (
const QObject* o :
object->children())
508}
void warnUnsaved(const QObject *)
◆ widgetHandled()
| void VP1Serialise::widgetHandled |
( |
const QWidget * | w | ) |
|
◆ m_d
◆ m_helpername
| QString VP1HelperClassBase::m_helpername |
|
privateinherited |
◆ m_system
◆ s_vp1verbose
The documentation for this class was generated from the following files: