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 
19 
20 class DDFilteredView;
21 class DDLogicalPart;
22 struct DDPosData;
23 
34 
41 {
42  friend class DDFilteredView;
43 
44 public:
46  typedef std::vector<int> nav_type;
47  typedef std::pair<int const *, size_t> NavRange;
48 
51 
52  virtual ~DDExpandedView();
53 
55  const DDLogicalPart & logicalPart() const;
56 
58  const DDTranslation & translation() const;
59 
61  const DDRotationMatrix & rotation() const;
62 
64  const DDGeoHistory & geoHistory() const;
65 
67  bool goTo(const nav_type &);
68  bool goTo(NavRange);
69  bool goTo(int const * newpos, size_t sz);
70 
72  nav_type navPos() const;
73 
75  nav_type copyNumbers() const;
76 
78  std::vector<const DDsvalues_type * > specifics() const;
79  void specificsV(std::vector<const DDsvalues_type * > & vc ) const;
80 
82  void mergedSpecificsV(DDsvalues_type & res) const;
83 
85  int copyno() const;
86 
87  // navigation
88 
90  const DDGeoHistory & scope() const;
91 
93  bool setScope(const DDGeoHistory & hist, int depth=0);
94 
96  void clearScope();
97 
99  int depth() const;
100 
102  bool next();
103 
105  bool nextB();
106 
108  bool nextSibling();
109 
111  bool firstChild();
112 
114  bool parent();
115 
117  //bool hasChildren() const;
118 
120  void reset();
121 
127  /* was protected, now public; was named goTo, now goToHistory*/
128  bool goToHistory(const DDGeoHistory & sc);
129 
130 protected:
131  bool descend(const DDGeoHistory & sc);
132 
133 protected:
140  unsigned int depth_;
141  const DDPosData * worldpos_ ;
142  std::vector<nav_type> nextBStack_;
143 };
144 
145 std::string printNavType(int const * n, size_t sz);
146 inline std::ostream & operator<<(std::ostream & os, const DDExpandedView::nav_type & n) {
147  os << printNavType(&n.front(),n.size());
148  return os;
149 }
150 inline std::ostream & operator<<(std::ostream & os, const DDExpandedView::NavRange & n) {
151  os << printNavType(n.first,n.second);
152  return os;
153 }
154 #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
type of data representation of DDCompactView
Definition: DDCompactView.h:90
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.
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
DDCompactView::walker_type * walker_
the tricky walker
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.
DDCompactView::walker_type w2_
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