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_( std::make_unique<DDCompactViewImpl>( rootnodedata )),
39  worldpos_( std::make_unique<DDPosData>( DDTranslation(), DDRotation(), 0 ))
40 {}
41 
43 {
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  rep_ = std::make_unique<DDCompactViewImpl>( DDLogicalPart( name ));
50  worldpos_ = std::make_unique<DDPosData>( DDTranslation(), DDRotation(), 0 );
51 }
52 
54 
61 {
62  return rep_->graph();
63 }
64 
67 {
68  return rep_->walker();
69 }
70 
71 const DDLogicalPart &
73 {
74  return rep_->root();
75 }
76 
77 const DDPosData*
79 {
80  return worldpos_.get();
81 }
82 
83 void
85  const DDLogicalPart & parent,
86  const std::string& copyno,
87  const DDTranslation & trans,
88  const DDRotation & rot,
89  const DDDivision * div )
90 {
91  int cpno = atoi( copyno.c_str());
92  position( self, parent, cpno, trans, rot, div );
93 }
94 
95 void
97  const DDLogicalPart & parent,
98  int copyno,
99  const DDTranslation & trans,
100  const DDRotation & rot,
101  const DDDivision * div )
102 {
103  rep_->position( self, parent, copyno, trans, rot, div );
104 }
105 
106 // UNSTABLE STUFF below ...
108 {
109  rep_->setRoot(root);
110 }
111 
112 void DDCompactView::swap( DDCompactView& repToSwap ) {
113  rep_->swap ( *(repToSwap.rep_) );
114 }
115 
117  : rep_( std::make_unique<DDCompactViewImpl>()),
118  worldpos_( std::make_unique<DDPosData>( DDTranslation(), DDRotation(), 0 ))
119 {}
120 
121 void
123  // at this point we should have a valid store of DDObjects and we will move these
124  // to the local storage area using swaps with the existing Singleton<Store...>'s
130 
131  // FIXME: 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 
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:13
DDCompactView()
Creates a compact-view.
GraphWalker walker() const
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
void setRoot(const DDLogicalPart &root)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
static value_type & instance()
DDI::Store< DDName, std::unique_ptr< DDI::Solid > > solidStore_
void swap(DDCompactView &)
std::unique_ptr< DDPosData > worldpos_
DDI::Store< DDName, std::unique_ptr< DDI::Specific > > specStore_
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
std::unique_ptr< DDCompactViewImpl > rep_
DDI::Store< DDName, std::unique_ptr< DDI::LogicalPart > > lpStore_
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)
const DDLogicalPart & root() const
returns the DDLogicalPart representing the root of the geometrical hierarchy
DDI::Store< DDName, std::unique_ptr< DDI::Material > > matStore_
DDI::Store< DDName, std::unique_ptr< DDRotationMatrix > > rotStore_