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...
 
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_, DDI::Singleton< I >::instance(), rot_, trans_, w2_, walker_, and worldpos_.

8  : walker_(0),w2_(cpv.graph(),cpv.root()), trans_(DDTranslation()), rot_(DDRotationMatrix()),
9  depth_(0), worldpos_(0)
10 {
11  // std::cout << "Building a DDExpandedView" << std::endl;
12  // MEC:2010-02-08 - consider the ROOT as where you want to start LOOKING at
13  // the DDD, and worldpos_ as the "real" root node of the graph. MOVE all this
14  // logic to DDCompactView. This should really be just the traverser...
15  DDRotation::StoreT::instance().setReadOnly(false);
17  DDRotation::StoreT::instance().setReadOnly(true);
18 
19  walker_ = &w2_;
20 
21  // std::cout << "Walker: current.first=" << (*walker_).current().first << std::endl;
22  // std::cout << "Walker: current.second=" << (*walker_).current().second << std::endl;
23 
24  DDPosData * pd((*walker_).current().second);
25  if (!pd)
26  pd = worldpos_;
27  DDExpandedNode expn((*walker_).current().first,
28  pd,
29  trans_,
30  rot_,
31  0);
32 
33  // starting point for position calculations, == root of expanded view
34  history_.push_back(expn);
35 }
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:16
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
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
static value_type & instance()
DDPosData * worldpos_
???
const DDTranslation trans_
DDCompactView::walker_type * walker_
the tricky walker
DDCompactView::walker_type w2_
const DDRotationMatrix rot_
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 38 of file DDExpandedView.cc.

38 { }

Member Function Documentation

void DDExpandedView::clearScope ( )

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

Definition at line 369 of file DDExpandedView.cc.

References depth_, and scope_.

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

370 {
371  scope_.clear();
372  depth_=0;
373 }
unsigned int depth_
depth of the scope, 0==unrestricted depth
DDGeoHistory scope_
scope of the expanded view
int DDExpandedView::copyno ( void  ) const

Copy number associated with the current node.

Definition at line 71 of file DDExpandedView.cc.

References history_.

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

72 {
73  return history_.back().copyno();
74 }
DDGeoHistory history_
std::vector of DDExpandedNode
DDExpandedView::nav_type DDExpandedView::copyNumbers ( ) const

return the stack of copy numbers

Definition at line 560 of file DDExpandedView.cc.

References history_, and query::result.

Referenced by DDFilteredView::copyNumbers().

561 {
563  DDGeoHistory::size_type sz = history_.size();
564  nav_type result(sz);
565 
566  for (; it < sz; ++it) {
567  result[it] = history_[it].copyno();
568  }
569  return result;
570 }
DDGeoHistory history_
std::vector of DDExpandedNode
uint16_t size_type
tuple result
Definition: query.py:137
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 65 of file DDExpandedView.cc.

References depth_.

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

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

Definition at line 460 of file DDExpandedView.cc.

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

Referenced by setScope().

461 {
462  DDGeoHistory::size_type mxx = sc.size();
463  DDGeoHistory::size_type cur = 0;
464  bool result(false);
465 
466  /* algo: compare currerent node in expanded-view with current-node in sc
467  if matching:
468  (A)go to first child in expanded-view, go one level deeper in sc
469  iterate over all children in expanded-view until one of them
470  matches the current node in sc.
471  if no one matches, return false
472  else continue at (A)
473  else return false
474  */
475  const DDExpandedNode & curNode = history_.back();
476 
477  if (sc.size()) {
478  //DCOUT('x', "curN=" << curNode.logicalPart() << " scope[0]=" << sc[cur].logicalPart() );
479  if (curNode==sc[cur]) {
480  bool res(false);
481  while(cur+1 < mxx && firstChild()) {
482  ++cur;
483  //DCOUT('x', "fc-curN=" << history_.back().logicalPart() << " scope[x]=" << sc[cur].logicalPart() );
484  if (!(history_.back()==sc[cur])) {
485  while(nextSibling()) {
486  //DCOUT('x', "ns-curN=" << history_.back().logicalPart() << " scope[x]=" << sc[cur].logicalPart() );
487  if (history_.back()==sc[cur]) {
488  res=true;
489  break;
490  }
491  }
492  }
493  else {
494  res=true;
495  }
496  if (res==false)
497  break;
498  }
499  result = res;
500  }
501  }
502  return result;
503 }
DDGeoHistory history_
std::vector of DDExpandedNode
represents one node in the DDExpandedView
uint16_t size_type
tuple result
Definition: query.py:137
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 148 of file DDExpandedView.cc.

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

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

149 {
150  bool result(false);
151  bool depthNotReached(true);
152 
153  // Check for the depth within the scope ...
154  if (depth_) {
155  if ( (history_.size()-scope_.size())==depth_ ) {
156  depthNotReached=false;
157  }
158  }
159  if (depthNotReached) {
160  if ((*walker_).firstChild()) {
161  DDExpandedNode & expnBefore(history_.back());
162  DDCompactView::walker_type::value_type curr = (*walker_).current();
163 
164  DDPosData * newPosd = curr.second;
165 
166  // T = ... (see nextSiblinig())
167  DDTranslation newTrans = expnBefore.trans_ + expnBefore.rot_ * newPosd->trans_;
168 
169  // R = ... (see nextSibling())
170  DDRotationMatrix newRot = expnBefore.rot_ * newPosd->rot();//.inverse();
171 
172  // create a new Expanded node and push it to the history ...
173  DDExpandedNode expn(curr.first, curr.second,
174  newTrans, newRot, 0);
175 
176  history_.push_back(expn);
177 
178  /* debug output
179  edm::LogInfo("DDExpandedView") << "FIRSTCHILD: name=" << expn.logicalPart().ddname()
180  << " rot=";
181 
182  if (expn.absRotation().isIdentity())
183  edm::LogInfo("DDExpandedView") << "[none]" << std::endl;
184  else
185  edm::LogInfo("DDExpandedView") << expn.absRotation() << std::endl;
186  */
187 
188  result = true;
189  } // if firstChild
190  } // if depthNotReached
191  return result;
192 }
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:16
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
graph< DDLogicalPart, DDPosData * >::value_type value_type
Definition: graphwalker.h:38
tuple result
Definition: query.py:137
const DDRotationMatrix & rot() const
Definition: DDPosData.h:41
DDTranslation trans_
Definition: DDPosData.h:47
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 506 of file DDExpandedView.cc.

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

506  {
507  return goTo(&newpos.front(),newpos.size());
508 
509 }
bool goTo(const nav_type &)
transversed the DDExpandedView according to the given stack of sibling numbers
bool DDExpandedView::goTo ( NavRange  newpos)

Definition at line 511 of file DDExpandedView.cc.

References goTo().

511  {
512  return goTo(newpos.first,newpos.second);
513 }
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 515 of file DDExpandedView.cc.

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

516 {
517  bool result(false);
518 
519  // save the current position
520  //nav_type savedPos = navPos();
521  DDGeoHistory savedPos = history_;
522 
523  // reset to root node
524  //FIXME: reset to root of scope!!
525  reset();
526 
527  // try to navigate down to the newpos
528  for (size_t i = 1; i < sz; ++i) {
529  result = firstChild();
530  if (result) {
531  int pos = newpos[i];
532  for(int k=0; k<pos; ++k) {
533  result = nextSibling();
534  }
535  }
536  else {
537  break;
538  }
539  }
540 
541  if (!result) {
542  goToHistory(savedPos);
543  }
544  return result;
545 }
int i
Definition: DBlmapReader.cc:9
DDGeoHistory history_
std::vector of DDExpandedNode
tuple result
Definition: query.py:137
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)
 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 422 of file DDExpandedView.cc.

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

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

423 {
424  bool result = true;
425  int tempD = depth_;
426  //DCOUT('G', " goto- target= " << pos );
427  DDGeoHistory tempScope = scope_;
428  reset();
429  DDGeoHistory::size_type s = pos.size();
430  for( DDGeoHistory::size_type j=1; j<s; ++j) {
431  if (! firstChild()) {
432  result = false;
433  //edm::LogError("DDExpandedView") << " ERROR! , wrong usage of DDExpandedView::goTo! " << std::endl;
434  //exit(1);
435  break;
436  }
437  int i=0;
438  for (; i<pos[j].siblingno(); ++i) {
439  if (! nextSibling()) {
440  //edm::LogError("DDExpandedView") << " ERROR! , wrong usage of DDExpandedView::goTo! " << std::endl;
441  result = false;
442  }
443  }
444  }
445 
446  if (!result) {
447  reset();
448  setScope(tempScope, tempD);
449  }
450  else {
451  scope_ = tempScope;
452  depth_ = tempD;
453  }
454 
455  //DCOUT('G', " goto-result = " << history_ );
456  return result;
457 }
int i
Definition: DBlmapReader.cc:9
unsigned int depth_
depth of the scope, 0==unrestricted depth
uint16_t size_type
tuple result
Definition: query.py:137
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 334 of file DDExpandedView.cc.

References mergedSpecificsV().

Referenced by MagGeoBuilderFromDDD::volumeHandle::volumeHandle().

334  {
335  DDsvalues_type merged;
336  mergedSpecificsV(merged);
337  return merged;
338 }
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 341 of file DDExpandedView.cc.

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

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

342 {
343 
344  merged.clear();
345  const std::vector<std::pair<DDPartSelection*, DDsvalues_type*> > & specs = logicalPart().attachedSpecifics();
346  if (specs.empty()) return;
347  const DDGeoHistory & hist = geoHistory();
348  for (size_t i=0; i<specs.size(); ++i) {
349  const std::pair<DDPartSelection*,DDsvalues_type*>& sp = specs[i];
350  const DDPartSelection & psel = *(sp.first);
351  if (DDCompareEqual(hist, psel)())
352  merge(merged,*sp.second);
353  }
354  // std::sort(merged.begin(),merged.end());
355 }
int i
Definition: DBlmapReader.cc:9
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.
const std::vector< std::pair< DDPartSelection *, DDsvalues_type * > > & attachedSpecifics(void) const
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.
DDExpandedView::nav_type DDExpandedView::navPos ( ) const

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

Definition at line 548 of file DDExpandedView.cc.

References history_, i, j, and pos.

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

549 {
552  nav_type pos(j);
553 
554  for (;i<j;++i)
555  pos[i] = history_[i].siblingno();
556 
557  return pos;
558 }
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 246 of file DDExpandedView.cc.

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

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

247 {
248  bool res(false);
249  if(firstChild())
250  res=true;
251  else if(nextSibling())
252  res=true;
253  else {
254  while(parent()) {
255  //DCOUT('C', "pa=" << logicalPart() );
256  if(nextSibling()) {
257  //DCOUT('C', "ns=" << logicalPart() );
258  res=true;
259  break;
260  }
261  }
262  //DCOUT('C', current().first << " "<< current().second );
263  }
264  return res;
265 }
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 269 of file DDExpandedView.cc.

270 {
271  bool res(false);
272  return res;
273 }
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 101 of file DDExpandedView.cc.

References history_, query::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()().

102 {
103  bool result(false);
104  if (scope_.size() && history_.back() == scope_.back()) {
105  ; // no-next-sibling, if current node is the root of the scope!
106  }
107  else {
108  if ((*walker_).nextSibling()) {
109  DDExpandedNode & expn(history_.back()); // back of history_ is always current node
110  DDCompactView::walker_type::value_type curr = (*walker_).current();
111  DDPosData const * posdOld = expn.posd_;
112  expn.logp_=curr.first;
113  expn.posd_=curr.second;
114 
115  DDGeoHistory::size_type hsize = history_.size();
116 
117 
118  if (hsize>1) {
119  const DDExpandedNode & expnBefore(history_[hsize-2]);
120 
121  // T = T1 + INV[R1] * T2
122  expn.trans_ = expnBefore.trans_ + (expnBefore.rot_ * expn.posd_->trans_);
123 
124  // R = R1*INV[R2]
125  // VI in principle we can do this
126  if ( !(expn.posd_->rot()==posdOld->rot()) ) {
127  expn.rot_ = expnBefore.rot_ * expn.posd_->rot();//.inverse();
128  ++counter().diff;
129  }else ++counter().same;
130 
131  }
132  else {
133  expn.trans_ = expn.posd_->trans_;
134  expn.rot_ = expn.posd_->rot();//.inverse();
135  }
136  ++expn.siblingno_;
137  result = true;
138  }
139  }
140  return result;
141 }
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:16
DDGeoHistory history_
std::vector of DDExpandedNode
represents one node in the DDExpandedView
uint16_t size_type
graph< DDLogicalPart, DDPosData * >::value_type value_type
Definition: graphwalker.h:38
tuple result
Definition: query.py:137
const DDRotationMatrix & rot() const
Definition: DDPosData.h:41
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 199 of file DDExpandedView.cc.

References history_, query::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().

200 {
201  bool result(false);
202  bool scopeRoot(false);
203 
204  // check for a scope
205  if (scope_.size()) {
206  if (scope_.back() == history_.back()) {
207  // the current node is the root of the scope
208  scopeRoot = true;
209  }
210  }
211 
212  if (!scopeRoot) {
213  if ((*walker_).parent()) {
214  history_.pop_back();
215  result = true;
216  }
217  }
218 
219  return result;
220 }
DDGeoHistory history_
std::vector of DDExpandedNode
tuple result
Definition: query.py:137
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 376 of file DDExpandedView.cc.

References clearScope(), and parent().

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

377 {
378  clearScope();
379  while(parent())
380  ;
381 }
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 53 of file DDExpandedView.cc.

References history_.

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

54 {
55  return history_.back().rot_;
56 }
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 364 of file DDExpandedView.cc.

References scope_.

Referenced by DDFilteredView::scope().

365 {
366  return scope_;
367 }
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 394 of file DDExpandedView.cc.

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

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

395 {
396  bool result(false);
397 
398  DDGeoHistory buf = scope_; // save current scope
399  scope_.clear(); // sets scope to global (full) scope
400 
401  while (parent()) ; // move up to the root of the expanded-view
402 
403  if (descend(sc)) { // try to move down the given scope-history ...
404  scope_ = sc;
405  depth_ = depth;
406  result = true;
407  }
408  else {
409  scope_ = buf;
410  }
411 
412  return result;
413 }
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.
tuple result
Definition: query.py:137
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 attac hed 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 300 of file DDExpandedView.cc.

References query::result, and specificsV().

Referenced by DDQuery::exec().

301 {
302  // backward compatible
303  std::vector<const DDsvalues_type * > result;
304  specificsV(result);
305  return result;
306 }
void specificsV(std::vector< const DDsvalues_type * > &vc) const
tuple result
Definition: query.py:137
void DDExpandedView::specificsV ( std::vector< const DDsvalues_type * > &  vc) const

Definition at line 308 of file DDExpandedView.cc.

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

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

309 {
310  unsigned int i(0);
311  //edm::LogInfo("DDExpandedView") << " in ::specifics " << std::endl;
312  const std::vector<std::pair<DDPartSelection*, DDsvalues_type*> > & specs = logicalPart().attachedSpecifics();
313  if (specs.size()) { // do only if SpecPar has data defined
314  //edm::LogInfo("DDExpandedView") << " found: specifics size=" << specs.size() << std::endl;
315  result.reserve(specs.size());
316  for (; i<specs.size(); ++i) {
317  const std::pair<DDPartSelection*,DDsvalues_type*>& sp = specs[i];
318  // a part selection
319  const DDPartSelection & psel = *(sp.first);
320  //edm::LogInfo("DDExpandedView") << " partsel.size = " << psel.size() << std::endl;
321  //edm::LogInfo("DDExpandedView") << " geohistory = " << geoHistory() << std::endl;
322  const DDGeoHistory & hist = geoHistory();
323 
324  //dump(hist);
325  //dump(psel);
326 
327  if (DDCompareEqual(hist, psel)()) //edm::LogInfo("DDExpandedView") << "MATCH!!!!" << std::endl;
328  result.push_back( sp.second );
329  }
330  }
331 }
int i
Definition: DBlmapReader.cc:9
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.
const std::vector< std::pair< DDPartSelection *, DDsvalues_type * > > & attachedSpecifics(void) const
tuple result
Definition: query.py:137
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 DDTranslation & DDExpandedView::translation ( void  ) const

The absolute translation of the current node.

Definition at line 47 of file DDExpandedView.cc.

References history_.

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

48 {
49  return history_.back().trans_;
50 }
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().

DDPosData* DDExpandedView::worldpos_
protected

???

Definition at line 136 of file DDExpandedView.h.

Referenced by DDExpandedView().