CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
FWOverlapTableView * m_browser
Definition: FWEveOverlap.h:23
void getNodeMatrix(const NodeInfo &nodeInfo, TGeoHMatrix &mat) const
bool paintChildNodesRecurse(FWGeometryTableManagerBase::Entries_i pIt, Int_t idx, const TGeoHMatrix &mtx)
Definition: FWEveOverlap.cc:54
virtual void Paint(Option_t *option="")
virtual FWGeometryTableManagerBase * getTableManager()
virtual TString GetHighlightTooltip()
FWBoolParameter m_rnrExtrusion
virtual void popupMenu(int x, int y, TGLViewer *v)
FWEveOverlap(FWOverlapTableView *v)
Definition: FWEveOverlap.cc:11
virtual void Paint(Option_t *option="")
Definition: FWEveOverlap.cc:26
virtual FWGeometryTableManagerBase * tableManager()
Definition: FWEveOverlap.cc:15
static void getNNodesTotal(TGeoNode *geoNode, int &off)
FWPopupMenu * setPopupMenu(int iX, int iY, TGLViewer *v, bool)
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
virtual FWGeometryTableViewBase * browser()
Definition: FWEveOverlap.cc:20
std::set< TGLPhysicalShape * > fHted
Definition: FWGeoTopNode.h:72
void paintShape(Int_t idx, const TGeoHMatrix &nm, bool volumeColor, bool parentNode)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
Definition: DDAxes.h:10
static int tableIdx(TGLPhysicalShape *ps)
Definition: FWGeoTopNode.cc:60