35std::map<G4SceneTreeItem::Type, G4String> G4SceneTreeItem::fTypeMap = {
49 for (
auto& child : fChildren)
50 child.ResetVisibility();
55 std::list<G4SceneTreeItem>::iterator& foundIter)
59 ed <<
"Not a root item:\n";
65 for (
auto& aModel : fChildren) {
66 if (aModel.fModelType ==
"G4PhysicalVolumeModel") {
69 auto iter = aModel.fChildren.begin();
70 auto iterEnd = aModel.fChildren.end();
71 std::istringstream iss(fullPathString);
73 while (iss >> name >> copyNo) {
74 partialPathString +=
' ' + name +
' ' + copyNo;
75 for (; iter != iterEnd; ++iter) {
76 if (iter->fPVPath == partialPathString) {
77 if (partialPathString != fullPathString) {
79 iter = iter->fChildren.begin();
80 iterEnd = iter->fChildren.end();
85 if (iter != iterEnd) {
98 static G4bool first =
true;
101 os <<
" Verbosity actions:"
103 <<
"\n >=1 a few lines"
104 <<
"\n >=2 check G4Atts"
105 <<
"\n >=3 print G4Atts"
106 <<
"\n >=4 print some attValues"
122 status = (fVisAttributes.
IsVisible() ?
"active" :
"inactive");
127 status = (fVisAttributes.
IsVisible() ?
"visible" :
"invisible");
131 status +=
",expanded";
133 status +=
",collapsed";
146 description =
" \"" + fModelDescription +
'"';
151 description =
" (" + fPVPath.substr(1, fPVPath.length() - 1) +
')';
161 if (verbosity >= 1) {
165 <<
"\n " << fChildren.size() << (fChildren.size()==1?
" child":
" children");
169 if (verbosity >= 2) {
172 if (attDefs ==
nullptr || attValues ==
nullptr) {
173 os <<
"\n No G4Atts";
177 if (attCheck.
Check(
"G4SceneTreeItem::Dump")) {
179 ed <<
"Item: " << attCheck;
181 "G4Atts don't check out");
185 if (verbosity >= 3) {
186 os <<
"\n G4Atts:\n" << attCheck;
187 static G4bool first1 =
true;
190 os <<
"\n Available G4Atts for touchable:";
193 os <<
"\n " << att.first
194 <<
',' << att.second.GetName()
195 <<
',' << att.second.GetDesc()
196 <<
',' << att.second.GetCategory()
197 <<
',' << att.second.GetExtra()
198 <<
',' << att.second.GetValueType()
199 <<
',' << att.second.GetTypeKey();
206 if (verbosity >= 4) {
207 for (
G4String name : {
"PVPath",
"GlobalExtent"}) {
209 const auto& iterAttDef = attDefs->find(name);
210 if (iterAttDef != attDefs->end()) {
211 result = result +
"\n " + iterAttDef->second.GetName();
212 result = result +
", " + iterAttDef->second.GetDesc();
215 for (
const auto& attValue : *attValues) {
217 if (attValue.GetName() == name) {
218 pAttValue = &attValue;
223 result = result +
", " + pAttValue->
GetValue();
238 static G4int depth = 0;
239 for (
G4int i = 0; i < depth; i++) os <<
" ";
243 child.DumpTree(os, verbosity);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4bool Check(const G4String &leader="") const
const G4String & GetValue() const
void DumpTree(std::ostream &, G4int verbosity=0) const
G4bool FindTouchableFromRoot(const G4String &fullPathString, std::list< G4SceneTreeItem >::iterator &foundIter)
const G4String & GetDescription() const
const std::list< G4SceneTreeItem > & GetChildren() const
const G4String & GetModelDescription() const
const G4String & GetTypeString() const
const std::map< G4String, G4AttDef > * GetAttDefs() const
void DumpSingleItem(std::ostream &, G4int verbosity=0) const
const G4String & GetModelType() const
std::vector< G4AttValue > * GetAttValues() const
void SetVisibility(G4bool=true)
const G4Colour & GetColour() const