CMS 3D CMS Logo

FWEveOverlap.cc
Go to the documentation of this file.
2 #include "TGeoOverlap.h"
8 //==============================================================================
9 //==============================================================================
10 //==============================================================================
12  m_browser(v)
13 {
14 }
16 {
17  return m_browser->getTableManager();
18 }
19 
21 {
22  return m_browser;
23 }
24 //______________________________________________________________________________
25 
26 void FWEveOverlap::Paint(Option_t*)
27 {
28 
29  if (m_browser->getTableManager()->refEntries().empty()) return;
30 
32 
33  TEveGeoManagerHolder gmgr( FWGeometryTableViewManager::getGeoMangeur());
34 
35 
36  int topNodeIdx = m_browser->getTopNodeIdx();
37 
39  std::advance(sit,topNodeIdx );
40  TGeoHMatrix mtx;
42 
43  bool drawsChildren = false;
44 
45  if ( (*sit).testBit(FWGeometryTableManagerBase::kVisNodeChld))
46  drawsChildren = paintChildNodesRecurse( sit, topNodeIdx, mtx);
47 
49  paintShape(topNodeIdx,mtx, false, drawsChildren);
50 }
51 
52 
53 // ______________________________________________________________________
54 bool FWEveOverlap::paintChildNodesRecurse (FWGeometryTableManagerBase::Entries_i pIt, Int_t cnt, const TGeoHMatrix& parentMtx)
55 {
56 
57  TGeoNode* parentNode = pIt->m_node;
58  int nD = parentNode->GetNdaughters();
59 
60  int dOff=0;
61 
62  pIt++;
63  int pcnt = cnt+1;
64 
65  bool drawsChildren = false;
66 
68  for (int n = 0; n != nD; ++n)
69  {
70  it = pIt;
71  std::advance(it,n + dOff);
72  cnt = pcnt + n+dOff;
73 
74  TGeoHMatrix nm = parentMtx;
75  nm.Multiply(it->m_node->GetMatrix());
76 
77  bool drawsChildrenSecondGen = false;
79  drawsChildrenSecondGen = paintChildNodesRecurse(it,cnt , nm);
80 
82  {
83  if (it->testBit(FWOverlapTableManager::kOverlap))
84  {
85  int nno;it->m_node->GetOverlaps(nno);
86  if ( (m_browser->m_rnrOverlap.value() && ((nno & BIT(1)) == BIT(1)) )
87  || (m_browser->m_rnrExtrusion.value() && ((nno & BIT(2)) == BIT(2)) ))
88  {
89  paintShape(cnt , nm, false, drawsChildrenSecondGen);
90  drawsChildren = true;
91  }
92 
93  }
94  else
95  {
96  paintShape(cnt , nm, false, drawsChildrenSecondGen);
97  drawsChildren = true;
98  }
99  }
100 
101  drawsChildren |= drawsChildrenSecondGen;
102  FWGeometryTableManagerBase::getNNodesTotal(parentNode->GetDaughter(n), dOff);
103  }
104  return drawsChildren;
105 }
106 
107 
108 //______________________________________________________________________________
109 
111 {
112  // printf("highlight tooltio \n");
113  std::set<TGLPhysicalShape*>::iterator it = fHted.begin();
114  int idx = tableIdx(*it);
115  if ( idx < 0)
116  {
117  return Form("TopNode ");
118  }
120 
121  TString name = data.name();
123 
124  ((FWOverlapTableManager*)m_browser->getTableManager())->getOverlapTitles(idx, name);
125  return name;
126  }
127 
128  return data.name();
129 }
130 
131 
132 //_____________________________________________________________________________
133 
134 void FWEveOverlap::popupMenu(int x, int y, TGLViewer* v)
135 {
136  FWPopupMenu* nodePopup = setPopupMenu(x, y,v, true);
137 
138  if (nodePopup) nodePopup->Connect("Activated(Int_t)",
139  "FWOverlapTableView",
140  m_browser,
141  "chosenItem(Int_t)");
142 }
FWBoolParameter m_rnrOverlap
void Paint(Option_t *option="") override
Definition: FWEveOverlap.cc:26
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:54
TString GetHighlightTooltip() override
FWBoolParameter m_rnrExtrusion
FWEveOverlap(FWOverlapTableView *v)
Definition: FWEveOverlap.cc:11
FWGeometryTableManagerBase * tableManager() override
Definition: FWEveOverlap.cc:15
static void getNNodesTotal(TGeoNode *geoNode, int &off)
FWPopupMenu * setPopupMenu(int iX, int iY, TGLViewer *v, bool)
std::set< TGLPhysicalShape * > fHted
Definition: FWGeoTopNode.h:73
void paintShape(Int_t idx, const TGeoHMatrix &nm, bool volumeColor, bool parentNode)
FWGeometryTableViewBase * browser() override
Definition: FWEveOverlap.cc:20
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void Paint(Option_t *option="") override
static int tableIdx(TGLPhysicalShape *ps)
Definition: FWGeoTopNode.cc:59