Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:19

0001 // @(#)root/graf:$Id$
0002 // Author: Rene Brun   16/10/95
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, 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_TPave
0013 #define ROOT_TPave
0014 
0015 
0016 #include "TBox.h"
0017 #include "TString.h"
0018 
0019 class TPave : public TBox {
0020 
0021 protected:
0022    Double_t     fX1NDC;         ///< X1 point in NDC coordinates
0023    Double_t     fY1NDC;         ///< Y1 point in NDC coordinates
0024    Double_t     fX2NDC;         ///< X2 point in NDC coordinates
0025    Double_t     fY2NDC;         ///< Y2 point in NDC coordinates
0026    Int_t        fBorderSize;    ///< window box bordersize in pixels
0027    Int_t        fInit;          ///< (=0 if transformation to NDC not yet done)
0028    Int_t        fShadowColor;   ///< Color of the pave's shadow
0029    Double_t     fCornerRadius;  ///< Corner radius in case of option arc
0030    TString      fOption;        ///< Pave style
0031    TString      fName;          ///< Pave name
0032 
0033 public:
0034    // TPave status bits
0035    enum {
0036       kNameIsAction = BIT(11)   ///< double clicking on TPave will execute action
0037    };
0038 
0039    TPave();
0040    TPave(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
0041          Int_t bordersize=4 ,Option_t *option="br");
0042    TPave(const TPave &pave);
0043    ~TPave() override;
0044 
0045    TPave &operator=(const TPave &src);
0046 
0047    void           Copy(TObject &pave) const override;
0048    virtual void   ConvertNDCtoPad();
0049    Int_t          DistancetoPrimitive(Int_t px, Int_t py) override;
0050    void           Draw(Option_t *option="") override;
0051    virtual TPave *DrawPave(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
0052                           Int_t bordersize=4 ,Option_t *option="br");
0053    void           ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
0054    Int_t          GetBorderSize() const { return fBorderSize;}
0055    Double_t       GetCornerRadius() const {return fCornerRadius;}
0056    const char    *GetName() const override {return fName.Data();}
0057    Option_t      *GetOption() const override {return fOption.Data();}
0058    Int_t          GetShadowColor() const {return fShadowColor;}
0059    Double_t       GetX1NDC() const {return fX1NDC;}
0060    Double_t       GetX2NDC() const {return fX2NDC;}
0061    Double_t       GetY1NDC() const {return fY1NDC;}
0062    Double_t       GetY2NDC() const {return fY2NDC;}
0063    ULong_t        Hash() const override { return fName.Hash(); }
0064    Bool_t         IsSortable() const override { return kTRUE; }
0065    void           ls(Option_t *option="") const override;
0066    void           Paint(Option_t *option="") override;
0067    virtual void   PaintPave(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
0068                             Int_t bordersize=4 ,Option_t *option="br");
0069    virtual void   PaintPaveArc(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
0070                                Int_t bordersize=4 ,Option_t *option="br");
0071    void           Print(Option_t *option="") const override;
0072    void           SavePrimitive(std::ostream &out, Option_t *option = "") override;
0073    /**
0074     * \brief Sets the border size of the TPave box and shadow
0075     * \param bordersize 0: disable shadow and box, 1: disable only shadow, 2+: tunes the shadow border size
0076     */
0077    virtual void   SetBorderSize(Int_t bordersize=4) {fBorderSize = bordersize;} // *MENU*
0078    virtual void   SetCornerRadius(Double_t rad = 0.2) {fCornerRadius = rad;} // *MENU*
0079    virtual void   SetName(const char *name="") {fName = name;} // *MENU*
0080    virtual void   SetOption(Option_t *option="br") {fOption = option;}
0081    virtual void   SetShadowColor(Int_t color) {fShadowColor=color;} // *MENU*
0082    virtual void   SetX1NDC(Double_t x1) {fX1NDC=x1;}
0083    virtual void   SetX2NDC(Double_t x2) {fX2NDC=x2;}
0084    virtual void   SetY1NDC(Double_t y1) {fY1NDC=y1;}
0085    virtual void   SetY2NDC(Double_t y2) {fY2NDC=y2;}
0086    void   SetX1(Double_t x1) override;
0087    void   SetX2(Double_t x2) override;
0088    void   SetY1(Double_t y1) override;
0089    void   SetY2(Double_t y2) override;
0090 
0091    ClassDefOverride(TPave,3)  //Pave. A box with shadowing
0092 };
0093 
0094 #endif
0095