CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/DetectorDescription/Core/interface/DDExpandedView.h

Go to the documentation of this file.
00001 #ifndef DDExpandedView_h
00002 #define DDExpandedView_h
00003 
00004 #include <iosfwd>
00005 #include <vector>
00006 #include <string>
00007 #include <map>
00008 
00009 #include "DetectorDescription/Core/interface/DDTransform.h"
00010 #include "DetectorDescription/Base/interface/DDTranslation.h"
00011 #include "DetectorDescription/Core/interface/DDCompactView.h"
00012 #include "DetectorDescription/Core/interface/DDLogicalPart.h"
00013 #include "DetectorDescription/Core/interface/DDPosData.h"
00014 #include "DetectorDescription/Core/interface/DDExpandedNode.h"
00015 #include "DetectorDescription/Core/interface/DDsvalues.h"
00016 
00017 class DDFilteredView;
00018 
00029 
00030 
00035 class DDExpandedView
00036 {
00037   friend class DDFilteredView;
00038   
00039 public:
00041   typedef std::vector<int> nav_type;
00042   typedef std::pair<int const *, size_t> NavRange;
00043   
00045   DDExpandedView(const DDCompactView &);
00046   
00047   virtual ~DDExpandedView();
00048   
00050   const DDLogicalPart & logicalPart() const;
00051   
00053   const DDTranslation & translation() const;
00054   
00056   const DDRotationMatrix & rotation() const;
00057   
00059   const DDGeoHistory & geoHistory() const;
00060   
00062   bool goTo(const nav_type &);
00063   bool goTo(NavRange);
00064   bool goTo(int const * newpos, size_t sz);
00065 
00067   nav_type navPos() const;
00068   
00070   nav_type copyNumbers() const;
00071   
00073   std::vector<const DDsvalues_type * > specifics() const;
00074   void specificsV(std::vector<const DDsvalues_type * > & vc ) const;
00075 
00076   DDsvalues_type mergedSpecifics() const;
00077   void mergedSpecificsV(DDsvalues_type & res) const;
00078   
00080   int copyno() const;
00081   
00082   // navigation 
00083 
00085   const DDGeoHistory & scope() const;
00086   
00088   bool setScope(const DDGeoHistory & hist, int depth=0);
00089   
00091   void clearScope();
00092   
00094   int depth() const;
00095     
00097   bool next(); 
00098   
00100   bool nextB();
00101   
00103   bool nextSibling();
00104   
00106   bool firstChild();
00107   
00109   bool parent();
00110   
00112   //bool hasChildren() const;
00113   
00115   void reset();
00116   
00122   /* was protected, now public; was named goTo, now goToHistory*/
00123   bool goToHistory(const DDGeoHistory & sc);
00124   
00125 protected:
00126   bool descend(const DDGeoHistory & sc);
00127 
00128 protected:
00129   DDCompactView::walker_type * walker_; 
00130   DDCompactView::walker_type w2_;
00131   const DDTranslation trans_;
00132   const DDRotationMatrix rot_;
00133   DDGeoHistory history_; 
00134   DDGeoHistory scope_; 
00135   unsigned int depth_; 
00136   DDPosData * worldpos_ ; 
00137   std::vector<nav_type> nextBStack_;
00138   //std::map<std::string,std::string> dummySpecifics_;    
00139 };
00140 
00141 std::ostream & printNavType(std::ostream &, int const * n, size_t sz);
00142 inline std::ostream & operator<<(std::ostream & os, const DDExpandedView::nav_type & n) {
00143     return printNavType(os,&n.front(),n.size());
00144 }
00145 inline std::ostream & operator<<(std::ostream & os, const DDExpandedView::NavRange & n) {
00146     return printNavType(os,n.first,n.second);
00147 }
00148 #endif