Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:41

0001 // @(#)root/eve7:$Id$
0002 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007, 2018
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT7_REveViewer
0013 #define ROOT7_REveViewer
0014 
0015 #include <ROOT/REveElement.hxx>
0016 
0017 namespace ROOT {
0018 namespace Experimental {
0019 
0020 class REveScene;
0021 
0022 ////////////////////////////////////////////////////////////////////////////////
0023 /// REveViewer
0024 /// Reve representation of TGLViewer.
0025 ////////////////////////////////////////////////////////////////////////////////
0026 
0027 class REveViewer : public REveElement
0028 {
0029 public:
0030    enum ECameraType { kCameraPerspXOZ, kCameraOrthoXOY };
0031    enum EAxesType {kAxesNone, kAxesOrigin, kAxesEdge };
0032 
0033 private:
0034    REveViewer(const REveViewer&) = delete;
0035    REveViewer& operator=(const REveViewer&) = delete;
0036 
0037    ECameraType fCameraType{kCameraPerspXOZ};
0038    EAxesType fAxesType{kAxesNone};
0039    bool      fBlackBackground{false};
0040 
0041    bool fMandatory{true};
0042    std::string fPostStreamFlag;
0043 
0044 public:
0045    REveViewer(const std::string &n="REveViewer", const std::string &t="");
0046    ~REveViewer() override;
0047 
0048    void Redraw(Bool_t resetCameras=kFALSE);
0049 
0050    virtual void AddScene(REveScene* scene);
0051    // XXX Missing RemoveScene() ????
0052 
0053    void SetCameraType(ECameraType t) { fCameraType = t; }
0054    ECameraType GetCameraType() const { return fCameraType; }
0055 
0056    void SetAxesType(int);
0057    void SetBlackBackground(bool);
0058 
0059    void DisconnectClient();
0060    void ConnectClient();
0061 
0062    void SetMandatory(bool x);
0063    bool GetMandatory() { return fMandatory; }
0064 
0065    void RemoveElementLocal(REveElement *el) override;
0066    void RemoveElementsLocal() override;
0067    Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset) override;
0068 };
0069 
0070 
0071 ////////////////////////////////////////////////////////////////////////////////
0072 /// REveViewerList
0073 /// List of Viewers providing common operations on REveViewer collections.
0074 ////////////////////////////////////////////////////////////////////////////////
0075 
0076 class REveViewerList : public REveElement
0077 {
0078 private:
0079    REveViewerList(const REveViewerList&) = delete;
0080    REveViewerList& operator=(const REveViewerList&) = delete;
0081 
0082 protected:
0083    Bool_t        fShowTooltip;
0084 
0085    Float_t       fBrightness;
0086    Bool_t        fUseLightColorSet;
0087 
0088    void HandleTooltip();
0089 
0090 public:
0091    REveViewerList(const std::string &n="REveViewerList", const std::string &t="");
0092    ~REveViewerList() override;
0093 
0094    void AddElement(REveElement* el) override;
0095    void RemoveElementLocal(REveElement* el) override;
0096    void RemoveElementsLocal() override;
0097 
0098    // --------------------------------
0099 
0100    virtual void Connect();
0101    virtual void Disconnect();
0102 
0103    void RepaintChangedViewers(Bool_t resetCameras, Bool_t dropLogicals);
0104    void RepaintAllViewers(Bool_t resetCameras, Bool_t dropLogicals);
0105    void DeleteAnnotations();
0106 
0107    void SceneDestructing(REveScene* scene);
0108 
0109    // --------------------------------
0110 
0111    void OnMouseOver(TObject* obj, UInt_t state);
0112    void OnReMouseOver(TObject* obj, UInt_t state);
0113    void OnUnMouseOver(TObject* obj, UInt_t state);
0114    void OnClicked(TObject *obj, UInt_t button, UInt_t state);
0115    void OnReClicked(TObject *obj, UInt_t button, UInt_t state);
0116    void OnUnClicked(TObject *obj, UInt_t button, UInt_t state);
0117 
0118    // --------------------------------
0119 
0120    Bool_t  GetShowTooltip()     const { return fShowTooltip; }
0121    void    SetShowTooltip(Bool_t x)   { fShowTooltip = x; }
0122 
0123    Float_t GetColorBrightness() const { return fBrightness; }
0124    void    SetColorBrightness(Float_t b);
0125 
0126    Bool_t  UseLightColorSet()   const { return fUseLightColorSet; }
0127    void    SwitchColorSet();
0128  //  Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset) override;
0129 };
0130 
0131 } // namespace Experimental
0132 } // namespace ROOT
0133 
0134 #endif