ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 #ifndef ROOT_TAxis
25 #include "TAxis.h"
26 #endif
27 
28 class TF1;
29 class TBrowser;
30 class TGaxis;
31 class TVirtualPad;
32 class TView;
33 class TAxis3D : public TNamed {
34 
35 private:
36  Int_t AxisChoice(Option_t *axis) const;
37  void Build();
38 
39 protected:
40  TAxis fAxis[3]; //X/Y/Z axis
41  TString fOption; // Options (is not use yet)
42  static const char *fgRulerName; // The default object name
43  TAxis *fSelected; //! The selected axis to play with
44  Bool_t fZoomMode; // Zoom mode for the entire parent TPad
45  Bool_t fStickyZoom; // StickyZoom mode: zoom will not be disabled after zooming attempt if true
46 
47  virtual void Copy(TObject &hnew) const;
48  void InitSet();
50 
51 public:
52  TAxis3D();
53  TAxis3D(Option_t *option);
54  TAxis3D(const TAxis3D &axis);
55  virtual ~TAxis3D(){;}
56 
57  virtual void Browse(TBrowser *b);
58 
60  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
61 
63  Bool_t & Zoom(){return fZoomMode;}
64 
65  virtual Int_t GetNdivisions(Option_t *axis="X") const;
66  virtual Color_t GetAxisColor(Option_t *axis="X") const;
67  virtual Color_t GetLabelColor(Option_t *axis="X") const;
68  virtual Style_t GetLabelFont(Option_t *axis="X") const;
69  virtual Float_t GetLabelOffset(Option_t *axis="X") const;
70  virtual Float_t GetLabelSize(Option_t *axis="X") const;
71  static TAxis3D *GetPadAxis(TVirtualPad *pad=0);
72  virtual Float_t GetTitleOffset(Option_t *axis="X") const;
73  virtual Float_t GetTickLength(Option_t *axis="X") const;
74 
75  virtual void GetCenter(Axis_t *center) {fAxis[0].GetCenter(center);}
76 
77  virtual void GetLowEdge(Axis_t *edge) {fAxis[0].GetLowEdge(edge);}
78 
79  virtual char *GetObjectInfo(Int_t px, Int_t py) const;
80 
81  Option_t *GetOption() const {return fOption.Data();}
82 
83  virtual TAxis *GetXaxis() {return &fAxis[0];}
84  virtual TAxis *GetYaxis() {return &fAxis[1];}
85  virtual TAxis *GetZaxis() {return &fAxis[2];}
86  virtual Bool_t IsFolder() const { return kTRUE;}
87  virtual void Paint(Option_t *option="");
88  void PaintAxis(TGaxis *axis, Float_t ang);
89  static Double_t *PixeltoXYZ(Double_t px, Double_t py, Double_t *point3D, TView *view =0);
90  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
91 
92  virtual void SetAxisColor(Color_t color=1, Option_t *axis="*"); // *MENU*
93  virtual void SetAxisRange(Double_t xmin, Double_t xmax, Option_t *axis="*");
94 
95  virtual void SetLabelColor(Color_t color=1, Option_t *axis="*");// *MENU*
96  virtual void SetLabelFont(Style_t font=62, Option_t *axis="*"); // *MENU*
97  virtual void SetLabelOffset(Float_t offset=0.005, Option_t *axis="*"); // *MENU*
98  virtual void SetLabelSize(Float_t size=0.02, Option_t *axis="*"); // *MENU*
99 
100  virtual void SetNdivisions(Int_t n=510, Option_t *axis="*"); // *MENU*
101  virtual void SetOption(Option_t *option=" ") {fOption = option;}
102  virtual void SetTickLength(Float_t length=0.02, Option_t *axis="*"); // *MENU*
103  virtual void SetTitleOffset(Float_t offset=1, Option_t *axis="*"); // *MENU*
104  virtual void SetXTitle(const char *title) {fAxis[0].SetTitle(title);} // *MENU*
105  virtual void SetYTitle(const char *title) {fAxis[1].SetTitle(title);} // *MENU*
106  virtual void SetZTitle(const char *title) {fAxis[2].SetTitle(title);} // *MENU*
107  static TAxis3D *ToggleRulers(TVirtualPad *pad=0);
108  static TAxis3D *ToggleZoom(TVirtualPad *pad=0);
109  void UseCurrentStyle();
110 
111  ClassDef(TAxis3D,1) //3-D ruler painting class
112 };
113 
114 
116 
117 #endif
static Double_t * PixeltoXYZ(Double_t px, Double_t py, Double_t *point3D, TView *view=0)
Convert "screen pixel" coordinates to some center of 3D WC coordinate if view and gPad present...
Definition: TAxis3D.cxx:457
float xmin
Definition: THbookFile.cxx:93
virtual void GetLowEdge(Double_t *edge) const
Return an array with the lod edge of all bins.
Definition: TAxis.cxx:533
static TAxis3D * ToggleZoom(TVirtualPad *pad=0)
Turn ON / OFF the "Ruler" and "zoom mode" of the TAxis3D object attached to the current pad (if pad =...
Definition: TAxis3D.cxx:766
short Style_t
Definition: RtypesCore.h:76
static TAxis3D * ToggleRulers(TVirtualPad *pad=0)
Turn ON / OFF the "Ruler", TAxis3D object attached to the current pad.
Definition: TAxis3D.cxx:738
void PaintAxis(TGaxis *axis, Float_t ang)
Draw the axis for TView object.
Definition: TAxis3D.cxx:323
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
tuple offset
Definition: tree.py:93
double Axis_t
Definition: RtypesCore.h:72
virtual void SetNdivisions(Int_t n=510, Option_t *axis="*")
Set number of divisions.
Definition: TAxis3D.cxx:643
virtual void SetLabelColor(Color_t color=1, Option_t *axis="*")
Set label color.
Definition: TAxis3D.cxx:672
See TView3D.
Definition: TView.h:36
virtual Float_t GetLabelSize(Option_t *axis="X") const
Get label size.
Definition: TAxis3D.cxx:605
Basic string class.
Definition: TString.h:137
static const char * fgRulerName
Definition: TAxis3D.h:42
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual Style_t GetLabelFont(Option_t *axis="X") const
Get label font.
Definition: TAxis3D.cxx:585
virtual void SetLabelSize(Float_t size=0.02, Option_t *axis="*")
Set label size.
Definition: TAxis3D.cxx:696
virtual Color_t GetAxisColor(Option_t *axis="X") const
Get axis color.
Definition: TAxis3D.cxx:565
void InitSet()
Initialization.
Definition: TAxis3D.cxx:149
Float_t py
Definition: hprod.C:33
The 3D axis painter class.
Definition: TAxis3D.h:33
virtual Color_t GetLabelColor(Option_t *axis="X") const
Get label color.
Definition: TAxis3D.cxx:575
virtual void SetTitleOffset(Float_t offset=1, Option_t *axis="*")
Set title offset.
Definition: TAxis3D.cxx:712
virtual Float_t GetTitleOffset(Option_t *axis="X") const
Get title offset.
Definition: TAxis3D.cxx:625
Bool_t fZoomMode
The selected axis to play with.
Definition: TAxis3D.h:44
virtual Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
Definition: TAxis3D.h:86
virtual void SetLabelFont(Style_t font=62, Option_t *axis="*")
Set label font.
Definition: TAxis3D.cxx:680
const char * Data() const
Definition: TString.h:349
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual Int_t GetNdivisions(Option_t *axis="X") const
Get number of divisions.
Definition: TAxis3D.cxx:555
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
TAxis fAxis[3]
Definition: TAxis3D.h:40
virtual void SetAxisColor(Color_t color=1, Option_t *axis="*")
Set axis color.
Definition: TAxis3D.cxx:651
virtual void SetXTitle(const char *title)
Definition: TAxis3D.h:104
Bool_t fStickyZoom
Definition: TAxis3D.h:45
void UseCurrentStyle()
Replace current attributes by current style.
Definition: TAxis3D.cxx:490
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:59
char * out
Definition: TBase64.cxx:29
short Color_t
Definition: RtypesCore.h:79
virtual void SetZTitle(const char *title)
Definition: TAxis3D.h:106
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TAxis3D.cxx:190
virtual void Browse(TBrowser *b)
Add all 3 axes to the TBrowser.
Definition: TAxis3D.cxx:164
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
Option_t * GetOption() const
Definition: TAxis3D.h:81
TString fOption
Definition: TAxis3D.h:41
Double_t length(const TVector2 &v)
Definition: CsgOps.cxx:347
Class to manage histogram axis.
Definition: TAxis.h:36
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
virtual void GetCenter(Axis_t *center)
Definition: TAxis3D.h:75
Bool_t & StickyZoom()
Definition: TAxis3D.h:62
virtual Float_t GetLabelOffset(Option_t *axis="X") const
Get label offset.
Definition: TAxis3D.cxx:595
virtual void SetOption(Option_t *option=" ")
Definition: TAxis3D.h:101
The axis painter class.
Definition: TGaxis.h:39
float xmax
Definition: THbookFile.cxx:93
virtual TAxis * GetYaxis()
Definition: TAxis3D.h:84
tuple pad
Definition: first.py:38
virtual void SetYTitle(const char *title)
Definition: TAxis3D.h:105
virtual void SetAxisRange(Double_t xmin, Double_t xmax, Option_t *axis="*")
Set axis range.
Definition: TAxis3D.cxx:659
Bool_t SwitchZoom()
Definition: TAxis3D.h:115
TAxis * fSelected
Definition: TAxis3D.h:43
virtual void GetLowEdge(Axis_t *edge)
Definition: TAxis3D.h:77
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a line.
Definition: TAxis3D.cxx:172
double Double_t
Definition: RtypesCore.h:55
Bool_t & Zoom()
Definition: TAxis3D.h:63
virtual void SetTickLength(Float_t length=0.02, Option_t *axis="*")
Set tick mark length.
Definition: TAxis3D.cxx:704
tuple view
Definition: tornado.py:20
virtual void SetLabelOffset(Float_t offset=0.005, Option_t *axis="*")
Set label offset.
Definition: TAxis3D.cxx:688
virtual TAxis * GetXaxis()
Definition: TAxis3D.h:83
Mother of all ROOT objects.
Definition: TObject.h:58
virtual Float_t GetTickLength(Option_t *axis="X") const
Get tick mark length.
Definition: TAxis3D.cxx:615
Float_t px
Definition: hprod.C:33
Bool_t axis
Definition: geodemo.C:37
static TAxis3D * GetPadAxis(TVirtualPad *pad=0)
Returns the "pad" Axis3D object pointer if any.
Definition: TAxis3D.cxx:721
virtual TAxis * GetZaxis()
Definition: TAxis3D.h:85
virtual void GetCenter(Double_t *center) const
Return an array with the center of all bins.
Definition: TAxis.cxx:524
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TAxis3D.cxx:480
1-Dim function class
Definition: TF1.h:149
void Build()
Int_t AxisChoice(Option_t *axis) const
Return the axis index by its name.
Definition: TAxis3D.cxx:543
virtual ~TAxis3D()
Definition: TAxis3D.h:55
virtual void Copy(TObject &hnew) const
Copy axis3d.
Definition: TAxis3D.cxx:140
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
Definition: TNamed.cxx:152
const Int_t n
Definition: legend1.C:16
virtual void Paint(Option_t *option="")
Paint axis over 3D view on the TPad.
Definition: TAxis3D.cxx:310
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Dummy method returns the const char * to "axis3d".
Definition: TAxis3D.cxx:302