CMS 3D CMS Logo

DDCompactView.cc
Go to the documentation of this file.
2 
3 #include <cstdlib>
4 
17 
18 class DDDivision;
19 
36 //
38  : rep_( new DDCompactViewImpl( rootnodedata )),
39  worldpos_( new DDPosData( DDTranslation(), DDRotation(), 0 ))
40 {
41  // 2010-01-27 I am leaving this here so that we are sure the global stores
42  // are open when a new DDCompactView is being made. Eventually I want to
43  // get rid of the need for this somehow? think about it...
44  DDMaterial::StoreT::instance().setReadOnly(false);
45  DDSolid::StoreT::instance().setReadOnly(false);
46  DDLogicalPart::StoreT::instance().setReadOnly(false);
47  DDSpecifics::StoreT::instance().setReadOnly(false);
48  DDRotation::StoreT::instance().setReadOnly(false);
49 }
50 
52 {}
53 
60 {
61  return rep_->graph();
62 }
63 
66 {
67  return rep_->walker();
68 }
69 
71 {
72  return rep_->root();
73 }
74 
76 {
77  return worldpos_.get();
78 }
79 
81  const DDLogicalPart & parent,
82  const std::string& copyno,
83  const DDTranslation & trans,
84  const DDRotation & rot,
85  const DDDivision * div)
86 {
87  int cpno = atoi(copyno.c_str());
88  position(self,parent,cpno,trans,rot, div);
89 }
90 
92  const DDLogicalPart & parent,
93  int copyno,
94  const DDTranslation & trans,
95  const DDRotation & rot,
96  const DDDivision * div)
97 {
98  rep_->position( self, parent, copyno, trans, rot, div );
99 }
100 
101 
102 // >>---==========================<()>==========================---<<
103 
104 // UNSTABLE STUFF below ...
106 {
107  rep_->setRoot(root);
108 }
109 
110 void DDCompactView::swap( DDCompactView& repToSwap ) {
111  rep_->swap ( *(repToSwap.rep_) );
112 }
113 
115  : rep_(new DDCompactViewImpl),
117 { }
118 
120  // at this point we should have a valid store of DDObjects and we will move these
121  // to the local storage area using swaps with the existing Singleton<Store...>'s
122  // 2010-01-27 memory patch
128 
129  // 2010-01-27 memory patch
130  // not sure this will stay, but for now we want to explicitely lock the global stores.
131  // lock the global stores.
132  DDMaterial::StoreT::instance().setReadOnly(false);
133  DDSolid::StoreT::instance().setReadOnly(false);
134  DDLogicalPart::StoreT::instance().setReadOnly(false);
135  DDSpecifics::StoreT::instance().setReadOnly(false);
136  DDRotation::StoreT::instance().setReadOnly(false);
137 
138 }
139 
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:13
DDCompactView()
Creates a compact-view.
GraphWalker walker() const
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:83
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:67
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:92
std::unique_ptr< DDCompactViewImpl > rep_
const Graph & graph() const
Provides read-only access to the data structure of the compact-view.
const DDPosData * worldPosition() const
The absolute position of the world.
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
DDI::Store< DDName, DDRotationMatrix * > rotStore_
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_