TAxis3D.h

Go to the documentation of this file.
00001 // @(#)root/g3d:$Id: TAxis3D.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Valery Fine(fine@mail.cern.ch)   07/01/2000
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_TAxis3D
00013 #define ROOT_TAxis3D
00014 
00015 //////////////////////////////////////////////////////////////////////////
00016 //                                                                      //
00017 // TAxis3D                                                              //
00018 //                                                                      //
00019 // 3D axice                                                             //
00020 //                                                                      //
00021 //////////////////////////////////////////////////////////////////////////
00022 
00023 
00024 #ifndef ROOT_TAxis
00025 #include "TAxis.h"
00026 #endif
00027 
00028 class TF1;
00029 class TBrowser;
00030 class TGaxis;
00031 class TVirtualPad;
00032 class TView;
00033 class TAxis3D : public TNamed  {
00034 
00035 private:
00036    Int_t   AxisChoice(Option_t *axis) const;
00037    void    Build();
00038 
00039 protected:
00040    TAxis               fAxis[3];    //X/Y/Z axis
00041    TString             fOption;     // Options (is not use yet)
00042    static  const char *fgRulerName; // The default object name
00043    TAxis              *fSelected;   //!  The selected axis to play with
00044    Bool_t              fZoomMode;   // Zoom mode for the entire parent TPad
00045    Bool_t              fStickyZoom; // StickyZoom mode:  zoom will not be disabled    after zooming attempt if true
00046 
00047    virtual void        Copy(TObject &hnew) const;
00048    void                InitSet();
00049    Bool_t              SwitchZoom();
00050 
00051 public:
00052    TAxis3D();
00053    TAxis3D(Option_t *option);
00054    TAxis3D(const TAxis3D &axis);
00055    virtual ~TAxis3D(){;}
00056 
00057    virtual void     Browse(TBrowser *b);
00058 
00059    virtual Int_t    DistancetoPrimitive(Int_t px, Int_t py);
00060    virtual void     ExecuteEvent(Int_t event, Int_t px, Int_t py);
00061 
00062    Bool_t & StickyZoom(){return fStickyZoom;}
00063    Bool_t & Zoom(){return fZoomMode;}
00064 
00065    virtual Int_t    GetNdivisions(Option_t *axis="X") const;
00066    virtual Color_t  GetAxisColor(Option_t *axis="X") const;
00067    virtual Color_t  GetLabelColor(Option_t *axis="X") const;
00068    virtual Style_t  GetLabelFont(Option_t *axis="X") const;
00069    virtual Float_t  GetLabelOffset(Option_t *axis="X") const;
00070    virtual Float_t  GetLabelSize(Option_t *axis="X") const;
00071    static  TAxis3D *GetPadAxis(TVirtualPad *pad=0);
00072    virtual Float_t  GetTitleOffset(Option_t *axis="X") const;
00073    virtual Float_t  GetTickLength(Option_t *axis="X") const;
00074 
00075    virtual void     GetCenter(Axis_t *center) {fAxis[0].GetCenter(center);}
00076 
00077    virtual void     GetLowEdge(Axis_t *edge) {fAxis[0].GetLowEdge(edge);}
00078 
00079    virtual char    *GetObjectInfo(Int_t px, Int_t py) const;
00080 
00081    Option_t        *GetOption() const {return fOption.Data();}
00082 
00083    virtual TAxis   *GetXaxis() {return &fAxis[0];}
00084    virtual TAxis   *GetYaxis() {return &fAxis[1];}
00085    virtual TAxis   *GetZaxis() {return &fAxis[2];}
00086    virtual Bool_t   IsFolder() const { return kTRUE;}
00087    virtual void     Paint(Option_t *option="");
00088    void             PaintAxis(TGaxis *axis, Float_t ang);
00089    static Double_t *PixeltoXYZ(Double_t px, Double_t py, Double_t *point3D, TView *view =0);
00090    virtual void     SavePrimitive(ostream &out, Option_t *option = "");
00091 
00092    virtual void     SetAxisColor(Color_t color=1, Option_t *axis="*"); // *MENU*
00093    virtual void     SetAxisRange(Double_t xmin, Double_t xmax, Option_t *axis="*");
00094 
00095    virtual void     SetLabelColor(Color_t color=1, Option_t *axis="*");// *MENU*
00096    virtual void     SetLabelFont(Style_t font=62, Option_t *axis="*"); // *MENU*
00097    virtual void     SetLabelOffset(Float_t offset=0.005, Option_t *axis="*"); // *MENU*
00098    virtual void     SetLabelSize(Float_t size=0.02, Option_t *axis="*"); // *MENU*
00099 
00100    virtual void     SetNdivisions(Int_t n=510, Option_t *axis="*"); // *MENU*
00101    virtual void     SetOption(Option_t *option=" ") {fOption = option;}
00102    virtual void     SetTickLength(Float_t length=0.02, Option_t *axis="*"); // *MENU*
00103    virtual void     SetTitleOffset(Float_t offset=1, Option_t *axis="*"); // *MENU*
00104    virtual void     SetXTitle(const char *title) {fAxis[0].SetTitle(title);} // *MENU*
00105    virtual void     SetYTitle(const char *title) {fAxis[1].SetTitle(title);} // *MENU*
00106    virtual void     SetZTitle(const char *title) {fAxis[2].SetTitle(title);} // *MENU*
00107    static  TAxis3D *ToggleRulers(TVirtualPad *pad=0);
00108    static  TAxis3D *ToggleZoom(TVirtualPad *pad=0);
00109    void             UseCurrentStyle();
00110 
00111    ClassDef(TAxis3D,1)  //3-D ruler painting class
00112 };
00113 
00114 
00115 inline Bool_t TAxis3D::SwitchZoom(){Bool_t s = fZoomMode; fZoomMode = !fZoomMode; return s;}
00116 
00117 #endif

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