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 }
FWBoolParameter m_rnrOverlap
void Paint(Option_t *option="") override
Definition: FWEveOverlap.cc:18
FWOverlapTableView * m_browser
Definition: FWEveOverlap.h:23
void popupMenu(int x, int y, TGLViewer *v) override
FWGeometryTableManagerBase * getTableManager() override
bool paintChildNodesRecurse(FWGeometryTableManagerBase::Entries_i pIt, Int_t idx, const TGeoHMatrix &mtx)
Definition: FWEveOverlap.cc:43
TString GetHighlightTooltip() override
Definition: FWEveOverlap.cc:93
FWBoolParameter m_rnrExtrusion
FWEveOverlap(FWOverlapTableView *v)
Definition: FWEveOverlap.cc:12
FWGeometryTableManagerBase * tableManager() override
Definition: FWEveOverlap.cc:13
static void getNNodesTotal(TGeoNode *geoNode, int &off)
FWPopupMenu * setPopupMenu(int iX, int iY, TGLViewer *v, bool)
std::set< TGLPhysicalShape * > fHted
Definition: FWGeoTopNode.h:71
void paintShape(Int_t idx, const TGeoHMatrix &nm, bool volumeColor, bool parentNode)
FWGeometryTableViewBase * browser() override
Definition: FWEveOverlap.cc:15
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
void Paint(Option_t *option="") override
void getNodeMatrix(const NodeInfo &nodeInfo, TGeoHMatrix &mat) const
float x
static int tableIdx(TGLPhysicalShape *ps)
Definition: FWGeoTopNode.cc:55