Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TAxis3D.h
Go to the documentation of this file.
1 // @(#)root/g3d:$Id$
2 // Author: Valery Fine(fine@mail.cern.ch) 07/01/2000
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TAxis3D
13 #define ROOT_TAxis3D
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TAxis3D //
18 // //
19 // 3D axice //
20 // //
21 //////////////////////////////////////////////////////////////////////////
22 
23 
24 #include "TAxis.h"
25 
26 class TF1;
27 class TBrowser;
28 class TGaxis;
29 class TVirtualPad;
30 class TView;
31 class TAxis3D : public TNamed {
32 
33 private:
34  Int_t AxisChoice(Option_t *axis) const;
35  void Build();
36 
37 protected:
38  TAxis fAxis[3]; //X/Y/Z axis
39  TString fOption; // Options (is not use yet)
40  static const char *fgRulerName; // The default object name
41  TAxis *fSelected; //! The selected axis to play with
42  Bool_t fZoomMode; // Zoom mode for the entire parent TPad
43  Bool_t fStickyZoom; // StickyZoom mode: zoom will not be disabled after zooming attempt if true
44 
45  virtual void Copy(TObject &hnew) const;
46  void InitSet();
47  Bool_t SwitchZoom();
48 
49 public:
50  TAxis3D();
51  TAxis3D(Option_t *option);
52  TAxis3D(const TAxis3D &axis);
53  virtual ~TAxis3D(){;}
54 
55  virtual void Browse(TBrowser *b);
56 
57  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
58  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
59 
60  Bool_t & StickyZoom(){return fStickyZoom;}
61  Bool_t & Zoom(){return fZoomMode;}
62 
63  virtual Int_t GetNdivisions(Option_t *axis="X") const;
64  virtual Color_t GetAxisColor(Option_t *axis="X") const;
65  virtual Color_t GetLabelColor(Option_t *axis="X") const;
66  virtual Style_t GetLabelFont(Option_t *axis="X") const;
67  virtual Float_t GetLabelOffset(Option_t *axis="X") const;
68  virtual Float_t GetLabelSize(Option_t *axis="X") const;
69  static TAxis3D *GetPadAxis(TVirtualPad *pad=0);
70  virtual Float_t GetTitleOffset(Option_t *axis="X") const;
71  virtual Float_t GetTickLength(Option_t *axis="X") const;
72 
73  virtual void GetCenter(Axis_t *center) {fAxis[0].GetCenter(center);}
74 
75  virtual void GetLowEdge(Axis_t *edge) {fAxis[0].GetLowEdge(edge);}
76 
77  virtual char *GetObjectInfo(Int_t px, Int_t py) const;
78 
79  Option_t *GetOption() const {return fOption.Data();}
80 
81  virtual TAxis *GetXaxis() {return &fAxis[0];}
82  virtual TAxis *GetYaxis() {return &fAxis[1];}
83  virtual TAxis *GetZaxis() {return &fAxis[2];}
84  virtual Bool_t IsFolder() const { return kTRUE;}
85  virtual void Paint(Option_t *option="");
86  void PaintAxis(TGaxis *axis, Float_t ang);
87  static Double_t *PixeltoXYZ(Double_t px, Double_t py, Double_t *point3D, TView *view =0);
88  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
89 
90  virtual void SetAxisColor(Color_t color=1, Option_t *axis="*"); // *MENU*
91  virtual void SetAxisRange(Double_t xmin, Double_t xmax, Option_t *axis="*");
92 
93  virtual void SetLabelColor(Color_t color=1, Option_t *axis="*");// *MENU*
94  virtual void SetLabelFont(Style_t font=62, Option_t *axis="*"); // *MENU*
95  virtual void SetLabelOffset(Float_t offset=0.005, Option_t *axis="*"); // *MENU*
96  virtual void SetLabelSize(Float_t size=0.02, Option_t *axis="*"); // *MENU*
97 
98  virtual void SetNdivisions(Int_t n=510, Option_t *axis="*"); // *MENU*
99  virtual void SetOption(Option_t *option=" ") {fOption = option;}
100  virtual void SetTickLength(Float_t length=0.02, Option_t *axis="*"); // *MENU*
101  virtual void SetTitleOffset(Float_t offset=1, Option_t *axis="*"); // *MENU*
102  virtual void SetXTitle(const char *title) {fAxis[0].SetTitle(title);} // *MENU*
103  virtual void SetYTitle(const char *title) {fAxis[1].SetTitle(title);} // *MENU*
104  virtual void SetZTitle(const char *title) {fAxis[2].SetTitle(title);} // *MENU*
105  static TAxis3D *ToggleRulers(TVirtualPad *pad=0);
106  static TAxis3D *ToggleZoom(TVirtualPad *pad=0);
107  void UseCurrentStyle();
108 
109  ClassDef(TAxis3D,1) //3-D ruler painting class
110 };
111 
112 
113 inline Bool_t TAxis3D::SwitchZoom(){Bool_t s = fZoomMode; fZoomMode = !fZoomMode; return s;}
114 
115 #endif