CMS 3D CMS Logo

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