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();
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 }
FWBoolParameter m_rnrOverlap
void Paint(Option_t *option="") override
Definition: FWEveOverlap.cc:17
FWOverlapTableView * m_browser
Definition: FWEveOverlap.h:23
void popupMenu(int x, int y, TGLViewer *v) override
FWGeometryTableManagerBase * getTableManager() override
void getNodeMatrix(const NodeInfo &nodeInfo, TGeoHMatrix &mat) const
bool paintChildNodesRecurse(FWGeometryTableManagerBase::Entries_i pIt, Int_t idx, const TGeoHMatrix &mtx)
Definition: FWEveOverlap.cc:42
TString GetHighlightTooltip() override
Definition: FWEveOverlap.cc:92
FWBoolParameter m_rnrExtrusion
FWEveOverlap(FWOverlapTableView *v)
Definition: FWEveOverlap.cc:11
FWGeometryTableManagerBase * tableManager() override
Definition: FWEveOverlap.cc:12
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:14
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
void Paint(Option_t *option="") override
static int tableIdx(TGLPhysicalShape *ps)
Definition: FWGeoTopNode.cc:54