Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:22:28

0001 // @(#)root/eve7:$Id$
0002 // Authors: Matevz Tadel & Alja Mrak-Tadel, 2019
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_REveDataProxySimpleBuilder
0013 #define ROOT7_REveDataProxySimpleBuilder
0014 
0015 #include<list>
0016 #include <ROOT/REveDataProxyBuilderBase.hxx>
0017 
0018 namespace ROOT {
0019 namespace Experimental {
0020 
0021 class REveDataCollection;
0022 class REveElement;
0023 
0024 class REveCollectionCompound : public REveCompound
0025 {
0026 private:
0027    REveDataCollection *fCollection{nullptr};   
0028 public:
0029    REveCollectionCompound(REveDataCollection *c);
0030    ~REveCollectionCompound() override;
0031    REveElement *GetSelectionMaster() override;
0032 
0033    bool fUsed{false};
0034 };
0035 
0036 //
0037 //____________________________________________________________________________________
0038 //
0039 class REveDataSimpleProxyBuilder : public REveDataProxyBuilderBase
0040 {
0041 
0042 public:
0043    REveDataSimpleProxyBuilder();
0044    ~REveDataSimpleProxyBuilder() override;
0045 
0046    struct SPBProduct {
0047       std::map<int, REveCollectionCompound*> map;
0048    }; 
0049    
0050    typedef  std::map<REveElement*, std::unique_ptr<SPBProduct*> > EProductMap_t;
0051 
0052    REveElement* CreateProduct(const std::string& viewType, const REveViewContext*) override;
0053 
0054 protected:
0055    void BuildProduct(const REveDataCollection* iCollection, REveElement* product, const REveViewContext*) override;
0056 
0057    void BuildProductViewType(const REveDataCollection* iCollection, REveElement* product, const std::string& viewType, const REveViewContext*) override;
0058 
0059    // Called once for every item in collection, the void* points to the
0060    // item properly offset in memory.
0061    virtual void BuildItem(const void* data, int index, REveElement* iCollectionHolder, const REveViewContext*) = 0;
0062    virtual void BuildItemViewType(const void* data, int index, REveElement* iCollectionHolder, const std::string& viewType, const REveViewContext*) = 0;
0063 
0064    void ModelChanges(const REveDataCollection::Ids_t& iIds, Product* p) override;
0065    void FillImpliedSelected(REveElement::Set_t& impSet, const std::set<int>& sec_idcs, Product* p) override;
0066    void Clean() override; // Utility
0067    REveCollectionCompound* CreateCompound(bool set_color=true, bool propagate_color_to_all_children=false);
0068 
0069    //int GetItemIdxForCompound() const;
0070    bool VisibilityModelChanges(int idx, REveElement*, const std::string& viewType, const REveViewContext*) override;
0071 
0072    std::map<REveElement*, SPBProduct*> fProductMap;
0073    REveCompound* GetHolder(REveElement *product, int idx);
0074 
0075 private:
0076    REveDataSimpleProxyBuilder(const REveDataSimpleProxyBuilder&); // stop default
0077 
0078    const REveDataSimpleProxyBuilder& operator=(const REveDataSimpleProxyBuilder&); // stop default
0079 };
0080 //==============================================================================
0081 
0082 
0083 } // namespace Experimental
0084 } // namespace ROOT
0085 
0086 #endif