GeoModel - GeoModelCore
GeoPrintGraphAction.cxx
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "GeoModelKernel/GeoPrintGraphAction.h"
6 
7 GeoPrintGraphAction::GeoPrintGraphAction (std::ostream &o)
8  : m_nameTag(nullptr)
9  , m_serialDenominator(nullptr)
10  , m_idTag(nullptr)
11  , m_transformState(true)
12  , m_volumeState(true)
13  , m_nametagState(true)
14  , m_serialDenominatorState(true)
15  , m_serialTransformerState(true)
16  , m_identifierState(true)
17  , m_o(o)
18  , m_indented(false)
19 {
20 }
21 
22 GeoPrintGraphAction::~GeoPrintGraphAction()
23 {
24 }
25 
26 void GeoPrintGraphAction::handleTransform (const GeoTransform *xform)
27 {
28  m_pendingTransformList.push_back(xform);
29  if (m_transformState) {
30  indent();
31  m_o << "TRANSFORM+";
32  }
33 }
34 
35 void GeoPrintGraphAction::handlePhysVol (const GeoPhysVol *vol)
36 {
37  if (m_volumeState) {
38  indent();
39  m_o << "VOLUME(" << vol->getLogVol()->getName() <<")" << std::endl;
40  }
41  m_pendingTransformList.erase(m_pendingTransformList.begin(),m_pendingTransformList.end());
42  m_indented=false;
43 }
44 
45 void GeoPrintGraphAction::handleFullPhysVol (const GeoFullPhysVol *vol)
46 {
47  if (m_volumeState) {
48  indent();
49  m_o << "VOLUME(" << vol->getLogVol()->getName() <<")" << std::endl;
50  }
51  m_pendingTransformList.erase(m_pendingTransformList.begin(),m_pendingTransformList.end());
52  m_indented=false;
53 }
54 
55 void GeoPrintGraphAction::handleNameTag (const GeoNameTag *nameTag)
56 {
57  if (m_nametagState) {
58  indent();
59  m_o << "NAMETAG: " << nameTag->getName() << "+";
60  }
61 }
62 
63 void GeoPrintGraphAction::handleSerialDenominator (const GeoSerialDenominator *sD)
64 {
65  if (m_nametagState) {
66  indent();
67  m_o << "SERIAL DENOMINATOR:: " << sD->getBaseName() << "+";
68  }
69 }
70 
71 void GeoPrintGraphAction::handleSerialTransformer (const GeoSerialTransformer *sT)
72 {
73  if (m_volumeState) {
74  indent();
75  m_o << sT->getNCopies() << " PARAMETERIZED VOLUMES(" << sT->getVolume()->getLogVol()->getName() << ")" << std::endl;
76  }
77  m_pendingTransformList.erase(m_pendingTransformList.begin(),m_pendingTransformList.end());
78  m_indented=false;
79 }
80 
81 void GeoPrintGraphAction::handleIdentifierTag (const GeoIdentifierTag *idTag)
82 {
83  if (m_identifierState) {
84  indent();
85  m_o << "NAME: " << idTag->getIdentifier() << "+";
86  }
87 }
88 
89 void GeoPrintGraphAction::setNotification (Type type, bool state)
90 {
91  if (type==TRANSFORM) {
92  m_transformState=state;
93  }
94  else if (type==VOLUME) {
95  m_volumeState=state;
96  }
97  else if (type==NAMETAG) {
98  m_nametagState=state;
99  }
100  else if (type==IDENTIFIERTAG) {
101  m_identifierState=state;
102  }
103 }
104 
105 void GeoPrintGraphAction::indent ()
106 {
107  if (!m_indented) {
108  m_indented=true;
109  for (size_t i=0;i<getPath()->getLength(); i++) {
110  m_o << " ";
111  }
112  }
113 }
114 
115 
This class generates a name for all physical volumes following it. The name is a prefix string follow...
This class represent a physical volume whose absolute default and aligned positions are known and hel...
This class gives a name to the next physical volume.
Definition: GeoNameTag.h:17
This class gives an integral identifer to the following physical volume.
const GeoLogVol * getLogVol() const
Returns the logical volume.
Definition: GeoVPhysVol.cxx:39
This class takes a physical volume and places it according to a transformation field, N times.
A basic geometrical (Euclidean) transform. Can return a GeoTrf::Transform3D. Reference counted...
Definition: GeoTransform.h:22
A GeoPhysVol is a physical volume for normal recursive access only. This means, normally, that it represents a piece of detector that nobody cares about except for tracing engines like GEANT. More specifically:
Definition: GeoPhysVol.h:31