ROOT logo
// @(#)root/g3d:$Id: TAxis3D.h 20882 2007-11-19 11:31:26Z rdm $
// Author: Valery Fine(fine@mail.cern.ch)   07/01/2000

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TAxis3D
#define ROOT_TAxis3D

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TAxis3D                                                              //
//                                                                      //
// 3D axice                                                             //
//                                                                      //
//////////////////////////////////////////////////////////////////////////


#ifndef ROOT_TAxis
#include "TAxis.h"
#endif

class TF1;
class TBrowser;
class TGaxis;
class TVirtualPad;
class TView;
class TAxis3D : public TNamed  {

private:
   Int_t   AxisChoice(Option_t *axis) const;
   void    Build();

protected:
   TAxis               fAxis[3];    //X/Y/Z axis
   TString             fOption;     // Options (is not use yet)
   static  const char *fgRulerName; // The default object name
   TAxis              *fSelected;   //!  The selected axis to play with
   Bool_t              fZoomMode;   // Zoom mode for the entire parent TPad
   Bool_t              fStickyZoom; // StickyZoom mode:  zoom will not be disabled    after zooming attempt if true

   virtual void        Copy(TObject &hnew) const;
   void                InitSet();
   Bool_t              SwitchZoom();

public:
   TAxis3D();
   TAxis3D(Option_t *option);
   TAxis3D(const TAxis3D &axis);
   virtual ~TAxis3D(){;}

   virtual void     Browse(TBrowser *b);

   virtual Int_t    DistancetoPrimitive(Int_t px, Int_t py);
   virtual void     ExecuteEvent(Int_t event, Int_t px, Int_t py);

   Bool_t & StickyZoom(){return fStickyZoom;}
   Bool_t & Zoom(){return fZoomMode;}

   virtual Int_t    GetNdivisions(Option_t *axis="X") const;
   virtual Color_t  GetAxisColor(Option_t *axis="X") const;
   virtual Color_t  GetLabelColor(Option_t *axis="X") const;
   virtual Style_t  GetLabelFont(Option_t *axis="X") const;
   virtual Float_t  GetLabelOffset(Option_t *axis="X") const;
   virtual Float_t  GetLabelSize(Option_t *axis="X") const;
   static  TAxis3D *GetPadAxis(TVirtualPad *pad=0);
   virtual Float_t  GetTitleOffset(Option_t *axis="X") const;
   virtual Float_t  GetTickLength(Option_t *axis="X") const;

   virtual void     GetCenter(Axis_t *center) {fAxis[0].GetCenter(center);}

   virtual void     GetLowEdge(Axis_t *edge) {fAxis[0].GetLowEdge(edge);}

   virtual char    *GetObjectInfo(Int_t px, Int_t py) const;

   Option_t        *GetOption() const {return fOption.Data();}

   virtual TAxis   *GetXaxis() {return &fAxis[0];}
   virtual TAxis   *GetYaxis() {return &fAxis[1];}
   virtual TAxis   *GetZaxis() {return &fAxis[2];}
   virtual Bool_t   IsFolder() const { return kTRUE;}
   virtual void     Paint(Option_t *option="");
   void             PaintAxis(TGaxis *axis, Float_t ang);
   static Double_t *PixeltoXYZ(Double_t px, Double_t py, Double_t *point3D, TView *view =0);
   virtual void     SavePrimitive(ostream &out, Option_t *option = "");

   virtual void     SetAxisColor(Color_t color=1, Option_t *axis="*"); // *MENU*
   virtual void     SetAxisRange(Double_t xmin, Double_t xmax, Option_t *axis="*");

   virtual void     SetLabelColor(Color_t color=1, Option_t *axis="*");// *MENU*
   virtual void     SetLabelFont(Style_t font=62, Option_t *axis="*"); // *MENU*
   virtual void     SetLabelOffset(Float_t offset=0.005, Option_t *axis="*"); // *MENU*
   virtual void     SetLabelSize(Float_t size=0.02, Option_t *axis="*"); // *MENU*

   virtual void     SetNdivisions(Int_t n=510, Option_t *axis="*"); // *MENU*
   virtual void     SetOption(Option_t *option=" ") {fOption = option;}
   virtual void     SetTickLength(Float_t length=0.02, Option_t *axis="*"); // *MENU*
   virtual void     SetTitleOffset(Float_t offset=1, Option_t *axis="*"); // *MENU*
   virtual void     SetXTitle(const char *title) {fAxis[0].SetTitle(title);} // *MENU*
   virtual void     SetYTitle(const char *title) {fAxis[1].SetTitle(title);} // *MENU*
   virtual void     SetZTitle(const char *title) {fAxis[2].SetTitle(title);} // *MENU*
   static  TAxis3D *ToggleRulers(TVirtualPad *pad=0);
   static  TAxis3D *ToggleZoom(TVirtualPad *pad=0);
   void             UseCurrentStyle();

   ClassDef(TAxis3D,1)  //3-D ruler painting class
};


inline Bool_t TAxis3D::SwitchZoom(){Bool_t s = fZoomMode; fZoomMode = !fZoomMode; return s;}

#endif
 TAxis3D.h:1
 TAxis3D.h:2
 TAxis3D.h:3
 TAxis3D.h:4
 TAxis3D.h:5
 TAxis3D.h:6
 TAxis3D.h:7
 TAxis3D.h:8
 TAxis3D.h:9
 TAxis3D.h:10
 TAxis3D.h:11
 TAxis3D.h:12
 TAxis3D.h:13
 TAxis3D.h:14
 TAxis3D.h:15
 TAxis3D.h:16
 TAxis3D.h:17
 TAxis3D.h:18
 TAxis3D.h:19
 TAxis3D.h:20
 TAxis3D.h:21
 TAxis3D.h:22
 TAxis3D.h:23
 TAxis3D.h:24
 TAxis3D.h:25
 TAxis3D.h:26
 TAxis3D.h:27
 TAxis3D.h:28
 TAxis3D.h:29
 TAxis3D.h:30
 TAxis3D.h:31
 TAxis3D.h:32
 TAxis3D.h:33
 TAxis3D.h:34
 TAxis3D.h:35
 TAxis3D.h:36
 TAxis3D.h:37
 TAxis3D.h:38
 TAxis3D.h:39
 TAxis3D.h:40
 TAxis3D.h:41
 TAxis3D.h:42
 TAxis3D.h:43
 TAxis3D.h:44
 TAxis3D.h:45
 TAxis3D.h:46
 TAxis3D.h:47
 TAxis3D.h:48
 TAxis3D.h:49
 TAxis3D.h:50
 TAxis3D.h:51
 TAxis3D.h:52
 TAxis3D.h:53
 TAxis3D.h:54
 TAxis3D.h:55
 TAxis3D.h:56
 TAxis3D.h:57
 TAxis3D.h:58
 TAxis3D.h:59
 TAxis3D.h:60
 TAxis3D.h:61
 TAxis3D.h:62
 TAxis3D.h:63
 TAxis3D.h:64
 TAxis3D.h:65
 TAxis3D.h:66
 TAxis3D.h:67
 TAxis3D.h:68
 TAxis3D.h:69
 TAxis3D.h:70
 TAxis3D.h:71
 TAxis3D.h:72
 TAxis3D.h:73
 TAxis3D.h:74
 TAxis3D.h:75
 TAxis3D.h:76
 TAxis3D.h:77
 TAxis3D.h:78
 TAxis3D.h:79
 TAxis3D.h:80
 TAxis3D.h:81
 TAxis3D.h:82
 TAxis3D.h:83
 TAxis3D.h:84
 TAxis3D.h:85
 TAxis3D.h:86
 TAxis3D.h:87
 TAxis3D.h:88
 TAxis3D.h:89
 TAxis3D.h:90
 TAxis3D.h:91
 TAxis3D.h:92
 TAxis3D.h:93
 TAxis3D.h:94
 TAxis3D.h:95
 TAxis3D.h:96
 TAxis3D.h:97
 TAxis3D.h:98
 TAxis3D.h:99
 TAxis3D.h:100
 TAxis3D.h:101
 TAxis3D.h:102
 TAxis3D.h:103
 TAxis3D.h:104
 TAxis3D.h:105
 TAxis3D.h:106
 TAxis3D.h:107
 TAxis3D.h:108
 TAxis3D.h:109
 TAxis3D.h:110
 TAxis3D.h:111
 TAxis3D.h:112
 TAxis3D.h:113
 TAxis3D.h:114
 TAxis3D.h:115
 TAxis3D.h:116
 TAxis3D.h:117