Logo ROOT  
Reference Guide
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();
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 
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 
114 
115 #endif
TAxis3D::GetOption
Option_t * GetOption() const
Definition: TAxis3D.h:79
n
const Int_t n
Definition: legend1.C:16
TAxis
Class to manage histogram axis.
Definition: TAxis.h:30
TAxis3D::GetPadAxis
static TAxis3D * GetPadAxis(TVirtualPad *pad=0)
Returns the "pad" Axis3D object pointer if any.
Definition: TAxis3D.cxx:720
TAxis3D::GetTickLength
virtual Float_t GetTickLength(Option_t *axis="X") const
Get tick mark length.
Definition: TAxis3D.cxx:614
TBrowser
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
Style_t
short Style_t
Definition: RtypesCore.h:80
TAxis3D::Browse
virtual void Browse(TBrowser *b)
Add all 3 axes to the TBrowser.
Definition: TAxis3D.cxx:163
Option_t
const char Option_t
Definition: RtypesCore.h:66
TAxis3D::fStickyZoom
Bool_t fStickyZoom
Definition: TAxis3D.h:43
TAxis3D::TAxis3D
TAxis3D()
Normal constructor.
Definition: TAxis3D.cxx:109
TAxis3D::GetCenter
virtual void GetCenter(Axis_t *center)
Definition: TAxis3D.h:73
TString::Data
const char * Data() const
Definition: TString.h:369
TAxis3D::AxisChoice
Int_t AxisChoice(Option_t *axis) const
Return the axis index by its name.
Definition: TAxis3D.cxx:542
Axis_t
double Axis_t
Definition: RtypesCore.h:76
TAxis3D::GetAxisColor
virtual Color_t GetAxisColor(Option_t *axis="X") const
Get axis color.
Definition: TAxis3D.cxx:564
TAxis3D::SetLabelOffset
virtual void SetLabelOffset(Float_t offset=0.005, Option_t *axis="*")
Set label offset.
Definition: TAxis3D.cxx:687
TAxis3D::GetObjectInfo
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Dummy method returns the const char * to "axis3d".
Definition: TAxis3D.cxx:301
xmax
float xmax
Definition: THbookFile.cxx:95
TAxis3D::GetNdivisions
virtual Int_t GetNdivisions(Option_t *axis="X") const
Get number of divisions.
Definition: TAxis3D.cxx:554
TAxis3D
The 3D axis painter class.
Definition: TAxis3D.h:31
TAxis3D::SetAxisRange
virtual void SetAxisRange(Double_t xmin, Double_t xmax, Option_t *axis="*")
Set axis range.
Definition: TAxis3D.cxx:658
Float_t
float Float_t
Definition: RtypesCore.h:57
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:162
TAxis3D::GetZaxis
virtual TAxis * GetZaxis()
Definition: TAxis3D.h:83
TAxis3D::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TAxis3D.cxx:479
Int_t
int Int_t
Definition: RtypesCore.h:45
TAxis3D::SetYTitle
virtual void SetYTitle(const char *title)
Definition: TAxis3D.h:103
TAxis3D::Paint
virtual void Paint(Option_t *option="")
Paint axis over 3D view on the TPad.
Definition: TAxis3D.cxx:309
TAxis3D::ExecuteEvent
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TAxis3D.cxx:189
TAxis3D::SetZTitle
virtual void SetZTitle(const char *title)
Definition: TAxis3D.h:104
TAxis3D::InitSet
void InitSet()
Initialization.
Definition: TAxis3D.cxx:148
TAxis3D::SetOption
virtual void SetOption(Option_t *option=" ")
Definition: TAxis3D.h:99
TAxis3D::GetLabelOffset
virtual Float_t GetLabelOffset(Option_t *axis="X") const
Get label offset.
Definition: TAxis3D.cxx:594
TAxis3D::fOption
TString fOption
Definition: TAxis3D.h:39
TAxis3D::GetTitleOffset
virtual Float_t GetTitleOffset(Option_t *axis="X") const
Get title offset.
Definition: TAxis3D.cxx:624
TAxis3D::ToggleZoom
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:765
TAxis3D::SetTickLength
virtual void SetTickLength(Float_t length=0.02, Option_t *axis="*")
Set tick mark length.
Definition: TAxis3D.cxx:703
TString
Basic string class.
Definition: TString.h:136
TAxis3D::fZoomMode
Bool_t fZoomMode
The selected axis to play with.
Definition: TAxis3D.h:42
Color_t
short Color_t
Definition: RtypesCore.h:83
TAxis3D::fAxis
TAxis fAxis[3]
Definition: TAxis3D.h:38
TAxis::GetLowEdge
virtual void GetLowEdge(Double_t *edge) const
Return an array with the low edge of all bins.
Definition: TAxis.cxx:562
b
#define b(i)
Definition: RSha256.hxx:100
bool
TAxis3D::SetTitleOffset
virtual void SetTitleOffset(Float_t offset=1, Option_t *axis="*")
Set title offset.
Definition: TAxis3D.cxx:711
TAxis3D::SetLabelColor
virtual void SetLabelColor(Color_t color=1, Option_t *axis="*")
Set label color.
Definition: TAxis3D.cxx:671
TAxis3D::SwitchZoom
Bool_t SwitchZoom()
Definition: TAxis3D.h:113
TAxis::GetCenter
virtual void GetCenter(Double_t *center) const
Return an array with the center of all bins.
Definition: TAxis.cxx:553
TView
See TView3D.
Definition: TView.h:25
TAxis3D::StickyZoom
Bool_t & StickyZoom()
Definition: TAxis3D.h:60
xmin
float xmin
Definition: THbookFile.cxx:95
TAxis3D::GetLabelColor
virtual Color_t GetLabelColor(Option_t *axis="X") const
Get label color.
Definition: TAxis3D.cxx:574
TAxis3D::GetLabelFont
virtual Style_t GetLabelFont(Option_t *axis="X") const
Get label font.
Definition: TAxis3D.cxx:584
TAxis3D::SetLabelFont
virtual void SetLabelFont(Style_t font=62, Option_t *axis="*")
Set label font.
Definition: TAxis3D.cxx:679
TAxis3D::UseCurrentStyle
void UseCurrentStyle()
Replace current attributes by current style.
Definition: TAxis3D.cxx:489
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
TAxis3D::GetLabelSize
virtual Float_t GetLabelSize(Option_t *axis="X") const
Get label size.
Definition: TAxis3D.cxx:604
TNamed::SetTitle
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition: TNamed.cxx:164
TAxis3D::fSelected
TAxis * fSelected
Definition: TAxis3D.h:41
TAxis3D::PaintAxis
void PaintAxis(TGaxis *axis, Float_t ang)
Draw the axis for TView object.
Definition: TAxis3D.cxx:322
TAxis3D::GetYaxis
virtual TAxis * GetYaxis()
Definition: TAxis3D.h:82
TAxis3D::GetLowEdge
virtual void GetLowEdge(Axis_t *edge)
Definition: TAxis3D.h:75
Double_t
double Double_t
Definition: RtypesCore.h:59
TVirtualPad
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:51
TAxis3D::DistancetoPrimitive
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a line.
Definition: TAxis3D.cxx:171
TGaxis
The axis painter class.
Definition: TGaxis.h:23
TAxis3D::SetAxisColor
virtual void SetAxisColor(Color_t color=1, Option_t *axis="*")
Set axis color.
Definition: TAxis3D.cxx:650
TAxis3D::SetXTitle
virtual void SetXTitle(const char *title)
Definition: TAxis3D.h:102
TAxis.h
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TAxis3D::Build
void Build()
TAxis3D::IsFolder
virtual Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition: TAxis3D.h:84
TAxis3D::SetNdivisions
virtual void SetNdivisions(Int_t n=510, Option_t *axis="*")
Set number of divisions.
Definition: TAxis3D.cxx:642
TAxis3D::SetLabelSize
virtual void SetLabelSize(Float_t size=0.02, Option_t *axis="*")
Set label size.
Definition: TAxis3D.cxx:695
TAxis3D::ToggleRulers
static TAxis3D * ToggleRulers(TVirtualPad *pad=0)
Turn ON / OFF the "Ruler", TAxis3D object attached to the current pad.
Definition: TAxis3D.cxx:737
TAxis3D::Copy
virtual void Copy(TObject &hnew) const
Copy axis3d.
Definition: TAxis3D.cxx:139
TF1
1-Dim function class
Definition: TF1.h:213
TAxis3D::GetXaxis
virtual TAxis * GetXaxis()
Definition: TAxis3D.h:81
TAxis3D::~TAxis3D
virtual ~TAxis3D()
Definition: TAxis3D.h:53
TAxis3D::Zoom
Bool_t & Zoom()
Definition: TAxis3D.h:61
TAxis3D::fgRulerName
static const char * fgRulerName
Definition: TAxis3D.h:40
int
TAxis3D::PixeltoXYZ
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:456