ATLAS Offline Software
Classes | Static Public Member Functions | Private Member Functions | List of all members
VP1HEPVisUtils Class Reference

#include <VP1HEPVisUtils.h>

Collaboration diagram for VP1HEPVisUtils:

Classes

class  Imp
 

Static Public Member Functions

static void initAllCustomClasses ()
 
static SoGroup * convertToStandardScene (SoGroup *)
 
static bool isCustomNode (SoNode *)
 
static SoNode * convertCustomNodeToAlternateRep (SoNode *)
 
static void updateAllAlternativeReps (SoGroup *)
 
static void clearAllAlternativeReps (SoGroup *)
 

Private Member Functions

 VP1HEPVisUtils ()
 
 ~VP1HEPVisUtils ()
 

Detailed Description

Definition at line 24 of file VP1HEPVisUtils.h.

Constructor & Destructor Documentation

◆ VP1HEPVisUtils()

VP1HEPVisUtils::VP1HEPVisUtils ( )
private

◆ ~VP1HEPVisUtils()

VP1HEPVisUtils::~VP1HEPVisUtils ( )
private

Member Function Documentation

◆ clearAllAlternativeReps()

void VP1HEPVisUtils::clearAllAlternativeReps ( SoGroup *  g)
static

Definition at line 297 of file VP1HEPVisUtils.cxx.

298 {
299  for (int i = 0; i<g->getNumChildren();++i) {
300  SoNode * n = g->getChild(i);
301  if ( Imp::isGroup(n) ) {
302  clearAllAlternativeReps(static_cast<SoGroup*>(n));
303  } else if (isCustomNode(n)) {
304  if ( n->getTypeId().isDerivedFrom(SoCons::getClassTypeId()) ) return Imp::clearAlternateRep<SoCons>(n);
305  if ( n->getTypeId().isDerivedFrom(SoLAr::getClassTypeId()) ) return Imp::clearAlternateRep<SoLAr>(n);
306  //NOT IMPLEMENTED if ( n->getTypeId().isDerivedFrom(SoPcons::getClassTypeId()) ) return Imp::clearAlternateRep<SoPcons>(n);
307  if ( n->getTypeId().isDerivedFrom(SoPcons::getClassTypeId()) ) return Imp::clearAlternateRep<SoPcons>(n);
308  if ( n->getTypeId().isDerivedFrom(SoGenericBox::getClassTypeId()) ) return Imp::clearAlternateRep<SoGenericBox>(n);
309  if ( n->getTypeId().isDerivedFrom(SoTubs::getClassTypeId()) ) return Imp::clearAlternateRep<SoTubs>(n);
310  if ( n->getTypeId().isDerivedFrom(SoPolyhedron::getClassTypeId()) ) return Imp::clearAlternateRep<SoPolyhedron>(n);
311  if ( n->getTypeId().isDerivedFrom(SoTessellated::getClassTypeId()) ) return Imp::clearAlternateRep<SoTessellated>(n);
312  }
313  }
314 }

◆ convertCustomNodeToAlternateRep()

SoNode * VP1HEPVisUtils::convertCustomNodeToAlternateRep ( SoNode *  n)
static

Definition at line 238 of file VP1HEPVisUtils.cxx.

239 {
240  if (!n)
241  return 0;
242 
244 
245  if ( n->getTypeId().isDerivedFrom(SoCons::getClassTypeId()) ) return Imp::convertToAlternateRep<SoCons>(n);
246  if ( n->getTypeId().isDerivedFrom(SoLAr::getClassTypeId()) ) return Imp::convertToAlternateRep<SoLAr>(n);
247 //NOT IMPLEMENTED if ( n->getTypeId().isDerivedFrom(SoPcons::getClassTypeId()) ) return Imp::convertToAlternateRep<SoPcons>(n);
248  if ( n->getTypeId().isDerivedFrom(SoPcons::getClassTypeId()) ) return Imp::convertToAlternateRep<SoPcons>(n);
249  if ( n->getTypeId().isDerivedFrom(SoGenericBox::getClassTypeId()) ) return Imp::convertToAlternateRep<SoGenericBox>(n);
250  if ( n->getTypeId().isDerivedFrom(SoTubs::getClassTypeId()) ) return Imp::convertToAlternateRep<SoTubs>(n);
251  if ( n->getTypeId().isDerivedFrom(SoPolyhedron::getClassTypeId()) ) return Imp::convertToAlternateRep<SoPolyhedron>(n);
252  if ( n->getTypeId().isDerivedFrom(SoTessellated::getClassTypeId()) ) return Imp::convertToAlternateRep<SoTessellated>(n);
253 
254  //A bit special. Probably should not get called here.
255  if ( Imp::isGroup(n) ) return Imp::convertToStandardGroupNode(static_cast<SoGroup*>(n),false /*transferChildren*/);
256  SoGroup * g = new SoGroup;
257  return g;//fixme: share this
258 }

◆ convertToStandardScene()

SoGroup * VP1HEPVisUtils::convertToStandardScene ( SoGroup *  g)
static

Definition at line 157 of file VP1HEPVisUtils.cxx.

158 {
159  if (!g)
160  return 0;
161 
163 
164  if (Imp::isNonCustomTree(g))
165  return g;
166 
167 
168  g->ref();
169 
171 
172  SoGroup* thegroup = Imp::convertToStandardScene(g);
173  thegroup->ref();
174 
176 
177  g->unrefNoDelete();
178  thegroup->unrefNoDelete();
179  return thegroup;
180 }

◆ initAllCustomClasses()

void VP1HEPVisUtils::initAllCustomClasses ( )
static

Definition at line 317 of file VP1HEPVisUtils.cxx.

◆ isCustomNode()

bool VP1HEPVisUtils::isCustomNode ( SoNode *  n)
static

Definition at line 183 of file VP1HEPVisUtils.cxx.

184 {
185  if (!n)
186  return false;
187 
188  return n->getNodeType() & SoNode::EXTENSION;
189 }

◆ updateAllAlternativeReps()

void VP1HEPVisUtils::updateAllAlternativeReps ( SoGroup *  g)
static

Definition at line 287 of file VP1HEPVisUtils.cxx.

288 {
289  clearAllAlternativeReps(g);//To make sure all altReps. are NULL
290  //(thus, we only update those with null,
291  //avoiding repeated updates on shared
292  //instances)
294 }

The documentation for this class was generated from the following files:
VP1HEPVisUtils::Imp::convertToStandardScene
static SoGroup * convertToStandardScene(SoGroup *g)
Definition: VP1HEPVisUtils.cxx:126
VP1HEPVisUtils::Imp::isNonCustomTree
static bool isNonCustomTree(SoGroup *g)
Definition: VP1HEPVisUtils.cxx:61
SoTessellated::initClass
static void initClass()
Definition: SoTessellated.cxx:19
VP1HEPVisUtils::initAllCustomClasses
static void initAllCustomClasses()
Definition: VP1HEPVisUtils.cxx:317
VP1HEPVisUtils::isCustomNode
static bool isCustomNode(SoNode *)
Definition: VP1HEPVisUtils.cxx:183
SoGenericBox::initClass
static void initClass()
Definition: SoGenericBox.cxx:62
VP1HEPVisUtils::clearAllAlternativeReps
static void clearAllAlternativeReps(SoGroup *)
Definition: VP1HEPVisUtils.cxx:297
VP1HEPVisUtils::Imp::updateAllNullAlternativeReps
static void updateAllNullAlternativeReps(SoGroup *g)
Definition: VP1HEPVisUtils.cxx:267
SoTransparency::initClass
static void initClass()
Definition: SoTransparency.cxx:29
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
SoPcons::initClass
static void initClass()
Class Initializer, required.
Definition: SoPcons.cxx:67
SoTubs::initClass
static void initClass()
Class Initializer, required.
Definition: SoTubs.cxx:63
VP1HEPVisUtils::Imp::isGroup
static bool isGroup(SoNode *n)
Definition: VP1HEPVisUtils.cxx:261
VP1HEPVisUtils::Imp::convertToStandardGroupNode
static SoGroup * convertToStandardGroupNode(SoGroup *g, bool transferChildren)
Definition: VP1HEPVisUtils.cxx:83
VP1HEPVisUtils::updateAllAlternativeReps
static void updateAllAlternativeReps(SoGroup *)
Definition: VP1HEPVisUtils.cxx:287
SoCons::initClass
static void initClass()
Class Initializer, required.
Definition: SoCons.cxx:59
SoPolyhedron::initClass
static void initClass()
Definition: SoPolyhedron.cxx:47
SoLAr::initClass
static void initClass()
Class Initializer, required.
Definition: SoLAr.cxx:62