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

#include <HitsSoNodeManager.h>

Inheritance diagram for HitsSoNodeManager:
Collaboration diagram for HitsSoNodeManager:

Classes

class  Imp

Public Member Functions

 HitsSoNodeManager (IVP1System *sys=0)
 ~HitsSoNodeManager ()
SoNode * getShapeNode_Point ()
SoNode * getShapeNode_Cross (double extent)
SoNode * getShapeNode_DriftDisc (double radius)
SoNode * getShapeNode_DriftTube (double halfLength, double radius)
SoNode * getShapeNode_ProjectedDriftTube (double halfLength, double radius, bool inner, bool outer)
SoNode * getShapeNode_Strip (double length, double width=0, double depth=0)
SoNode * getShapeNode_Wire (double length, double minWidth=0, double maxWidth=0, double depth=0)
SoNode * getShapeNode_Pad (double length, double minWidth=0, double maxWidth=0, double depth=0)
SoTransform * getUnitTransform ()
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 Member Functions

void setHelperClassName (const QString &n)

Private Member Functions

 HitsSoNodeManager (const HitsSoNodeManager &)
HitsSoNodeManageroperator= (const HitsSoNodeManager &)

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 17 of file HitsSoNodeManager.h.

Constructor & Destructor Documentation

◆ HitsSoNodeManager() [1/2]

HitsSoNodeManager::HitsSoNodeManager ( IVP1System * sys = 0)

Definition at line 91 of file HitsSoNodeManager.cxx.

92 : VP1HelperClassBase(sys,"HitsSoNodeManager"), m_d(new Imp)
93{
94 m_d->theclass = this;
95 m_d->cachedshape_point = 0;
96 m_d->cached_unittransform = 0;
97}
VP1HelperClassBase(IVP1System *sys=0, QString helpername="")

◆ ~HitsSoNodeManager()

HitsSoNodeManager::~HitsSoNodeManager ( )

Definition at line 111 of file HitsSoNodeManager.cxx.

112{
113 messageVerbose("destructor begin");
114
115 //Make sure we know if we didn't have efficient shared instancing:
116 m_d->summarise(m_d->cachedshapes_drifttubes.size(),"drift tube");
117 m_d->summarise(m_d->cachedshapes_driftdiscs.size(),"drift disc");
118 m_d->summarise(m_d->cachedshapes_projdrifttubes.size(),"projected drift tube");
119 m_d->summarise(m_d->cachedshapes_strips.size(),"strip");
120 m_d->summarise(m_d->cachedshapes_cross.size(),"cross");
121
122 //unref kept nodes:
123 Imp::unrefValues(m_d->cachedshapes_drifttubes);
124 Imp::unrefValues(m_d->cachedshapes_driftdiscs);
125 Imp::unrefValues(m_d->cachedshapes_projdrifttubes);
126 Imp::unrefValues(m_d->cachedshapes_strips);
127 Imp::unrefValues(m_d->cachedshapes_cross);
128 if (m_d->cachedshape_point)
129 m_d->cachedshape_point->unref();
130 if (m_d->cached_unittransform)
131 m_d->cached_unittransform->unref();
132
133 delete m_d;
134 messageVerbose("destructor end");
135}
static void unrefValues(T &t)
void messageVerbose(const QString &) const

◆ HitsSoNodeManager() [2/2]

HitsSoNodeManager::HitsSoNodeManager ( const HitsSoNodeManager & )
private

Member Function Documentation

◆ getShapeNode_Cross()

SoNode * HitsSoNodeManager::getShapeNode_Cross ( double extent)

Definition at line 427 of file HitsSoNodeManager.cxx.

428{
429 std::map<double,SoNode*>::const_iterator it = m_d->cachedshapes_cross.find(extent);
430 if (it!=m_d->cachedshapes_cross.end())
431 return it->second;
432
433 SoVertexProperty * vertices = new SoVertexProperty;
434 int iver(0);
435 vertices->vertex.set1Value(iver++,-extent,0.0,0.0);
436 vertices->vertex.set1Value(iver++,+extent,0.0,0.0);
437 vertices->vertex.set1Value(iver++,0.0,-extent,0.0);
438 vertices->vertex.set1Value(iver++,0.0,+extent,0.0);
439 vertices->vertex.set1Value(iver++,0.0,0.0,-extent);
440 vertices->vertex.set1Value(iver++,0.0,0.0,+extent);
441
442 SoLineSet * cross = new SoLineSet;
443 cross->vertexProperty = vertices;
444 int numlines(0);
445 cross->numVertices.set1Value(numlines++,2);
446 cross->numVertices.set1Value(numlines++,2);
447 cross->numVertices.set1Value(numlines++,2);
448
449 m_d->cachedshapes_cross[extent] = cross;
450 m_d->cachedshapes_cross[extent]->ref();
451
452 return m_d->cachedshapes_cross[extent];
453}

◆ getShapeNode_DriftDisc()

SoNode * HitsSoNodeManager::getShapeNode_DriftDisc ( double radius)

Definition at line 177 of file HitsSoNodeManager.cxx.

178{
179 m_d->sanitiseParameterValueAllowZero(radius);
180 if (radius==0.0)
181 return getShapeNode_Point();
182
183 std::map<double,SoNode*>::const_iterator it = m_d->cachedshapes_driftdiscs.find(radius);
184 if (it!=m_d->cachedshapes_driftdiscs.end())
185 return it->second;
186
187 SoSeparator*sep = new SoSeparator;//fixme: check if sogroup improves performance.
188 SoRotationXYZ * rot = new SoRotationXYZ;
189 rot->axis.setValue(SoRotationXYZ::X);
190 rot->angle.setValue(M_PI*0.5f);
191 sep->addChild(rot);
192 SoCylinder * cyl = new SoCylinder;
193 cyl->radius.setValue(radius);
194 cyl->height.setValue(m_d->driftdischeight);
195 sep->addChild(cyl);
196
197 m_d->cachedshapes_driftdiscs[radius] = sep;
198 sep->ref();
199 return sep;
200}
#define M_PI

◆ getShapeNode_DriftTube()

SoNode * HitsSoNodeManager::getShapeNode_DriftTube ( double halfLength,
double radius )

Definition at line 138 of file HitsSoNodeManager.cxx.

139{
140 m_d->sanitiseParameterValue(halfLength);
141 m_d->sanitiseParameterValueAllowZero(radius);
142 //Fixme: discretize by radius!!
143
144 double id(halfLength-999999999.9*radius);
145 std::map<double,SoNode*>::const_iterator it = m_d->cachedshapes_drifttubes.find(id);
146 if (it!=m_d->cachedshapes_drifttubes.end())
147 return it->second;
148
149 if (radius>0) {
150 SoSeparator*sep = new SoSeparator;
151 SoRotationXYZ * rot = new SoRotationXYZ;
152 rot->axis.setValue(SoRotationXYZ::X);
153 rot->angle.setValue(M_PI*0.5f);
154 sep->addChild(rot);
155 SoCylinder * cyl = new SoCylinder;
156 cyl->radius.setValue(radius);
157 cyl->height.setValue(2.0f*halfLength);
158 sep->addChild(cyl);
159 m_d->cachedshapes_drifttubes[id] = sep;
160 sep->ref();
161 return sep;
162 } else {
163 SoVertexProperty * scatVtxProperty = new SoVertexProperty();
164 scatVtxProperty->vertex.set1Value(0, 0.0f,0.0f,-halfLength);
165 scatVtxProperty->vertex.set1Value(1, 0.0f,0.0f, halfLength);
166 SoLineSet * line = new SoLineSet();
167 line->numVertices = 2;
168 line->vertexProperty = scatVtxProperty;
169 m_d->cachedshapes_drifttubes[id] = line;
170 line->ref();
171 return line;
172 }
173
174}

◆ getShapeNode_Pad()

SoNode * HitsSoNodeManager::getShapeNode_Pad ( double length,
double minWidth = 0,
double maxWidth = 0,
double depth = 0 )

Definition at line 363 of file HitsSoNodeManager.cxx.

364{
365
366 //std::cout << "HitsSoNodeManager::getShapeNode_Pad()" << std::endl;
367
368 m_d->sanitiseParameterValueAllowZero(length);
369 m_d->sanitiseParameterValueAllowZero(minWidth);
370 m_d->sanitiseParameterValueAllowZero(maxWidth);
371 m_d->sanitiseParameterValueAllowZero(depth);
372
373 //double id(length-minWidth*9999.99-depth*999999799.0);//something unique
374 //std::map<double,SoNode*>::const_iterator it = m_d->cachedshapes_strips.find(id);
375 //if (it!=m_d->cachedshapes_strips.end())
376 // return it->second;
377
378 if (maxWidth==0.0 && depth==0) {
379 if (length==0.0) {
380 std::cout << "maxWidth==0.0 && depth==0 && lengthPad==0.0, returning a point..." << std::endl;
381 return getShapeNode_Point();
382 }
383 //Return a line:
384 //std::cout << "maxWidth==0.0 && depth==0, returning a line..." << std::endl;
385 SoVertexProperty * scatVtxProperty = new SoVertexProperty();
386 scatVtxProperty->vertex.set1Value(0, 0.0f,-length*0.5f,0.0f);
387 scatVtxProperty->vertex.set1Value(1, 0.0f, length*0.5f,0.0f);
388 SoLineSet * line = new SoLineSet();
389 line->numVertices = 2;
390 line->vertexProperty = scatVtxProperty;
391 //m_d->cachedshapes_strips[id] = line;
392 line->ref();
393 return line;
394 } else {
395 //std::cout << "returning a box..." << std::endl;
396 //Return a box.
398 SoGenericBox* trd = new SoGenericBox;
399 m_d->sanitiseParameterValue(length);
400 m_d->sanitiseParameterValue(minWidth);
401 m_d->sanitiseParameterValue(maxWidth);
402 m_d->sanitiseParameterValue(depth);
403 trd->setParametersForTrd(0.5*minWidth,0.5*maxWidth,0.5*length,0.5*length,0.5*depth);
404 //m_d->cachedshapes_strips[id] = trd;
405 trd->drawEdgeLines = true;
406 trd->ref();
407 return trd;
408 }
409}
double length(const pvec &v)
void setParametersForTrd(float dx1, float dx2, float dy1, float dy2, float dz)
static void initClass()
SoSFBool drawEdgeLines
std::string depth
tag string for intendation
Definition fastadd.cxx:46

◆ getShapeNode_Point()

SoNode * HitsSoNodeManager::getShapeNode_Point ( )

Definition at line 412 of file HitsSoNodeManager.cxx.

413{
414 if (!m_d->cachedshape_point) {
415 SoPointSet * scatPointSet = new SoPointSet;
416 SoVertexProperty * scatVtxProperty = new SoVertexProperty;
417 scatVtxProperty->vertex.set1Value(0,0.0f,0.0f,0.0f);
418 scatPointSet->numPoints=1;
419 scatPointSet->vertexProperty.setValue(scatVtxProperty);
420 m_d->cachedshape_point = scatPointSet;
421 m_d->cachedshape_point->ref();
422 }
423 return m_d->cachedshape_point;
424}

◆ getShapeNode_ProjectedDriftTube()

SoNode * HitsSoNodeManager::getShapeNode_ProjectedDriftTube ( double halfLength,
double radius,
bool inner,
bool outer )

Definition at line 203 of file HitsSoNodeManager.cxx.

205{
206 m_d->sanitiseParameterValue(halfLength);
207 m_d->sanitiseParameterValueAllowZero(radius);
208 //Fixme: discretize by radius!!
209
210 double id(halfLength-9999.9*radius-(inner?0.0:-9999799.99)-(outer?0.0:-9999997979.99));//something unique
211 std::map<double,SoNode*>::const_iterator it = m_d->cachedshapes_projdrifttubes.find(id);
212 if (it!=m_d->cachedshapes_projdrifttubes.end())
213 return it->second;
214
215 if (!inner&&!outer) {
216 //Should probably never be called. But whatever:
217 SoInfo * info = new SoInfo;//something harmless and lightweight.
218 info->ref();
219 m_d->cachedshapes_projdrifttubes[id] = info;
220 return info;
221 }
222
223 //Fix for inner projections to put the hits from short barrel straws onto same z as the long barrel straws:
224 double halfLengthInner = halfLength<160.0 ? 2*349.3150-halfLength : halfLength;
225 m_d->sanitiseParameterValue(halfLengthInner);
226
227 if (radius>0) {
228 SoSeparator*sep = new SoSeparator;//fixme: check if sogroup improves performance.
229 SoRotationXYZ * rot = new SoRotationXYZ;
230 rot->axis.setValue(SoRotationXYZ::X);
231 rot->angle.setValue(M_PI*0.5f);
232 sep->addChild(rot);
233 SoCylinder * cyl = new SoCylinder;
234 cyl->radius.setValue(radius);
235 cyl->height.setValue(m_d->driftdischeight);
236 if (inner) {
237 SoTranslation * trans = new SoTranslation;
238 trans->translation.setValue(0.0f,halfLengthInner,0.0f);
239 sep->addChild(trans);
240 sep->addChild(cyl);
241 }
242 if (outer) {
243 SoTranslation * trans = new SoTranslation;
244 trans->translation.setValue(0.0f,(inner?-halfLength-halfLengthInner:-halfLength),0.0f);
245 sep->addChild(trans);
246 sep->addChild(cyl);
247 }
248 m_d->cachedshapes_projdrifttubes[id] = sep;
249 sep->ref();
250 return sep;
251 } else {
252 SoPointSet * scatPointSet = new SoPointSet;
253 SoVertexProperty * scatVtxProperty = new SoVertexProperty;
254 int i(0);
255 if (inner)
256 scatVtxProperty->vertex.set1Value(i++,0.0f,0.0f,halfLengthInner);
257 if (outer)
258 scatVtxProperty->vertex.set1Value(i++,0.0f,0.0f,-halfLength);
259 scatPointSet->numPoints=i;
260 scatPointSet->vertexProperty.setValue(scatVtxProperty);
261 m_d->cachedshapes_projdrifttubes[id] = scatPointSet;
262 scatPointSet->ref();
263 return scatPointSet;
264 }
265}

◆ getShapeNode_Strip()

SoNode * HitsSoNodeManager::getShapeNode_Strip ( double length,
double width = 0,
double depth = 0 )

Can never reach this line (coverity 31149) std::cout << "Returning zero!" << std::endl; return 0;

Definition at line 269 of file HitsSoNodeManager.cxx.

270{
271 //std::cout << "HitsSoNodeManager::getShapeNode_Strip()" << std::endl;
272
273 m_d->sanitiseParameterValueAllowZero(length);
274 m_d->sanitiseParameterValueAllowZero(width);
275 m_d->sanitiseParameterValueAllowZero(depth);
276
277 double id(length-width*9999.99-depth*999999799.0);//something unique
278 std::map<double,SoNode*>::const_iterator it = m_d->cachedshapes_strips.find(id);
279 if (it!=m_d->cachedshapes_strips.end())
280 return it->second;
281
282 if (width==0.0&&depth==0) {
283 if (length==0.0) {
284 std::cout << "lengthStrip==0.0, returning a point..." << std::endl;
285 return getShapeNode_Point();
286 }
287 //Return a line:
288 SoVertexProperty * scatVtxProperty = new SoVertexProperty();
289 scatVtxProperty->vertex.set1Value(0, 0.0f,-length*0.5f,0.0f);
290 scatVtxProperty->vertex.set1Value(1, 0.0f, length*0.5f,0.0f);
291 SoLineSet * line = new SoLineSet();
292 line->numVertices = 2;
293 line->vertexProperty = scatVtxProperty;
294 m_d->cachedshapes_strips[id] = line;
295 line->ref();
296 return line;
297 } else {
298 //Return a box.
300 SoGenericBox* cube = new SoGenericBox;
301 m_d->sanitiseParameterValue(length);
302 m_d->sanitiseParameterValue(width);
303 m_d->sanitiseParameterValue(depth);
304 cube->setParametersForBox(0.5*width,0.5*length,0.5*depth);
305 m_d->cachedshapes_strips[id] = cube;
306 cube->drawEdgeLines = true;
307 cube->ref();
308 return cube;
309 }
314}
const double width
void setParametersForBox(float dx, float dy, float dz, float xcenter=0.0, float ycenter=0.0, float zcenter=0.0)

◆ getShapeNode_Wire()

SoNode * HitsSoNodeManager::getShapeNode_Wire ( double length,
double minWidth = 0,
double maxWidth = 0,
double depth = 0 )

Definition at line 317 of file HitsSoNodeManager.cxx.

318{
319
320 //std::cout << "HitsSoNodeManager::getShapeNode_Wire()" << std::endl;
321
322 m_d->sanitiseParameterValueAllowZero(length);
323 m_d->sanitiseParameterValueAllowZero(minWidth);
324 m_d->sanitiseParameterValueAllowZero(maxWidth);
325 m_d->sanitiseParameterValueAllowZero(depth);
326
327 //double id(length-minWidth*9999.99-depth*999999799.0);//something unique
328 //std::map<double,SoNode*>::const_iterator it = m_d->cachedshapes_strips.find(id);
329 //if (it!=m_d->cachedshapes_strips.end())
330 // return it->second;
331
332 if (maxWidth==0.0&&depth==0) {
333 if (length==0.0) {
334 std::cout << "lengthWire==0.0, returning a point..." << std::endl;
335 return getShapeNode_Point();
336 }
337 //Return a line:
338 SoVertexProperty * scatVtxProperty = new SoVertexProperty();
339 scatVtxProperty->vertex.set1Value(0, 0.0f,-length*0.5f,0.0f);
340 scatVtxProperty->vertex.set1Value(1, 0.0f, length*0.5f,0.0f);
341 SoLineSet * line = new SoLineSet();
342 line->numVertices = 2;
343 line->vertexProperty = scatVtxProperty;
344 //m_d->cachedshapes_strips[id] = line;
345 line->ref();
346 return line;
347 } else {
348 //Return a box.
350 SoGenericBox* trd = new SoGenericBox;
351 m_d->sanitiseParameterValue(length);
352 m_d->sanitiseParameterValue(minWidth);
353 m_d->sanitiseParameterValue(maxWidth);
354 m_d->sanitiseParameterValue(depth);
355 trd->setParametersForTrd(0.5*minWidth,0.5*maxWidth,0.5*length,0.5*length,0.5*depth);
356 //m_d->cachedshapes_strips[id] = trd;
357 trd->drawEdgeLines = true;
358 trd->ref();
359 return trd;
360 }
361}

◆ getUnitTransform()

SoTransform * HitsSoNodeManager::getUnitTransform ( )

Definition at line 456 of file HitsSoNodeManager.cxx.

457{
458 if (!m_d->cached_unittransform) {
459 m_d->cached_unittransform = new SoTransform;
460 m_d->cached_unittransform->ref();
461 }
462 return m_d->cached_unittransform;
463}

◆ helperClassName()

const QString & VP1HelperClassBase::helperClassName ( ) const
inlineinherited

Definition at line 51 of file VP1HelperClassBase.h.

51{ return m_helpername; }

◆ 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}

◆ 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}

◆ operator=()

HitsSoNodeManager & HitsSoNodeManager::operator= ( const HitsSoNodeManager & )
private

◆ setHelperClassName()

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

Definition at line 59 of file VP1HelperClassBase.h.

◆ 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

◆ 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; }

◆ 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

◆ 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* HitsSoNodeManager::m_d
private

Definition at line 41 of file HitsSoNodeManager.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: