CMS 3D CMS Logo

DDExpandedView.h
Go to the documentation of this file.
1 #ifndef DDExpandedView_h
2 #define DDExpandedView_h
3 
4 #include <cstddef>
5 #include <iosfwd>
6 #include <map>
7 #include <string>
8 #include <utility>
9 #include <vector>
10 
20 
21 class DDFilteredView;
22 class DDLogicalPart;
23 struct DDPosData;
24 
35 
42 {
43  friend class DDFilteredView;
44 
45 public:
47 
49  typedef std::vector<int> nav_type;
50  typedef std::pair<int const *, size_t> NavRange;
51 
54 
55  virtual ~DDExpandedView();
56 
58  const DDLogicalPart & logicalPart() const;
59 
61  const DDTranslation & translation() const;
62 
64  const DDRotationMatrix & rotation() const;
65 
67  const DDGeoHistory & geoHistory() const;
68 
70  bool goTo(const nav_type &);
71  bool goTo(NavRange);
72  bool goTo(int const * newpos, size_t sz);
73 
75  nav_type navPos() const;
76 
78  nav_type copyNumbers() const;
79 
81  std::vector<const DDsvalues_type * > specifics() const;
82  void specificsV(std::vector<const DDsvalues_type * > & vc ) const;
83 
85  void mergedSpecificsV(DDsvalues_type & res) const;
86 
88  int copyno() const;
89 
90  // navigation
91 
93  const DDGeoHistory & scope() const;
94 
96  bool setScope(const DDGeoHistory & hist, int depth=0);
97 
99  void clearScope();
100 
102  int depth() const;
103 
105  bool next();
106 
108  bool nextB();
109 
111  bool nextSibling();
112 
114  bool firstChild();
115 
117  bool parent();
118 
120  //bool hasChildren() const;
121 
123  void reset();
124 
125  /* was protected, now public; was named goTo, now goToHistory*/
126  bool goToHistory(const DDGeoHistory & sc);
127 
128 protected:
129  bool descend(const DDGeoHistory & sc);
130 
131 protected:
138  unsigned int depth_;
139  const DDPosData * worldpos_ ;
140  std::vector<nav_type> nextBStack_;
141 };
142 
143 std::string printNavType(int const * n, size_t sz);
144 inline std::ostream & operator<<(std::ostream & os, const DDExpandedView::nav_type & n) {
145  os << printNavType(&n.front(),n.size());
146  return os;
147 }
148 inline std::ostream & operator<<(std::ostream & os, const DDExpandedView::NavRange & n) {
149  os << printNavType(n.first,n.second);
150  return os;
151 }
152 #endif
bool next()
set current node to the next node in the expanded tree
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
bool parent()
set the current node to the parent node ...
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:13
DDsvalues_type mergedSpecifics() const
bool descend(const DDGeoHistory &sc)
nav_type copyNumbers() const
return the stack of copy numbers
virtual ~DDExpandedView()
DDGeoHistory history_
std::vector of DDExpandedNode
std::vector< const DDsvalues_type * > specifics() const
User specific data attached to the current node.
unsigned int depth_
depth of the scope, 0==unrestricted depth
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:83
std::pair< int const *, size_t > NavRange
Definition: Electron.h:6
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
nav_type navPos() const
return the stack of sibling numbers which indicates the current position in the DDExpandedView ...
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
WalkerType w2_
WalkerType * walker_
the tricky walker
void specificsV(std::vector< const DDsvalues_type * > &vc) const
const DDTranslation trans_
DDExpandedView(const DDCompactView &)
Constructs an expanded-view based on the compact-view.
int depth() const
depth of the scope. 0 means unrestricted depth.
std::string printNavType(int const *n, size_t sz)
std::ostream & operator<<(std::ostream &os, const DDExpandedView::nav_type &n)
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::maps an index to a DDValue. The index corresponds to the index assigned to the name of the std::...
Definition: DDsvalues.h:20
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
bool setScope(const DDGeoHistory &hist, int depth=0)
sets the scope of the expanded view
const DDTranslation & translation() const
The absolute translation of the current node.
void clearScope()
clears the scope; the full tree is available, depth=0
std::vector< nav_type > nextBStack_
std::vector< DDExpandedNode > DDGeoHistory
Geometrical &#39;path&#39; of the current node up to the root-node.
bool nextB()
broad search order of next()
const DDGeoHistory & scope() const
The scope of the expanded-view.
void reset()
true, if a call to firstChild() would succeed (current node has at least one child) ...
int copyno() const
Copy number associated with the current node.
bool firstChild()
set the current node to the first child ...
bool nextSibling()
set the current node to the next sibling ...
const DDRotationMatrix rot_
bool goToHistory(const DDGeoHistory &sc)
bool goTo(const nav_type &)
transversed the DDExpandedView according to the given stack of sibling numbers
const DDPosData * worldpos_
???
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the expanded-view.
DDGeoHistory scope_
scope of the expanded view
Provides an exploded view of the detector (tree-view)
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
void mergedSpecificsV(DDsvalues_type &res) const
std::vector< int > nav_type
std::vector of sibling numbers