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;
216 G4int detail = verbosity % 10;
218 if (verbosity < 10 && pCurrentPV->IsReplicated()) {
220 PVPath::const_reverse_iterator thisID = drawnPVPath.rbegin();
221 PVPath::const_reverse_iterator motherID = ++drawnPVPath.rbegin();
225 if (i->back().GetPhysicalVolume()->GetLogicalVolume() ==
226 thisID->GetPhysicalVolume()->GetLogicalVolume()) {
245 if (motherID == drawnPVPath.rend() &&
248 if (motherID != drawnPVPath.rend() &&
250 motherID->GetPhysicalVolume()->GetLogicalVolume() ==
251 (*i)[i->size() - 2].GetPhysicalVolume()->GetLogicalVolume())
264 if (verbosity < 10 &&
271 G4Exception(
"G4ASCIITreeSceneHandler::RequestPrimitives",
274 "Replica unexpected");
304 for (
size_t i = 0; i < drawnPVPath.size(); i++ ) *
fpOutFile <<
" ";
307 <<
"\":" << currentCopyNo;
310 if (verbosity < 10) {
325 <<
" (" << nReplicas <<
" parametrised volumes)";
333 <<
" (" << nReplicas <<
" replicas)";
338 if (verbosity < 10) {
349 << pCurrentLV->
GetName() <<
"\"";
372 if (pCurrentMaterial) {
375 <<
" (" << pCurrentMaterial->
GetName() <<
")";
382 if (pCurrentMaterial) {
390 G4double daughter_subtracted_volume =
391 daughter_subtracted_mass / pCurrentMaterial->
GetDensity();
393 <<
G4BestUnit(daughter_subtracted_volume,
"Volume")
395 <<
G4BestUnit(daughter_subtracted_mass,
"Mass");
401 const std::map<G4String,G4AttDef>* attDefs = pPVModel->
GetAttDefs();
408 fRestOfLine <<
"\nLocal polyhedron coordinates:\n" << *polyhedron;
410 polyhedron->Transform(*transform);
411 fRestOfLine <<
"\nGlobal polyhedron coordinates:\n" << *polyhedron;
415 fLVSet.insert(pCurrentLV);
virtual G4Polyhedron * GetPolyhedron() const
const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual G4bool IsReplicated() const =0
const G4String & GetName() const
G4Material * GetCurrentMaterial() const
G4double GetDensity() const
const G4ModelingParameters * GetModelingParameters() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4ASCIITreeSceneHandler(G4VGraphicsSystem &system, const G4String &name)
virtual G4GeometryType GetEntityType() const =0
const std::vector< G4PhysicalVolumeNodeID > & GetDrawnPVPath() const
void SetModelingParameters(const G4ModelingParameters *)
std::set< PVPath > fReplicaSet
std::vector< PVNodeID > PVPath
static std::vector< G4String > fVerbosityGuidance
virtual void BeginModeling()
virtual void RequestPrimitives(const G4VSolid &)
virtual void EndModeling()
std::set< PVPath >::iterator ReplicaSetIterator
G4GLOB_DLL std::ostream G4cout
G4Transform3D * GetCurrentTransform() const
const G4String & GetName() const
const std::vector< Model > & GetRunDurationModelList() const
virtual G4VPVParameterisation * GetParameterisation() const =0
G4VReadOutGeometry * GetROgeometry() const
G4VGraphicsSystem * GetGraphicsSystem() const
G4int GetNoDaughters() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4VPhysicalVolume * GetTopPhysicalVolume() const
virtual G4bool IsParameterised() const =0
G4double GetVolume() const
G4int GetRequestedDepth() const
G4int GetVerbosity() const
G4LogicalVolume * GetLogicalVolume() const
std::vector< G4AttValue > * CreateCurrentAttValues() const
virtual void EndModeling()
virtual G4int GetCopyNo() const =0
G4int fLastNonSequentialCopyNo
const G4VPhysicalVolume * fpLastPV
virtual ~G4ASCIITreeSceneHandler()
virtual void GetReplicationData(EAxis &axis, G4int &nReplicas, G4double &width, G4double &offset, G4bool &consuming) const =0
void WriteHeader(std::ostream &)
G4double GetMass(G4bool forced=false, G4bool propagate=true, G4Material *parMaterial=0)
const G4String & GetName() const
G4LogicalVolume * GetCurrentLV() const
G4VPhysicalVolume * GetCurrentPV() const
std::set< G4LogicalVolume * > fLVSet
G4VSensitiveDetector * GetSensitiveDetector() const
virtual void BeginModeling()
void CurtailDescent() const
std::ostringstream fRestOfLine
void DescribeYourselfTo(G4VGraphicsScene &)