FWGeometryTableViewBase

FWViewCombo

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
#ifndef Fireworks_Core_FWGeometryTableViewBase_h
#define Fireworks_Core_FWGeometryTableViewBase_h

#ifndef __CINT__
#include <memory>
#endif

#include "Rtypes.h"
#include "TGFrame.h"
#include "TGButton.h"
#include "Fireworks/Core/interface/FWViewType.h"
#ifndef __CINT__
#include "Fireworks/Core/interface/FWViewBase.h"
#include "Fireworks/Core/interface/FWViewBase.h"
#include "Fireworks/Core/interface/FWConfigurableParameterizable.h"
#include "Fireworks/Core/interface/FWStringParameter.h"
#include "Fireworks/Core/interface/FWEnumParameter.h"
#include "Fireworks/Core/interface/FWLongParameter.h"
#include "Fireworks/Core/interface/FWParameterSetterBase.h"
#include "Fireworks/Core/interface/FWParameterSetterEditorBase.h"
#endif

class TGeoNode;
class TGeoVolume;
class TGStatusBar;
class TGeoManager;
class TEveWindowSlot;
class TEveWindowFrame;
class TEveElement;
class FWEveDigitSetScalableMarker;
class TEveScene;

class FWTableWidget;
class FWGeometryTableManagerBase;
class FWConfiguration;
class FWColorPopup;
class FWColorManager;
class FWGeoTopNode;
class FWParameterBase;

class FWGeometryTableViewBase
#ifndef __CINT__
    : public FWViewBase,
      public FWParameterSetterEditorBase
#endif
{
public:
  class FWViewCombo : public TGTextButton {
  private:
    FWGeometryTableViewBase* m_tableView;
    TEveElement* m_el;

  public:
    FWViewCombo(const TGWindow* p, FWGeometryTableViewBase* t)
        : TGTextButton(p,
                       "Select Views",
                       -1,
                       TGButton::GetDefaultGC()(),
                       TGTextButton::GetDefaultFontStruct(),
                       kRaisedFrame | kDoubleBorder),
          m_tableView(t),
          m_el(nullptr) {}
    ~FWViewCombo() override {}
    void setElement(TEveElement* x) { m_el = x; }
    Bool_t HandleButton(Event_t* event) override;
  };

  FWGeometryTableViewBase(TEveWindowSlot*, FWViewType::EType, FWColorManager*);
  ~FWGeometryTableViewBase() override;

  virtual void cellClicked(Int_t iRow, Int_t iColumn, Int_t iButton, Int_t iKeyMod, Int_t iGlobalX, Int_t iGlobalY);

  // void chosenItemFrom3DView(int);
  virtual void chosenItem(int);
  void selectView(int);

  bool getEnableHighlight() { return m_enableHighlight.value(); }
  virtual FWGeometryTableManagerBase* getTableManager() { return nullptr; }

  // ---------- const member functions ---------------------

  void addTo(FWConfiguration&) const override;
  void saveImageTo(const std::string& iName) const override {}
  void nodeColorChangeRequested(Color_t);

  void setBackgroundColor();
  void populate3DViewsFromConfig();
  virtual void refreshTable3D();

  void cdNode(int);
  virtual void cdTop();
  virtual void cdUp();
  virtual void setPath(int, std::string&);

  void checkExpandLevel();

  int getTopNodeIdx() const { return TMath::Max((int)m_topNodeIdx.value(), 0); }

  FWEveDigitSetScalableMarker* getMarker() { return m_marker; }
  void transparencyChanged();

  void reloadColors();

  long getParentTransparencyFactor() const { return m_parentTransparencyFactor.value(); }
  long getLeafTransparencyFactor() const { return m_leafTransparencyFactor.value(); }
  long getMinParentTransparency() const { return m_minParentTransparency.value(); }
  long getMinLeafTransparency() const { return m_minLeafTransparency.value(); }

protected:
#ifndef __CINT__
  FWLongParameter m_topNodeIdx;
  FWLongParameter m_autoExpand;
  FWBoolParameter m_enableHighlight;

  FWLongParameter m_parentTransparencyFactor;
  FWLongParameter m_leafTransparencyFactor;
  FWLongParameter m_minParentTransparency;
  FWLongParameter m_minLeafTransparency;
#endif

  FWColorManager* m_colorManager;
  FWTableWidget* m_tableWidget;

  //  TGCompositeFrame       *m_settersFrame;

  FWColorPopup* m_colorPopup;

  TEveWindowFrame* m_eveWindow;
  TGCompositeFrame* m_frame;

  FWViewCombo* m_viewBox;

  const FWConfiguration* m_viewersConfig;

  bool m_enableRedraw;

  FWEveDigitSetScalableMarker* m_marker;
  FWGeoTopNode* m_eveTopNode;
  TEveScene* m_eveScene;

#ifndef __CINT__
  // std::vector<std::shared_ptr<FWParameterSetterBase> > m_setters;
#endif
  //   void resetSetters();
  //   void makeSetter(TGCompositeFrame* frame, FWParameterBase* param);

  void postConst();

  void setTopNodePathFromConfig(const FWConfiguration& iFrom);

  void populateController(ViewerParameterGUI&) const override;

private:
  int m_tableRowIndexForColorPopup;

  FWGeometryTableViewBase(const FWGeometryTableViewBase&);                   // stop default
  const FWGeometryTableViewBase& operator=(const FWGeometryTableViewBase&);  // stop default
  void setColumnSelected(int idx);
  ClassDef(FWGeometryTableViewBase, 0);
};

#endif