Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ModelingParameters.cc File Reference
#include "G4ModelingParameters.hh"
#include "G4ios.hh"
#include "G4VisAttributes.hh"
#include "G4ExceptionSeverity.hh"
#include "G4SystemOfUnits.hh"
#include "G4VSolid.hh"
#include "G4DisplacedSolid.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PhysicalVolumeModel.hh"
#include "G4UnitsTable.hh"

Go to the source code of this file.

Macros

#define G4warn   G4cout
 

Functions

std::ostream & operator<< (std::ostream &os, const G4ModelingParameters &mp)
 
std::ostream & operator<< (std::ostream &os, const G4ModelingParameters::PVNameCopyNoPath &path)
 
std::ostream & operator<< (std::ostream &os, const G4ModelingParameters::PVPointerCopyNoPath &path)
 
std::ostream & operator<< (std::ostream &os, const std::vector< G4ModelingParameters::VisAttributesModifier > &vams)
 

Macro Definition Documentation

◆ G4warn

#define G4warn   G4cout

Definition at line 44 of file G4ModelingParameters.cc.

Function Documentation

◆ operator<<() [1/4]

std::ostream & operator<< ( std::ostream &  os,
const G4ModelingParameters mp 
)

Definition at line 161 of file G4ModelingParameters.cc.

162{
163 os << "Modeling parameters (warning ";
164 if (mp.fWarning) os << "true";
165 else os << "false";
166 os << "):";
167
168 const G4VisAttributes* va = mp.fpDefaultVisAttributes;
169 os << "\n Default vis. attributes: ";
170 if (va) os << *va;
171 else os << "none";
172
173 os << "\n Current requested drawing style: ";
174 switch (mp.fDrawingStyle) {
176 os << "wireframe"; break;
178 os << "hidden line removal (hlr)"; break;
180 os << "surface (hsr)"; break;
182 os << "surface and edges (hlhsr)"; break;
184 os << "cloud"; break;
185 default: os << "unrecognised"; break;
186 }
187
188 os << "\n Number of cloud points: " << mp.fNumberOfCloudPoints;
189
190 os << "\n Culling: ";
191 if (mp.fCulling) os << "on";
192 else os << "off";
193
194 os << "\n Culling invisible objects: ";
195 if (mp.fCullInvisible) os << "on";
196 else os << "off";
197
198 os << "\n Density culling: ";
199 if (mp.fDensityCulling) {
200 os << "on - invisible if density less than "
201 << mp.fVisibleDensity / (1. * g / cm3) << " g cm^-3";
202 }
203 else os << "off";
204
205 os << "\n Culling daughters covered by opaque mothers: ";
206 if (mp.fCullCovered) os << "on";
207 else os << "off";
208
209 os << "\n Colour by density: ";
210 if (mp.fCBDAlgorithmNumber <= 0) {
211 os << "inactive";
212 } else {
213 os << "Algorithm " << mp.fCBDAlgorithmNumber << ", Parameters:";
214 for (auto p: mp.fCBDParameters) {
215 os << ' ' << G4BestUnit(p,"Volumic Mass");
216 }
217 }
218
219 os << "\n Explode factor: " << mp.fExplodeFactor
220 << " about centre: " << mp.fExplodeCentre;
221
222 os << "\n No. of sides used in circle polygon approximation: "
223 << mp.fNoOfSides;
224
225 os << "\n Section (DCUT) shape (G4DisplacedSolid) pointer: ";
226 if (!mp.fpSectionSolid) os << "non-";
227 os << "null";
228
229 os << "\n Cutaway (DCUT) shape (G4DisplacedSolid) pointer: ";
230 if (!mp.fpCutawaySolid) os << "non-";
231 os << "null";
232
233 os << "\n Event pointer: " << mp.fpEvent;
234
235 os << "\n Vis attributes modifiers: ";
236 const std::vector<G4ModelingParameters::VisAttributesModifier>& vams =
237 mp.fVisAttributesModifiers;
238 if (vams.empty()) {
239 os << "None";
240 } else {
241 os << vams;
242 }
243
244 os << "\n Special Mesh Rendering: ";
245 if (mp.fSpecialMeshRendering) {
246 os << "on: ";
247 if (mp.fSpecialMeshVolumes.empty()) {
248 os << "all meshes";
249 } else {
250 os << "selected meshes";
251 for (const auto& vol: mp.fSpecialMeshVolumes) {
252 os << "\n " << vol.GetName() << ':' << vol.GetCopyNo();
253 }
254 }
255 } else os << "off";
256
257 return os;
258}
#define G4BestUnit(a, b)

◆ operator<<() [2/4]

std::ostream & operator<< ( std::ostream &  os,
const G4ModelingParameters::PVNameCopyNoPath path 
)

Definition at line 365 of file G4ModelingParameters.cc.

367{
368 os << "Touchable path: ";
369 if (path.empty()) {
370 os << "empty";
371 } else {
372 os << "physical-volume-name:copy-number pairs:\n ";
374 for (i = path.begin(); i != path.end(); ++i) {
375 if (i != path.begin()) {
376 os << ',';
377 }
378 os << i->GetName() << ':' << i->GetCopyNo();
379 }
380 }
381 return os;
382}
PVNameCopyNoPath::const_iterator PVNameCopyNoPathConstIterator

◆ operator<<() [3/4]

std::ostream & operator<< ( std::ostream &  os,
const G4ModelingParameters::PVPointerCopyNoPath path 
)

Definition at line 397 of file G4ModelingParameters.cc.

399{
400 os << "Touchable path: physical-volume-pointer:copy-number pairs:\n ";
402 for (i = path.begin(); i != path.end(); ++i) {
403 if (i != path.begin()) {
404 os << ',';
405 }
406 os << '(' << (void*)(i->GetPVPointer()) << ')' << i->GetName() << ':' << i->GetCopyNo();
407 }
408 return os;
409}
PVPointerCopyNoPath::const_iterator PVPointerCopyNoPathConstIterator

◆ operator<<() [4/4]

std::ostream & operator<< ( std::ostream &  os,
const std::vector< G4ModelingParameters::VisAttributesModifier > &  vams 
)

Definition at line 411 of file G4ModelingParameters.cc.

414{
415 std::vector<G4ModelingParameters::VisAttributesModifier>::const_iterator
416 iModifier;
417 for (iModifier = vams.begin();
418 iModifier != vams.end();
419 ++iModifier) {
421 iModifier->GetPVNameCopyNoPath();
422 os << '\n' << vamPath;
423 const G4VisAttributes& vamVisAtts = iModifier->GetVisAttributes();
424 const G4Colour& c = vamVisAtts.GetColour();
425 switch (iModifier->GetVisAttributesSignifier()) {
427 os << " visibility ";
428 if (vamVisAtts.IsVisible()) {
429 os << "true";
430 } else {
431 os << "false";
432 }
433 break;
435 os << " daughtersInvisible ";
436 if (vamVisAtts.IsDaughtersInvisible()) {
437 os << "true";
438 } else {
439 os << "false";
440 }
441 break;
443 os << " colour " << c;
444 break;
446 os << " lineStyle ";
447 switch (vamVisAtts.GetLineStyle()) {
449 os << "unbroken";
450 break;
452 os << "dashed";
453 break;
455 os << "dotted";
456 }
457 break;
459 os << " lineWidth "
460 << vamVisAtts.GetLineWidth();
461 break;
464 os << " forceWireframe ";
465 if (vamVisAtts.IsForceDrawingStyle()) {
466 os << "true";
467 } else {
468 os << "false";
469 }
470 }
471 break;
473 if (vamVisAtts.GetForcedDrawingStyle() == G4VisAttributes::solid) {
474 os << " forceSolid ";
475 if (vamVisAtts.IsForceDrawingStyle()) {
476 os << "true";
477 } else {
478 os << "false";
479 }
480 }
481 break;
483 if (vamVisAtts.GetForcedDrawingStyle() == G4VisAttributes::cloud) {
484 os << " forceCloud ";
485 if (vamVisAtts.IsForceDrawingStyle()) {
486 os << "true";
487 } else {
488 os << "false";
489 }
490 }
491 break;
493 os << " numberOfCloudPoints "
494 << vamVisAtts.GetForcedNumberOfCloudPoints();
495 break;
497 os << " forceAuxEdgeVisible: ";
498 if (!vamVisAtts.IsForceDrawingStyle()) {
499 os << "not ";
500 }
501 os << " forced";
502 if (vamVisAtts.IsForceAuxEdgeVisible()) {
503 os << ": ";
504 if (vamVisAtts.IsForcedAuxEdgeVisible()) {
505 os << "true";
506 } else {
507 os << "false";
508 }
509 }
510 break;
512 os << " lineSegmentsPerCircle "
513 << vamVisAtts.GetForcedLineSegmentsPerCircle();
514 break;
515 }
516 }
517
518 return os;
519}
std::vector< PVNameCopyNo > PVNameCopyNoPath
G4int GetForcedNumberOfCloudPoints() const
G4double GetLineWidth() const
G4bool IsDaughtersInvisible() const
G4int GetForcedLineSegmentsPerCircle() const
LineStyle GetLineStyle() const
const G4Colour & GetColour() const
G4bool IsVisible() const
G4bool IsForceAuxEdgeVisible() const
G4bool IsForcedAuxEdgeVisible() const
ForcedDrawingStyle GetForcedDrawingStyle() const
G4bool IsForceDrawingStyle() const