60 fLastNonSequentialCopyNo(-99)
70 const G4String& outFileName = pSystem -> GetOutFileName();
71 if (outFileName ==
"G4cout") {
78 G4cout <<
"G4ASCIITreeSceneHandler::BeginModeling: writing to ";
79 if (outFileName ==
"G4cout") {
80 G4cout <<
"G4 standard output (G4cout)";
82 G4cout <<
"file \"" << outFileName <<
"\"";
87 if (outFileName !=
"G4cout") {
96 const G4int detail = verbosity % 10;
97 os <<
"# Set verbosity with \"/vis/ASCIITree/verbose <verbosity>\":";
102 os <<
"\n# Now printing with verbosity " << verbosity;
103 os <<
"\n# Format is: PV:n";
104 if (detail >= 1) os <<
" / LV (SD,RO)";
105 if (detail >= 2) os <<
" / Solid(type)";
106 if (detail >= 3) os <<
", volume, density";
107 if (detail >= 5) os <<
", daughter-subtracted volume and mass";
109 "\n# Abbreviations: PV = Physical Volume, LV = Logical Volume,"
110 "\n# SD = Sensitive Detector, RO = Read Out Geometry.";
116 const G4int detail = verbosity % 10;
117 const G4String& outFileName = pSystem -> GetOutFileName();
137 std::vector<G4Scene::Model>::const_iterator i;
138 for (i = models.begin(); i != models.end(); ++i) {
154 G4cout <<
"Overall volume of \""
160 <<
" and the daughter-included mass";
163 G4cout <<
" to unlimited depth";
165 G4cout <<
", ignoring daughters at depth "
178 if (outFileName !=
"G4cout") {
180 G4cout <<
"Output file \"" << outFileName <<
"\" closed." <<
G4endl;
184 G4cout <<
"G4ASCIITreeSceneHandler::EndModeling" <<
G4endl;
192 if (!pPVModel)
return;
211 G4int detail = verbosity % 10;
213 if (verbosity < 10 && pCurrentPV->IsReplicated()) {
215 PVPath::const_reverse_iterator thisID = drawnPVPath.rbegin();
216 PVPath::const_reverse_iterator motherID = ++drawnPVPath.rbegin();
220 if (i->back().GetPhysicalVolume()->GetLogicalVolume() ==
221 thisID->GetPhysicalVolume()->GetLogicalVolume()) {
240 if (motherID == drawnPVPath.rend() &&
243 if (motherID != drawnPVPath.rend() &&
245 motherID->GetPhysicalVolume()->GetLogicalVolume() ==
246 (*i)[i->size() - 2].GetPhysicalVolume()->GetLogicalVolume())
259 if (verbosity < 10 &&
266 G4Exception(
"G4ASCIITreeSceneHandler::RequestPrimitives",
269 "Replica unexpected");
299 for (
size_t i = 0; i < drawnPVPath.size(); i++ ) *
fpOutFile <<
" ";
302 <<
"\":" << currentCopyNo;
305 if (verbosity < 10) {
320 <<
" (" << nReplicas <<
" parametrised volumes)";
328 <<
" (" << nReplicas <<
" replicas)";
333 if (verbosity < 10) {
344 << pCurrentLV->
GetName() <<
"\"";
367 if (pCurrentMaterial) {
370 <<
" (" << pCurrentMaterial->
GetName() <<
")";
377 if (pCurrentMaterial) {
385 G4double daughter_subtracted_volume =
386 daughter_subtracted_mass / pCurrentMaterial->
GetDensity();
388 <<
G4BestUnit(daughter_subtracted_volume,
"Volume")
390 <<
G4BestUnit(daughter_subtracted_mass,
"Mass");
395 fLVSet.insert(pCurrentLV);
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4DLLIMPORT 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
G4int GetNoDaughters() const
G4double GetMass(G4bool forced=false, G4bool propagate=true, G4Material *parMaterial=0)
G4VSensitiveDetector * GetSensitiveDetector() const
G4double GetDensity() const
const G4String & GetName() const
G4VPhysicalVolume * GetWorldVolume() const
G4double GetVolume() const
const std::vector< G4PhysicalVolumeNodeID > & GetDrawnPVPath() const
G4int GetRequestedDepth() const
G4VPhysicalVolume * GetCurrentPV() const
void DescribeYourselfTo(G4VGraphicsScene &)
G4LogicalVolume * GetCurrentLV() const
G4VPhysicalVolume * GetTopPhysicalVolume() const
G4Material * GetCurrentMaterial() const
const std::vector< Model > & GetRunDurationModelList() const
static G4TransportationManager * GetTransportationManager()
G4Navigator * GetNavigatorForTracking() 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 G4GeometryType GetEntityType() const =0
virtual void EndModeling()
virtual void BeginModeling()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)