Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // @(#)root/eve7:$Id$
0002 // Authors: Matevz Tadel & Alja Mrak-Tadel, 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_REveDataProxyBuilderBase
0013 #define ROOT7_REveDataProxyBuilderBase
0014 
0015 #include <ROOT/REveElement.hxx>
0016 #include <ROOT/REveCompound.hxx>
0017 #include <ROOT/REveDataCollection.hxx>
0018 
0019 namespace ROOT {
0020 namespace Experimental {
0021 
0022 class REveViewContext;
0023 class REveTrackPropagator;
0024 
0025 class REveDataProxyBuilderBase
0026 {
0027 public:
0028    struct Product
0029    {
0030       std::string              m_viewType;
0031       const REveViewContext   *m_viewContext{nullptr};
0032       REveCompound            *m_elements{nullptr};
0033 
0034       Product(std::string viewType, const REveViewContext* c);
0035       virtual ~Product();
0036    };
0037 
0038    // ---------- const member functions ---------------------
0039 
0040    const REveViewContext&    Context()    const;
0041    REveDataCollection* Collection() const { return m_collection;  }
0042 
0043    // ---------- constructor/destructor  ---------------------
0044 
0045    REveDataProxyBuilderBase();
0046    virtual ~REveDataProxyBuilderBase() {}
0047 
0048    virtual void SetCollection(REveDataCollection*);
0049    //   virtual void SetInteractionList(REveDataInteractionList*, const std::string&);
0050 
0051    virtual void CollectionBeingDestroyed(const REveDataCollection*);
0052 
0053    virtual void Build();
0054    // virtual void Build(REveElement* product);
0055 
0056    virtual REveElement* CreateProduct(const std::string& viewType, const REveViewContext*);
0057    //  void removePerViewProduct(const REveViewContext* vc);
0058 
0059    void FillImpliedSelected(REveElement::Set_t& impSet, const std::set<int>&);
0060    void ModelChanges(const REveDataCollection::Ids_t&);
0061    void CollectionChanged(const REveDataCollection*);
0062 
0063    virtual void ScaleChanged();
0064 
0065    void SetupElement(REveElement* el, bool color = true);
0066    void SetupAddElement(REveElement* el, REveElement* parent,  bool set_color = true);
0067 
0068    bool GetHaveAWindow() const { return m_haveWindow; }
0069    void SetHaveAWindow(bool);
0070 
0071    // const member functions
0072    virtual bool HaveSingleProduct() const { return true; }
0073 
0074 protected:
0075    // Override this if visibility changes can cause (re)-creation of proxies.
0076    // Returns true if new proxies were created.
0077    virtual bool VisibilityModelChanges(int idx, REveElement*, const std::string& viewType, const REveViewContext*);
0078 
0079    virtual void BuildProduct(const REveDataCollection* iItem, REveElement* product, const REveViewContext*);
0080    virtual void BuildProductViewType(const REveDataCollection* iItem, REveElement* product, const std::string& viewType, const REveViewContext*);
0081 
0082    virtual void ModelChanges(const REveDataCollection::Ids_t&, Product*) = 0;
0083    virtual void FillImpliedSelected( REveElement::Set_t& /*impSet*/, const std::set<int>&, Product*) {};
0084    virtual void LocalModelChanges(int idx, REveElement* el, const REveViewContext* ctx);
0085 
0086    virtual void ScaleProduct(REveElement*, const std::string&) {};
0087 
0088    virtual void Clean();
0089    virtual void CleanLocal();
0090 
0091    std::vector<Product*> m_products;
0092 
0093 private:
0094    REveDataCollection *m_collection{nullptr};
0095 
0096    bool                  m_haveWindow{false};
0097    bool                  m_modelsChanged{false};
0098 };
0099 
0100 } // namespace Experimental
0101 } // namespace ROOT
0102 #endif