File indexing completed on 2025-01-18 10:11:37
0001
0002
0003
0004
0005
0006
0007
0008
0009
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.};
0027 Double_t fRmax{0.};
0028 Double_t fR0{0.};
0029 Double_t fDr{0.};
0030 Double_t fRgray{0.};
0031 Double_t fX[15];
0032 Double_t fY[15];
0033 TCanvas *fCanvas{nullptr};
0034 TArc *fArc{nullptr};
0035 TLine *fLine{nullptr};
0036 TText *fText{nullptr};
0037 TGraph *fGraph{nullptr};
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)
0064 };
0065
0066 #endif
0067