CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DDLogicalPart.h
Go to the documentation of this file.
1 #ifndef DDLogicalPart_h
2 #define DDLogicalPart_h
3 
4 /* remove
5 //#include "DetectorDescription/Core/interface/DDMaterial.h"
6 //#include "DetectorDescription/Core/interface/DDSolid.h"
7 //class DDCompactViewImpl;
8 //class DDSpecificsImpl;
9 */
10 #include <iosfwd>
11 #include <vector>
12 #include <string>
13 #include <map>
19 //#include "DetectorDescription/Core/interface/DDPartSelection.h"
20 
21 namespace DDI { class LogicalPart; }
22 class DDMaterial;
23 class DDSolid;
24 class DDSpecifics;
25 class DDLogicalPart;
26 //class DDsvalues_type;
27 class DDPartSelection;
28 
29 std::ostream & operator<<( std::ostream &, const DDLogicalPart &);
30 
32 
95 class DDLogicalPart : public DDBase<DDName,DDI::LogicalPart*>
96 {
97  friend std::ostream & operator<<( std::ostream &, const DDLogicalPart &);
98  //friend DDCompactViewImpl;
99  //friend DDSpecificsImpl;
100 public:
102  DDLogicalPart() : DDBase<DDName,DDI::LogicalPart*>(){ }
103 
105  DDLogicalPart(const DDName & name);
106 
108  DDLogicalPart(const DDName & name,
109  const DDMaterial & material,
110  const DDSolid & solid,
112 
114  DDEnums::Category category() const; // { return rep().category(); }
115 
116 
117 
119  const DDMaterial & material() const;
120 
122  const DDSolid & solid() const;
123 
125  double & weight();
126 
128  std::vector<const DDsvalues_type *> specifics() const;
129 
132 
134  void addSpecifics(const std::pair<DDPartSelection*,DDsvalues_type*> &);
135  void removeSpecifics(const std::pair<DDPartSelection*,DDsvalues_type*> &);
136  const std::vector< std::pair<DDPartSelection*,DDsvalues_type*> > & attachedSpecifics() const;
137  bool hasDDValue(const DDValue &) const;
138  //const std::vector<DDPartSelection*> & partSelections(const DDValue &) const;
140  //const std::vector<DDSpecifics> & specifics() const;
141 
142  //std::vector<DDPosPart>& posParts() const { return rep_->posParts(); }
143 /* static void clear(); */
144 
145 private:
146  //void addSpecifics(const DDSpecifics & sp);
147  //void removeSpecifics(const DDSpecifics & sp);
148 
149  //explicit DDLogicalPart(DDRedirect<DDLogicalPartImpl>* p, bool dummy);
150 };
151 
152 
153 // some helpers .... (not very clean, redesign!!)
154 std::pair<bool,std::string> DDIsValid(const std::string & ns, const std::string & name, std::vector<DDLogicalPart> & result,bool doRegex=true);
155 // std::maps name to std::vector of namespaces
156 // 2009-2010 re-write...FIX: Understand how this is used by DDSpecifics and FIX
158 void DD_NC(const DDName &);
159 
160 #endif
Definition: DDBase.h:18
bool hasDDValue(const DDValue &) const
const DDName & name() const
Definition: DDBase.h:88
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
std::vector< const DDsvalues_type * > specifics() const
returns the specific-data attached to the LogicalPart only (not to a DDExpandedNode) ...
friend std::ostream & operator<<(std::ostream &, const DDLogicalPart &)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
const DDMaterial & material() const
Returns a reference object of the material this LogicalPart is made of.
DDLogicalPart()
The default constructor provides an uninitialzed reference object.
A DDSolid represents the shape of a part.
Definition: DDSolid.h:42
const std::vector< std::pair< DDPartSelection *, DDsvalues_type * > > & attachedSpecifics() const
void addSpecifics(const std::pair< DDPartSelection *, DDsvalues_type * > &)
don&#39;t use, internal only /todo make it private
tuple result
Definition: query.py:137
void DD_NC(const DDName &)
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::maps an index to a DDValue. The index corresponds to the index assigned to the name of the std::...
Definition: DDsvalues.h:19
Category
Definition: DDEnums.h:7
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:95
DDsvalues_type mergedSpecifics() const
returns the merged-specifics, i.e. the last specified specifics of this logical-part ...
DDI::Singleton< std::map< std::string, std::vector< DDName > > > LPNAMES
void removeSpecifics(const std::pair< DDPartSelection *, DDsvalues_type * > &)
const DDSolid & solid() const
Returns a reference object of the solid being the shape of this LogicalPart.
std::pair< bool, std::string > DDIsValid(const std::string &ns, const std::string &name, std::vector< DDLogicalPart > &result, bool doRegex=true)
double & weight()
Weight of the LogicalPart viewed as a component, if cached, else -1.
DDEnums::Category category() const
Returns the categorization of the DDLogicalPart (sensitive detector element, cable, ...)
Interface to attach user specific data to nodes in the expanded-view.
Definition: DDSpecifics.h:40