CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_2_9_HLT1_bphpatch4/src/DetectorDescription/Core/interface/DDLogicalPart.h

Go to the documentation of this file.
00001 #ifndef DDLogicalPart_h
00002 #define DDLogicalPart_h
00003 
00004 /* remove 
00005 //#include "DetectorDescription/Core/interface/DDMaterial.h"
00006 //#include "DetectorDescription/Core/interface/DDSolid.h"
00007 //class DDCompactViewImpl;
00008 //class DDSpecificsImpl;
00009 */ 
00010 #include <iosfwd>
00011 #include <vector>
00012 #include <string>
00013 #include <map>
00014 #include "DetectorDescription/Core/interface/DDName.h"
00015 #include "DetectorDescription/Core/interface/DDBase.h"
00016 #include "DetectorDescription/Core/interface/DDEnums.h"
00017 #include "DetectorDescription/Base/interface/Singleton.h"
00018 #include "DetectorDescription/Core/interface/DDsvalues.h"
00019 //#include "DetectorDescription/Core/interface/DDPartSelection.h"
00020 
00021 namespace DDI { class LogicalPart; }
00022 class DDMaterial;
00023 class DDSolid;
00024 class DDSpecifics;
00025 class DDLogicalPart;
00026 //class DDsvalues_type;
00027 class DDPartSelection;
00028 
00029 std::ostream & operator<<( std::ostream &, const DDLogicalPart &);
00030 
00032 
00095 class DDLogicalPart : public DDBase<DDName,DDI::LogicalPart*>
00096 {
00097   friend std::ostream & operator<<( std::ostream &, const DDLogicalPart &);
00098   //friend DDCompactViewImpl;
00099   //friend DDSpecificsImpl;
00100 public:  
00102   DDLogicalPart() : DDBase<DDName,DDI::LogicalPart*>(){ }   
00103   
00105   DDLogicalPart(const DDName & name);
00106     
00108   DDLogicalPart(const DDName & name,
00109                 const DDMaterial & material,
00110                 const DDSolid & solid,
00111                 DDEnums::Category cat=DDEnums::unspecified);
00112   
00114   DDEnums::Category category() const; // { return rep().category(); }
00115   
00116 
00117     
00119   const DDMaterial & material() const;
00120   
00122   const DDSolid & solid() const; 
00123   
00125   double & weight();
00126   
00128   std::vector<const DDsvalues_type *> specifics() const;
00129   
00131   DDsvalues_type mergedSpecifics() const;
00132   
00134   void addSpecifics(const std::pair<DDPartSelection*,DDsvalues_type*> &);
00135   void removeSpecifics(const std::pair<DDPartSelection*,DDsvalues_type*> &);
00136   const std::vector< std::pair<DDPartSelection*,DDsvalues_type*> > & attachedSpecifics() const;
00137   bool hasDDValue(const DDValue &) const;
00138   //const std::vector<DDPartSelection*> & partSelections(const DDValue &) const;
00140   //const std::vector<DDSpecifics> & specifics() const;
00141   
00142   //std::vector<DDPosPart>& posParts() const { return rep_->posParts(); }
00143 /*   static void clear(); */
00144   
00145 private:  
00146   //void addSpecifics(const DDSpecifics & sp);
00147   //void removeSpecifics(const DDSpecifics & sp);
00148   
00149   //explicit DDLogicalPart(DDRedirect<DDLogicalPartImpl>* p, bool dummy);
00150 };
00151 
00152 
00153 // some helpers .... (not very clean, redesign!!)
00154 std::pair<bool,std::string> DDIsValid(const std::string & ns, const std::string & name, std::vector<DDLogicalPart> & result,bool doRegex=true);
00155 // std::maps name to std::vector of namespaces
00156 // 2009-2010 re-write...FIX: Understand how this is used by DDSpecifics and FIX
00157 typedef DDI::Singleton<std::map<std::string,std::vector<DDName> > > LPNAMES;
00158 void DD_NC(const DDName &);
00159 
00160 #endif