Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // @(#)root/eve7:$Id$
0002 // Author: Matevz Tadel 2007
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_REveCompound
0013 #define ROOT7_REveCompound
0014 
0015 #include <ROOT/REveElement.hxx>
0016 #include <ROOT/REveProjectionBases.hxx>
0017 
0018 namespace ROOT {
0019 namespace Experimental {
0020 
0021 //==============================================================================
0022 // REveCompound
0023 // Container for managing compounds of EveElements.
0024 //==============================================================================
0025 
0026 class REveCompound : public REveElement,
0027                      public REveProjectable
0028 {
0029 private:
0030    REveCompound(const REveCompound &) = delete;
0031    REveCompound &operator=(const REveCompound &) = delete;
0032 
0033 protected:
0034    Short_t fCompoundOpen{0}; // If more than zero, tag new children as compound members.
0035    Bool_t  fDoColor{kFALSE};
0036    Bool_t  fDoTransparency{kFALSE};
0037 
0038 public:
0039    REveCompound(const std::string& n = "REveCompound", const std::string& t = "",
0040                 Bool_t doColor = kTRUE, Bool_t doTransparency = kFALSE);
0041    ~REveCompound() override {}
0042 
0043    void   OpenCompound()   { ++fCompoundOpen; }
0044    void   CloseCompound()  { --fCompoundOpen; }
0045    Bool_t IsCompoundOpen() const { return fCompoundOpen > 0; }
0046 
0047    void SetMainColor(Color_t color) override;
0048    void SetMainTransparency(Char_t t) override;
0049 
0050    void AddElement(REveElement *el) override;
0051    void RemoveElementLocal(REveElement *el) override;
0052    void RemoveElementsLocal() override;
0053 
0054    void FillImpliedSelectedSet(Set_t &impSelSet, const std::set<int>&) override;
0055 
0056    TClass *ProjectedClass(const REveProjection *p) const override;
0057 };
0058 
0059 //==============================================================================
0060 // REveCompoundProjected
0061 // Projected EveCompund container.
0062 //==============================================================================
0063 
0064 class REveCompoundProjected : public REveCompound,
0065                               public REveProjected
0066 {
0067 private:
0068    REveCompoundProjected(const REveCompoundProjected &) = delete;
0069    REveCompoundProjected &operator=(const REveCompoundProjected &) = delete;
0070 
0071 public:
0072    REveCompoundProjected();
0073    ~REveCompoundProjected() override {}
0074 
0075    void SetMainColor(Color_t color) override;
0076 
0077    void UpdateProjection() override {}
0078    REveElement *GetProjectedAsElement() override { return this; }
0079 };
0080 
0081 } // namespace Experimental
0082 } // namespace ROOT
0083 
0084 #endif