CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DDCompactView.cc
Go to the documentation of this file.
8 
13 
14 #include <iostream>
15 
32 //
34  : rep_( new DDCompactViewImpl( rootnodedata )),
35  worldpos_( new DDPosData( DDTranslation(), DDRotation(), 0 ))
36 {
37  // 2010-01-27 I am leaving this here so that we are sure the global stores
38  // are open when a new DDCompactView is being made. Eventually I want to
39  // get rid of the need for this somehow? think about it...
40  DDMaterial::StoreT::instance().setReadOnly(false);
41  DDSolid::StoreT::instance().setReadOnly(false);
42  DDLogicalPart::StoreT::instance().setReadOnly(false);
43  DDSpecifics::StoreT::instance().setReadOnly(false);
44  DDRotation::StoreT::instance().setReadOnly(false);
45 }
46 
48 {}
49 
56 {
57  return rep_->graph();
58 }
59 
61 {
62  return const_cast<graph_type&>(rep_->graph());
63 }
64 
66 {
67  return rep_->root();
68 }
69 
71 {
72  return worldpos_.get();
73 }
74 
76 {
77  return rep_->walker();
78 }
79 
80 
99 double DDCompactView::weight(const DDLogicalPart & p) const
100 {
101  return rep_->weight(p);
102 }
103 
105  const DDLogicalPart & parent,
106  std::string copyno,
107  const DDTranslation & trans,
108  const DDRotation & rot,
109  const DDDivision * div)
110 {
111  int cpno = atoi(copyno.c_str());
112  position(self,parent,cpno,trans,rot, div);
113 }
114 
116  const DDLogicalPart & parent,
117  int copyno,
118  const DDTranslation & trans,
119  const DDRotation & rot,
120  const DDDivision * div)
121 {
122  rep_->position( self, parent, copyno, trans, rot, div );
123 }
124 
125 
126 // >>---==========================<()>==========================---<<
127 
128 // UNSTABLE STUFF below ...
130 {
131  rep_->setRoot(root);
132 }
133 
134 void DDCompactView::swap( DDCompactView& repToSwap ) {
135  rep_->swap ( *(repToSwap.rep_) );
136 }
137 
139  : rep_(new DDCompactViewImpl),
140  worldpos_( new DDPosData( DDTranslation(), DDRotation(), 0 ))
141 { }
142 
144  // at this point we should have a valid store of DDObjects and we will move these
145  // to the local storage area using swaps with the existing Singleton<Store...>'s
146  // 2010-01-27 memory patch
152 
153  // 2010-01-27 memory patch
154  // not sure this will stay, but for now we want to explicitely lock the global stores.
155  // lock the global stores.
156  DDMaterial::StoreT::instance().setReadOnly(false);
157  DDSolid::StoreT::instance().setReadOnly(false);
158  DDLogicalPart::StoreT::instance().setReadOnly(false);
159  DDSpecifics::StoreT::instance().setReadOnly(false);
160  DDRotation::StoreT::instance().setReadOnly(false);
161 
162 }
163 
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:13
DDCompactView()
Creates a compact-view.
list parent
Definition: dbtoconf.py:74
double weight(const DDLogicalPart &p) const
Prototype version of calculating the weight of a detector component.
const graph_type & graph() const
Provides read-only access to the data structure of the compact-view.
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
graph_type & writeableGraph()
type of data representation of DDCompactView
Definition: DDCompactView.h:76
void setRoot(const DDLogicalPart &root)
don&#39;t use : interface not stable ....
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
static value_type & instance()
DDI::Store< DDName, DDI::Specific * > specStore_
void swap(DDCompactView &)
std::unique_ptr< DDPosData > worldpos_
DDI::Store< DDName, DDI::Solid * > solidStore_
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
std::unique_ptr< DDCompactViewImpl > rep_
const DDPosData * worldPosition() const
The absolute position of the world.
DDI::Store< DDName, DDRotationMatrix * > rotStore_
walker_type walker() const
dont&#39;t use ! Proper implementation missing ...
const DDLogicalPart & root() const
returns the DDLogicalPart representing the root of the geometrical hierarchy
DDI::Store< DDName, DDI::LogicalPart * > lpStore_
DDI::Store< DDName, DDI::Material * > matStore_
string root
initialization
Definition: dbtoconf.py:70