Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:27:02

0001 #ifndef Fireworks_Core_FWGeoTopNode_h
0002 #define Fireworks_Core_FWGeoTopNode_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Core
0006 // Class  :     FWGeoTopNode
0007 //
0008 /**\class FWGeoTopNode FWGeoTopNode.h Fireworks/Core/interface/FWGeoTopNode.h
0009 
0010  Description: [one line class summary]
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Matevz Tadel, Alja Mrak Tadel
0018 //         Created:  Thu Jun 23 01:25:00 CEST 2011
0019 //
0020 
0021 #ifndef __CINT__
0022 #include "Fireworks/Core/interface/FWGeometryTableManagerBase.h"
0023 #endif
0024 #include "TEveElement.h"
0025 #include "TAttBBox.h"
0026 #include "TGLUtil.h"
0027 #include <set>
0028 
0029 class TGeoHMatrix;
0030 class TGLPhysicalShape;
0031 class TGLSelectRecord;
0032 class TGLViewer;
0033 
0034 class FWGeometryTableView;
0035 class FWOverlapTableView;
0036 class TBuffer3D;
0037 class TGeoNode;
0038 class FWGeoTopNodeGLScene;
0039 class FWPopupMenu;
0040 
0041 class FWGeoTopNode : public TEveElementList, public TAttBBox {
0042   friend class FWGeoTopNodeGL;
0043 
0044 public:
0045   enum MenuOptions {
0046     kSetTopNode,
0047     kSetTopNodeCam,
0048     kVisSelfOff,
0049     kVisChldOn,
0050     kVisChldOff,
0051     kApplyChldCol,
0052     kApplyChldColRec,
0053     kCamera,
0054     kPrintMaterial,
0055     kPrintPath,
0056     kPrintShape,
0057     kPrintOverlap,
0058     kOverlapVisibilityMotherOn,
0059     kOverlapVisibilityMotherOff
0060   };
0061 
0062   FWGeoTopNode(const char* n = "FWGeoTopNode", const char* t = "FWGeoTopNode") {}
0063   ~FWGeoTopNode() override {}
0064 
0065   void Paint(Option_t* option = "") override;
0066   FWGeoTopNodeGLScene* m_scene;
0067 
0068   virtual FWGeometryTableManagerBase* tableManager() { return nullptr; }
0069   virtual FWGeometryTableViewBase* browser() { return nullptr; }
0070 
0071   std::set<TGLPhysicalShape*> fHted;
0072   std::set<TGLPhysicalShape*> fSted;
0073 
0074   int getFirstSelectedTableIndex();
0075   bool selectPhysicalFromTable(int);
0076   void clearSelection() {
0077     fHted.clear();
0078     fSted.clear();
0079   }
0080 
0081   void printSelected();
0082   virtual void popupMenu(int x, int y, TGLViewer*) {}
0083 
0084   void UnSelected() override;
0085   void UnHighlighted() override;
0086 
0087   static TGLVector3 s_pickedCamera3DCenter;
0088   static TGLViewer* s_pickedViewer;
0089 
0090 protected:
0091   static UInt_t phyID(int tableIdx);
0092   static int tableIdx(TGLPhysicalShape* ps);
0093 
0094   void ProcessSelection(TGLSelectRecord& rec, std::set<TGLPhysicalShape*>& sset, TGLPhysicalShape* id);
0095 
0096   void EraseFromSet(std::set<TGLPhysicalShape*>& sset, TGLPhysicalShape* id);
0097   void ClearSet(std::set<TGLPhysicalShape*>& sset);
0098 
0099   void SetStateOf(TGLPhysicalShape* id);
0100 
0101   void setupBuffMtx(TBuffer3D& buff, const TGeoHMatrix& mat);
0102 
0103   FWPopupMenu* setPopupMenu(int iX, int iY, TGLViewer* v, bool);
0104 
0105   void paintShape(Int_t idx, const TGeoHMatrix& nm, bool volumeColor, bool parentNode);
0106   void ComputeBBox() override;
0107 
0108 private:
0109   FWGeoTopNode(const FWGeoTopNode&);                   // stop default
0110   const FWGeoTopNode& operator=(const FWGeoTopNode&);  // stop default
0111 #ifndef __CINT__
0112   UChar_t wrapTransparency(FWGeometryTableManagerBase::NodeInfo& data, bool leafNode);
0113 #endif
0114 
0115   ClassDefOverride(FWGeoTopNode, 0);
0116 };
0117 
0118 #endif