File indexing completed on 2024-04-06 12:11:31
0001 #ifndef Fireworks_Core_FWGeometryTableViewBase_h
0002 #define Fireworks_Core_FWGeometryTableViewBase_h
0003
0004 #ifndef __CINT__
0005 #include <memory>
0006 #endif
0007
0008 #include "Rtypes.h"
0009 #include "TGFrame.h"
0010 #include "TGButton.h"
0011 #include "Fireworks/Core/interface/FWViewType.h"
0012 #ifndef __CINT__
0013 #include "Fireworks/Core/interface/FWViewBase.h"
0014 #include "Fireworks/Core/interface/FWViewBase.h"
0015 #include "Fireworks/Core/interface/FWConfigurableParameterizable.h"
0016 #include "Fireworks/Core/interface/FWStringParameter.h"
0017 #include "Fireworks/Core/interface/FWEnumParameter.h"
0018 #include "Fireworks/Core/interface/FWLongParameter.h"
0019 #include "Fireworks/Core/interface/FWParameterSetterBase.h"
0020 #include "Fireworks/Core/interface/FWParameterSetterEditorBase.h"
0021 #endif
0022
0023 class TGeoNode;
0024 class TGeoVolume;
0025 class TGStatusBar;
0026 class TGeoManager;
0027 class TEveWindowSlot;
0028 class TEveWindowFrame;
0029 class TEveElement;
0030 class FWEveDigitSetScalableMarker;
0031 class TEveScene;
0032
0033 class FWTableWidget;
0034 class FWGeometryTableManagerBase;
0035 class FWConfiguration;
0036 class FWColorPopup;
0037 class FWColorManager;
0038 class FWGeoTopNode;
0039 class FWParameterBase;
0040
0041 class FWGeometryTableViewBase
0042 #ifndef __CINT__
0043 : public FWViewBase,
0044 public FWParameterSetterEditorBase
0045 #endif
0046 {
0047 public:
0048 class FWViewCombo : public TGTextButton {
0049 private:
0050 FWGeometryTableViewBase* m_tableView;
0051 TEveElement* m_el;
0052
0053 public:
0054 FWViewCombo(const TGWindow* p, FWGeometryTableViewBase* t)
0055 : TGTextButton(p,
0056 "Select Views",
0057 -1,
0058 TGButton::GetDefaultGC()(),
0059 TGTextButton::GetDefaultFontStruct(),
0060 kRaisedFrame | kDoubleBorder),
0061 m_tableView(t),
0062 m_el(nullptr) {}
0063 ~FWViewCombo() override {}
0064 void setElement(TEveElement* x) { m_el = x; }
0065 Bool_t HandleButton(Event_t* event) override;
0066 };
0067
0068 FWGeometryTableViewBase(TEveWindowSlot*, FWViewType::EType, FWColorManager*);
0069 ~FWGeometryTableViewBase() override;
0070
0071 virtual void cellClicked(Int_t iRow, Int_t iColumn, Int_t iButton, Int_t iKeyMod, Int_t iGlobalX, Int_t iGlobalY);
0072
0073
0074 virtual void chosenItem(int);
0075 void selectView(int);
0076
0077 bool getEnableHighlight() { return m_enableHighlight.value(); }
0078 virtual FWGeometryTableManagerBase* getTableManager() { return nullptr; }
0079
0080
0081
0082 void addTo(FWConfiguration&) const override;
0083 void saveImageTo(const std::string& iName) const override {}
0084 void nodeColorChangeRequested(Color_t);
0085
0086 void setBackgroundColor();
0087 void populate3DViewsFromConfig();
0088 virtual void refreshTable3D();
0089
0090 void cdNode(int);
0091 virtual void cdTop();
0092 virtual void cdUp();
0093 virtual void setPath(int, std::string&);
0094
0095 void checkExpandLevel();
0096
0097 int getTopNodeIdx() const { return TMath::Max((int)m_topNodeIdx.value(), 0); }
0098
0099 FWEveDigitSetScalableMarker* getMarker() { return m_marker; }
0100 void transparencyChanged();
0101
0102 void reloadColors();
0103
0104 long getParentTransparencyFactor() const { return m_parentTransparencyFactor.value(); }
0105 long getLeafTransparencyFactor() const { return m_leafTransparencyFactor.value(); }
0106 long getMinParentTransparency() const { return m_minParentTransparency.value(); }
0107 long getMinLeafTransparency() const { return m_minLeafTransparency.value(); }
0108
0109 protected:
0110 #ifndef __CINT__
0111 FWLongParameter m_topNodeIdx;
0112 FWLongParameter m_autoExpand;
0113 FWBoolParameter m_enableHighlight;
0114
0115 FWLongParameter m_parentTransparencyFactor;
0116 FWLongParameter m_leafTransparencyFactor;
0117 FWLongParameter m_minParentTransparency;
0118 FWLongParameter m_minLeafTransparency;
0119 #endif
0120
0121 FWColorManager* m_colorManager;
0122 FWTableWidget* m_tableWidget;
0123
0124
0125
0126 FWColorPopup* m_colorPopup;
0127
0128 TEveWindowFrame* m_eveWindow;
0129 TGCompositeFrame* m_frame;
0130
0131 FWViewCombo* m_viewBox;
0132
0133 const FWConfiguration* m_viewersConfig;
0134
0135 bool m_enableRedraw;
0136
0137 FWEveDigitSetScalableMarker* m_marker;
0138 FWGeoTopNode* m_eveTopNode;
0139 TEveScene* m_eveScene;
0140
0141 #ifndef __CINT__
0142
0143 #endif
0144
0145
0146
0147 void postConst();
0148
0149 void setTopNodePathFromConfig(const FWConfiguration& iFrom);
0150
0151 void populateController(ViewerParameterGUI&) const override;
0152
0153 private:
0154 int m_tableRowIndexForColorPopup;
0155
0156 FWGeometryTableViewBase(const FWGeometryTableViewBase&);
0157 const FWGeometryTableViewBase& operator=(const FWGeometryTableViewBase&);
0158 void setColumnSelected(int idx);
0159 ClassDef(FWGeometryTableViewBase, 0);
0160 };
0161
0162 #endif