Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

TAxis3D.h

Go to the documentation of this file.
00001 // @(#)root/g3d:$Name:  $:$Id: TAxis3D.h,v 1.6 2002/10/31 07:27:34 brun Exp $
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 #ifndef ROOT_TAxis3D
00012 #define ROOT_TAxis3D
00013 // $Id: TAxis3D.h,v 1.6 2002/10/31 07:27:34 brun Exp $
00014 // ***********************************************************************
00015 // * C++ class library to paint axis "arround" TView object
00016 // * Copyright(c) 1997~1999  [BNL] Brookhaven National Laboratory, STAR, All rights reserved
00017 // * Author                  Valeri Fine  (fine@bnl.gov)
00018 // * Copyright(c) 1997~1999  Valeri Fine  (fine@bnl.gov)
00019 // *
00020 // * This program is distributed in the hope that it will be useful,
00021 // * but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00023 // *
00024 // * Permission to use, copy, modify and distribute this software and its
00025 // * documentation for any purpose is hereby granted without fee,
00026 // * provided that the above copyright notice appear in all copies and
00027 // * that both that copyright notice and this permission notice appear
00028 // * in supporting documentation.  Brookhaven National Laboratory makes no
00029 // * representations about the suitability of this software for any
00030 // * purpose.  It is provided "as is" without express or implied warranty.
00031 // ************************************************************************
00032 
00034 //                                                                      //
00035 // TAxis3D                                                              //
00036 //                                                                      //
00037 // 3D axice                                                             //
00038 //                                                                      //
00040 
00041 
00042 #ifndef ROOT_TAxis
00043 #include "TAxis.h"
00044 #endif
00045 
00046 class TF1;
00047 class TBrowser;
00048 class TGaxis;
00049 class TVirtualPad;
00050 class TView;
00051 class TAxis3D : public TNamed  {
00052 
00053 private:
00054     Int_t   AxisChoice(Option_t *axis) const;
00055     void    Build();
00056 
00057 protected:
00058     TAxis           fAxis[3];             //X/Y/Z axis
00059     TString         fOption;              // Options (is not use yet)
00060     static  const Char_t *rulerName;      // The default object name
00061     TAxis          *fSelected;            
00062             Bool_t  fZoomMode;            // Zoom mode for the entire parent TPad
00063 
00064     virtual void    Copy(TObject &hnew) const;
00065             void    InitSet();
00066             Bool_t  SwitchZoom();
00067 
00068 public:
00069     TAxis3D();
00070     TAxis3D(Option_t *option);
00071     TAxis3D(const TAxis3D &axis);
00072     virtual ~ TAxis3D(){;}
00073 
00074     virtual void     Browse(TBrowser *b);
00075 
00076     virtual Int_t    DistancetoPrimitive(Int_t px, Int_t py);
00077     virtual void     ExecuteEvent(Int_t event, Int_t px, Int_t py);
00078 
00079     virtual Int_t    GetNdivisions(Option_t *axis="X") const;
00080     virtual Color_t  GetAxisColor(Option_t *axis="X") const;
00081     virtual Color_t  GetLabelColor(Option_t *axis="X") const;
00082     virtual Style_t  GetLabelFont(Option_t *axis="X") const;
00083     virtual Float_t  GetLabelOffset(Option_t *axis="X") const;
00084     virtual Float_t  GetLabelSize(Option_t *axis="X") const;
00085     static  TAxis3D *GetPadAxis(TVirtualPad *pad=0);
00086     virtual Float_t  GetTitleOffset(Option_t *axis="X") const;
00087     virtual Float_t  GetTickLength(Option_t *axis="X") const;
00088 
00089     virtual void     GetCenter(Axis_t *center) {fAxis[0].GetCenter(center);}
00090 
00091     virtual void     GetLowEdge(Axis_t *edge) {fAxis[0].GetLowEdge(edge);}
00092 
00093     virtual char    *GetObjectInfo(Int_t px, Int_t py) const;
00094 
00095     Option_t        *GetOption() const {return fOption.Data();}
00096 
00097     virtual TAxis   *GetXaxis() {return &fAxis[0];}
00098     virtual TAxis   *GetYaxis() {return &fAxis[1];}
00099     virtual TAxis   *GetZaxis() {return &fAxis[2];}
00100     virtual Bool_t   IsFolder() const { return kTRUE;}
00101     virtual void     Paint(Option_t *option="");
00102             void     PaintAxis(TGaxis *axis, Float_t ang);
00103     static Double_t *PixeltoXYZ(Double_t px, Double_t py, Double_t *point3D, TView *view =0);
00104     virtual void     SavePrimitive(ofstream &out, Option_t *option);
00105 
00106     virtual void     SetAxisColor(Color_t color=1, Option_t *axis="*"); // *MENU*
00107     virtual void     SetAxisRange(Double_t xmin, Double_t xmax, Option_t *axis="*");
00108 
00109     virtual void     SetLabelColor(Color_t color=1, Option_t *axis="*");// *MENU*
00110     virtual void     SetLabelFont(Style_t font=62, Option_t *axis="*"); // *MENU*
00111     virtual void     SetLabelOffset(Float_t offset=0.005, Option_t *axis="*"); // *MENU*
00112     virtual void     SetLabelSize(Float_t size=0.02, Option_t *axis="*"); // *MENU*
00113 
00114     virtual void     SetNdivisions(Int_t n=510, Option_t *axis="*"); // *MENU*
00115     virtual void     SetOption(Option_t *option=" ") {fOption = option;}
00116     virtual void     SetTickLength(Float_t length=0.02, Option_t *axis="*"); // *MENU*
00117     virtual void     SetTitleOffset(Float_t offset=1, Option_t *axis="*"); // *MENU*
00118     virtual void     SetXTitle(const char *title) {fAxis[0].SetTitle(title);} // *MENU*
00119     virtual void     SetYTitle(const char *title) {fAxis[1].SetTitle(title);} // *MENU*
00120     virtual void     SetZTitle(const char *title) {fAxis[2].SetTitle(title);} // *MENU*
00121     static  TAxis3D *ToggleRulers(TVirtualPad *pad=0);
00122     static  TAxis3D *ToggleZoom(TVirtualPad *pad=0);
00123     void             UseCurrentStyle();
00124 
00125     ClassDef(TAxis3D,1)  //3-D ruler painting class
00126 };
00127 
00128 
00129 inline Bool_t TAxis3D::SwitchZoom(){Bool_t s = fZoomMode; fZoomMode = !fZoomMode; return s;}
00130 
00131 #endif

Generated on Thu Dec 18 14:52:16 2003 for ROOT by doxygen1.2.16