CMS 3D CMS Logo

FWEveOverlap.cc
Go to the documentation of this file.
2 #include "TGeoOverlap.h"
8 //==============================================================================
9 //==============================================================================
10 //==============================================================================
13 
15 //______________________________________________________________________________
16 
17 void FWEveOverlap::Paint(Option_t*) {
18  if (m_browser->getTableManager()->refEntries().empty())
19  return;
20 
22 
23  TEveGeoManagerHolder gmgr(FWGeometryTableViewManager::getGeoMangeur());
24 
25  int topNodeIdx = m_browser->getTopNodeIdx();
26 
28  std::advance(sit, topNodeIdx);
29  TGeoHMatrix mtx;
31 
32  bool drawsChildren = false;
33 
34  if ((*sit).testBit(FWGeometryTableManagerBase::kVisNodeChld))
35  drawsChildren = paintChildNodesRecurse(sit, topNodeIdx, mtx);
36 
38  paintShape(topNodeIdx, mtx, false, drawsChildren);
39 }
40 
41 // ______________________________________________________________________
43  Int_t cnt,
44  const TGeoHMatrix& parentMtx) {
45  TGeoNode* parentNode = pIt->m_node;
46  int nD = parentNode->GetNdaughters();
47 
48  int dOff = 0;
49 
50  pIt++;
51  int pcnt = cnt + 1;
52 
53  bool drawsChildren = false;
54 
56  for (int n = 0; n != nD; ++n) {
57  it = pIt;
58  std::advance(it, n + dOff);
59  cnt = pcnt + n + dOff;
60 
61  TGeoHMatrix nm = parentMtx;
62  nm.Multiply(it->m_node->GetMatrix());
63 
64  bool drawsChildrenSecondGen = false;
66  drawsChildrenSecondGen = paintChildNodesRecurse(it, cnt, nm);
67 
69  if (it->testBit(FWOverlapTableManager::kOverlap)) {
70  int nno;
71  it->m_node->GetOverlaps(nno);
72  if ((m_browser->m_rnrOverlap.value() && ((nno & BIT(1)) == BIT(1))) ||
73  (m_browser->m_rnrExtrusion.value() && ((nno & BIT(2)) == BIT(2)))) {
74  paintShape(cnt, nm, false, drawsChildrenSecondGen);
75  drawsChildren = true;
76  }
77 
78  } else {
79  paintShape(cnt, nm, false, drawsChildrenSecondGen);
80  drawsChildren = true;
81  }
82  }
83 
84  drawsChildren |= drawsChildrenSecondGen;
85  FWGeometryTableManagerBase::getNNodesTotal(parentNode->GetDaughter(n), dOff);
86  }
87  return drawsChildren;
88 }
89 
90 //______________________________________________________________________________
91 
93  // printf("highlight tooltio \n");
94  std::set<TGLPhysicalShape*>::iterator it = fHted.begin();
95  int idx = tableIdx(*it);
96  if (idx < 0) {
97  return Form("TopNode ");
98  }
100 
101  TString name = data.name();
102  if (data.testBit(FWOverlapTableManager::kOverlap)) {
103  ((FWOverlapTableManager*)m_browser->getTableManager())->getOverlapTitles(idx, name);
104  return name;
105  }
106 
107  return data.name();
108 }
109 
110 //_____________________________________________________________________________
111 
112 void FWEveOverlap::popupMenu(int x, int y, TGLViewer* v) {
113  FWPopupMenu* nodePopup = setPopupMenu(x, y, v, true);
114 
115  if (nodePopup)
116  nodePopup->Connect("Activated(Int_t)", "FWOverlapTableView", m_browser, "chosenItem(Int_t)");
117 }
DDAxes::y
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
FWGeometryTableViewManager::getGeoMangeur
static TGeoManager * getGeoMangeur()
Definition: FWGeometryTableViewManager.cc:78
FWEveOverlap::paintChildNodesRecurse
bool paintChildNodesRecurse(FWGeometryTableManagerBase::Entries_i pIt, Int_t idx, const TGeoHMatrix &mtx)
Definition: FWEveOverlap.cc:42
FWGeoTopNode::tableIdx
static int tableIdx(TGLPhysicalShape *ps)
Definition: FWGeoTopNode.cc:55
DDAxes::x
findQualityFiles.v
v
Definition: findQualityFiles.py:179
training_settings.idx
idx
Definition: training_settings.py:16
FWOverlapTableManager::kOverlapChild
Definition: FWOverlapTableManager.h:33
FWGeometryTableManagerBase
Definition: FWGeometryTableManagerBase.h:36
FWOverlapTableManager::kOverlap
Definition: FWOverlapTableManager.h:33
FWOverlapTableView::m_rnrOverlap
FWBoolParameter m_rnrOverlap
Definition: FWOverlapTableView.h:81
FWEveOverlap::m_browser
FWOverlapTableView * m_browser
Definition: FWEveOverlap.h:23
FWEveOverlap::FWEveOverlap
FWEveOverlap(FWOverlapTableView *v)
Definition: FWEveOverlap.cc:11
FWEveOverlap::tableManager
FWGeometryTableManagerBase * tableManager() override
Definition: FWEveOverlap.cc:12
FWGeometryTableManagerBase::getNNodesTotal
static void getNNodesTotal(TGeoNode *geoNode, int &off)
Definition: FWGeometryTableManagerBase.h:204
FWGeometryTableViewManager.h
vertices_cff.x
x
Definition: vertices_cff.py:29
FWGeometryTableViewBase
Definition: FWGeometryTableViewBase.h:41
FWOverlapTableView::getTableManager
FWGeometryTableManagerBase * getTableManager() override
Definition: FWOverlapTableView.cc:165
FWEveOverlap::GetHighlightTooltip
TString GetHighlightTooltip() override
Definition: FWEveOverlap.cc:92
FWGeometryTableManagerBase::getNodeMatrix
void getNodeMatrix(const NodeInfo &nodeInfo, TGeoHMatrix &mat) const
Definition: FWGeometryTableManagerBase.cc:161
FWPopupMenu
Definition: FWPopupMenu.cc:5
FWGeometryTableManagerBase::kVisNodeSelf
Definition: FWGeometryTableManagerBase.h:45
FWPopupMenu.cc
FWGeoTopNode::paintShape
void paintShape(Int_t idx, const TGeoHMatrix &nm, bool volumeColor, bool parentNode)
Definition: FWGeoTopNode.cc:213
fwLog.h
FWGeometryTableManagerBase::refEntries
Entries_v & refEntries()
Definition: FWGeometryTableManagerBase.h:143
FWGeometryTableViewBase::getTopNodeIdx
int getTopNodeIdx() const
Definition: FWGeometryTableViewBase.h:97
FWGeometryTableManagerBase::NodeInfo
Definition: FWGeometryTableManagerBase.h:52
FWEveOverlap::popupMenu
void popupMenu(int x, int y, TGLViewer *v) override
Definition: FWEveOverlap.cc:112
FWEveOverlap.h
FWGenericParameter::value
T value() const
Definition: FWGenericParameter.h:50
FWOverlapTableManager
Definition: FWOverlapTableManager.h:31
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
FWOverlapTableView::m_rnrExtrusion
FWBoolParameter m_rnrExtrusion
Definition: FWOverlapTableView.h:82
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
FWGeoTopNode::setPopupMenu
FWPopupMenu * setPopupMenu(int iX, int iY, TGLViewer *v, bool)
Definition: FWGeoTopNode.cc:336
FWOverlapTableManager.h
FWOverlapTableView.h
FWGeometryTableManagerBase::Entries_i
Entries_v::iterator Entries_i
Definition: FWGeometryTableManagerBase.h:88
FWGeometryTableManagerBase::kVisNodeChld
Definition: FWGeometryTableManagerBase.h:46
FWGeoTopNode::fHted
std::set< TGLPhysicalShape * > fHted
Definition: FWGeoTopNode.h:71
FWEveOverlap::browser
FWGeometryTableViewBase * browser() override
Definition: FWEveOverlap.cc:14
FWGeoTopNode::Paint
void Paint(Option_t *option="") override
Definition: FWGeoTopNode.cc:294
FWOverlapTableView
Definition: FWOverlapTableView.h:32
FWEveOverlap::Paint
void Paint(Option_t *option="") override
Definition: FWEveOverlap.cc:17