ATLAS Offline Software
Loading...
Searching...
No Matches
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

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;
51 m_d->controller=controller;
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;
57 m_d->matVisAttributes = matVisAttributes;
58 m_d->volVisAttributes = volVisAttributes;
59 m_d->zappedvolumelistmodel = zappedvolumelistmodel;
60}
SoSeparator * textSep() const
SoSeparator * m_textSep
base text sep
GeoSysController * controller() const
VolVisAttributes * volVisAttributes() const
MatVisAttributes * matVisAttributes() const
bool flag
Definition master.py:29

◆ ~VolumeHandleSharedData()

VolumeHandleSharedData::~VolumeHandleSharedData ( )

Definition at line 63 of file VolumeHandleSharedData.cxx.

64{
65 std::map<const GeoLogVol *, SoShape *>::iterator it, itE = m_d->logvol2shape.end();
66 for (it=m_d->logvol2shape.begin();it!=itE;++it) {
67 if (it->second)
68 it->second->unref();
69 }
70 std::map<double, SoNode *>::iterator it2, it2E = m_d->id2shape.end();
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{
221 m_d->zappedvolumelistmodel->addToZappedVolumes(handle);
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;
194 std::map<double, SoNode *>::iterator it = m_d->id2shape.find(id);
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}
#define M_PI

◆ 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;
133 setShowVolumeOutlines(n,m_d->controller->showVolumeOutLines());
134}
static void setShowVolumeOutlines(SoGroup *nodesep, bool showvol)

◆ removeZappedVolumesFromGui()

void VolumeHandleSharedData::removeZappedVolumesFromGui ( VolumeHandle * handle)

Definition at line 225 of file VolumeHandleSharedData.cxx.

226{
227 m_d->zappedvolumelistmodel->removeFromZappedVolumes(handle);
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);
169 std::map<const GeoLogVol *, SoShape *>::iterator itShape = m_d->logvol2shape.find(logVolume);
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: