CMS 3D CMS Logo

Functions

/data/refman/pasoursint/CMSSW_5_3_1/src/DetectorDescription/Core/src/hierarchy.h File Reference

Go to the source code of this file.

Functions

void hierarchy (const DDLogicalPart &)

Function Documentation

void hierarchy ( const DDLogicalPart )

Definition at line 168 of file hierarchy.cc.

References prof2calltree::count, gather_cfg::cout, DDBase< N, C >::ddname(), graph< N, E >::edges(), g, generateHtml(), DDCompactView::graph(), hierarchy(), DDLogicalPart::material(), DDBase< N, C >::name(), graph< N, E >::nodeData(), DDName::ns(), and writeMaterials().

Referenced by hierarchy().

{
  static  DDCompactView cpv ;
  static DDCompactView::graph_type g = cpv.graph();
  static int count=0;
  static std::vector<DDLogicalPart> history;
  static std::map<std::string,std::set<DDMaterial> > materials;
  //DDCompactView::graph_type::adj_iterator it = g.begin();
  
  history.push_back(parent);
  materials[parent.material().name().ns()].insert(parent.material());
  std::cout << history.size() << std::string(2*count,' ') << " " << parent.ddname() << std::endl;
  DDCompactView::graph_type::edge_range er = g.edges(parent);
  DDCompactView::graph_type::edge_iterator eit = er.first;
  std::map<DDLogicalPart,int> children;
  for (; eit != er.second; ++eit) {  
     children[g.nodeData(*eit)]++;
  }
  
  generateHtml(history,children);
  
  std::map<DDLogicalPart,int>::iterator cit = children.begin();
  for (; cit != children.end(); ++cit) {
     ++count;
     hierarchy(cit->first);
     history.pop_back();
     --count;
  }
  
  writeMaterials(materials);
}