CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DDExpandedView.h
Go to the documentation of this file.
1 #ifndef DDExpandedView_h
2 #define DDExpandedView_h
3 
4 #include <iosfwd>
5 #include <vector>
6 #include <string>
7 #include <map>
8 
16 
17 class DDFilteredView;
18 
29 
36 {
37  friend class DDFilteredView;
38 
39 public:
41  typedef std::vector<int> nav_type;
42  typedef std::pair<int const *, size_t> NavRange;
43 
46 
47  virtual ~DDExpandedView();
48 
50  const DDLogicalPart & logicalPart() const;
51 
53  const DDTranslation & translation() const;
54 
56  const DDRotationMatrix & rotation() const;
57 
59  const DDGeoHistory & geoHistory() const;
60 
62  bool goTo(const nav_type &);
63  bool goTo(NavRange);
64  bool goTo(int const * newpos, size_t sz);
65 
67  nav_type navPos() const;
68 
70  nav_type copyNumbers() const;
71 
73  std::vector<const DDsvalues_type * > specifics() const;
74  void specificsV(std::vector<const DDsvalues_type * > & vc ) const;
75 
77  void mergedSpecificsV(DDsvalues_type & res) const;
78 
80  int copyno() const;
81 
82  // navigation
83 
85  const DDGeoHistory & scope() const;
86 
88  bool setScope(const DDGeoHistory & hist, int depth=0);
89 
91  void clearScope();
92 
94  int depth() const;
95 
97  bool next();
98 
100  bool nextB();
101 
103  bool nextSibling();
104 
106  bool firstChild();
107 
109  bool parent();
110 
112  //bool hasChildren() const;
113 
115  void reset();
116 
122  /* was protected, now public; was named goTo, now goToHistory*/
123  bool goToHistory(const DDGeoHistory & sc);
124 
125 protected:
126  bool descend(const DDGeoHistory & sc);
127 
128 protected:
135  unsigned int depth_;
136  const DDPosData * worldpos_ ;
137  std::vector<nav_type> nextBStack_;
138 };
139 
140 std::string printNavType(int const * n, size_t sz);
141 inline std::ostream & operator<<(std::ostream & os, const DDExpandedView::nav_type & n) {
142  os << printNavType(&n.front(),n.size());
143  return os;
144 }
145 inline std::ostream & operator<<(std::ostream & os, const DDExpandedView::NavRange & n) {
146  os << printNavType(n.first,n.second);
147  return os;
148 }
149 #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
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
type of data representation of DDCompactView
Definition: DDCompactView.h:77
std::pair< int const *, size_t > NavRange
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::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:19
DDCompactView::walker_type * walker_
the tricky walker
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
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