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

#include <VolumeHandleSharedData.h>

Collaboration diagram for VolumeHandleSharedData:

Classes

class  Imp
 

Public Member Functions

 VolumeHandleSharedData (GeoSysController *controller, VP1GeoFlags::SubSystemFlag, std::map< SoSeparator *, VolumeHandle * > *sonodesep2volhandle, const GeoPVConstLink &motherpV, PhiSectorManager *, SoMaterial *topMaterial, MatVisAttributes *, VolVisAttributes *, ZappedVolumeListModel *, VP1GeoTreeView *, SoSeparator *)
 
 ~VolumeHandleSharedData ()
 
void ref ()
 
void unref ()
 
GeoPVConstLink geoPVConstLinkOfTreeTopsMother () const
 
PhiSectorManagerphiSectorManager () const
 
VP1GeoFlags::SubSystemFlag subSystemFlag () const
 
SoMaterial * fallBackTopLevelMaterial () const
 
VP1GeoTreeViewvolumeBrowser () const
 
MatVisAttributesmatVisAttributes () const
 
VolVisAttributesvolVisAttributes () const
 
SoSeparator * textSep () const
 
GeoSysControllercontroller () const
 
void addZappedVolumeToGui (VolumeHandle *)
 
void removeZappedVolumesFromGui (VolumeHandle *)
 
SoNode * toShapeNode (const GeoPVConstLink &pV)
 
SoNode * getSoCylinderOrientedLikeGeoTube (const double &radius, const double &halfLength)
 
void registerNodeSepForVolumeHandle (SoSeparator *, VolumeHandle *)
 

Static Public Member Functions

static void setShowVolumeOutlines (SoGroup *nodesep, bool showvol)
 

Private Member Functions

 VolumeHandleSharedData (const VolumeHandleSharedData &)
 
VolumeHandleSharedDataoperator= (const VolumeHandleSharedData &)
 

Private Attributes

Impm_d
 
VP1GeoTreeViewm_volumebrowser
 
SoSeparator * m_textSep
 base text sep More...
 

Detailed Description

Definition at line 25 of file VolumeHandleSharedData.h.

Constructor & Destructor Documentation

◆ VolumeHandleSharedData() [1/2]

VolumeHandleSharedData::VolumeHandleSharedData ( GeoSysController controller,
VP1GeoFlags::SubSystemFlag  flag,
std::map< SoSeparator *, VolumeHandle * > *  sonodesep2volhandle,
const GeoPVConstLink &  motherpV,
PhiSectorManager psm,
SoMaterial *  topMaterial,
MatVisAttributes matVisAttributes,
VolVisAttributes volVisAttributes,
ZappedVolumeListModel zappedvolumelistmodel,
VP1GeoTreeView volbrowser,
SoSeparator *  textSep 
)

Definition at line 43 of file VolumeHandleSharedData.cxx.

48  : m_d(new Imp), m_volumebrowser(volbrowser), m_textSep(textSep)
49 {
50  m_d->ref = 0;
52  m_d->sonodesep2volhandle = sonodesep2volhandle;
53  m_d->motherpV = motherpV;
54  m_d->phisectormanager = psm;
55  m_d->subsysflag = flag;
56  m_d->topMaterial = topMaterial;
59  m_d->zappedvolumelistmodel = zappedvolumelistmodel;
60 }

◆ ~VolumeHandleSharedData()

VolumeHandleSharedData::~VolumeHandleSharedData ( )

Definition at line 63 of file VolumeHandleSharedData.cxx.

64 {
66  for (it=m_d->logvol2shape.begin();it!=itE;++it) {
67  if (it->second)
68  it->second->unref();
69  }
71  for (it2=m_d->id2shape.begin();it2!=it2E;++it2) {
72  if (it2->second)
73  it2->second->unref();
74  }
75  delete m_d; m_d=0;
76 }

◆ VolumeHandleSharedData() [2/2]

VolumeHandleSharedData::VolumeHandleSharedData ( const VolumeHandleSharedData )
private

Member Function Documentation

◆ addZappedVolumeToGui()

void VolumeHandleSharedData::addZappedVolumeToGui ( VolumeHandle handle)

Definition at line 219 of file VolumeHandleSharedData.cxx.

220 {
222 }

◆ controller()

GeoSysController * VolumeHandleSharedData::controller ( ) const

Definition at line 123 of file VolumeHandleSharedData.cxx.

124 {
125  return m_d->controller;
126 }

◆ fallBackTopLevelMaterial()

SoMaterial * VolumeHandleSharedData::fallBackTopLevelMaterial ( ) const

Definition at line 105 of file VolumeHandleSharedData.cxx.

106 {
107  return m_d->topMaterial;
108 }

◆ geoPVConstLinkOfTreeTopsMother()

GeoPVConstLink VolumeHandleSharedData::geoPVConstLinkOfTreeTopsMother ( ) const

Definition at line 213 of file VolumeHandleSharedData.cxx.

214 {
215  return m_d->motherpV;
216 }

◆ getSoCylinderOrientedLikeGeoTube()

SoNode * VolumeHandleSharedData::getSoCylinderOrientedLikeGeoTube ( const double &  radius,
const double &  halfLength 
)

Definition at line 191 of file VolumeHandleSharedData.cxx.

192 {
193  double id = radius - 9999.0*halfLength;
195  if (it!=m_d->id2shape.end())
196  return it->second;
197 
198  SoGroup * group = new SoGroup;
199  SoRotationXYZ * rot = new SoRotationXYZ;
200  rot->axis.setValue(SoRotationXYZ::X);
201  rot->angle.setValue(M_PI*0.5f);
202  group->addChild(rot);
203  SoCylinder * cyl = new SoCylinder;
204  cyl->radius.setValue(radius);
205  cyl->height.setValue(2.0*halfLength);
206  group->addChild(cyl);
207  group->ref();
208  m_d->id2shape[id]=group;
209  return group;
210 }

◆ matVisAttributes()

MatVisAttributes * VolumeHandleSharedData::matVisAttributes ( ) const

Definition at line 93 of file VolumeHandleSharedData.cxx.

94 {
95  return m_d->matVisAttributes;
96 }

◆ operator=()

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

◆ phiSectorManager()

PhiSectorManager * VolumeHandleSharedData::phiSectorManager ( ) const

Definition at line 117 of file VolumeHandleSharedData.cxx.

118 {
119  return m_d->phisectormanager;
120 }

◆ ref()

void VolumeHandleSharedData::ref ( )

Definition at line 79 of file VolumeHandleSharedData.cxx.

80 {
81  ++(m_d->ref);
82 }

◆ registerNodeSepForVolumeHandle()

void VolumeHandleSharedData::registerNodeSepForVolumeHandle ( SoSeparator *  n,
VolumeHandle vh 
)

Definition at line 129 of file VolumeHandleSharedData.cxx.

130 {
131  assert(m_d->sonodesep2volhandle->find(n)==m_d->sonodesep2volhandle->end());
132  (*(m_d->sonodesep2volhandle))[n]=vh;
134 }

◆ removeZappedVolumesFromGui()

void VolumeHandleSharedData::removeZappedVolumesFromGui ( VolumeHandle handle)

Definition at line 225 of file VolumeHandleSharedData.cxx.

226 {
228 }

◆ setShowVolumeOutlines()

void VolumeHandleSharedData::setShowVolumeOutlines ( SoGroup *  nodesep,
bool  showvol 
)
static

Definition at line 137 of file VolumeHandleSharedData.cxx.

138 {
139  for (int i = 0; i<nodegroup->getNumChildren();++i) {
140  SoNode * n = nodegroup->getChild(i);
141  if (n->getTypeId().isDerivedFrom(SoGenericBox::getClassTypeId())) {
142  if (static_cast<SoGenericBox*>(n)->drawEdgeLines.getValue()!=showvol)
143  static_cast<SoGenericBox*>(n)->drawEdgeLines.setValue(showvol);
144  } else if (n->getTypeId().isDerivedFrom(SoTubs::getClassTypeId())) {
145  if (static_cast<SoTubs*>(n)->drawEdgeLines.getValue()!=showvol){
146  static_cast<SoTubs*>(n)->drawEdgeLines.setValue(showvol);
147  }
148  } else if (n->getTypeId().isDerivedFrom(SoPcons::getClassTypeId())) {
149  if (static_cast<SoPcons*>(n)->drawEdgeLines.getValue()!=showvol){
150  static_cast<SoPcons*>(n)->drawEdgeLines.setValue(showvol);
151  }
152  } else if (n->getTypeId().isDerivedFrom(SoTessellated::getClassTypeId())) {
153  if (static_cast<SoTessellated*>(n)->drawEdgeLines.getValue()!=showvol){
154  static_cast<SoTessellated*>(n)->drawEdgeLines.setValue(showvol);
155  }
156  } else if (n->getTypeId().isDerivedFrom(SoGroup::getClassTypeId())) {
157  setShowVolumeOutlines(static_cast<SoGroup*>(n),showvol);
158  }
159  }
160 }

◆ subSystemFlag()

VP1GeoFlags::SubSystemFlag VolumeHandleSharedData::subSystemFlag ( ) const

Definition at line 111 of file VolumeHandleSharedData.cxx.

112 {
113  return m_d->subsysflag;
114 }

◆ textSep()

SoSeparator* VolumeHandleSharedData::textSep ( ) const
inline

Definition at line 43 of file VolumeHandleSharedData.h.

43 {return m_textSep;}

◆ toShapeNode()

SoNode * VolumeHandleSharedData::toShapeNode ( const GeoPVConstLink &  pV)

Definition at line 163 of file VolumeHandleSharedData.cxx.

164 {
165  const GeoLogVol * logVolume = pV->getLogVol();
166 
167  // if shape already stored for this volume, return that
168  SoShape * shape (0);
170  if (itShape!=m_d->logvol2shape.end()) {
171  return itShape->second;
172  }
173 
174  const GeoShape * geoshape = logVolume->getShape();
175 
176  m_d->visaction.reset();
177  if (geoshape->typeID()==GeoShapeShift::getClassTypeID()) {
178  dynamic_cast<const GeoShapeShift*>(geoshape)->getOp()->exec(&(m_d->visaction));
179  //NB: the transformation part of the GeoShapeShift will be applied elsewhere
180  } else {
181  geoshape->exec(&(m_d->visaction));
182  }
183  shape = m_d->visaction.getShape();
184  if (shape)
185  shape->ref();
186  m_d->logvol2shape[logVolume] = shape;
187  return shape;
188 }

◆ unref()

void VolumeHandleSharedData::unref ( )

Definition at line 85 of file VolumeHandleSharedData.cxx.

86 {
87  --(m_d->ref);
88  if (!m_d->ref)
89  delete this;
90 }

◆ volumeBrowser()

VP1GeoTreeView* VolumeHandleSharedData::volumeBrowser ( ) const
inline

Definition at line 40 of file VolumeHandleSharedData.h.

40 { return m_volumebrowser; }

◆ volVisAttributes()

VolVisAttributes * VolumeHandleSharedData::volVisAttributes ( ) const

Definition at line 99 of file VolumeHandleSharedData.cxx.

100 {
101  return m_d->volVisAttributes;
102 }

Member Data Documentation

◆ m_d

Imp* VolumeHandleSharedData::m_d
private

Definition at line 63 of file VolumeHandleSharedData.h.

◆ m_textSep

SoSeparator* VolumeHandleSharedData::m_textSep
private

base text sep

Definition at line 67 of file VolumeHandleSharedData.h.

◆ m_volumebrowser

VP1GeoTreeView* VolumeHandleSharedData::m_volumebrowser
private

Definition at line 66 of file VolumeHandleSharedData.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
ZappedVolumeListModel::removeFromZappedVolumes
void removeFromZappedVolumes(VolumeHandle *)
Definition: ZappedVolumeListModel.h:68
VolumeHandleSharedData::Imp::motherpV
GeoPVConstLink motherpV
Definition: VolumeHandleSharedData.cxx:32
VolumeHandleSharedData::m_d
Imp * m_d
Definition: VolumeHandleSharedData.h:62
VolumeHandleSharedData::Imp::visaction
SoVisualizeAction visaction
Definition: VolumeHandleSharedData.cxx:30
SoPcons
SoPcons - Inventor version of the G4Cons Geant Geometry entity.
Definition: SoPcons.h:39
SoTubs
SoTubs - Inventor version of the G4Tubs Geant Geometry entity.
Definition: SoTubs.h:50
SoTessellated::drawEdgeLines
SoSFBool drawEdgeLines
Definition: SoTessellated.h:31
skel.it
it
Definition: skel.GENtoEVGEN.py:396
SoVisualizeAction::reset
void reset()
Definition: SoVisualizeAction.h:50
M_PI
#define M_PI
Definition: ActiveFraction.h:11
VolumeHandleSharedData::Imp::matVisAttributes
MatVisAttributes * matVisAttributes
Definition: VolumeHandleSharedData.cxx:36
VolumeHandleSharedData::volVisAttributes
VolVisAttributes * volVisAttributes() const
Definition: VolumeHandleSharedData.cxx:99
VolumeHandleSharedData::Imp::phisectormanager
PhiSectorManager * phisectormanager
Definition: VolumeHandleSharedData.cxx:33
VolumeHandleSharedData::Imp::controller
GeoSysController * controller
Definition: VolumeHandleSharedData.cxx:27
VolumeHandleSharedData::Imp::subsysflag
VP1GeoFlags::SubSystemFlag subsysflag
Definition: VolumeHandleSharedData.cxx:34
VolumeHandleSharedData::textSep
SoSeparator * textSep() const
Definition: VolumeHandleSharedData.h:43
TruthTest.itE
itE
Definition: TruthTest.py:25
Monitored::X
@ X
Definition: HistogramFillerUtils.h:24
VolumeHandleSharedData::Imp::id2shape
std::map< double, SoNode * > id2shape
Definition: VolumeHandleSharedData.cxx:29
SoTessellated
Definition: SoTessellated.h:24
SoVisualizeAction::getShape
SoShape * getShape()
Definition: SoVisualizeAction.h:49
GeoSysController::showVolumeOutLines
bool showVolumeOutLines() const
Definition: GeoSysController.cxx:462
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
VolumeHandleSharedData::m_volumebrowser
VP1GeoTreeView * m_volumebrowser
Definition: VolumeHandleSharedData.h:66
master.flag
bool flag
Definition: master.py:29
VolumeHandleSharedData::Imp::logvol2shape
std::map< const GeoLogVol *, SoShape * > logvol2shape
Definition: VolumeHandleSharedData.cxx:28
hist_file_dump.f
f
Definition: hist_file_dump.py:135
VolumeHandleSharedData::Imp::ref
int ref
Definition: VolumeHandleSharedData.cxx:39
SoTubs::drawEdgeLines
SoSFBool drawEdgeLines
Definition: SoTubs.h:87
SoPcons::drawEdgeLines
SoSFBool drawEdgeLines
Definition: SoPcons.h:80
VolumeHandleSharedData::Imp::zappedvolumelistmodel
ZappedVolumeListModel * zappedvolumelistmodel
Definition: VolumeHandleSharedData.cxx:38
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
VolumeHandleSharedData::Imp::volVisAttributes
VolVisAttributes * volVisAttributes
Definition: VolumeHandleSharedData.cxx:37
VolumeHandleSharedData::setShowVolumeOutlines
static void setShowVolumeOutlines(SoGroup *nodesep, bool showvol)
Definition: VolumeHandleSharedData.cxx:137
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
ZappedVolumeListModel::addToZappedVolumes
void addToZappedVolumes(VolumeHandle *)
Definition: ZappedVolumeListModel.h:61
SoGenericBox
Definition: SoGenericBox.h:26
VolumeHandleSharedData::m_textSep
SoSeparator * m_textSep
base text sep
Definition: VolumeHandleSharedData.h:67
VolumeHandleSharedData::Imp::topMaterial
SoMaterial * topMaterial
Definition: VolumeHandleSharedData.cxx:35
VolumeHandleSharedData::controller
GeoSysController * controller() const
Definition: VolumeHandleSharedData.cxx:123
VolumeHandleSharedData::matVisAttributes
MatVisAttributes * matVisAttributes() const
Definition: VolumeHandleSharedData.cxx:93
VolumeHandleSharedData::Imp::sonodesep2volhandle
std::map< SoSeparator *, VolumeHandle * > * sonodesep2volhandle
Definition: VolumeHandleSharedData.cxx:31