CMS 3D CMS Logo

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
 
using WalkerType = math::GraphWalker< DDLogicalPart, DDPosData * >
 

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_
 
WalkerType w2_
 
WalkerTypewalker_
 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 41 of file DDExpandedView.h.

Member Typedef Documentation

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

std::vector of sibling numbers

Definition at line 49 of file DDExpandedView.h.

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

Definition at line 50 of file DDExpandedView.h.

Definition at line 46 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 21 of file DDExpandedView.cc.

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

22  : walker_( nullptr ),
23  w2_( cpv.graph(), cpv.root()),
26  depth_( 0 ),
27  worldpos_( cpv.worldPosition())
28 {
29  walker_ = &w2_;
30 
31  const DDPosData * pd((*walker_).current().second);
32  if (!pd)
33  pd = worldpos_;
34  DDExpandedNode expn((*walker_).current().first,
35  pd,
36  trans_,
37  rot_,
38  0);
39 
40  // starting point for position calculations, == root of expanded view
41  history_.emplace_back(expn);
42 }
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
WalkerType w2_
WalkerType * walker_
the tricky walker
const DDTranslation trans_
const Graph & graph() const
Provides read-only access to the data structure of the compact-view.
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 44 of file DDExpandedView.cc.

44 { }

Member Function Documentation

void DDExpandedView::clearScope ( )

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

Definition at line 309 of file DDExpandedView.cc.

References depth_, and scope_.

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

310 {
311  scope_.clear();
312  depth_=0;
313 }
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 76 of file DDExpandedView.cc.

References history_.

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

77 {
78  return history_.back().copyno();
79 }
DDGeoHistory history_
std::vector of DDExpandedNode
DDExpandedView::nav_type DDExpandedView::copyNumbers ( ) const

return the stack of copy numbers

Definition at line 489 of file DDExpandedView.cc.

References history_, and mps_fire::result.

Referenced by DDFilteredView::copyNumbers().

490 {
492  DDGeoHistory::size_type sz = history_.size();
493  nav_type result(sz);
494 
495  for (; it < sz; ++it) {
496  result[it] = history_[it].copyno();
497  }
498  return result;
499 }
DDGeoHistory history_
std::vector of DDExpandedNode
uint16_t size_type
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 70 of file DDExpandedView.cc.

References depth_.

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

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

Definition at line 394 of file DDExpandedView.cc.

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

Referenced by setScope().

395 {
396  DDGeoHistory::size_type mxx = sc.size();
397  DDGeoHistory::size_type cur = 0;
398  bool result(false);
399 
400  /* algo: compare currerent node in expanded-view with current-node in sc
401  if matching:
402  (A)go to first child in expanded-view, go one level deeper in sc
403  iterate over all children in expanded-view until one of them
404  matches the current node in sc.
405  if no one matches, return false
406  else continue at (A)
407  else return false
408  */
409  const DDExpandedNode & curNode = history_.back();
410 
411  if (!sc.empty()) {
412  if (curNode==sc[cur]) {
413  bool res(false);
414  while(cur+1 < mxx && firstChild()) {
415  ++cur;
416  if (!(history_.back()==sc[cur])) {
417  while(nextSibling()) {
418  if (history_.back()==sc[cur]) {
419  res=true;
420  break;
421  }
422  }
423  }
424  else {
425  res=true;
426  }
427  if (res==false)
428  break;
429  }
430  result = res;
431  }
432  }
433  return result;
434 }
DDGeoHistory history_
std::vector of DDExpandedNode
represents one node in the DDExpandedView
uint16_t size_type
Definition: Electron.h:6
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 131 of file DDExpandedView.cc.

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

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

132 {
133  bool result(false);
134  bool depthNotReached(true);
135 
136  // Check for the depth within the scope ...
137  if (depth_) {
138  if ( (history_.size()-scope_.size())==depth_ ) {
139  depthNotReached=false;
140  }
141  }
142  if (depthNotReached) {
143  if ((*walker_).firstChild()) {
144  DDExpandedNode & expnBefore(history_.back());
145  WalkerType::value_type curr = (*walker_).current();
146 
147  DDPosData * newPosd = curr.second;
148 
149  // T = ... (see nextSiblinig())
150  DDTranslation newTrans = expnBefore.trans_ + expnBefore.rot_ * newPosd->trans();
151 
152  // R = ... (see nextSibling())
153  DDRotationMatrix newRot = expnBefore.rot_ * newPosd->rot();//.inverse();
154 
155  // create a new Expanded node and push it to the history ...
156  DDExpandedNode expn(curr.first, curr.second,
157  newTrans, newRot, 0);
158 
159  history_.emplace_back(expn);
160  result = true;
161  } // if firstChild
162  } // if depthNotReached
163  return result;
164 }
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:13
typename math::Graph< DDLogicalPart, DDPosData * >::value_type value_type
Definition: GraphWalker.h:29
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 DDRotationMatrix & rot() const
Definition: DDPosData.h:33
const DDTranslation & trans() const
Definition: DDPosData.h:30
DDTranslation trans_
Definition: DDPosData.h:41
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 437 of file DDExpandedView.cc.

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

437  {
438  return goTo(&newpos.front(),newpos.size());
439 
440 }
bool goTo(const nav_type &)
transversed the DDExpandedView according to the given stack of sibling numbers
bool DDExpandedView::goTo ( NavRange  newpos)

Definition at line 442 of file DDExpandedView.cc.

References goTo().

442  {
443  return goTo(newpos.first,newpos.second);
444 }
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 446 of file DDExpandedView.cc.

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

447 {
448  bool result(false);
449 
450  // save the current position
451  DDGeoHistory savedPos = history_;
452 
453  // reset to root node
454  //FIXME: reset to root of scope!!
455  reset();
456 
457  // try to navigate down to the newpos
458  for (size_t i = 1; i < sz; ++i) {
459  result = firstChild();
460  if (result) {
461  int pos = newpos[i];
462  for(int k=0; k<pos; ++k) {
463  result = nextSibling();
464  }
465  }
466  else {
467  break;
468  }
469  }
470 
471  if (!result) {
472  goToHistory(savedPos);
473  }
474  return result;
475 }
DDGeoHistory history_
std::vector of DDExpandedNode
int k[5][pyjets_maxn]
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)

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 361 of file DDExpandedView.cc.

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

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

362 {
363  bool result = true;
364  int tempD = depth_;
365  DDGeoHistory tempScope = scope_;
366  reset();
367  DDGeoHistory::size_type s = pos.size();
368  for( DDGeoHistory::size_type j=1; j<s; ++j) {
369  if (! firstChild()) {
370  result = false;
371  break;
372  }
373  int i=0;
374  for (; i<pos[j].siblingno(); ++i) {
375  if (! nextSibling()) {
376  result = false;
377  }
378  }
379  }
380 
381  if (!result) {
382  reset();
383  setScope(tempScope, tempD);
384  }
385  else {
386  scope_ = tempScope;
387  depth_ = tempD;
388  }
389 
390  return result;
391 }
unsigned int depth_
depth of the scope, 0==unrestricted depth
uint16_t size_type
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 280 of file DDExpandedView.cc.

References mergedSpecificsV().

280  {
281  DDsvalues_type merged;
282  mergedSpecificsV(merged);
283  return merged;
284 }
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
void mergedSpecificsV(DDsvalues_type &res) const
void DDExpandedView::mergedSpecificsV ( DDsvalues_type res) const

Definition at line 286 of file DDExpandedView.cc.

References DDLogicalPart::attachedSpecifics(), geoHistory(), create_public_lumi_plots::hist, logicalPart(), MatrixUtil::merge(), and SiPixelPhase1DigisV_cfi::specs.

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

287 {
288  merged.clear();
289  const auto& specs = logicalPart().attachedSpecifics();
290  if (specs.empty()) return;
291  const DDGeoHistory & hist = geoHistory();
292  for( const auto& it : specs ) {
293  if (DDCompareEqual(hist, *it.first)())
294  merge(merged,*it.second);
295  }
296 }
compares a given geometrical-history whether it corresponds to the given part-selector ...
Definition: DDComparator.h:16
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
def merge(dictlist, TELL=False)
Definition: MatrixUtil.py:193
DDExpandedView::nav_type DDExpandedView::navPos ( ) const

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

Definition at line 477 of file DDExpandedView.cc.

References history_, and mps_fire::i.

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

478 {
481  nav_type pos(j);
482 
483  for (;i<j;++i)
484  pos[i] = history_[i].siblingno();
485 
486  return pos;
487 }
DDGeoHistory history_
std::vector of DDExpandedNode
uint16_t size_type
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 209 of file DDExpandedView.cc.

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

Referenced by DDDefaultNumberingScheme::DDDefaultNumberingScheme(), DDExpandedViewDump(), ddstats(), GeometryInfoDump::dumpInfo(), DDFilteredView::next(), DDCompareEPV::operator()(), and output().

210 {
211  bool res(false);
212  if(firstChild())
213  res=true;
214  else if(nextSibling())
215  res=true;
216  else {
217  while(parent()) {
218  if(nextSibling()) {
219  res=true;
220  break;
221  }
222  }
223  }
224  return res;
225 }
bool parent()
set the current node to the parent node ...
Definition: Electron.h:6
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 229 of file DDExpandedView.cc.

230 {
231  bool res(false);
232  return res;
233 }
Definition: Electron.h:6
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 86 of file DDExpandedView.cc.

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

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

87 {
88  bool result(false);
89  if (!scope_.empty() && history_.back() == scope_.back()) {
90  ; // no-next-sibling, if current node is the root of the scope!
91  }
92  else {
93  if ((*walker_).nextSibling()) {
94  DDExpandedNode & expn(history_.back()); // back of history_ is always current node
95  WalkerType::value_type curr = (*walker_).current();
96  DDPosData const * posdOld = expn.posd_;
97  expn.logp_=curr.first;
98  expn.posd_=curr.second;
99 
100  DDGeoHistory::size_type hsize = history_.size();
101 
102 
103  if (hsize>1) {
104  const DDExpandedNode & expnBefore(history_[hsize-2]);
105 
106  // T = T1 + INV[R1] * T2
107  expn.trans_ = expnBefore.trans_ + (expnBefore.rot_ * expn.posd_->trans());
108 
109  // R = R1*INV[R2]
110  // VI in principle we can do this
111  if ( !(expn.posd_->rot()==posdOld->rot()) ) {
112  expn.rot_ = expnBefore.rot_ * expn.posd_->rot();//.inverse();
113  }
114  }
115  else {
116  expn.trans_ = expn.posd_->trans();
117  expn.rot_ = expn.posd_->rot();//.inverse();
118  }
119  ++expn.siblingno_;
120  result = true;
121  }
122  }
123  return result;
124 }
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:13
typename math::Graph< DDLogicalPart, DDPosData * >::value_type value_type
Definition: GraphWalker.h:29
DDGeoHistory history_
std::vector of DDExpandedNode
represents one node in the DDExpandedView
uint16_t size_type
const DDRotationMatrix & rot() const
Definition: DDPosData.h:33
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 171 of file DDExpandedView.cc.

References history_, mps_fire::result, and scope_.

Referenced by 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().

172 {
173  bool result(false);
174  bool scopeRoot(false);
175 
176  // check for a scope
177  if (!scope_.empty()) {
178  if (scope_.back() == history_.back()) {
179  // the current node is the root of the scope
180  scopeRoot = true;
181  }
182  }
183 
184  if (!scopeRoot) {
185  if ((*walker_).parent()) {
186  history_.pop_back();
187  result = true;
188  }
189  }
190 
191  return result;
192 }
DDGeoHistory history_
std::vector of DDExpandedNode
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 315 of file DDExpandedView.cc.

References clearScope(), and parent().

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

316 {
317  clearScope();
318  while(parent())
319  ;
320 }
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 58 of file DDExpandedView.cc.

References history_.

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

59 {
60  return history_.back().rot_;
61 }
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 304 of file DDExpandedView.cc.

References scope_.

Referenced by DDFilteredView::scope().

305 {
306  return scope_;
307 }
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 333 of file DDExpandedView.cc.

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

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

334 {
335  bool result(false);
336 
337  DDGeoHistory buf = scope_; // save current scope
338  scope_.clear(); // sets scope to global (full) scope
339 
340  while (parent()) ; // move up to the root of the expanded-view
341 
342  if (descend(sc)) { // try to move down the given scope-history ...
343  scope_ = sc;
344  depth_ = depth;
345  result = true;
346  }
347  else {
348  scope_ = buf;
349  }
350 
351  return result;
352 }
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
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 254 of file DDExpandedView.cc.

References mps_fire::result, and specificsV().

255 {
256  // backward compatible
257  std::vector<const DDsvalues_type * > result;
258  specificsV(result);
259  return result;
260 }
void specificsV(std::vector< const DDsvalues_type * > &vc) const
void DDExpandedView::specificsV ( std::vector< const DDsvalues_type * > &  vc) const

Definition at line 263 of file DDExpandedView.cc.

References DDLogicalPart::attachedSpecifics(), geoHistory(), create_public_lumi_plots::hist, logicalPart(), and SiPixelPhase1DigisV_cfi::specs.

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

264 {
265  const auto & specs = logicalPart().attachedSpecifics();
266  if( !specs.empty())
267  {
268  result.reserve(specs.size());
269  for( const auto& it : specs ) {
270  // a part selection
271  const DDPartSelection & psel = *(it.first);
272  const DDGeoHistory & hist = geoHistory();
273 
274  if (DDCompareEqual(hist, psel)())
275  result.emplace_back( it.second );
276  }
277  }
278 }
compares a given geometrical-history whether it corresponds to the given part-selector ...
Definition: DDComparator.h:16
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 52 of file DDExpandedView.cc.

References history_.

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

53 {
54  return history_.back().trans_;
55 }
DDGeoHistory history_
std::vector of DDExpandedNode

Friends And Related Function Documentation

friend class DDFilteredView
friend

Definition at line 43 of file DDExpandedView.h.

Member Data Documentation

unsigned int DDExpandedView::depth_
protected

depth of the scope, 0==unrestricted depth

Definition at line 138 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 140 of file DDExpandedView.h.

const DDRotationMatrix DDExpandedView::rot_
protected

Definition at line 135 of file DDExpandedView.h.

Referenced by DDExpandedView().

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

Definition at line 134 of file DDExpandedView.h.

Referenced by DDExpandedView().

WalkerType DDExpandedView::w2_
protected

Definition at line 133 of file DDExpandedView.h.

Referenced by DDExpandedView().

WalkerType* DDExpandedView::walker_
protected

the tricky walker

Definition at line 132 of file DDExpandedView.h.

Referenced by DDExpandedView().

const DDPosData* DDExpandedView::worldpos_
protected

???

Definition at line 139 of file DDExpandedView.h.

Referenced by DDExpandedView().