TPave.h

Go to the documentation of this file.
00001 // @(#)root/graf:$Id: TPave.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Rene Brun   16/10/95
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TPave
00013 #define ROOT_TPave
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TPave                                                                //
00019 //                                                                      //
00020 // Pave class.                                                          //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #ifndef ROOT_TBox
00025 #include "TBox.h"
00026 #endif
00027 #ifndef ROOT_TString
00028 #include "TString.h"
00029 #endif
00030 
00031 class TPave : public TBox {
00032 
00033 protected:
00034    Double_t     fX1NDC;         //X1 point in NDC coordinates
00035    Double_t     fY1NDC;         //Y1 point in NDC coordinates
00036    Double_t     fX2NDC;         //X2 point in NDC coordinates
00037    Double_t     fY2NDC;         //Y2 point in NDC coordinates
00038    Int_t        fBorderSize;    //window box bordersize in pixels
00039    Int_t        fInit;          //(=0 if transformation to NDC not yet done)
00040    Int_t        fShadowColor;   //Color of the pave's shadow
00041    Double_t     fCornerRadius;  //Corner radius in case of option arc
00042    TString      fOption;        //Pave style
00043    TString      fName;          //Pave name
00044 
00045 public:
00046    // TPave status bits
00047    enum {
00048       kNameIsAction = BIT(11)   // double clicking on TPave will execute action
00049    };
00050 
00051    TPave();
00052    TPave(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
00053          Int_t bordersize=4 ,Option_t *option="br");
00054    TPave(const TPave &pave);
00055    virtual ~TPave();
00056    void  Copy(TObject &pave) const;
00057    virtual void  ConvertNDCtoPad();
00058    virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
00059    virtual void  Draw(Option_t *option="");
00060    virtual void  DrawPave(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
00061                           Int_t bordersize=4 ,Option_t *option="br");
00062    virtual void  ExecuteEvent(Int_t event, Int_t px, Int_t py);
00063    Int_t       GetBorderSize() const { return fBorderSize;}
00064    Double_t    GetCornerRadius() const {return fCornerRadius;}
00065    Option_t   *GetName() const {return fName.Data();}
00066    Option_t   *GetOption() const {return fOption.Data();}
00067    Int_t       GetShadowColor() const {return fShadowColor;}
00068    Double_t    GetX1NDC() const {return fX1NDC;}
00069    Double_t    GetX2NDC() const {return fX2NDC;}
00070    Double_t    GetY1NDC() const {return fY1NDC;}
00071    Double_t    GetY2NDC() const {return fY2NDC;}
00072    virtual ULong_t  Hash() const { return fName.Hash(); }
00073    virtual Bool_t   IsSortable() const { return kTRUE; }
00074    virtual void  ls(Option_t *option="") const;
00075    virtual void  Paint(Option_t *option="");
00076    virtual void  PaintPave(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
00077                            Int_t bordersize=4 ,Option_t *option="br");
00078    virtual void  PaintPaveArc(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
00079                               Int_t bordersize=4 ,Option_t *option="br");
00080    virtual void  Print(Option_t *option="") const;
00081    virtual void  SavePrimitive(ostream &out, Option_t *option = "");
00082    virtual void  SetBorderSize(Int_t bordersize=4) {fBorderSize = bordersize;} // *MENU*
00083    virtual void  SetCornerRadius(Double_t rad = 0.2) {fCornerRadius = rad;} // *MENU*
00084    virtual void  SetName(const char *name="") {fName = name;} // *MENU*
00085    virtual void  SetOption(Option_t *option="br") {fOption = option;}
00086    virtual void  SetShadowColor(Int_t color) {fShadowColor=color;} // *MENU*
00087    virtual void  SetX1NDC(Double_t x1) {fX1NDC=x1;}
00088    virtual void  SetX2NDC(Double_t x2) {fX2NDC=x2;}
00089    virtual void  SetY1NDC(Double_t y1) {fY1NDC=y1;}
00090    virtual void  SetY2NDC(Double_t y2) {fY2NDC=y2;}
00091 
00092    ClassDef(TPave,3)  //Pave. A box with shadowing
00093 };
00094 
00095 #endif
00096 

Generated on Tue Jul 5 14:14:10 2011 for ROOT_528-00b_version by  doxygen 1.5.1