CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DetectorDescription/Core/interface/DDCompactView.h

Go to the documentation of this file.
00001 #ifndef DDCompactView_h
00002 #define DDCompactView_h
00003 
00004 #include <vector>
00005 
00006 //#include <memory>
00007 
00008 #include "DetectorDescription/Base/interface/Ptr.h"
00009 
00010 #include "DetectorDescription/Core/interface/DDAlgo.h"
00011 #include "DetectorDescription/Core/interface/DDCompactViewImpl.h"
00012 #include "DetectorDescription/Core/interface/graphwalker.h"
00013 
00014 
00015 class DDPartSelector;
00016 class DDPhysicalPart;
00017 namespace DDI {
00018   class Material;
00019   class Solid;
00020   class LogicalPart;
00021   class Specific;
00022 }
00023 
00024 
00031 //MEC: these comments are kept from original... Will we ever do this? don't think so.
00032 //FIXME: DDCompactView: check for proper acyclic directed graph structure!!
00033 //FIXME:
00034 //FIXME:         X          [A-X] ... LogicalPart
00035 //FIXME:        / \             | ... PosPart (directed parten to child)
00036 //FIXME:       A   A
00037 //FIXME:       |   | 
00038 //FIXME:       B   C      
00039 //FIXME:
00040 //FIXME:    THIS IS NOT ALLOWED, but currently can be specified using DDL ....
00041 //FIXME:
00042 
00043 //typedef TreeNode<DDPhysicalPart,int> expnode_t;
00045 //typedef graph<DDLogicalPart,DDPosData*> graph_type; //:typedef Graph<DDLogicalPart,DDPosData*> graph_type;
00046 
00048 
00081 class DDCompactView
00082 {
00083  
00084 public:
00086   typedef std::vector<DDLogicalPart> logchild_type;
00087   
00089   typedef std::vector< std::pair<DDLogicalPart,DDPosData*> > poschildren_type;
00090   
00092   typedef std::pair<DDLogicalPart,DDPosData*> pos_type;
00093   
00095   //:typedef GraphWalker<DDLogicalPart,DDPosData*> walker_type;
00096   typedef graphwalker<DDLogicalPart,DDPosData*> walker_type;
00097   
00099   //:typedef walker_type::value_type value_type;
00100   
00102 
00103   typedef ::graph<DDLogicalPart,DDPosData*> graph_type;
00104     
00106   explicit DDCompactView();
00107   
00109   explicit DDCompactView(const DDLogicalPart & rootnodedata);
00110   
00111   ~DDCompactView();
00112   
00114   const graph_type & graph() const;
00115 
00117   const DDLogicalPart & root() const;
00118 
00120   double weight(const DDLogicalPart & p) const;
00121 
00123   void algoPosPart(const DDLogicalPart & self,
00124                    const DDLogicalPart & parent,
00125                    DDAlgo & algo
00126                    );
00127   
00128   void position (const DDLogicalPart & self,
00129                  const DDLogicalPart & parent,
00130                  std::string copyno,
00131                  const DDTranslation & trans,
00132                  const DDRotation & rot,
00133                  const DDDivision * div = NULL);
00134   
00135   void position (const DDLogicalPart & self,
00136                  const DDLogicalPart & parent,
00137                  int copyno,
00138                  const DDTranslation & trans,
00139                  const DDRotation & rot,
00140                  const DDDivision * div = NULL);
00141   
00142   // ************************************************************************
00143   // UNSTABLE STUFF below! DON'T USE!
00144   // ************************************************************************
00145   
00147   void setRoot(const DDLogicalPart & root);
00148 
00150   walker_type walker() const;
00151 
00152   // ---------------------------------------------------------------
00153   // +++ DDCore INTERNAL USE ONLY ++++++++++++++++++++++++++++++++++
00154     
00155   // to modify the structure! DDCore internal!
00156   graph_type & writeableGraph();
00157 
00158   void swap( DDCompactView& );
00159 
00160   void lockdown();
00161   
00162  protected:
00163   DDCompactViewImpl* rep_;
00164 
00165  private:
00166     // 2010-01-27 memory patch
00167     // for copying and protecting DD Store's after parsing is complete.
00168     DDI::Store<DDName, DDI::Material*> matStore_;
00169     DDI::Store<DDName, DDI::Solid*> solidStore_;
00170     DDI::Store<DDName, DDI::LogicalPart*> lpStore_;
00171     DDI::Store<DDName, DDI::Specific*> specStore_;
00172     DDI::Store<DDName, DDRotationMatrix*> rotStore_;    
00173 
00174 };
00175 
00177 typedef DDCompactView::walker_type walker_type;
00178 #endif