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 #include <iosfwd>
5 #include <vector>
6 #include <string>
7 #include <map>
13 
14 namespace DDI { class LogicalPart; }
15 
16 class DDMaterial;
17 class DDSolid;
18 class DDSpecifics;
19 class DDLogicalPart;
20 class DDPartSelection;
21 
22 std::ostream & operator<<( std::ostream &, const DDLogicalPart &);
23 
25 
88 class DDLogicalPart : public DDBase<DDName,DDI::LogicalPart*>
89 {
90  friend std::ostream & operator<<( std::ostream &, const DDLogicalPart &);
91 
92 public:
94  DDLogicalPart( void ) : DDBase<DDName,DDI::LogicalPart*>(){ }
95 
97  DDLogicalPart( const DDName & name );
98 
100  DDLogicalPart( const DDName & name,
101  const DDMaterial & material,
102  const DDSolid & solid,
104 
106  DDEnums::Category category( void ) const;
107 
109  const DDMaterial & material( void ) const;
110 
112  const DDSolid & solid( void ) const;
113 
115  double & weight( void );
116 
118  std::vector<const DDsvalues_type *> specifics( void ) const;
119 
121  DDsvalues_type mergedSpecifics( void ) const;
122 
124  void addSpecifics( const std::pair<const DDPartSelection*, const DDsvalues_type*> &);
125  void removeSpecifics( const std::pair<DDPartSelection*,DDsvalues_type*> &);
126  const std::vector< std::pair<const DDPartSelection*, const DDsvalues_type*> > & attachedSpecifics( void ) const;
127  bool hasDDValue( const DDValue & ) const;
128 };
129 
130 // some helpers .... (not very clean, redesign!!)
131 std::pair<bool, std::string>
132 DDIsValid( const std::string & ns, const std::string & name, std::vector<DDLogicalPart> & result, bool doRegex = true );
133 // std::maps name to std::vector of namespaces
134 // 2009-2010 re-write...FIX: Understand how this is used by DDSpecifics and FIX
136 void DD_NC( const DDName & );
137 
138 #endif
Definition: DDBase.h:10
bool hasDDValue(const DDValue &) const
const DDName & name() const
Definition: DDBase.h:78
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
DDEnums::Category category(void) const
Returns the categorization of the DDLogicalPart (sensitive detector element, cable, ...)
friend std::ostream & operator<<(std::ostream &, const DDLogicalPart &)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:14
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
double & weight(void)
Weight of the LogicalPart viewed as a component, if cached, else -1.
A DDSolid represents the shape of a part.
Definition: DDSolid.h:35
std::vector< const DDsvalues_type * > specifics(void) const
returns the specific-data attached to the LogicalPart only (not to a DDExpandedNode) ...
DDI::Singleton< std::map< std::string, std::vector< DDName > > > LPNAMES
def cat
Definition: eostools.py:400
tuple result
Definition: query.py:137
void DD_NC(const DDName &)
Definition: DDLogicalPart.cc:9
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:88
DDsvalues_type mergedSpecifics(void) const
returns the merged-specifics, i.e. the last specified specifics of this logical-part ...
void addSpecifics(const std::pair< const DDPartSelection *, const DDsvalues_type * > &)
don&#39;t use, internal only /todo make it private
std::pair< bool, std::string > DDIsValid(const std::string &ns, const std::string &name, std::vector< DDLogicalPart > &result, bool doRegex=true)
void removeSpecifics(const std::pair< DDPartSelection *, DDsvalues_type * > &)
DDLogicalPart(void)
The default constructor provides an uninitialzed reference object.
Definition: DDLogicalPart.h:94
const std::vector< std::pair< const DDPartSelection *, const DDsvalues_type * > > & attachedSpecifics(void) const
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
Interface to attach user specific data to nodes in the expanded-view.
Definition: DDSpecifics.h:37