Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:37

0001 // @(#)root/gpad:$Id$
0002 // Author: Rene Brun   10/03/2007
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2021, 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 ROOT_TColorWheel
0013 #define ROOT_TColorWheel
0014 
0015 #include "TNamed.h"
0016 
0017 class TCanvas;
0018 class TArc;
0019 class TLine;
0020 class TText;
0021 class TGraph;
0022 
0023 class TColorWheel : public TNamed {
0024 
0025 private:
0026    Double_t  fRmin{0.};          ///<Minimum radius for rectangles
0027    Double_t  fRmax{0.};          ///<Maximum radius for rectangles
0028    Double_t  fR0{0.};            ///<Minimum radius for circles
0029    Double_t  fDr{0.};            ///<Circles radius
0030    Double_t  fRgray{0.};         ///<Maximum radius of gray circle
0031    Double_t  fX[15];             ///<X coordinates of the center of circles
0032    Double_t  fY[15];             ///<Y coordinates of the center of circles
0033    TCanvas  *fCanvas{nullptr};   ///<! Canvas used to draw the Color Wheel
0034    TArc     *fArc{nullptr};      ///<! pointer to utility arc
0035    TLine    *fLine{nullptr};     ///<! pointer to utility line
0036    TText    *fText{nullptr};     ///<! pointer to utility text
0037    TGraph   *fGraph{nullptr};    ///<! pointer to utility graph
0038 
0039    TColorWheel(const TColorWheel &) = delete;
0040    TColorWheel &operator=(const TColorWheel &) = delete;
0041 
0042 protected:
0043    Int_t InCircles(Double_t x, Double_t y, Int_t coffset, Double_t angle) const;
0044    Int_t InGray(Double_t x, Double_t y) const;
0045    Int_t InRectangles(Double_t x, Double_t y, Int_t coffset, Double_t angle) const;
0046    void  PaintCircle(Int_t coffset,Int_t n,Double_t x, Double_t y, Double_t ang) const;
0047    void  PaintCircles(Int_t coffset, Double_t angle) const ;
0048    void  PaintGray() const;
0049    void  PaintRectangles(Int_t coffset, Double_t angle) const;
0050    void  Rotate(Double_t x, Double_t y, Double_t &u, Double_t &v, Double_t ang) const;
0051 
0052 public:
0053    TColorWheel();
0054    ~TColorWheel() override;
0055    Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
0056    void Draw(Option_t *option = "") override;
0057    TCanvas *GetCanvas() const { return fCanvas; }
0058    virtual Int_t GetColor(Int_t px, Int_t py) const;
0059    char *GetObjectInfo(Int_t px, Int_t py) const override;
0060    void Paint(Option_t *option = "") override;
0061    virtual void SetCanvas(TCanvas *can) { fCanvas = can; }
0062 
0063    ClassDefOverride(TColorWheel,1)  //The ROOT Color Wheel
0064 };
0065 
0066 #endif
0067