CMS 3D CMS Logo

FWGeoTopNode.h
Go to the documentation of this file.
1 #ifndef Fireworks_Core_FWGeoTopNode_h
2 #define Fireworks_Core_FWGeoTopNode_h
3 // -*- C++ -*-
4 //
5 // Package: Core
6 // Class : FWGeoTopNode
7 //
16 //
17 // Original Author: Matevz Tadel, Alja Mrak Tadel
18 // Created: Thu Jun 23 01:25:00 CEST 2011
19 //
20 
21 #ifndef __CINT__
23 #endif
24 #include "TEveElement.h"
25 #include "TAttBBox.h"
26 #include "TGLUtil.h"
27 #include <set>
28 
29 class TGeoHMatrix;
30 class TGLPhysicalShape;
31 class TGLSelectRecord;
32 class TGLViewer;
33 
35 class FWOverlapTableView;
36 class TBuffer3D;
37 class TGeoNode;
39 class FWPopupMenu;
40 
41 class FWGeoTopNode : public TEveElementList,
42  public TAttBBox
43 {
44  friend class FWGeoTopNodeGL;
45 public:
46 
47  enum MenuOptions {
62  };
63 
64  FWGeoTopNode(const char* n = "FWGeoTopNode", const char* t = "FWGeoTopNode"){}
65  ~FWGeoTopNode() override{}
66 
67  void Paint(Option_t* option="") override;
69 
70  virtual FWGeometryTableManagerBase* tableManager() { return nullptr; }
71  virtual FWGeometryTableViewBase* browser() { return nullptr; }
72 
73  std::set<TGLPhysicalShape*> fHted;
74  std::set<TGLPhysicalShape*> fSted;
75 
77  bool selectPhysicalFromTable(int);
78  void clearSelection() {fHted.clear(); fSted.clear();}
79 
80  void printSelected();
81  virtual void popupMenu(int x, int y, TGLViewer*) {}
82 
83  void UnSelected() override;
84  void UnHighlighted() override;
85 
86  static TGLVector3 s_pickedCamera3DCenter;
87  static TGLViewer* s_pickedViewer;
88 
89 protected:
90  static UInt_t phyID(int tableIdx);
91  static int tableIdx(TGLPhysicalShape* ps);
92 
93  void ProcessSelection(TGLSelectRecord& rec, std::set<TGLPhysicalShape*>& sset, TGLPhysicalShape* id);
94 
95  void EraseFromSet(std::set<TGLPhysicalShape*>& sset, TGLPhysicalShape* id);
96  void ClearSet(std::set<TGLPhysicalShape*>& sset);
97 
98  void SetStateOf(TGLPhysicalShape* id);
99 
100 
101  void setupBuffMtx(TBuffer3D& buff, const TGeoHMatrix& mat);
102 
103  FWPopupMenu* setPopupMenu(int iX, int iY, TGLViewer* v, bool);
104 
105 
106  void paintShape(Int_t idx, const TGeoHMatrix& nm, bool volumeColor, bool parentNode);
107  void ComputeBBox() override;
108 private:
109  FWGeoTopNode(const FWGeoTopNode&); // stop default
110  const FWGeoTopNode& operator=(const FWGeoTopNode&); // stop default
111 #ifndef __CINT__
113 #endif
114 
115 
117 };
118 
119 
120 #endif
std::set< TGLPhysicalShape * > fSted
Definition: FWGeoTopNode.h:74
virtual FWGeometryTableManagerBase * tableManager()
Definition: FWGeoTopNode.h:70
void ClearSet(std::set< TGLPhysicalShape * > &sset)
Definition: FWGeoTopNode.cc:71
void printSelected()
int getFirstSelectedTableIndex()
void UnHighlighted() override
void clearSelection()
Definition: FWGeoTopNode.h:78
FWGeoTopNodeGLScene * m_scene
Definition: FWGeoTopNode.h:68
void UnSelected() override
UChar_t wrapTransparency(FWGeometryTableManagerBase::NodeInfo &data, bool leafNode)
ClassDefOverride(FWGeoTopNode, 0)
virtual void popupMenu(int x, int y, TGLViewer *)
Definition: FWGeoTopNode.h:81
~FWGeoTopNode() override
Definition: FWGeoTopNode.h:65
FWGeoTopNode(const char *n="FWGeoTopNode", const char *t="FWGeoTopNode")
Definition: FWGeoTopNode.h:64
FWPopupMenu * setPopupMenu(int iX, int iY, TGLViewer *v, bool)
virtual FWGeometryTableViewBase * browser()
Definition: FWGeoTopNode.h:71
bool selectPhysicalFromTable(int)
static TGLViewer * s_pickedViewer
Definition: FWGeoTopNode.h:87
const FWGeoTopNode & operator=(const FWGeoTopNode &)
std::set< TGLPhysicalShape * > fHted
Definition: FWGeoTopNode.h:73
void paintShape(Int_t idx, const TGeoHMatrix &nm, bool volumeColor, bool parentNode)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void Paint(Option_t *option="") override
void EraseFromSet(std::set< TGLPhysicalShape * > &sset, TGLPhysicalShape *id)
Definition: FWGeoTopNode.cc:64
void ProcessSelection(TGLSelectRecord &rec, std::set< TGLPhysicalShape * > &sset, TGLPhysicalShape *id)
void SetStateOf(TGLPhysicalShape *id)
Definition: FWGeoTopNode.cc:81
static int tableIdx(TGLPhysicalShape *ps)
Definition: FWGeoTopNode.cc:59
void ComputeBBox() override
static TGLVector3 s_pickedCamera3DCenter
Definition: FWGeoTopNode.h:86
void setupBuffMtx(TBuffer3D &buff, const TGeoHMatrix &mat)
static UInt_t phyID(int tableIdx)
Definition: FWGeoTopNode.cc:53