CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
DDFilteredView Class Reference

#include <DDFilteredView.h>

Public Types

typedef DDExpandedView::nav_type nav_type
 

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...
 
 DDFilteredView (const DDCompactView &, const DDFilter &)
 Keeps a pointer to the DDfilter. More...
 
 DDFilteredView ()=delete
 
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 &)
 
const std::vector< DDGeoHistory > & history () const
 
const DDLogicalPartlogicalPart () const
 The logical-part of the current node in the filtered-view. More...
 
DDsvalues_type mergedSpecifics () const
 
void mergedSpecificsV (DDsvalues_type &merged) const
 
nav_type navPos () const
 return the stack of sibling numbers More...
 
bool next ()
 set current node to the next node in the filtered tree More...
 
bool nextSibling ()
 set the current node to the next sibling ... More...
 
bool parent ()
 set the current node to the parent node ... More...
 
void print ()
 
void reset ()
 clears the scope and sets the filtered view to its root-node 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)
 sets the scope of the expanded view More...
 
std::vector< const DDsvalues_type * > specifics () const
 
void specificsV (std::vector< const DDsvalues_type * > &result) const
 User specific data attached to the current node. More...
 
const DDTranslationtranslation () const
 The absolute translation of the current node. More...
 

Private Member Functions

bool filter ()
 

Private Attributes

DDExpandedView epv_
 
DDFilter const * filter_
 
std::vector< DDGeoHistoryparents_
 

Detailed Description

Description: Filtered View of a Tree

Implementation: Filter criteria is defined in XML

Definition at line 18 of file DDFilteredView.h.

Member Typedef Documentation

Definition at line 21 of file DDFilteredView.h.

Constructor & Destructor Documentation

DDFilteredView::DDFilteredView ( const DDCompactView cpv,
const DDFilter fltr 
)

Keeps a pointer to the DDfilter.

Definition at line 12 of file DDFilteredView.cc.

References epv_, DDExpandedView::geoHistory(), and parents_.

13  : epv_(cpv), filter_(&fltr)
14 {
15  parents_.emplace_back(epv_.geoHistory());
16 }
DDExpandedView epv_
std::vector< DDGeoHistory > parents_
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
DDFilter const * filter_
DDFilteredView::DDFilteredView ( )
delete

Member Function Documentation

void DDFilteredView::clearScope ( )

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

Definition at line 81 of file DDFilteredView.cc.

References DDExpandedView::clearScope(), epv_, DDExpandedView::geoHistory(), and parents_.

82 {
83  epv_.clearScope();
84  parents_.clear();
85  parents_.emplace_back(epv_.geoHistory());
86 }
DDExpandedView epv_
std::vector< DDGeoHistory > parents_
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
void clearScope()
clears the scope; the full tree is available, depth=0
int DDFilteredView::copyno ( ) const

Copy number associated with the current node.

Definition at line 61 of file DDFilteredView.cc.

References DDExpandedView::copyno(), and epv_.

Referenced by CTPPSGeometryESModule::buildDetGeomDesc(), DTGeometryParserFromDDD::buildLayer(), DTGeometryBuilderFromDDD::buildLayer(), and DTGeometryParsFromDD::insertLayer().

62 {
63  return epv_.copyno();
64 }
DDExpandedView epv_
int copyno() const
Copy number associated with the current node.
DDFilteredView::nav_type DDFilteredView::copyNumbers ( ) const
bool DDFilteredView::filter ( )
private
bool DDFilteredView::firstChild ( )

set the current node to the first child ...

Algorithm:

  • find the first child matching the filter down the current subtree using next() which transverses already in the required hierarchical sequence ...

Definition at line 108 of file DDFilteredView.cc.

References DDExpandedView::depth_, epv_, DDExpandedView::geoHistory(), DDExpandedView::goToHistory(), next(), parents_, mps_fire::result, and DDExpandedView::scope_.

Referenced by ListIds::analyze(), HcalParametersFromDD::build(), FastTimeParametersFromDD::build(), HGCalParametersFromDD::build(), MTDParametersFromDD::build(), CmsTrackerLevelBuilder::build(), CSCGeometryParsFromDD::build(), GEMGeometryBuilderFromDDD::build(), CmsMTDLevelBuilder::build(), CmsMTDConstruction::buildComponent(), CmsDetConstruction::buildComponent(), CTPPSGeometryESModule::buildDetGeomDesc(), ME0GeometryParsFromDD::buildGeometry(), ME0GeometryBuilderFromDDD::buildGeometry(), GEMGeometryParsFromDD::buildGeometry(), RPCGeometryBuilderFromDDD::buildGeometry(), RPCGeometryParsFromDD::buildGeometry(), DTGeometryParsFromDD::buildGeometry(), DTGeometryBuilderFromDDD::buildGeometry(), DTGeometryParserFromDDD::buildLayer(), DTGeometryBuilderFromDDD::buildLayer(), CaloTrkProcessing::CaloTrkProcessing(), HGCalSimHitValidation::defineGeometry(), ECalSD::ECalSD(), FastTimerSD::FastTimerSD(), MaterialBudgetHcalHistos::fillBeginJob(), HcalTB06BeamSD::getNames(), MaterialBudgetHcalHistos::getNames(), HCalSD::getNames(), HCalSD::HCalSD(), HcalTB06BeamSD::HcalTB06BeamSD(), HFFibre::HFFibre(), HFShowerFibreBundle::HFShowerFibreBundle(), HFShowerPMT::HFShowerPMT(), DreamSD::initMap(), HcalTB02SD::initMap(), ECalSD::initMap(), DTGeometryParsFromDD::insertLayer(), HGCalGeomParameters::loadCellParsHexagon(), HGCalGeomParameters::loadGeometryHexagon(), HGCalGeomParameters::loadSpecParsHexagon(), EcalTBHodoscopeGeometryLoaderFromDDD::makeGeometry(), MtdSD::MtdSD(), MuonDDDConstants::MuonDDDConstants(), nextSibling(), DTGeometryParserFromDDD::parseGeometry(), CmsTrackerRingBuilder::sortNS(), and PrintGeomInfoAction::update().

109 {
110  bool result = false;
111 
112  // save the current position
113  DDGeoHistory savedPos = epv_.geoHistory();
114 
115  // save the current scope
116  DDGeoHistory savedScope = epv_.scope_;
117  int savedDepth = epv_.depth_;
118 
119  // set current node to be the scope
121  epv_.depth_ = 0;
122 
123  // search the subtree for the first matching node
124  if (next()) {
125  result = true;
126  epv_.scope_ = savedScope;
127  epv_.depth_ = savedDepth;
128  }
129  else { // restore the starting point
130  epv_.scope_ = savedScope;
131  epv_.depth_ = savedDepth;
132  epv_.goToHistory(savedPos);
133  }
134 
135  if (result) {
136  parents_.emplace_back(epv_.geoHistory());
137  }
138 
139  return result;
140 }
DDExpandedView epv_
std::vector< DDGeoHistory > parents_
unsigned int depth_
depth of the scope, 0==unrestricted depth
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
bool next()
set current node to the next node in the filtered tree
std::vector< DDExpandedNode > DDGeoHistory
Geometrical &#39;path&#39; of the current node up to the root-node.
bool goToHistory(const DDGeoHistory &sc)
DDGeoHistory scope_
scope of the expanded view
const DDGeoHistory & DDFilteredView::geoHistory ( ) const
bool DDFilteredView::goTo ( const nav_type )

Definition at line 233 of file DDFilteredView.cc.

References mps_fire::result.

Referenced by TrackerG4SimHitNumberingScheme::getFilteredView().

234 {
235  // WARNING!!!!!!!!!!
236  // NOT IMPLEMENTED!!!!!!!
237  bool result(false);
238  return result;
239 }
const std::vector< DDGeoHistory > & DDFilteredView::history ( ) const

Definition at line 251 of file DDFilteredView.cc.

References parents_.

Referenced by CmsTrackerLevelBuilder::build(), and CmsMTDLevelBuilder::build().

252 {
253  return parents_;
254 }
std::vector< DDGeoHistory > parents_
const DDLogicalPart & DDFilteredView::logicalPart ( ) const

The logical-part of the current node in the filtered-view.

Definition at line 18 of file DDFilteredView.cc.

References epv_, and DDExpandedView::logicalPart().

Referenced by ListIds::analyze(), CSCGeometryParsFromDD::build(), GEMGeometryBuilderFromDDD::build(), CmsMTDConstruction::buildBTLModule(), ME0GeometryParsFromDD::buildChamber(), ME0GeometryBuilderFromDDD::buildChamber(), GEMGeometryParsFromDD::buildChamber(), GEMGeometryBuilderFromDDD::buildChamber(), CmsMTDConstruction::buildComponent(), CmsMTDTrayBuilder::buildComponent(), CmsMTDDiscBuilder::buildComponent(), CmsMTDEndcapBuilder::buildComponent(), CmsMTDSubStrctBuilder::buildComponent(), CmsMTDBuilder::buildComponent(), CTPPSGeometryESModule::buildDetGeomDesc(), ME0GeometryParsFromDD::buildEtaPartition(), ME0GeometryBuilderFromDDD::buildEtaPartition(), GEMGeometryParsFromDD::buildEtaPartition(), GEMGeometryBuilderFromDDD::buildEtaPartition(), ME0GeometryParsFromDD::buildGeometry(), ME0GeometryBuilderFromDDD::buildGeometry(), RPCGeometryBuilderFromDDD::buildGeometry(), GEMGeometryParsFromDD::buildGeometry(), RPCGeometryParsFromDD::buildGeometry(), ME0GeometryParsFromDD::buildLayer(), ME0GeometryBuilderFromDDD::buildLayer(), GEMGeometryParsFromDD::buildSuperChamber(), GEMGeometryBuilderFromDDD::buildSuperChamber(), HGCalSimHitValidation::defineGeometry(), DTGeometryParsFromDD::extractParameters(), DTGeometryBuilderFromDDD::extractParameters(), ME0GeometryParsFromDD::getDimension(), HcalTB06BeamSD::getNames(), MaterialBudgetHcalHistos::getNames(), HCalSD::getNames(), HCalSD::HCalSD(), HcalTB06BeamSD::HcalTB06BeamSD(), DreamSD::initMap(), HcalTB02SD::initMap(), ECalSD::initMap(), HcalGeomParameters::loadGeometry(), HGCalGeomParameters::loadGeometryHexagon(), HGCalGeomParameters::loadGeometryHexagon8(), EcalTBHodoscopeGeometryLoaderFromDDD::makeGeometry(), MaterialAccountingGroup::MaterialAccountingGroup(), and PrintGeomInfoAction::update().

19 {
20  return epv_.logicalPart();
21 }
DDExpandedView epv_
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the expanded-view.
DDsvalues_type DDFilteredView::mergedSpecifics ( ) const
void DDFilteredView::mergedSpecificsV ( DDsvalues_type merged) const

Definition at line 49 of file DDFilteredView.cc.

References epv_, and DDExpandedView::mergedSpecificsV().

50 {
51  epv_.mergedSpecificsV(merged);
52 }
DDExpandedView epv_
void mergedSpecificsV(DDsvalues_type &res) const
DDFilteredView::nav_type DDFilteredView::navPos ( ) const

return the stack of sibling numbers

Definition at line 223 of file DDFilteredView.cc.

References epv_, and DDExpandedView::navPos().

Referenced by GeometricDet::GeometricDet(), and GeometricTimingDet::GeometricTimingDet().

224 {
225  return epv_.navPos();
226 }
DDExpandedView epv_
nav_type navPos() const
return the stack of sibling numbers which indicates the current position in the DDExpandedView ...
bool DDFilteredView::next ( void  )
bool DDFilteredView::nextSibling ( )

set the current node to the next sibling ...

Algorithm:

  • find the first node - which matches the filter - in the subtrees of the siblings of the current node

Definition at line 148 of file DDFilteredView.cc.

References epv_, filter(), firstChild(), RemoveAddSevLevel::flag, DDExpandedView::geoHistory(), DDExpandedView::goToHistory(), DDExpandedView::nextSibling(), DDExpandedView::parent(), parents_, and mps_fire::result.

Referenced by CmsTrackerLevelBuilder::build(), GEMGeometryBuilderFromDDD::build(), CmsMTDLevelBuilder::build(), CmsDetConstruction::buildComponent(), CmsMTDConstruction::buildComponent(), CTPPSGeometryESModule::buildDetGeomDesc(), ME0GeometryParsFromDD::buildGeometry(), ME0GeometryBuilderFromDDD::buildGeometry(), GEMGeometryParsFromDD::buildGeometry(), RPCGeometryBuilderFromDDD::buildGeometry(), RPCGeometryParsFromDD::buildGeometry(), DTGeometryParsFromDD::buildGeometry(), DTGeometryBuilderFromDDD::buildGeometry(), DTGeometryParserFromDDD::buildLayer(), DTGeometryBuilderFromDDD::buildLayer(), DTGeometryParsFromDD::insertLayer(), EcalTBHodoscopeGeometryLoaderFromDDD::makeGeometry(), and DTGeometryParserFromDDD::parseGeometry().

149 {
150  //PRE: the current node A is one matching the filter or the (scoped) root
151  //POST: current node is A if no filter has matched, or B with matching filter
152  // B is the firstChild matching the filter in the subtrees of A's siblings
153  bool result = false;
154  DDGeoHistory savedPos = epv_.geoHistory();
155 
156  bool flag = true;
157  //bool shuffleParent = false;
158  while (flag) {
159  if (epv_.nextSibling()) {
160  if ( filter() ) {
161  result = true;
162  break;
163  }
164  else if (firstChild()) {
165  result = true;
166  // firstChild increases parents!
167  parents_.pop_back();
168  break;
169  }
170  } // <-- epv_.nextSibling
171  else if (!epv_.parent()) {
172  flag = false;
173  }
174  if (epv_.geoHistory().size() == parents_[parents_.size()-2].size()) {
175  flag = false;
176  }
177  }
178 
179  if (!result)
180  epv_.goToHistory(savedPos);
181  else
182  parents_.back() = epv_.geoHistory();
183 
184  return result;
185 }
bool parent()
set the current node to the parent node ...
DDExpandedView epv_
std::vector< DDGeoHistory > parents_
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.
bool nextSibling()
set the current node to the next sibling ...
bool firstChild()
set the current node to the first child ...
bool goToHistory(const DDGeoHistory &sc)
bool DDFilteredView::parent ( )

set the current node to the parent node ...

Definition at line 187 of file DDFilteredView.cc.

References epv_, DDExpandedView::goToHistory(), parents_, and mps_fire::result.

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(), CmsTrackerLevelBuilder::build(), GEMGeometryBuilderFromDDD::build(), CmsMTDLevelBuilder::build(), CmsDetConstruction::buildComponent(), CmsMTDConstruction::buildComponent(), CTPPSGeometryESModule::buildDetGeomDesc(), ME0GeometryParsFromDD::buildGeometry(), ME0GeometryBuilderFromDDD::buildGeometry(), GEMGeometryParsFromDD::buildGeometry(), DTGeometryParsFromDD::buildGeometry(), DTGeometryBuilderFromDDD::buildGeometry(), 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(), DTGeometryParsFromDD::insertLayer(), 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(), Vispa.Views.LineDecayView.LineDecayContainer::noDecorationsMode(), Vispa.Views.LineDecayView.LineDecayContainer::operationId(), Vispa.Views.LineDecayView.DecayLine::paint(), Vispa.Gui.VispaWidget.VispaWidget::paintEvent(), DTGeometryParserFromDDD::parseGeometry(), Vispa.Gui.ConnectableWidget.ConnectableWidget::positionizeMenuWidget(), print(), Vispa.Views.LineDecayView.DecayLine::qtLineStyle(), 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(), Vispa.Views.LineDecayView.LineDecayContainer::sizeHint(), CmsTrackerRingBuilder::sortNS(), 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().

188 {
189  bool result = false;
190 
191  if (parents_.size()==1) {
192  result = false;
193  }
194  else {
195  parents_.pop_back();
196  epv_.goToHistory(parents_.back());
197  result = true;
198  }
199 
200  // =====> CHECK WHETHER THE FOLLOWING REMARKS STILL REPRESENT THE IMPLEMENTATION ABOVE <===
201  // case 1: we've reached the (scoped) root of the underlying expanded-view
202  // from the first child of the fitered-view; result must be true
203  // case 2: we've reached a parent-node where the filter said 'yes';
204  // result must be true
205  // case 3: we are already at the (scoped) root of the underlying expanded-view
206  // result must be false
207 
208  return result;
209 }
DDExpandedView epv_
std::vector< DDGeoHistory > parents_
bool goToHistory(const DDGeoHistory &sc)
void DDFilteredView::print ( void  )

Definition at line 241 of file DDFilteredView.cc.

References epv_, parent(), parents_, and DDExpandedView::scope_.

241  {
242  edm::LogInfo("DDFliteredView") << "FilteredView Status" << std::endl
243  << "-------------------" << std::endl
244  << "scope = " << epv_.scope_ << std::endl
245  << "parents:" << std::endl;
246  for (const auto & parent : parents_)
247  edm::LogInfo("DDFliteredView") << " " << parent << std::endl;
248 
249 }
bool parent()
set the current node to the parent node ...
DDExpandedView epv_
std::vector< DDGeoHistory > parents_
DDGeoHistory scope_
scope of the expanded view
void DDFilteredView::reset ( void  )

clears the scope and sets the filtered view to its root-node

Definition at line 211 of file DDFilteredView.cc.

References epv_, DDExpandedView::geoHistory(), parents_, and DDExpandedView::reset().

212 {
213  epv_.reset();
214  parents_.clear();
215  parents_.emplace_back(epv_.geoHistory());
216 }
DDExpandedView epv_
std::vector< DDGeoHistory > parents_
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
void reset()
true, if a call to firstChild() would succeed (current node has at least one child) ...
const DDRotationMatrix & DDFilteredView::rotation ( void  ) const
const DDGeoHistory & DDFilteredView::scope ( ) const

The scope of the expanded-view.

Definition at line 66 of file DDFilteredView.cc.

References epv_, and DDExpandedView::scope().

67 {
68  return epv_.scope();
69 }
DDExpandedView epv_
const DDGeoHistory & scope() const
The scope of the expanded-view.
bool DDFilteredView::setScope ( const DDGeoHistory hist)

sets the scope of the expanded view

Definition at line 71 of file DDFilteredView.cc.

References epv_, parents_, mps_fire::result, and DDExpandedView::setScope().

72 {
73  bool result = epv_.setScope(hist,0);
74  if (result) {
75  parents_.clear();
76  parents_.emplace_back(hist);
77  }
78  return result;
79 }
DDExpandedView epv_
std::vector< DDGeoHistory > parents_
bool setScope(const DDGeoHistory &hist, int depth=0)
sets the scope of the expanded view
std::vector< const DDsvalues_type * > DDFilteredView::specifics ( ) const
void DDFilteredView::specificsV ( std::vector< const DDsvalues_type * > &  result) const

User specific data attached to the current node.

Definition at line 44 of file DDFilteredView.cc.

References epv_, and DDExpandedView::specificsV().

Referenced by dddGetStringRaw().

45 {
47 }
DDExpandedView epv_
void specificsV(std::vector< const DDsvalues_type * > &vc) const
const DDTranslation & DDFilteredView::translation ( void  ) const

Member Data Documentation

DDExpandedView DDFilteredView::epv_
private
DDFilter const* DDFilteredView::filter_
private

Definition at line 90 of file DDFilteredView.h.

Referenced by filter().

std::vector<DDGeoHistory> DDFilteredView::parents_
private