61 fLastNonSequentialCopyNo(-99)
71 const G4String& outFileName = pSystem -> GetOutFileName();
72 if (outFileName ==
"G4cout") {
79 static G4bool firstTime =
true;
82 G4cout <<
"G4ASCIITreeSceneHandler::BeginModeling: writing to ";
83 if (outFileName ==
"G4cout") {
84 G4cout <<
"G4 standard output (G4cout)";
86 G4cout <<
"file \"" << outFileName <<
"\"";
93 if (outFileName !=
"G4cout") {
102 const G4int detail = verbosity % 10;
103 os <<
"# Set verbosity with \"/vis/ASCIITree/verbose <verbosity>\":";
108 os <<
"\n# Now printing with verbosity " << verbosity;
109 os <<
"\n# Format is: PV:n";
110 if (detail >= 1) os <<
" / LV (SD,RO)";
111 if (detail >= 2) os <<
" / Solid(type)";
112 if (detail >= 3) os <<
", volume, density";
113 if (detail >= 5) os <<
", daughter-subtracted volume and mass";
114 if (detail >= 6) os <<
", physical volume dump";
115 if (detail >= 7) os <<
", polyhedron dump";
117 "\n# Abbreviations: PV = Physical Volume, LV = Logical Volume,"
118 "\n# SD = Sensitive Detector, RO = Read Out Geometry.";
124 const G4int detail = verbosity % 10;
125 const G4String& outFileName = pSystem -> GetOutFileName();
145 std::vector<G4Scene::Model>::const_iterator i;
146 for (i = models.begin(); i != models.end(); ++i) {
159 G4cout <<
"Overall volume of \""
165 <<
" and the daughter-included mass";
168 G4cout <<
" to unlimited depth";
170 G4cout <<
", ignoring daughters at depth "
182 if (outFileName !=
"G4cout") {
184 G4cout <<
"Output file \"" << outFileName <<
"\" closed." <<
G4endl;
188 G4cout <<
"G4ASCIITreeSceneHandler::EndModeling" <<
G4endl;
196 if (!pPVModel)
return;
217 G4int detail = verbosity % 10;
225 const G4bool isAmenableToSupression =
226 (verbosity < 10 && isSimpleReplica) || (verbosity < 3 && isParameterised);
227 if (isAmenableToSupression) {
229 PVPath::const_reverse_iterator thisID = drawnPVPath.rbegin();
230 PVPath::const_reverse_iterator motherID = ++drawnPVPath.rbegin();
234 if (i->back().GetPhysicalVolume()->GetLogicalVolume() ==
235 thisID->GetPhysicalVolume()->GetLogicalVolume()) {
254 if (motherID == drawnPVPath.rend() &&
257 if (motherID != drawnPVPath.rend() &&
259 motherID->GetPhysicalVolume()->GetLogicalVolume() ==
260 (*i)[i->size() - 2].GetPhysicalVolume()->GetLogicalVolume())
274 if (verbosity < 10 && !isParameterised &&
278 if (isAmenableToSupression) {
279 G4Exception(
"G4ASCIITreeSceneHandler::RequestPrimitives",
282 "Volume amenable to suppressed printing unexpected");
313 for (
size_t i = 0; i < drawnPVPath.size(); i++ ) *
fpOutFile <<
" ";
315 <<
"\":" << currentCopyNo;
318 if (verbosity < 10) {
333 <<
" (" << nReplicas <<
" parametrised volumes)";
341 <<
" (" << nReplicas <<
" replicas)";
346 if (verbosity < 10) {
357 << pCurrentLV->
GetName() <<
"\"";
380 if (pCurrentMaterial) {
383 <<
" (" << pCurrentMaterial->
GetName() <<
")";
390 if (pCurrentMaterial) {
398 G4double daughter_subtracted_volume =
399 daughter_subtracted_mass / pCurrentMaterial->
GetDensity();
401 <<
G4BestUnit(daughter_subtracted_volume,
"Volume")
403 <<
G4BestUnit(daughter_subtracted_mass,
"Mass");
409 const std::map<G4String,G4AttDef>* attDefs = pPVModel->
GetAttDefs();
416 fRestOfLine <<
"\nLocal polyhedron coordinates:\n" << *polyhedron;
419 fRestOfLine <<
"\nGlobal polyhedron coordinates:\n" << *polyhedron;
423 fLVSet.insert(pCurrentLV);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
static std::vector< G4String > fVerbosityGuidance
virtual ~G4ASCIITreeSceneHandler()
const G4VPhysicalVolume * fpLastPV
std::vector< PVNodeID > PVPath
virtual void BeginModeling()
G4ASCIITreeSceneHandler(G4VGraphicsSystem &system, const G4String &name)
G4int fLastNonSequentialCopyNo
virtual void EndModeling()
std::ostringstream fRestOfLine
void WriteHeader(std::ostream &)
std::set< PVPath >::iterator ReplicaSetIterator
virtual void RequestPrimitives(const G4VSolid &)
std::set< G4LogicalVolume * > fLVSet
std::set< PVPath > fReplicaSet
G4int GetVerbosity() const
G4double GetMass(G4bool forced=false, G4bool propagate=true, G4Material *parMaterial=nullptr)
G4VSensitiveDetector * GetSensitiveDetector() const
std::size_t GetNoDaughters() const
const G4String & GetName() const
G4double GetDensity() const
const G4String & GetName() const
G4double GetVolume() const
const std::vector< G4PhysicalVolumeNodeID > & GetDrawnPVPath() const
G4int GetRequestedDepth() const
const G4Transform3D & GetCurrentTransform() const
G4VPhysicalVolume * GetCurrentPV() const
std::vector< G4AttValue > * CreateCurrentAttValues() const
void CurtailDescent() const
void DescribeYourselfTo(G4VGraphicsScene &)
G4LogicalVolume * GetCurrentLV() const
G4VPhysicalVolume * GetTopPhysicalVolume() const
G4Material * GetCurrentMaterial() const
const std::map< G4String, G4AttDef > * GetAttDefs() const
const std::vector< Model > & GetRunDurationModelList() const
const G4ModelingParameters * GetModelingParameters() const
void SetModelingParameters(const G4ModelingParameters *)
virtual G4bool IsReplicated() const =0
G4LogicalVolume * GetLogicalVolume() const
virtual void GetReplicationData(EAxis &axis, G4int &nReplicas, G4double &width, G4double &offset, G4bool &consuming) const =0
virtual G4int GetCopyNo() const =0
const G4String & GetName() const
virtual G4VPVParameterisation * GetParameterisation() const =0
virtual G4bool IsParameterised() const =0
G4VGraphicsSystem * GetGraphicsSystem() const
G4VReadOutGeometry * GetROgeometry() const
virtual G4Polyhedron * GetPolyhedron() const
virtual G4GeometryType GetEntityType() const =0
virtual void EndModeling()
virtual void BeginModeling()
HepPolyhedron & Transform(const G4Transform3D &t)