CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWEveDetectorGeo Class Reference

#include <FWEveDetectorGeo.h>

Inheritance diagram for FWEveDetectorGeo:
FWGeoTopNode

Public Member Functions

FWGeometryTableViewBasebrowser () override
 
 FWEveDetectorGeo (FWGeometryTableView *v)
 
TString GetHighlightTooltip () override
 
void Paint (Option_t *option="") override
 
void popupMenu (int x, int y, TGLViewer *) override
 
FWGeometryTableManagerBasetableManager () override
 
 ~FWEveDetectorGeo () override
 
- Public Member Functions inherited from FWGeoTopNode
void clearSelection ()
 
 FWGeoTopNode (const char *n="FWGeoTopNode", const char *t="FWGeoTopNode")
 
int getFirstSelectedTableIndex ()
 
void Paint (Option_t *option="") override
 
void printSelected ()
 
bool selectPhysicalFromTable (int)
 
void UnHighlighted () override
 
void UnSelected () override
 
 ~FWGeoTopNode () override
 

Private Member Functions

 ClassDefOverride (FWEveDetectorGeo, 0)
 
bool paintChildNodesRecurse (FWGeometryTableManagerBase::Entries_i pIt, Int_t idx, const TGeoHMatrix &mtx)
 

Private Attributes

FWGeometryTableViewm_browser
 
bool m_filterOff
 
int m_maxLevel
 

Additional Inherited Members

- Public Types inherited from FWGeoTopNode
enum  MenuOptions {
  kSetTopNode, kSetTopNodeCam, kVisSelfOff, kVisChldOn,
  kVisChldOff, kApplyChldCol, kApplyChldColRec, kCamera,
  kPrintMaterial, kPrintPath, kPrintShape, kPrintOverlap,
  kOverlapVisibilityMotherOn, kOverlapVisibilityMotherOff
}
 
- Public Attributes inherited from FWGeoTopNode
std::set< TGLPhysicalShape * > fHted
 
std::set< TGLPhysicalShape * > fSted
 
FWGeoTopNodeGLScenem_scene
 
- Static Public Attributes inherited from FWGeoTopNode
static TGLVector3 s_pickedCamera3DCenter
 
static TGLViewer * s_pickedViewer = nullptr
 
- Protected Member Functions inherited from FWGeoTopNode
void ClearSet (std::set< TGLPhysicalShape * > &sset)
 
void ComputeBBox () override
 
void EraseFromSet (std::set< TGLPhysicalShape * > &sset, TGLPhysicalShape *id)
 
void paintShape (Int_t idx, const TGeoHMatrix &nm, bool volumeColor, bool parentNode)
 
void ProcessSelection (TGLSelectRecord &rec, std::set< TGLPhysicalShape * > &sset, TGLPhysicalShape *id)
 
FWPopupMenusetPopupMenu (int iX, int iY, TGLViewer *v, bool)
 
void SetStateOf (TGLPhysicalShape *id)
 
void setupBuffMtx (TBuffer3D &buff, const TGeoHMatrix &mat)
 
- Static Protected Member Functions inherited from FWGeoTopNode
static UInt_t phyID (int tableIdx)
 
static int tableIdx (TGLPhysicalShape *ps)
 

Detailed Description

Definition at line 10 of file FWEveDetectorGeo.h.

Constructor & Destructor Documentation

◆ FWEveDetectorGeo()

FWEveDetectorGeo::FWEveDetectorGeo ( FWGeometryTableView v)

Definition at line 13 of file FWEveDetectorGeo.cc.

13 : m_browser(v), m_maxLevel(0), m_filterOff(false) {}

◆ ~FWEveDetectorGeo()

FWEveDetectorGeo::~FWEveDetectorGeo ( )
inlineoverride

Definition at line 13 of file FWEveDetectorGeo.h.

13 {}

Member Function Documentation

◆ browser()

FWGeometryTableViewBase * FWEveDetectorGeo::browser ( )
overridevirtual

Reimplemented from FWGeoTopNode.

Definition at line 17 of file FWEveDetectorGeo.cc.

17 { return m_browser; }

References m_browser.

◆ ClassDefOverride()

FWEveDetectorGeo::ClassDefOverride ( FWEveDetectorGeo  ,
 
)
private

◆ GetHighlightTooltip()

TString FWEveDetectorGeo::GetHighlightTooltip ( )
override

Definition at line 110 of file FWEveDetectorGeo.cc.

110  {
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 }

References data, FWGeoTopNode::fHted, FWGeometryTableView::getTableManager(), heavyIonCSV_trainingSettings::idx, m_browser, FWGeometryTableManagerBase::refEntries(), and FWGeoTopNode::tableIdx().

◆ Paint()

void FWEveDetectorGeo::Paint ( Option_t *  option = "")
override

Definition at line 20 of file FWEveDetectorGeo.cc.

20  {
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 }

References FWGeometryTableView::getFilter(), FWGeometryTableViewManager::getGeoMangeur(), FWGeometryTableManagerBase::getLevelOffset(), FWGeometryTableManagerBase::getNodeMatrix(), FWGeometryTableView::getTableManager(), FWGeometryTableViewBase::getTopNodeIdx(), FWGeometryTableView::getVisLevel(), FWGeometryTableView::getVolumeMode(), FWGeometryTableManagerBase::kVisNodeSelf, m_browser, m_filterOff, m_maxLevel, FWGeoTopNode::Paint(), paintChildNodesRecurse(), FWGeoTopNode::paintShape(), FWGeometryTableManagerBase::refEntries(), mps_setup::stdout, and tableManager().

◆ paintChildNodesRecurse()

bool FWEveDetectorGeo::paintChildNodesRecurse ( FWGeometryTableManagerBase::Entries_i  pIt,
Int_t  idx,
const TGeoHMatrix &  mtx 
)
private

Definition at line 55 of file FWEveDetectorGeo.cc.

57  {
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 }

References FWGeometryTableView::getIgnoreVisLevelWhenFilter(), FWGeometryTableManagerBase::getNNodesTotal(), FWGeometryTableView::getVolumeMode(), FWGeometryTableView::isSelectedByRegion(), m_browser, m_filterOff, m_maxLevel, dqmiodumpmetadata::n, FWGeoTopNode::paintShape(), and tableManager().

Referenced by Paint().

◆ popupMenu()

void FWEveDetectorGeo::popupMenu ( int  x,
int  y,
TGLViewer *  v 
)
overridevirtual

Reimplemented from FWGeoTopNode.

Definition at line 122 of file FWEveDetectorGeo.cc.

122  {
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 }

References m_browser, FWGeoTopNode::setPopupMenu(), findQualityFiles::v, x, and y.

◆ tableManager()

FWGeometryTableManagerBase * FWEveDetectorGeo::tableManager ( )
overridevirtual

Reimplemented from FWGeoTopNode.

Definition at line 15 of file FWEveDetectorGeo.cc.

15 { return m_browser->getTableManager(); }

References FWGeometryTableView::getTableManager(), and m_browser.

Referenced by Paint(), and paintChildNodesRecurse().

Member Data Documentation

◆ m_browser

FWGeometryTableView* FWEveDetectorGeo::m_browser
private

◆ m_filterOff

bool FWEveDetectorGeo::m_filterOff
private

Definition at line 35 of file FWEveDetectorGeo.h.

Referenced by Paint(), and paintChildNodesRecurse().

◆ m_maxLevel

int FWEveDetectorGeo::m_maxLevel
private

Definition at line 34 of file FWEveDetectorGeo.h.

Referenced by Paint(), and paintChildNodesRecurse().

DDAxes::y
FWGeometryTableManager
Definition: FWGeometryTableManager.h:30
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
DDAxes::x
findQualityFiles.v
v
Definition: findQualityFiles.py:179
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::getVisLevel
int getVisLevel() const
Definition: FWGeometryTableView.h:47
FWGeometryTableManagerBase::getNNodesTotal
static void getNNodesTotal(TGeoNode *geoNode, int &off)
Definition: FWGeometryTableManagerBase.h:204
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
FWGeoTopNode::paintShape
void paintShape(Int_t idx, const TGeoHMatrix &nm, bool volumeColor, bool parentNode)
Definition: FWGeoTopNode.cc:213
FWGeometryTableView::getVolumeMode
bool getVolumeMode() const
Definition: FWGeometryTableView.h:44
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
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
FWGeometryTableView::getFilter
std::string getFilter() const
Definition: FWGeometryTableView.h:45
FWGeometryTableManagerBase::Entries_i
Entries_v::iterator Entries_i
Definition: FWGeometryTableManagerBase.h:88
FWGeoTopNode::fHted
std::set< TGLPhysicalShape * > fHted
Definition: FWGeoTopNode.h:71
FWGeoTopNode::Paint
void Paint(Option_t *option="") override
Definition: FWGeoTopNode.cc:294
FWEveDetectorGeo::m_maxLevel
int m_maxLevel
Definition: FWEveDetectorGeo.h:34