CMS 3D CMS Logo

DDCompactView.h
Go to the documentation of this file.
1 #ifndef DDCompactView_h
2 #define DDCompactView_h
3 
4 #include <cstddef>
5 #include <memory>
6 #include <string>
7 #include <utility>
8 #include <vector>
9 
18 
19 class DDCompactViewImpl;
20 class DDDivision;
21 class DDName;
22 class DDPartSelector;
23 class DDPhysicalPart;
24 struct DDPosData;
25 
26 namespace DDI {
27  class LogicalPart;
28  class Material;
29  class Solid;
30  class Specific;
31 }
32 
33 
40 //MEC: these comments are kept from original... Will we ever do this? don't think so.
41 //FIXME: DDCompactView: check for proper acyclic directed graph structure!!
42 //FIXME:
43 //FIXME: X [A-X] ... LogicalPart
44 //FIXME: / \ | ... PosPart (directed parten to child)
45 //FIXME: A A
46 //FIXME: | |
47 //FIXME: B C
48 //FIXME:
49 //FIXME: THIS IS NOT ALLOWED, but currently can be specified using DDL ....
50 //FIXME:
51 
52 //typedef TreeNode<DDPhysicalPart,int> expnode_t;
54 //typedef graph<DDLogicalPart,DDPosData*> graph_type; //:typedef Graph<DDLogicalPart,DDPosData*> graph_type;
55 
57 
91 {
92 
93 public:
95  typedef std::vector<DDLogicalPart> logchild_type;
96 
98  typedef std::vector< std::pair<DDLogicalPart,DDPosData*> > poschildren_type;
99 
101  typedef std::pair<DDLogicalPart,DDPosData*> pos_type;
102 
104 
106 
108 
110  explicit DDCompactView();
111 
113  explicit DDCompactView(const DDLogicalPart & rootnodedata);
114 
115  ~DDCompactView();
116 
118  const graph_type & graph() const;
119 
121  const DDLogicalPart & root() const;
122 
124  const DDPosData * worldPosition() const;
125 
127  double weight(const DDLogicalPart & p) const;
128 
129  void position (const DDLogicalPart & self,
130  const DDLogicalPart & parent,
131  const std::string& copyno,
132  const DDTranslation & trans,
133  const DDRotation & rot,
134  const DDDivision * div = nullptr);
135 
136  void position (const DDLogicalPart & self,
137  const DDLogicalPart & parent,
138  int copyno,
139  const DDTranslation & trans,
140  const DDRotation & rot,
141  const DDDivision * div = nullptr);
142 
143  // ************************************************************************
144  // UNSTABLE STUFF below! DON'T USE!
145  // ************************************************************************
146 
148  void setRoot(const DDLogicalPart & root);
149 
151  walker_type walker() const;
152 
153  // ---------------------------------------------------------------
154  // +++ DDCore INTERNAL USE ONLY ++++++++++++++++++++++++++++++++++
155 
156  // to modify the structure! DDCore internal!
157  graph_type & writeableGraph();
158 
159  void swap( DDCompactView& );
160 
161  void lockdown();
162 
163  private:
164  std::unique_ptr<DDCompactViewImpl> rep_;
165  std::unique_ptr<DDPosData> worldpos_ ;
166 
167  // 2010-01-27 memory patch
168  // for copying and protecting DD Store's after parsing is complete.
174 
175 };
176 
179 #endif
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:13
DDCompactView::walker_type walker_type
global type for a compact-view walker
math::Graph< DDLogicalPart, DDPosData * > graph_type
type of representation of the compact-view (acyclic directed multigraph)
std::vector< std::pair< DDLogicalPart, DDPosData * > > poschildren_type
container-type of pairs of children nodes and their relative position data of a given node in the com...
Definition: DDCompactView.h:98
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
type of data representation of DDCompactView
Definition: DDCompactView.h:90
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:116
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:67
std::pair< DDLogicalPart, DDPosData * > pos_type
pair ...
DDI::Store< DDName, DDI::Specific * > specStore_
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_
std::vector< DDLogicalPart > logchild_type
container-type of children of a given node in the compact-view
Definition: DDCompactView.h:95
DDI::Store< DDName, DDRotationMatrix * > rotStore_
static int position[264][3]
Definition: ReadPGInfo.cc:509
math::GraphWalker< DDLogicalPart, DDPosData * > walker_type
DDI::Store< DDName, DDI::LogicalPart * > lpStore_
DDI::Store< DDName, DDI::Material * > matStore_