62 fLastNonSequentialCopyNo(-99)
72 const G4String& outFileName = pSystem -> GetOutFileName();
73 if (outFileName ==
"G4cout") {
80 static G4bool firstTime =
true;
83 G4cout <<
"G4ASCIITreeSceneHandler::BeginModeling: writing to ";
84 if (outFileName ==
"G4cout") {
85 G4cout <<
"G4 standard output (G4cout)";
87 G4cout <<
"file \"" << outFileName <<
"\"";
94 if (outFileName !=
"G4cout") {
103 const G4int detail = verbosity % 10;
104 os <<
"# Set verbosity with \"/vis/ASCIITree/verbose <verbosity>\":";
109 os <<
"\n# Now printing with verbosity " << verbosity;
110 os <<
"\n# Format is: PV:n";
111 if (detail >= 1) os <<
" / LV (SD,RO)";
112 if (detail >= 2) os <<
" / Solid(type)";
113 if (detail >= 3) os <<
", volume, density";
114 if (detail >= 5) os <<
", daughter-subtracted volume and mass";
115 if (detail >= 6) os <<
", physical volume dump";
116 if (detail >= 7) os <<
", polyhedron dump";
118 "\n# Abbreviations: PV = Physical Volume, LV = Logical Volume,"
119 "\n# SD = Sensitive Detector, RO = Read Out Geometry.";
125 const G4int detail = verbosity % 10;
126 const G4String& outFileName = pSystem -> GetOutFileName();
146 std::vector<G4Scene::Model>::const_iterator i;
147 for (i = models.begin(); i != models.end(); ++i) {
160 G4cout <<
"Overall volume of \""
166 <<
" and the daughter-included mass";
169 G4cout <<
" to unlimited depth";
171 G4cout <<
", ignoring daughters at depth "
183 if (outFileName !=
"G4cout") {
185 G4cout <<
"Output file \"" << outFileName <<
"\" closed." <<
G4endl;
189 G4cout <<
"G4ASCIITreeSceneHandler::EndModeling" <<
G4endl;
197 if (!pPVModel)
return;
218 G4int detail = verbosity % 10;
226 const G4bool isAmenableToSupression =
227 (verbosity < 10 && isSimpleReplica) || (verbosity < 3 && isParameterised);
228 if (isAmenableToSupression) {
230 PVPath::const_reverse_iterator thisID = drawnPVPath.rbegin();
231 PVPath::const_reverse_iterator motherID = ++drawnPVPath.rbegin();
235 if (i->back().GetPhysicalVolume()->GetLogicalVolume() ==
236 thisID->GetPhysicalVolume()->GetLogicalVolume()) {
255 if (motherID == drawnPVPath.rend() &&
258 if (motherID != drawnPVPath.rend() &&
260 motherID->GetPhysicalVolume()->GetLogicalVolume() ==
261 (*i)[i->size() - 2].GetPhysicalVolume()->GetLogicalVolume())
275 if (verbosity < 10 && !isParameterised &&
279 if (isAmenableToSupression) {
280 G4Exception(
"G4ASCIITreeSceneHandler::RequestPrimitives",
283 "Volume amenable to suppressed printing unexpected");
314 for (
size_t i = 0; i < drawnPVPath.size(); i++ ) *
fpOutFile <<
" ";
316 <<
"\":" << currentCopyNo;
319 if (verbosity < 10) {
334 <<
" (" << nReplicas <<
" parametrised volumes)";
342 <<
" (" << nReplicas <<
" replicas)";
347 if (verbosity < 10) {
358 << pCurrentLV->
GetName() <<
"\"";
381 if (pCurrentMaterial) {
384 <<
" (" << pCurrentMaterial->
GetName() <<
")";
391 if (pCurrentMaterial) {
399 G4double daughter_subtracted_volume =
400 daughter_subtracted_mass / pCurrentMaterial->
GetDensity();
402 <<
G4BestUnit(daughter_subtracted_volume,
"Volume")
404 <<
G4BestUnit(daughter_subtracted_mass,
"Mass");
410 const std::map<G4String,G4AttDef>* attDefs = pPVModel->
GetAttDefs();
417 fRestOfLine <<
"\nLocal polyhedron coordinates:\n" << *polyhedron;
419 polyhedron->Transform(*transform);
420 fRestOfLine <<
"\nGlobal polyhedron coordinates:\n" << *polyhedron;
424 fLVSet.insert(pCurrentLV);
const std::vector< Model > & GetRunDurationModelList() const
virtual ~G4ASCIITreeSceneHandler()
const G4VPhysicalVolume * fpLastPV
system("rm -rf microbeam.root")
void DescribeYourselfTo(G4VGraphicsScene &)
G4LogicalVolume * GetLogicalVolume() const
virtual G4bool IsParameterised() const =0
G4VSensitiveDetector * GetSensitiveDetector() const
std::set< G4LogicalVolume * > fLVSet
std::vector< PVNodeID > PVPath
virtual G4Polyhedron * GetPolyhedron() const
virtual G4VPVParameterisation * GetParameterisation() const =0
G4int GetNoDaughters() const
const G4ModelingParameters * GetModelingParameters() const
virtual void RequestPrimitives(const G4VSolid &)
void WriteHeader(std::ostream &)
std::ostringstream fRestOfLine
G4ASCIITreeSceneHandler(G4VGraphicsSystem &system, const G4String &name)
void SetModelingParameters(const G4ModelingParameters *)
const G4String & GetName() const
void CurtailDescent() const
G4VPhysicalVolume * GetTopPhysicalVolume() const
G4VReadOutGeometry * GetROgeometry() const
G4Transform3D * GetCurrentTransform() const
virtual G4int GetCopyNo() const =0
const std::map< G4String, G4AttDef > * GetAttDefs() const
std::set< PVPath > fReplicaSet
G4LogicalVolume * GetCurrentLV() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4int GetVerbosity() const
G4Material * GetCurrentMaterial() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4VPhysicalVolume * GetCurrentPV() const
G4VGraphicsSystem * GetGraphicsSystem() const
const std::vector< G4PhysicalVolumeNodeID > & GetDrawnPVPath() const
virtual void GetReplicationData(EAxis &axis, G4int &nReplicas, G4double &width, G4double &offset, G4bool &consuming) const =0
G4GLOB_DLL std::ostream G4cout
static std::vector< G4String > fVerbosityGuidance
virtual G4bool IsReplicated() const =0
virtual void EndModeling()
std::set< PVPath >::iterator ReplicaSetIterator
virtual G4GeometryType GetEntityType() const =0
virtual void BeginModeling()
G4int fLastNonSequentialCopyNo
G4double GetVolume() const
virtual void EndModeling()
G4int GetRequestedDepth() const
std::vector< G4AttValue > * CreateCurrentAttValues() const
G4double GetMass(G4bool forced=false, G4bool propagate=true, G4Material *parMaterial=0)
const G4String & GetName() const
const G4String & GetName() const
virtual void BeginModeling()
G4double GetDensity() const