Go to the documentation of this file.00001 #ifndef Fireworks_Core_FWGeoTopNode_h
00002 #define Fireworks_Core_FWGeoTopNode_h
00003
00004
00005
00006
00007
00016
00017
00018
00019
00020
00021
00022 #ifndef __CINT__
00023 #include "Fireworks/Core/interface/FWGeometryTableManagerBase.h"
00024 #endif
00025 #include "TEveElement.h"
00026 #include "TAttBBox.h"
00027 #include "TGLUtil.h"
00028 #include <set>
00029
00030 class TGeoHMatrix;
00031 class TGLPhysicalShape;
00032 class TGLSelectRecord;
00033 class TGLViewer;
00034
00035 class FWGeometryTableView;
00036 class FWOverlapTableView;
00037 class TBuffer3D;
00038 class TGeoNode;
00039 class FWGeoTopNodeGLScene;
00040 class FWPopupMenu;
00041
00042 class FWGeoTopNode : public TEveElementList,
00043 public TAttBBox
00044 {
00045 friend class FWGeoTopNodeGL;
00046 public:
00047
00048 enum MenuOptions {
00049 kSetTopNode,
00050 kSetTopNodeCam,
00051 kVisSelfOff,
00052 kVisChldOn,
00053 kVisChldOff,
00054 kCamera,
00055 kPrintMaterial,
00056 kPrintPath,
00057 kPrintShape,
00058 kPrintOverlap,
00059 kOverlapVisibilityMotherOn,
00060 kOverlapVisibilityMotherOff
00061 };
00062
00063 FWGeoTopNode(const char* n = "FWGeoTopNode", const char* t = "FWGeoTopNode"){}
00064 virtual ~FWGeoTopNode(){}
00065
00066 virtual void Paint(Option_t* option="");
00067 FWGeoTopNodeGLScene *m_scene;
00068
00069 virtual FWGeometryTableManagerBase* tableManager() { return 0; }
00070 virtual FWGeometryTableViewBase* browser() { return 0; }
00071
00072 std::set<TGLPhysicalShape*> fHted;
00073 std::set<TGLPhysicalShape*> fSted;
00074
00075 int getFirstSelectedTableIndex();
00076 bool selectPhysicalFromTable(int);
00077 void clearSelection() {fHted.clear(); fSted.clear();}
00078
00079 void printSelected();
00080 virtual void popupMenu(int x, int y, TGLViewer*) {}
00081
00082 virtual void UnSelected();
00083 virtual void UnHighlighted();
00084
00085 static TGLVector3 s_pickedCamera3DCenter;
00086 static TGLViewer* s_pickedViewer;
00087
00088 protected:
00089 static UInt_t phyID(int tableIdx);
00090 static int tableIdx(TGLPhysicalShape* ps);
00091
00092 void ProcessSelection(TGLSelectRecord& rec, std::set<TGLPhysicalShape*>& sset, TGLPhysicalShape* id);
00093
00094 void EraseFromSet(std::set<TGLPhysicalShape*>& sset, TGLPhysicalShape* id);
00095 void ClearSet(std::set<TGLPhysicalShape*>& sset);
00096
00097 void SetStateOf(TGLPhysicalShape* id);
00098
00099
00100 void setupBuffMtx(TBuffer3D& buff, const TGeoHMatrix& mat);
00101
00102 FWPopupMenu* setPopupMenu(int iX, int iY, TGLViewer* v, bool);
00103
00104
00105 void paintShape(Int_t idx, const TGeoHMatrix& nm, bool volumeColor, bool parentNode);
00106 virtual void ComputeBBox();
00107 private:
00108 FWGeoTopNode(const FWGeoTopNode&);
00109 const FWGeoTopNode& operator=(const FWGeoTopNode&);
00110 #ifndef __CINT__
00111 UChar_t wrapTransparency(FWGeometryTableManagerBase::NodeInfo& data, bool leafNode);
00112 #endif
00113
00114
00115 ClassDef(FWGeoTopNode, 0);
00116 };
00117
00118
00119 #endif