ATLAS Offline Software
Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
TrackLODHandle Class Reference

#include <TrackLODManager.h>

Collaboration diagram for TrackLODHandle:

Classes

class  Imp
 

Public Member Functions

void addNodes (SoGroup *simple, SoGroup *detailed)
 
void removeNodes (SoGroup *simple, SoGroup *detailed)
 

Private Member Functions

 TrackLODHandle (SoGroup *, VP1ExtraSepLayerHelper *, VP1ExtraSepLayerHelper *, int, const double &)
 
 ~TrackLODHandle ()
 
 TrackLODHandle (const TrackLODHandle &)
 
TrackLODHandleoperator= (const TrackLODHandle &)
 

Private Attributes

Impm_d
 

Friends

class TrackLODManager
 
class TrackLODManager::Imp
 

Detailed Description

Definition at line 56 of file TrackLODManager.h.

Constructor & Destructor Documentation

◆ TrackLODHandle() [1/2]

TrackLODHandle::TrackLODHandle ( SoGroup *  attachgroup_LOD,
VP1ExtraSepLayerHelper sephelper_simple,
VP1ExtraSepLayerHelper sephelper_detailed,
int  regionindex,
const double &  crossover_value 
)
private

Definition at line 247 of file TrackLODManager.cxx.

251  : m_d(new Imp(attachgroup_LOD,sephelper_simple,sephelper_detailed,regionindex,crossover_value))
252 {
253 // if (VP1Msg::verbose())
254 // VP1Msg::messageVerbose("TrackLODHandle Constructed with regionIndex = "+QString::number(regionindex)
255 // +" and nominal crossover value = "+QString::number(crossover_value));
256  if (!attachgroup_LOD||!sephelper_simple||!sephelper_detailed)
257  VP1Msg::messageDebug("TrackLODHandle ERROR: Received null pointer!");
258 }

◆ ~TrackLODHandle()

TrackLODHandle::~TrackLODHandle ( )
private

Definition at line 261 of file TrackLODManager.cxx.

262 {
263  if (m_d->lod) {
264  if (m_d->attachGroup_LOD->findChild(m_d->lod)>-1) {
265  m_d->attachGroup_LOD->removeChild(m_d->lod);
268  }
269  m_d->lod->unref();
270  m_d->sep_detailed->unref();
271  m_d->sep_simple->unref();
272  }
273  delete m_d;
274 }

◆ TrackLODHandle() [2/2]

TrackLODHandle::TrackLODHandle ( const TrackLODHandle )
private

Member Function Documentation

◆ addNodes()

void TrackLODHandle::addNodes ( SoGroup *  simple,
SoGroup *  detailed 
)

Definition at line 277 of file TrackLODManager.cxx.

278 {
279  if (!m_d->lod) {
280 // if (VP1Msg::verbose())
281 // VP1Msg::messageVerbose( "TrackLODHandle addNodes: Initialising nodes: LOD, sep_detailed and sep_simple.");
282  m_d->lod = new SoLevelOfDetail;
283  m_d->sep_detailed = new SoSeparator;
284  m_d->sep_simple = new SoSeparator;
285  m_d->lod->ref();
286  m_d->sep_detailed->ref();
287  m_d->sep_simple->ref();
288  m_d->lod->addChild(m_d->sep_detailed);
289  m_d->lod->addChild(m_d->sep_simple);
290  }
291 
292  if (VP1Msg::verbose()) {
293  //Extra sanity checks:
294  if (!detailed) {
295  VP1Msg::messageVerbose("TrackLODHandle ERROR: addNodes received null pointer for detailed node");
296  return;
297  }
298  if (!simple) {
299  VP1Msg::messageVerbose("TrackLODHandle ERROR: addNodes received null pointer for simple node");
300  return;
301  }
302  if (m_d->sep_detailed->findChild(detailed)>=0) {
303  VP1Msg::messageVerbose("TrackLODHandle ERROR: addNodes called for detailed node which is already added");
304  return;
305  }
306  if (m_d->sep_simple->findChild(simple)>=0) {
307  VP1Msg::messageVerbose("TrackLODHandle ERROR: addNodes called for simple node which is already added");
308  return;
309  }
310  }
311 
312  m_d->sep_detailed->addChild(detailed);
313  m_d->sep_simple->addChild(simple);
314 
315  if (m_d->sep_detailed->getNumChildren()==1) {
316  //We went from 0 to 1 children!
317  if (VP1Msg::verbose()&&m_d->attachGroup_LOD->findChild(m_d->lod)>=0)
318  VP1Msg::messageVerbose("TrackLODHandle ERROR: adding lod, but it is already a child!!");
319  m_d->attachGroup_LOD->addChild(m_d->lod);
322  }
324 }

◆ operator=()

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

◆ removeNodes()

void TrackLODHandle::removeNodes ( SoGroup *  simple,
SoGroup *  detailed 
)

Definition at line 327 of file TrackLODManager.cxx.

328 {
329  if (!m_d->lod)
330  return;
331 
332  if (VP1Msg::verbose()) {
333  //Extra sanity checks:
334  if (!detailed) {
335  VP1Msg::messageVerbose("TrackLODHandle ERROR: removeNodes received null pointer for detailed node");
336  return;
337  }
338  if (!simple) {
339  VP1Msg::messageVerbose("TrackLODHandle ERROR: removeNodes received null pointer for simple node");
340  return;
341  }
342  if (m_d->sep_detailed->findChild(detailed)<0) {
343  VP1Msg::messageVerbose("TrackLODHandle ERROR: removeNodes called for detailed node which is not already added");
344  return;
345  }
346  if (m_d->sep_simple->findChild(simple)<0) {
347  VP1Msg::messageVerbose("TrackLODHandle ERROR: removeNodes called for simple node which is not already added");
348  return;
349  }
350  }
351  m_d->sep_detailed->removeChild(detailed);
352  m_d->sep_simple->removeChild(simple);
353 
354  if (m_d->sep_detailed->getNumChildren()<1) {
355  //We went from 1 to 0 children
356  if (VP1Msg::verbose()&&m_d->attachGroup_LOD->findChild(m_d->lod)<0)
357  VP1Msg::messageVerbose("TrackLODHandle ERROR: removing child, but node is not currently a child!!");
358  m_d->attachGroup_LOD->removeChild(m_d->lod);
361  } else {
363  }
364 }

Friends And Related Function Documentation

◆ TrackLODManager

friend class TrackLODManager
friend

Definition at line 65 of file TrackLODManager.h.

◆ TrackLODManager::Imp

friend class TrackLODManager::Imp
friend

Definition at line 66 of file TrackLODManager.h.

Member Data Documentation

◆ m_d

Imp* TrackLODHandle::m_d
private

Definition at line 68 of file TrackLODManager.h.


The documentation for this class was generated from the following files:
VP1ExtraSepLayerHelper::removeNode
void removeNode(SoNode *)
Definition: VP1ExtraSepLayerHelper.cxx:95
TrackLODHandle::Imp::sep_detailed
SoSeparator * sep_detailed
Definition: TrackLODManager.cxx:235
TrackLODHandle::Imp::lod
SoLevelOfDetail * lod
Definition: TrackLODManager.cxx:234
TrackLODHandle::Imp::attachHelper_detailed
VP1ExtraSepLayerHelper * attachHelper_detailed
Definition: TrackLODManager.cxx:231
TrackLODHandle::Imp::updateCrossOverField
void updateCrossOverField() const
Definition: TrackLODManager.cxx:237
VP1Msg::messageVerbose
static void messageVerbose(const QString &)
Definition: VP1Msg.cxx:84
VP1ExtraSepLayerHelper::addNode
void addNode(SoNode *)
Definition: VP1ExtraSepLayerHelper.cxx:54
VP1Msg::messageDebug
static void messageDebug(const QString &)
Definition: VP1Msg.cxx:39
TrackLODHandle::Imp::attachGroup_LOD
SoGroup * attachGroup_LOD
Definition: TrackLODManager.cxx:229
VP1Msg::verbose
static bool verbose()
Definition: VP1Msg.h:31
TrackLODHandle::Imp::sep_simple
SoSeparator * sep_simple
Definition: TrackLODManager.cxx:236
TrackLODHandle::Imp::attachHelper_simple
VP1ExtraSepLayerHelper * attachHelper_simple
Definition: TrackLODManager.cxx:230
TrackLODHandle::m_d
Imp * m_d
Definition: TrackLODManager.h:67