CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
DDExpandedView Class Reference

Provides an exploded view of the detector (tree-view) More...

#include <DDExpandedView.h>

Public Types

typedef std::vector< int > nav_type
 std::vector of sibling numbers More...
 
typedef std::pair< int const
*, size_t > 
NavRange
 

Public Member Functions

void clearScope ()
 clears the scope; the full tree is available, depth=0 More...
 
int copyno () const
 Copy number associated with the current node. More...
 
nav_type copyNumbers () const
 return the stack of copy numbers More...
 
 DDExpandedView (const DDCompactView &)
 Constructs an expanded-view based on the compact-view. More...
 
int depth () const
 depth of the scope. 0 means unrestricted depth. More...
 
bool firstChild ()
 set the current node to the first child ... More...
 
const DDGeoHistorygeoHistory () const
 The list of ancestors up to the root-node of the current node. More...
 
bool goTo (const nav_type &)
 transversed the DDExpandedView according to the given stack of sibling numbers More...
 
bool goTo (NavRange)
 
bool goTo (int const *newpos, size_t sz)
 
bool goToHistory (const DDGeoHistory &sc)
 
const DDLogicalPartlogicalPart () const
 The logical-part of the current node in the expanded-view. More...
 
DDsvalues_type mergedSpecifics () const
 
void mergedSpecificsV (DDsvalues_type &res) const
 
nav_type navPos () const
 return the stack of sibling numbers which indicates the current position in the DDExpandedView More...
 
bool next ()
 set current node to the next node in the expanded tree More...
 
bool nextB ()
 broad search order of next() More...
 
bool nextSibling ()
 set the current node to the next sibling ... More...
 
bool parent ()
 set the current node to the parent node ... More...
 
void reset ()
 true, if a call to firstChild() would succeed (current node has at least one child) More...
 
const DDRotationMatrixrotation () const
 The absolute rotation of the current node. More...
 
const DDGeoHistoryscope () const
 The scope of the expanded-view. More...
 
bool setScope (const DDGeoHistory &hist, int depth=0)
 sets the scope of the expanded view More...
 
std::vector< const
DDsvalues_type * > 
specifics () const
 User specific data attached to the current node. More...
 
void specificsV (std::vector< const DDsvalues_type * > &vc) const
 
const DDTranslationtranslation () const
 The absolute translation of the current node. More...
 
virtual ~DDExpandedView ()
 

Protected Member Functions

bool descend (const DDGeoHistory &sc)
 

Protected Attributes

unsigned int depth_
 depth of the scope, 0==unrestricted depth More...
 
DDGeoHistory history_
 std::vector of DDExpandedNode More...
 
std::vector< nav_typenextBStack_
 
const DDRotationMatrix rot_
 
DDGeoHistory scope_
 scope of the expanded view More...
 
const DDTranslation trans_
 
DDCompactView::walker_type w2_
 
DDCompactView::walker_typewalker_
 the tricky walker More...
 
const DDPosDataworldpos_
 ??? More...
 

Friends

class DDFilteredView
 

Detailed Description

Provides an exploded view of the detector (tree-view)

DDExpandedView provides a tree-walker (iterator) for the expanded view of the detector description. Further it provides a registration mechanism for call-backs whenever a node in the expanded view becomes current and fullfills the user-defined predicate.

FIXME: DDExpandedView: in the Prototype just one class - FIXME: later seperation of interface & implementation!Taking a DDCompactView the DDExpandedView expands the compact-view into a detector tree. One instance of DDExpandedView corresponds to one node in the tree. It is the 'current' node. By using tree navigation ( next(), nextSibling(), parent(), firstChild() ) the DDExpandedView represents the new corresponding node.

Definition at line 35 of file DDExpandedView.h.

Member Typedef Documentation

typedef std::vector<int> DDExpandedView::nav_type

std::vector of sibling numbers

Definition at line 41 of file DDExpandedView.h.

typedef std::pair<int const *, size_t> DDExpandedView::NavRange

Definition at line 42 of file DDExpandedView.h.

Constructor & Destructor Documentation

DDExpandedView::DDExpandedView ( const DDCompactView cpv)

Constructs an expanded-view based on the compact-view.

After construction the instance corresponds to the root of the geometrical tree.

Definition at line 7 of file DDExpandedView.cc.

References history_, rot_, trans_, w2_, walker_, and worldpos_.

8  : walker_(0),
9  w2_(cpv.graph(),cpv.root()),
12  depth_( 0 ),
13  worldpos_( cpv.worldPosition())
14 {
15  walker_ = &w2_;
16 
17  const DDPosData * pd((*walker_).current().second);
18  if (!pd)
19  pd = worldpos_;
20  DDExpandedNode expn((*walker_).current().first,
21  pd,
22  trans_,
23  rot_,
24  0);
25 
26  // starting point for position calculations, == root of expanded view
27  history_.push_back(expn);
28 }
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:13
const graph_type & graph() const
Provides read-only access to the data structure of the compact-view.
DDGeoHistory history_
std::vector of DDExpandedNode
represents one node in the DDExpandedView
unsigned int depth_
depth of the scope, 0==unrestricted depth
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
const DDTranslation trans_
DDCompactView::walker_type * walker_
the tricky walker
DDCompactView::walker_type w2_
const DDPosData * worldPosition() const
The absolute position of the world.
const DDRotationMatrix rot_
const DDPosData * worldpos_
???
const DDLogicalPart & root() const
returns the DDLogicalPart representing the root of the geometrical hierarchy
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
DDExpandedView::~DDExpandedView ( )
virtual

Definition at line 30 of file DDExpandedView.cc.

30 { }

Member Function Documentation

void DDExpandedView::clearScope ( )

clears the scope; the full tree is available, depth=0

Definition at line 295 of file DDExpandedView.cc.

References depth_, and scope_.

Referenced by DDFilteredView::clearScope(), and reset().

296 {
297  scope_.clear();
298  depth_=0;
299 }
unsigned int depth_
depth of the scope, 0==unrestricted depth
DDGeoHistory scope_
scope of the expanded view
int DDExpandedView::copyno ( ) const

Copy number associated with the current node.

Definition at line 62 of file DDExpandedView.cc.

References history_.

Referenced by DDFilteredView::copyno(), DDExpandedViewDump(), DetGeomDesc::DetGeomDesc(), DDI::Specific::node(), DDCompareEPV::operator()(), and TrackerGeometricDetExtraESModule::putOne().

63 {
64  return history_.back().copyno();
65 }
DDGeoHistory history_
std::vector of DDExpandedNode
DDExpandedView::nav_type DDExpandedView::copyNumbers ( ) const

return the stack of copy numbers

Definition at line 475 of file DDExpandedView.cc.

References history_, and mps_fire::result.

Referenced by DDFilteredView::copyNumbers().

476 {
478  DDGeoHistory::size_type sz = history_.size();
479  nav_type result(sz);
480 
481  for (; it < sz; ++it) {
482  result[it] = history_[it].copyno();
483  }
484  return result;
485 }
DDGeoHistory history_
std::vector of DDExpandedNode
uint16_t size_type
tuple result
Definition: mps_fire.py:84
std::vector< int > nav_type
std::vector of sibling numbers
int DDExpandedView::depth ( ) const

depth of the scope. 0 means unrestricted depth.

Definition at line 56 of file DDExpandedView.cc.

References depth_.

Referenced by DDCompareEPV::operator()(), and setScope().

57 {
58  return depth_;
59 }
unsigned int depth_
depth of the scope, 0==unrestricted depth
bool DDExpandedView::descend ( const DDGeoHistory sc)
protected

Definition at line 380 of file DDExpandedView.cc.

References firstChild(), history_, nextSibling(), and mps_fire::result.

Referenced by setScope().

381 {
382  DDGeoHistory::size_type mxx = sc.size();
383  DDGeoHistory::size_type cur = 0;
384  bool result(false);
385 
386  /* algo: compare currerent node in expanded-view with current-node in sc
387  if matching:
388  (A)go to first child in expanded-view, go one level deeper in sc
389  iterate over all children in expanded-view until one of them
390  matches the current node in sc.
391  if no one matches, return false
392  else continue at (A)
393  else return false
394  */
395  const DDExpandedNode & curNode = history_.back();
396 
397  if (sc.size()) {
398  if (curNode==sc[cur]) {
399  bool res(false);
400  while(cur+1 < mxx && firstChild()) {
401  ++cur;
402  if (!(history_.back()==sc[cur])) {
403  while(nextSibling()) {
404  if (history_.back()==sc[cur]) {
405  res=true;
406  break;
407  }
408  }
409  }
410  else {
411  res=true;
412  }
413  if (res==false)
414  break;
415  }
416  result = res;
417  }
418  }
419  return result;
420 }
DDGeoHistory history_
std::vector of DDExpandedNode
represents one node in the DDExpandedView
uint16_t size_type
tuple result
Definition: mps_fire.py:84
bool firstChild()
set the current node to the first child ...
bool nextSibling()
set the current node to the next sibling ...
bool DDExpandedView::firstChild ( )

set the current node to the first child ...

returns true, if a child of the current node exists and updates this otherwise returns false

Definition at line 117 of file DDExpandedView.cc.

References depth_, history_, mps_fire::result, DDPosData::rot(), scope_, and DDPosData::trans_.

Referenced by MagGeoBuilderFromDDD::build(), descend(), goTo(), goToHistory(), next(), DDI::Specific::node(), and DDCompareEPV::operator()().

118 {
119  bool result(false);
120  bool depthNotReached(true);
121 
122  // Check for the depth within the scope ...
123  if (depth_) {
124  if ( (history_.size()-scope_.size())==depth_ ) {
125  depthNotReached=false;
126  }
127  }
128  if (depthNotReached) {
129  if ((*walker_).firstChild()) {
130  DDExpandedNode & expnBefore(history_.back());
131  DDCompactView::walker_type::value_type curr = (*walker_).current();
132 
133  DDPosData * newPosd = curr.second;
134 
135  // T = ... (see nextSiblinig())
136  DDTranslation newTrans = expnBefore.trans_ + expnBefore.rot_ * newPosd->trans_;
137 
138  // R = ... (see nextSibling())
139  DDRotationMatrix newRot = expnBefore.rot_ * newPosd->rot();//.inverse();
140 
141  // create a new Expanded node and push it to the history ...
142  DDExpandedNode expn(curr.first, curr.second,
143  newTrans, newRot, 0);
144 
145  history_.push_back(expn);
146  result = true;
147  } // if firstChild
148  } // if depthNotReached
149  return result;
150 }
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:13
DDGeoHistory history_
std::vector of DDExpandedNode
represents one node in the DDExpandedView
unsigned int depth_
depth of the scope, 0==unrestricted depth
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
tuple result
Definition: mps_fire.py:84
graph< DDLogicalPart, DDPosData * >::value_type value_type
Definition: graphwalker.h:38
const DDRotationMatrix & rot() const
Definition: DDPosData.h:31
DDTranslation trans_
Definition: DDPosData.h:36
DDGeoHistory scope_
scope of the expanded view
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const DDGeoHistory & DDExpandedView::geoHistory ( ) const
bool DDExpandedView::goTo ( const nav_type newpos)

transversed the DDExpandedView according to the given stack of sibling numbers

Definition at line 423 of file DDExpandedView.cc.

Referenced by DetGeomDesc::DetGeomDesc(), goTo(), DDDefaultNumberingScheme::node(), and TrackerGeometricDetExtraESModule::produce().

423  {
424  return goTo(&newpos.front(),newpos.size());
425 
426 }
bool goTo(const nav_type &)
transversed the DDExpandedView according to the given stack of sibling numbers
bool DDExpandedView::goTo ( NavRange  newpos)

Definition at line 428 of file DDExpandedView.cc.

References goTo().

428  {
429  return goTo(newpos.first,newpos.second);
430 }
bool goTo(const nav_type &)
transversed the DDExpandedView according to the given stack of sibling numbers
bool DDExpandedView::goTo ( int const *  newpos,
size_t  sz 
)

Definition at line 432 of file DDExpandedView.cc.

References firstChild(), goToHistory(), history_, i, relval_2017::k, nextSibling(), reset(), and mps_fire::result.

433 {
434  bool result(false);
435 
436  // save the current position
437  DDGeoHistory savedPos = history_;
438 
439  // reset to root node
440  //FIXME: reset to root of scope!!
441  reset();
442 
443  // try to navigate down to the newpos
444  for (size_t i = 1; i < sz; ++i) {
445  result = firstChild();
446  if (result) {
447  int pos = newpos[i];
448  for(int k=0; k<pos; ++k) {
449  result = nextSibling();
450  }
451  }
452  else {
453  break;
454  }
455  }
456 
457  if (!result) {
458  goToHistory(savedPos);
459  }
460  return result;
461 }
int i
Definition: DBlmapReader.cc:9
DDGeoHistory history_
std::vector of DDExpandedNode
tuple result
Definition: mps_fire.py:84
std::vector< DDExpandedNode > DDGeoHistory
Geometrical &#39;path&#39; of the current node up to the root-node.
void reset()
true, if a call to firstChild() would succeed (current node has at least one child) ...
bool firstChild()
set the current node to the first child ...
bool nextSibling()
set the current node to the next sibling ...
bool goToHistory(const DDGeoHistory &sc)
bool DDExpandedView::goToHistory ( const DDGeoHistory pos)
 NOT IN THE PROTOTYPE

goTo will reset the ExpandedView if pos is not a valid position. Currently no checks are implemented to verify that pos is within the current scope of the ExpandedView.

Definition at line 347 of file DDExpandedView.cc.

References depth_, firstChild(), i, j, nextSibling(), reset(), mps_fire::result, alignCSCRings::s, scope_, and setScope().

Referenced by DDFilteredView::firstChild(), goTo(), DDFilteredView::nextSibling(), and DDFilteredView::parent().

348 {
349  bool result = true;
350  int tempD = depth_;
351  DDGeoHistory tempScope = scope_;
352  reset();
353  DDGeoHistory::size_type s = pos.size();
354  for( DDGeoHistory::size_type j=1; j<s; ++j) {
355  if (! firstChild()) {
356  result = false;
357  break;
358  }
359  int i=0;
360  for (; i<pos[j].siblingno(); ++i) {
361  if (! nextSibling()) {
362  result = false;
363  }
364  }
365  }
366 
367  if (!result) {
368  reset();
369  setScope(tempScope, tempD);
370  }
371  else {
372  scope_ = tempScope;
373  depth_ = tempD;
374  }
375 
376  return result;
377 }
int i
Definition: DBlmapReader.cc:9
unsigned int depth_
depth of the scope, 0==unrestricted depth
uint16_t size_type
tuple result
Definition: mps_fire.py:84
int j
Definition: DBlmapReader.cc:9
bool setScope(const DDGeoHistory &hist, int depth=0)
sets the scope of the expanded view
std::vector< DDExpandedNode > DDGeoHistory
Geometrical &#39;path&#39; of the current node up to the root-node.
void reset()
true, if a call to firstChild() would succeed (current node has at least one child) ...
bool firstChild()
set the current node to the first child ...
bool nextSibling()
set the current node to the next sibling ...
DDGeoHistory scope_
scope of the expanded view
const DDLogicalPart & DDExpandedView::logicalPart ( ) const
DDsvalues_type DDExpandedView::mergedSpecifics ( ) const

Definition at line 266 of file DDExpandedView.cc.

References mergedSpecificsV().

266  {
267  DDsvalues_type merged;
268  mergedSpecificsV(merged);
269  return merged;
270 }
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
void mergedSpecificsV(DDsvalues_type &res) const
void DDExpandedView::mergedSpecificsV ( DDsvalues_type res) const

Definition at line 272 of file DDExpandedView.cc.

References DDLogicalPart::attachedSpecifics(), geoHistory(), estimatePileup::hist, logicalPart(), and MatrixUtil::merge().

Referenced by DDSpecificsFilter::accept_impl(), DDFilteredView::mergedSpecifics(), mergedSpecifics(), and DDFilteredView::mergedSpecificsV().

273 {
274  merged.clear();
275  const auto& specs = logicalPart().attachedSpecifics();
276  if (specs.empty()) return;
277  const DDGeoHistory & hist = geoHistory();
278  for( const auto& it : specs ) {
279  if (DDCompareEqual(hist, *it.first)())
280  merge(merged,*it.second);
281  }
282 }
compares a given geometrical-history whether it corresponds to the given part-selector ...
Definition: DDComparator.h:13
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
std::vector< DDExpandedNode > DDGeoHistory
Geometrical &#39;path&#39; of the current node up to the root-node.
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the expanded-view.
const std::vector< std::pair< const DDPartSelection *, const DDsvalues_type * > > & attachedSpecifics(void) const
DDExpandedView::nav_type DDExpandedView::navPos ( ) const

return the stack of sibling numbers which indicates the current position in the DDExpandedView

Definition at line 463 of file DDExpandedView.cc.

References history_, i, and j.

Referenced by DDDefaultNumberingScheme::DDDefaultNumberingScheme(), DetGeomDesc::DetGeomDesc(), GeometryInfoDump::dumpInfo(), DDDefaultNumberingScheme::id(), and DDFilteredView::navPos().

464 {
467  nav_type pos(j);
468 
469  for (;i<j;++i)
470  pos[i] = history_[i].siblingno();
471 
472  return pos;
473 }
int i
Definition: DBlmapReader.cc:9
DDGeoHistory history_
std::vector of DDExpandedNode
uint16_t size_type
int j
Definition: DBlmapReader.cc:9
std::vector< int > nav_type
std::vector of sibling numbers
bool DDExpandedView::next ( void  )

set current node to the next node in the expanded tree

Tree transversal:

  • try to go to the first child
  • else try to go to the next sibling
  • else try to go to the next sibling of the parent

Currently the whole remaining subtree is transversed when next() is subsequently called.

Definition at line 195 of file DDExpandedView.cc.

References firstChild(), nextSibling(), and parent().

Referenced by BeautifulSoup.PageElement::_invert(), DDDefaultNumberingScheme::DDDefaultNumberingScheme(), DDExpandedViewDump(), ddstats(), GeometryInfoDump::dumpInfo(), DDQuery::exec(), DDFilteredView::next(), DDCompareEPV::operator()(), and output().

196 {
197  bool res(false);
198  if(firstChild())
199  res=true;
200  else if(nextSibling())
201  res=true;
202  else {
203  while(parent()) {
204  if(nextSibling()) {
205  res=true;
206  break;
207  }
208  }
209  }
210  return res;
211 }
bool parent()
set the current node to the parent node ...
bool firstChild()
set the current node to the first child ...
bool nextSibling()
set the current node to the next sibling ...
bool DDExpandedView::nextB ( )

broad search order of next()

broad first

Definition at line 215 of file DDExpandedView.cc.

216 {
217  bool res(false);
218  return res;
219 }
bool DDExpandedView::nextSibling ( )

set the current node to the next sibling ...

returns true, if a next sibling exists and updates this otherwise returns false. If a scope was set, the nextSibling of the root of the scope is not selected.

Definition at line 72 of file DDExpandedView.cc.

References history_, mps_fire::result, DDPosData::rot(), DDExpandedNode::rot_, scope_, and DDExpandedNode::trans_.

Referenced by BeautifulSoup.Tag::__str__(), BeautifulSoup.PageElement::_invert(), MagGeoBuilderFromDDD::build(), descend(), goTo(), goToHistory(), next(), DDFilteredView::nextSibling(), DDI::Specific::node(), and DDCompareEPV::operator()().

73 {
74  bool result(false);
75  if (scope_.size() && history_.back() == scope_.back()) {
76  ; // no-next-sibling, if current node is the root of the scope!
77  }
78  else {
79  if ((*walker_).nextSibling()) {
80  DDExpandedNode & expn(history_.back()); // back of history_ is always current node
81  DDCompactView::walker_type::value_type curr = (*walker_).current();
82  DDPosData const * posdOld = expn.posd_;
83  expn.logp_=curr.first;
84  expn.posd_=curr.second;
85 
86  DDGeoHistory::size_type hsize = history_.size();
87 
88 
89  if (hsize>1) {
90  const DDExpandedNode & expnBefore(history_[hsize-2]);
91 
92  // T = T1 + INV[R1] * T2
93  expn.trans_ = expnBefore.trans_ + (expnBefore.rot_ * expn.posd_->trans_);
94 
95  // R = R1*INV[R2]
96  // VI in principle we can do this
97  if ( !(expn.posd_->rot()==posdOld->rot()) ) {
98  expn.rot_ = expnBefore.rot_ * expn.posd_->rot();//.inverse();
99  }
100  }
101  else {
102  expn.trans_ = expn.posd_->trans_;
103  expn.rot_ = expn.posd_->rot();//.inverse();
104  }
105  ++expn.siblingno_;
106  result = true;
107  }
108  }
109  return result;
110 }
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:13
DDGeoHistory history_
std::vector of DDExpandedNode
represents one node in the DDExpandedView
uint16_t size_type
tuple result
Definition: mps_fire.py:84
graph< DDLogicalPart, DDPosData * >::value_type value_type
Definition: graphwalker.h:38
const DDRotationMatrix & rot() const
Definition: DDPosData.h:31
DDGeoHistory scope_
scope of the expanded view
bool DDExpandedView::parent ( )

set the current node to the parent node ...

returns ture, if a parent exists and updates this otherwise returns false. When false is returned, the root node of the scope is reached.

Definition at line 157 of file DDExpandedView.cc.

References history_, mps_fire::result, and scope_.

Referenced by BeautifulSoup.PageElement::_invert(), Vispa.Gui.ConnectableWidget.ConnectableWidget::addMenuEntry(), Vispa.Views.LineDecayView.LineDecayContainer::applyFilter(), Vispa.Views.BoxDecayView.BoxDecayContainer::arrangeUsingRelations(), Vispa.Views.BoxDecayView.BoxDecayContainer::autolayoutAlgorithm(), Vispa.Gui.ZoomableScrollableWidgetOwner.ZoomableScrollableWidgetOwner::autosizeScrollArea(), Vispa.Views.BoxDecayView.BoxDecayContainer::autosizeScrollArea(), Vispa.Gui.PortWidget.PortWidget::connectionPoint(), Vispa.Main.StartupScreen.StartupScreen::createDescriptionWidget(), Vispa.Views.BoxDecayView.BoxDecayContainer::dataAccessor(), Vispa.Views.LineDecayView.LineDecayContainer::dataAccessor(), Vispa.Views.LineDecayView.DecayLine::dataAccessor(), Vispa.Views.LineDecayView.LineDecayContainer::delete(), Vispa.Views.LineDecayView.DecayNode::delete(), Vispa.Views.LineDecayView.DecayLine::delete(), Vispa.Gui.VispaWidget.VispaWidget::delete(), Vispa.Gui.VispaWidget.VispaWidget::dragWidget(), Vispa.Share.ImageExporter.ImageExporter::exportImageDialog(), Vispa.Views.LineDecayView.DecayLine::extendedSize(), Vispa.Gui.VispaWidget.VispaWidget::keyPressEvent(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.ConnectableWidget.ConnectableWidget::leaveEvent(), Vispa.Gui.PortWidget.PortWidget::moduleParent(), Vispa.Gui.WidgetContainer.WidgetContainer::mouseDoubleClickEvent(), Vispa.Gui.VispaWidget.VispaWidget::mouseDoubleClickEvent(), Vispa.Gui.PortConnection.PointToPointConnection::mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget::mousePressEvent(), Vispa.Views.LineDecayView.ParticleWidget::mousePressEvent(), Vispa.Views.LineDecayView.DecayNode::move(), next(), DDFilteredView::nextSibling(), Vispa.Views.LineDecayView.LineDecayContainer::noDecorationsMode(), Vispa.Views.LineDecayView.LineDecayContainer::operationId(), DDCompareEPV::operator()(), Vispa.Views.LineDecayView.DecayLine::paint(), Vispa.Gui.VispaWidget.VispaWidget::paintEvent(), Vispa.Gui.ConnectableWidget.ConnectableWidget::positionizeMenuWidget(), Vispa.Views.LineDecayView.DecayLine::qtLineStyle(), reset(), Vispa.Views.WidgetView.WidgetView::restoreSelection(), Vispa.Views.WidgetView.WidgetView::select(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), setScope(), Vispa.Views.LineDecayView.LineDecayContainer::sizeHint(), Vispa.Views.LineDecayView.LineDecayContainer::tabController(), Vispa.Views.BoxDecayView.BoxDecayContainer::toggleCollapsed(), Vispa.Views.LineDecayView.DecayNode::unite(), Vispa.Views.PropertyView.PropertyView::valueChanged(), Vispa.Views.BoxDecayView.BoxDecayContainer::widgetByObject(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::widgetDoubleClicked(), and Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::widgetDragged().

158 {
159  bool result(false);
160  bool scopeRoot(false);
161 
162  // check for a scope
163  if (scope_.size()) {
164  if (scope_.back() == history_.back()) {
165  // the current node is the root of the scope
166  scopeRoot = true;
167  }
168  }
169 
170  if (!scopeRoot) {
171  if ((*walker_).parent()) {
172  history_.pop_back();
173  result = true;
174  }
175  }
176 
177  return result;
178 }
DDGeoHistory history_
std::vector of DDExpandedNode
tuple result
Definition: mps_fire.py:84
DDGeoHistory scope_
scope of the expanded view
void DDExpandedView::reset ( void  )

true, if a call to firstChild() would succeed (current node has at least one child)

clears the scope and sets the ExpandedView to its root-node

Definition at line 301 of file DDExpandedView.cc.

References clearScope(), and parent().

Referenced by DDDefaultNumberingScheme::DDDefaultNumberingScheme(), DDQuery::exec(), goTo(), goToHistory(), and DDFilteredView::reset().

302 {
303  clearScope();
304  while(parent())
305  ;
306 }
bool parent()
set the current node to the parent node ...
void clearScope()
clears the scope; the full tree is available, depth=0
const DDRotationMatrix & DDExpandedView::rotation ( void  ) const

The absolute rotation of the current node.

Definition at line 44 of file DDExpandedView.cc.

References history_.

Referenced by MagGeoBuilderFromDDD::build(), DDExpandedViewDump(), DetGeomDesc::DetGeomDesc(), GeometryInfoDump::dumpInfo(), output(), MagGeoBuilderFromDDD::volumeHandle::referencePlane(), and DDFilteredView::rotation().

45 {
46  return history_.back().rot_;
47 }
DDGeoHistory history_
std::vector of DDExpandedNode
const DDGeoHistory & DDExpandedView::scope ( ) const

The scope of the expanded-view.

All navigational commands only operate in the subtree rooted by the node marked by the node of the DDGeoHistory returned by this method. If the size() of the scope equals 0, the full scope covering the whole expanded-view is set (default).

Definition at line 290 of file DDExpandedView.cc.

References scope_.

Referenced by DDFilteredView::scope().

291 {
292  return scope_;
293 }
DDGeoHistory scope_
scope of the expanded view
bool DDExpandedView::setScope ( const DDGeoHistory sc,
int  depth = 0 
)

sets the scope of the expanded view

The scope of the expanded-view is set to the subtree rooted by the node marked by the DDGeohistory hist. The current not of the expanded view is set to the root of the subtree. All navigational methods apply only on the subtree.

In case of hist not marking a valid node in the expanded-view, the state of the expanded-view is unchanged and false is returned by setScope(). Otherwise true is returned.

Definition at line 319 of file DDExpandedView.cc.

References depth(), depth_, descend(), parent(), mps_fire::result, and scope_.

Referenced by DDQuery::exec(), goToHistory(), and DDFilteredView::setScope().

320 {
321  bool result(false);
322 
323  DDGeoHistory buf = scope_; // save current scope
324  scope_.clear(); // sets scope to global (full) scope
325 
326  while (parent()) ; // move up to the root of the expanded-view
327 
328  if (descend(sc)) { // try to move down the given scope-history ...
329  scope_ = sc;
330  depth_ = depth;
331  result = true;
332  }
333  else {
334  scope_ = buf;
335  }
336 
337  return result;
338 }
bool parent()
set the current node to the parent node ...
bool descend(const DDGeoHistory &sc)
unsigned int depth_
depth of the scope, 0==unrestricted depth
tuple result
Definition: mps_fire.py:84
int depth() const
depth of the scope. 0 means unrestricted depth.
std::vector< DDExpandedNode > DDGeoHistory
Geometrical &#39;path&#39; of the current node up to the root-node.
DDGeoHistory scope_
scope of the expanded view
std::vector< const DDsvalues_type * > DDExpandedView::specifics ( ) const

User specific data attached to the current node.

User specific data can be attached to single nodes or a selection of nodes in the expanded view through the DDSpecifics interface.

The resulting std::vector is of size 0 if no specific data was attached.

Definition at line 240 of file DDExpandedView.cc.

References mps_fire::result, and specificsV().

Referenced by DDQuery::exec().

241 {
242  // backward compatible
243  std::vector<const DDsvalues_type * > result;
244  specificsV(result);
245  return result;
246 }
tuple result
Definition: mps_fire.py:84
void specificsV(std::vector< const DDsvalues_type * > &vc) const
void DDExpandedView::specificsV ( std::vector< const DDsvalues_type * > &  vc) const

Definition at line 249 of file DDExpandedView.cc.

References DDLogicalPart::attachedSpecifics(), geoHistory(), estimatePileup::hist, and logicalPart().

Referenced by DDSpecificsFilter::accept_impl(), DDFilteredView::specifics(), specifics(), and DDFilteredView::specificsV().

250 {
251  const auto & specs = logicalPart().attachedSpecifics();
252  if( specs.size())
253  {
254  result.reserve(specs.size());
255  for( const auto& it : specs ) {
256  // a part selection
257  const DDPartSelection & psel = *(it.first);
258  const DDGeoHistory & hist = geoHistory();
259 
260  if (DDCompareEqual(hist, psel)())
261  result.push_back( it.second );
262  }
263  }
264 }
compares a given geometrical-history whether it corresponds to the given part-selector ...
Definition: DDComparator.h:13
tuple result
Definition: mps_fire.py:84
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
std::vector< DDExpandedNode > DDGeoHistory
Geometrical &#39;path&#39; of the current node up to the root-node.
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the expanded-view.
const std::vector< std::pair< const DDPartSelection *, const DDsvalues_type * > > & attachedSpecifics(void) const
const DDTranslation & DDExpandedView::translation ( void  ) const

The absolute translation of the current node.

Definition at line 38 of file DDExpandedView.cc.

References history_.

Referenced by MagGeoBuilderFromDDD::build(), DDExpandedViewDump(), DetGeomDesc::DetGeomDesc(), GeometryInfoDump::dumpInfo(), output(), and DDFilteredView::translation().

39 {
40  return history_.back().trans_;
41 }
DDGeoHistory history_
std::vector of DDExpandedNode

Friends And Related Function Documentation

friend class DDFilteredView
friend

Definition at line 37 of file DDExpandedView.h.

Member Data Documentation

unsigned int DDExpandedView::depth_
protected

depth of the scope, 0==unrestricted depth

Definition at line 135 of file DDExpandedView.h.

Referenced by clearScope(), depth(), DDFilteredView::firstChild(), firstChild(), goToHistory(), and setScope().

DDGeoHistory DDExpandedView::history_
protected
std::vector<nav_type> DDExpandedView::nextBStack_
protected

Definition at line 137 of file DDExpandedView.h.

const DDRotationMatrix DDExpandedView::rot_
protected

Definition at line 132 of file DDExpandedView.h.

Referenced by DDExpandedView().

DDGeoHistory DDExpandedView::scope_
protected
const DDTranslation DDExpandedView::trans_
protected

Definition at line 131 of file DDExpandedView.h.

Referenced by DDExpandedView().

DDCompactView::walker_type DDExpandedView::w2_
protected

Definition at line 130 of file DDExpandedView.h.

Referenced by DDExpandedView().

DDCompactView::walker_type* DDExpandedView::walker_
protected

the tricky walker

Definition at line 129 of file DDExpandedView.h.

Referenced by DDExpandedView().

const DDPosData* DDExpandedView::worldpos_
protected

???

Definition at line 136 of file DDExpandedView.h.

Referenced by DDExpandedView().