本文整理汇总了C++中TGeoVolume::GetNodes方法的典型用法代码示例。如果您正苦于以下问题:C++ TGeoVolume::GetNodes方法的具体用法?C++ TGeoVolume::GetNodes怎么用?C++ TGeoVolume::GetNodes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TGeoVolume
的用法示例。
在下文中一共展示了TGeoVolume::GetNodes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main() {
TGeoNode *node = NULL;
TGeoVolume *vol = NULL;
LMCgeomN *g = new LMCgeomN("Telescope");
TObjArray *oa = g->GetGeoManager()->GetListOfNodes();
for (int i=0; i<oa->GetEntries(); i++) {
node = (TGeoNode*)oa->At(i);
vol = node->GetVolume();
cout << "= " << node->GetName() << " " << vol->GetName() <<endl;
TObjArray *vnodes = vol->GetNodes();
cout << vnodes->GetEntries() << endl;
for (int j=0; j<vnodes->GetEntries(); j++) {
node = (TGeoNode*)vnodes->At(j);
cout << "== " << node->GetName() << endl;
vol = node->GetVolume();
TObjArray *vnodes1 = vol->GetNodes();
for (int k=0; k<vnodes1->GetEntries(); k++) {
node = (TGeoNode*)vnodes1->At(k);
cout << "=== " << node->GetName() << endl;
vol = node->GetVolume();
TObjArray *vnodes2 = vol->GetNodes();
if(!vnodes2) continue;
for (int q=0; q<vnodes2->GetEntries(); q++) {
node = (TGeoNode*)vnodes2->At(q);
cout << "==== " << node->GetName() << endl;
}
}
}
}
return 0;
}
示例2: vol
GeoHandler& GeoHandler::i_collect(const TGeoNode* current, int level, Region rg, LimitSet ls) {
TGeoVolume* volume = current->GetVolume();
TObjArray* nodes = volume->GetNodes();
int num_children = nodes ? nodes->GetEntriesFast() : 0;
Volume vol(volume);
Region region = vol.region();
LimitSet limits = vol.limitSet();
if ( m_propagateRegions ) {
if ( !region.isValid() && rg.isValid() ) {
region = rg;
vol.setRegion(region);
}
if ( !limits.isValid() && ls.isValid() ) {
limits = ls;
vol.setLimitSet(limits);
}
}
(*m_data)[level].insert(current);
//printf("GeoHandler: collect level:%d %s\n",level,current->GetName());
if (num_children > 0) {
for (int i = 0; i < num_children; ++i) {
TGeoNode* node = (TGeoNode*) nodes->At(i);
i_collect(node, level + 1, region, limits);
}
}
return *this;
}
示例3: visibility_all_nodes
void visibility_all_nodes(Bool_t vis_state)
{
TGeoVolume *v;
TIter it(gGeoManager->GetListOfVolumes());
while ((v = (TGeoVolume*) it()) != 0)
{
TGeoNode *n;
TIter it2(v->GetNodes());
while ((n = (TGeoNode*) it2()) != 0)
{
n->SetVisibility(vis_state);
}
}
full_update();
}