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.

◆ ~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.

References m_browser.

17 { return m_browser; }
FWGeometryTableView * m_browser

◆ ClassDefOverride()

FWEveDetectorGeo::ClassDefOverride ( FWEveDetectorGeo  ,
 
)
private

◆ GetHighlightTooltip()

TString FWEveDetectorGeo::GetHighlightTooltip ( )
override

Definition at line 110 of file FWEveDetectorGeo.cc.

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

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 }
FWGeometryTableManagerBase * getTableManager() override
std::set< TGLPhysicalShape * > fHted
Definition: FWGeoTopNode.h:71
FWGeometryTableView * m_browser
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
static int tableIdx(TGLPhysicalShape *ps)
Definition: FWGeoTopNode.cc:55

◆ Paint()

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

Definition at line 20 of file FWEveDetectorGeo.cc.

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().

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 }
bool paintChildNodesRecurse(FWGeometryTableManagerBase::Entries_i pIt, Int_t idx, const TGeoHMatrix &mtx)
std::string getFilter() const
FWGeometryTableManagerBase * tableManager() override
FWGeometryTableManagerBase * getTableManager() override
void paintShape(Int_t idx, const TGeoHMatrix &nm, bool volumeColor, bool parentNode)
FWGeometryTableView * m_browser
void Paint(Option_t *option="") override
void getNodeMatrix(const NodeInfo &nodeInfo, TGeoHMatrix &mat) const

◆ paintChildNodesRecurse()

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

Definition at line 55 of file FWEveDetectorGeo.cc.

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

Referenced by Paint().

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 }
bool paintChildNodesRecurse(FWGeometryTableManagerBase::Entries_i pIt, Int_t idx, const TGeoHMatrix &mtx)
bool getIgnoreVisLevelWhenFilter() const
static void getNNodesTotal(TGeoNode *geoNode, int &off)
FWGeometryTableManagerBase * tableManager() override
void paintShape(Int_t idx, const TGeoHMatrix &nm, bool volumeColor, bool parentNode)
FWGeometryTableView * m_browser
bool isSelectedByRegion() const

◆ popupMenu()

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

Reimplemented from FWGeoTopNode.

Definition at line 122 of file FWEveDetectorGeo.cc.

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

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 }
FWPopupMenu * setPopupMenu(int iX, int iY, TGLViewer *v, bool)
FWGeometryTableView * m_browser

◆ tableManager()

FWGeometryTableManagerBase * FWEveDetectorGeo::tableManager ( )
overridevirtual

Reimplemented from FWGeoTopNode.

Definition at line 15 of file FWEveDetectorGeo.cc.

References FWGeometryTableView::getTableManager(), and m_browser.

Referenced by Paint(), and paintChildNodesRecurse().

15 { return m_browser->getTableManager(); }
FWGeometryTableManagerBase * getTableManager() override
FWGeometryTableView * m_browser

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().