CMS 3D CMS Logo

FWEveDetectorGeo.cc
Go to the documentation of this file.
7 
8 #include "TGeoMatrix.h"
9 
10 //==============================================================================
11 //==============================================================================
12 //==============================================================================
13 FWEveDetectorGeo::FWEveDetectorGeo(FWGeometryTableView* v) : m_browser(v), m_maxLevel(0), m_filterOff(false) {}
14 
16 
18 //______________________________________________________________________________
19 
20 void FWEveDetectorGeo::Paint(Option_t* opt) {
22 
23  // printf("PAINPAINTPAINTPAINTPAINTPAINTPAINTPAINTPAINTPAINTT %d/%d \n", m_browser->getTopNodeIdx(), (int)m_browser->getTableManager()->refEntries().size());
24  if (m_browser->getTableManager()->refEntries().empty())
25  return;
26 
27  TEveGeoManagerHolder gmgr(FWGeometryTableViewManager::getGeoMangeur());
28 
30 
31  m_filterOff = m_browser->getFilter().empty();
32 
33  Int_t topIdx = m_browser->getTopNodeIdx();
35 
36  TGeoHMatrix mtx;
37  if (topIdx >= 0) {
38  std::advance(sit, topIdx);
40  }
41 
42  bool drawsChildren = false;
43 
44  if (((FWGeometryTableManager*)tableManager())->getVisibilityChld(*sit))
45  drawsChildren = paintChildNodesRecurse(sit, topIdx, mtx);
46 
47  if (sit->testBit(FWGeometryTableManagerBase::kVisNodeSelf) &&
48  ((FWGeometryTableManager*)tableManager())->getVisibility(*sit))
49  paintShape(topIdx, mtx, m_browser->getVolumeMode(), drawsChildren);
50 
51  fflush(stdout);
52 }
53 
54 // ______________________________________________________________________
56  Int_t cnt,
57  const TGeoHMatrix& parentMtx) {
58  TGeoNode* parentNode = pIt->m_node;
59  int nD = parentNode->GetNdaughters();
60 
61  int dOff = 0;
62 
63  pIt++;
64  int pcnt = cnt + 1;
65 
66  bool drawsChildNodes = false;
67 
69  for (int n = 0; n != nD; ++n) {
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 drawsChildNodesSecondGen = false;
79  if (((FWGeometryTableManager*)tableManager())->getVisibilityChld(*it) && (it->m_level < m_maxLevel)) {
80  drawsChildNodesSecondGen = paintChildNodesRecurse(it, cnt, nm);
81  }
82 
83  if (((FWGeometryTableManager*)tableManager())->getVisibility(*it)) {
84  paintShape(cnt, nm, m_browser->getVolumeMode(), drawsChildNodesSecondGen);
85  drawsChildNodes = true;
86  }
87 
88  } else {
89  if (((FWGeometryTableManager*)tableManager())->getVisibilityChld(*it) &&
90  (it->m_level < m_maxLevel || m_browser->getIgnoreVisLevelWhenFilter())) {
91  drawsChildNodesSecondGen = paintChildNodesRecurse(it, cnt, nm);
92  }
93 
94  ((FWGeometryTableManager*)tableManager())->assertNodeFilterCache(*it);
95  if (((FWGeometryTableManager*)tableManager())->getVisibility(*it)) {
96  paintShape(cnt, nm, m_browser->getVolumeMode(), drawsChildNodesSecondGen);
97  drawsChildNodes = true;
98  }
99  }
100 
101  drawsChildNodes |= drawsChildNodesSecondGen;
102  FWGeometryTableManagerBase::getNNodesTotal(parentNode->GetDaughter(n), dOff);
103  }
104 
105  return drawsChildNodes;
106 }
107 
108 //______________________________________________________________________________
109 
111  std::set<TGLPhysicalShape*>::iterator it = fHted.begin();
112  int idx = tableIdx(*it);
113  if (idx > 0) {
115  return data.name();
116  }
117  return "error";
118 }
119 
120 //_____________________________________________________________________________
121 
122 void FWEveDetectorGeo::popupMenu(int x, int y, TGLViewer* v) {
123  FWPopupMenu* nodePopup = FWGeoTopNode::setPopupMenu(x, y, v, false);
124 
125  if (nodePopup)
126  nodePopup->Connect("Activated(Int_t)", "FWGeometryTableView", m_browser, "chosenItem(Int_t)");
127 }
DDAxes::y
FWGeometryTableManager
Definition: FWGeometryTableManager.h:30
FWEveDetectorGeo.h
funct::false
false
Definition: Factorize.h:29
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
FWGeometryTableViewManager::getGeoMangeur
static TGeoManager * getGeoMangeur()
Definition: FWGeometryTableViewManager.cc:78
FWGeoTopNode::tableIdx
static int tableIdx(TGLPhysicalShape *ps)
Definition: FWGeoTopNode.cc:55
FWEveDetectorGeo::tableManager
FWGeometryTableManagerBase * tableManager() override
Definition: FWEveDetectorGeo.cc:15
FWGeometryTableManager.h
DDAxes::x
findQualityFiles.v
v
Definition: findQualityFiles.py:179
runTheMatrix.opt
opt
Definition: runTheMatrix.py:306
FWGeometryTableManagerBase
Definition: FWGeometryTableManagerBase.h:36
FWGeometryTableView::getIgnoreVisLevelWhenFilter
bool getIgnoreVisLevelWhenFilter() const
Definition: FWGeometryTableView.h:48
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
FWEveDetectorGeo::m_browser
FWGeometryTableView * m_browser
Definition: FWEveDetectorGeo.h:33
FWGeometryTableView
Definition: FWGeometryTableView.h:28
FWGeometryTableView::getVisLevel
int getVisLevel() const
Definition: FWGeometryTableView.h:47
FWGeometryTableManagerBase::getNNodesTotal
static void getNNodesTotal(TGeoNode *geoNode, int &off)
Definition: FWGeometryTableManagerBase.h:204
FWGeometryTableViewManager.h
FWGeometryTableViewBase
Definition: FWGeometryTableViewBase.h:41
FWGeometryTableView::isSelectedByRegion
bool isSelectedByRegion() const
Definition: FWGeometryTableView.h:61
FWGeometryTableView::getTableManager
FWGeometryTableManagerBase * getTableManager() override
Definition: FWGeometryTableView.cc:242
FWGeometryTableManagerBase::getNodeMatrix
void getNodeMatrix(const NodeInfo &nodeInfo, TGeoHMatrix &mat) const
Definition: FWGeometryTableManagerBase.cc:161
mps_setup.stdout
stdout
Definition: mps_setup.py:250
FWPopupMenu
Definition: FWPopupMenu.cc:5
FWGeometryTableManagerBase::kVisNodeSelf
Definition: FWGeometryTableManagerBase.h:45
FWEveDetectorGeo::paintChildNodesRecurse
bool paintChildNodesRecurse(FWGeometryTableManagerBase::Entries_i pIt, Int_t idx, const TGeoHMatrix &mtx)
Definition: FWEveDetectorGeo.cc:55
FWPopupMenu.cc
FWGeoTopNode::paintShape
void paintShape(Int_t idx, const TGeoHMatrix &nm, bool volumeColor, bool parentNode)
Definition: FWGeoTopNode.cc:213
fwLog.h
FWGeometryTableView::getVolumeMode
bool getVolumeMode() const
Definition: FWGeometryTableView.h:44
FWEveDetectorGeo::Paint
void Paint(Option_t *option="") override
Definition: FWEveDetectorGeo.cc:20
FWGeometryTableManagerBase::refEntries
Entries_v & refEntries()
Definition: FWGeometryTableManagerBase.h:143
FWGeometryTableViewBase::getTopNodeIdx
int getTopNodeIdx() const
Definition: FWGeometryTableViewBase.h:97
FWGeometryTableManagerBase::getLevelOffset
int getLevelOffset() const
Definition: FWGeometryTableManagerBase.h:151
FWGeometryTableManagerBase::NodeInfo
Definition: FWGeometryTableManagerBase.h:52
FWEveDetectorGeo::m_filterOff
bool m_filterOff
Definition: FWEveDetectorGeo.h:35
genVertex_cff.x
x
Definition: genVertex_cff.py:12
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
FWEveDetectorGeo::browser
FWGeometryTableViewBase * browser() override
Definition: FWEveDetectorGeo.cc: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
FWEveDetectorGeo::FWEveDetectorGeo
FWEveDetectorGeo(FWGeometryTableView *v)
Definition: FWEveDetectorGeo.cc:13
FWGeometryTableView::getFilter
std::string getFilter() const
Definition: FWGeometryTableView.h:45
FWGeometryTableManagerBase::Entries_i
Entries_v::iterator Entries_i
Definition: FWGeometryTableManagerBase.h:88
FWEveDetectorGeo::popupMenu
void popupMenu(int x, int y, TGLViewer *) override
Definition: FWEveDetectorGeo.cc:122
FWGeoTopNode::fHted
std::set< TGLPhysicalShape * > fHted
Definition: FWGeoTopNode.h:71
FWGeometryTableView.h
FWGeoTopNode::Paint
void Paint(Option_t *option="") override
Definition: FWGeoTopNode.cc:294
FWEveDetectorGeo::GetHighlightTooltip
TString GetHighlightTooltip() override
Definition: FWEveDetectorGeo.cc:110
FWEveDetectorGeo::m_maxLevel
int m_maxLevel
Definition: FWEveDetectorGeo.h:34