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

References history_, DDI::Singleton< I >::instance(), rot_, trans_, w2_, walker_, and worldpos_.

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

39 { }

Member Function Documentation

void DDExpandedView::clearScope ( )

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

Definition at line 371 of file DDExpandedView.cc.

References depth_, and scope_.

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

372 {
373  scope_.clear();
374  depth_=0;
375 }
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 72 of file DDExpandedView.cc.

References history_.

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

73 {
74  return history_.back().copyno();
75  //return (*walker_).current().second->copyno_;
76 }
DDGeoHistory history_
std::vector of DDExpandedNode
DDExpandedView::nav_type DDExpandedView::copyNumbers ( ) const

return the stack of copy numbers

Definition at line 562 of file DDExpandedView.cc.

References history_, and query::result.

Referenced by DDFilteredView::copyNumbers().

563 {
565  DDGeoHistory::size_type sz = history_.size();
566  nav_type result(sz);
567 
568  for (; it < sz; ++it) {
569  result[it] = history_[it].copyno();
570  }
571  return result;
572 }
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 66 of file DDExpandedView.cc.

References depth_.

Referenced by setScope().

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

Definition at line 462 of file DDExpandedView.cc.

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

Referenced by setScope().

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

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

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

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

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

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

Definition at line 513 of file DDExpandedView.cc.

References goTo().

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

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

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

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

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

425 {
426  bool result = true;
427  int tempD = depth_;
428  //DCOUT('G', " goto- target= " << pos );
429  DDGeoHistory tempScope = scope_;
430  reset();
431  DDGeoHistory::size_type s = pos.size();
432  for( DDGeoHistory::size_type j=1; j<s; ++j) {
433  if (! firstChild()) {
434  result = false;
435  //edm::LogError("DDExpandedView") << " ERROR! , wrong usage of DDExpandedView::goTo! " << std::endl;
436  //exit(1);
437  break;
438  }
439  int i=0;
440  for (; i<pos[j].siblingno(); ++i) {
441  if (! nextSibling()) {
442  //edm::LogError("DDExpandedView") << " ERROR! , wrong usage of DDExpandedView::goTo! " << std::endl;
443  result = false;
444  }
445  }
446  }
447 
448  if (!result) {
449  reset();
450  setScope(tempScope, tempD);
451  }
452  else {
453  scope_ = tempScope;
454  depth_ = tempD;
455  }
456 
457  //DCOUT('G', " goto-result = " << history_ );
458  return result;
459 }
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 ...
string s
Definition: asciidump.py:422
DDGeoHistory scope_
scope of the expanded view
const DDLogicalPart & DDExpandedView::logicalPart ( ) const
DDsvalues_type DDExpandedView::mergedSpecifics ( ) const

Definition at line 336 of file DDExpandedView.cc.

References mergedSpecificsV().

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

336  {
337  DDsvalues_type merged;
338  mergedSpecificsV(merged);
339  return merged;
340 }
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 343 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().

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

References history_, i, j, and pos.

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

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

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

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

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

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

References cmsDriverOptions::counter, history_, query::result, DDPosData::rot(), DDExpandedNode::rot_, scope_, and DDExpandedNode::trans_.

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

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

References history_, query::result, and scope_.

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

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

References clearScope(), and parent().

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

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

References history_.

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

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

References scope_.

Referenced by DDFilteredView::scope().

367 {
368  return scope_;
369 }
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 396 of file DDExpandedView.cc.

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

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

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

References query::result, and specificsV().

Referenced by DDQuery::exec().

303 {
304  // backward compatible
305  std::vector<const DDsvalues_type * > result;
306  specificsV(result);
307  return result;
308 }
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 310 of file DDExpandedView.cc.

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

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

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

References history_.

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

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