File indexing completed on 2025-11-04 10:26:33
0001 
0002 
0003 
0004 
0005 
0006 
0007 
0008 
0009 
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    
0039 
0040    const REveViewContext&    Context()    const;
0041    REveDataCollection* Collection() const { return m_collection;  }
0042 
0043    
0044 
0045    REveDataProxyBuilderBase();
0046    virtual ~REveDataProxyBuilderBase() {}
0047 
0048    virtual void SetCollection(REveDataCollection*);
0049    
0050 
0051    virtual void CollectionBeingDestroyed(const REveDataCollection*);
0052 
0053    virtual void Build();
0054    
0055 
0056    virtual REveElement* CreateProduct(const std::string& viewType, const REveViewContext*);
0057    
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    
0072    virtual bool HaveSingleProduct() const { return true; }
0073 
0074 protected:
0075    
0076    
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& , 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 } 
0101 } 
0102 #endif