test
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.
2 
3 #include <stdlib.h>
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 
65 {
66  return const_cast<graph_type&>(rep_->graph());
67 }
68 
70 {
71  return rep_->root();
72 }
73 
75 {
76  return worldpos_.get();
77 }
78 
80 {
81  return rep_->walker();
82 }
83 
84 
103 double DDCompactView::weight(const DDLogicalPart & p) const
104 {
105  return rep_->weight(p);
106 }
107 
109  const DDLogicalPart & parent,
110  std::string copyno,
111  const DDTranslation & trans,
112  const DDRotation & rot,
113  const DDDivision * div)
114 {
115  int cpno = atoi(copyno.c_str());
116  position(self,parent,cpno,trans,rot, div);
117 }
118 
120  const DDLogicalPart & parent,
121  int copyno,
122  const DDTranslation & trans,
123  const DDRotation & rot,
124  const DDDivision * div)
125 {
126  rep_->position( self, parent, copyno, trans, rot, div );
127 }
128 
129 
130 // >>---==========================<()>==========================---<<
131 
132 // UNSTABLE STUFF below ...
134 {
135  rep_->setRoot(root);
136 }
137 
138 void DDCompactView::swap( DDCompactView& repToSwap ) {
139  rep_->swap ( *(repToSwap.rep_) );
140 }
141 
143  : rep_(new DDCompactViewImpl),
144  worldpos_( new DDPosData( DDTranslation(), DDRotation(), 0 ))
145 { }
146 
148  // at this point we should have a valid store of DDObjects and we will move these
149  // to the local storage area using swaps with the existing Singleton<Store...>'s
150  // 2010-01-27 memory patch
156 
157  // 2010-01-27 memory patch
158  // not sure this will stay, but for now we want to explicitely lock the global stores.
159  // lock the global stores.
160  DDMaterial::StoreT::instance().setReadOnly(false);
161  DDSolid::StoreT::instance().setReadOnly(false);
162  DDLogicalPart::StoreT::instance().setReadOnly(false);
163  DDSpecifics::StoreT::instance().setReadOnly(false);
164  DDRotation::StoreT::instance().setReadOnly(false);
165 
166 }
167 
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:13
DDCompactView()
Creates a compact-view.
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:90
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:92
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_