class description - source file - inheritance tree

class TAxis3D : public TNamed

Int_t AxisChoice(Option_t* axis) void Build() protected:
virtual void Copy(TObject& hnew) void InitSet() Bool_t SwitchZoom() public:
TAxis3D TAxis3D() TAxis3D TAxis3D(Option_t* option) TAxis3D TAxis3D(const TAxis3D& axis) virtual void ~TAxis3D() virtual void Browse(TBrowser* b) TClass* Class() virtual Int_t DistancetoPrimitive(Int_t px, Int_t py) virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py) virtual Color_t GetAxisColor(Option_t* axis = X) virtual void GetCenter(Axis_t* center) virtual Color_t GetLabelColor(Option_t* axis = X) virtual Style_t GetLabelFont(Option_t* axis = X) virtual Float_t GetLabelOffset(Option_t* axis = X) virtual Float_t GetLabelSize(Option_t* axis = X) virtual void GetLowEdge(Axis_t* edge) virtual Int_t GetNdivisions(Option_t* axis = X) virtual char* GetObjectInfo(Int_t px, Int_t py) virtual Option_t* GetOption() const TAxis3D* GetPadAxis(TVirtualPad* pad = 0) virtual Float_t GetTickLength(Option_t* axis = X) virtual Float_t GetTitleOffset(Option_t* axis = X) virtual TAxis* GetXaxis() virtual TAxis* GetYaxis() virtual TAxis* GetZaxis() virtual TClass* IsA() const virtual Bool_t IsFolder() virtual void Paint(Option_t* option) void PaintAxis(TGaxis* axis, Float_t ang) Axis_t* PixeltoXYZ(Axis_t px, Axis_t py, Axis_t* point3D, TView* view = 0) virtual void SavePrimitive(ofstream& out, Option_t* option) virtual void SetAxisColor(Color_t color = 1, Option_t* axis = *) virtual void SetAxisRange(Float_t xmin, Float_t xmax, Option_t* axis = *) virtual void SetLabelColor(Color_t color = 1, Option_t* axis = *) virtual void SetLabelFont(Style_t font = 62, Option_t* axis = *) virtual void SetLabelOffset(Float_t offset = 0.005, Option_t* axis = *) virtual void SetLabelSize(Float_t size = 0.02, Option_t* axis = *) virtual void SetNdivisions(Int_t n = 510, Option_t* axis = *) virtual void SetOption(Option_t* option = ) virtual void SetTickLength(Float_t length = 0.02, Option_t* axis = *) virtual void SetTitleOffset(Float_t offset = 1, Option_t* axis = *) virtual void SetXTitle(char* title) virtual void SetYTitle(char* title) virtual void SetZTitle(char* title) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) TAxis3D* ToggleRulers(TVirtualPad* pad = 0) TAxis3D* ToggleZoom(TVirtualPad* pad = 0) virtual void UseCurrentStyle()

Data Members

TAxis fAxis[3] X/Y/Z axice TString fOption Options (is not use yet) static const Char_t* rulerName The default object name TAxis* fSelected ! The selected axis to play with Bool_t fZoomMode Zoom mode for the entire parent TPad

Class Description

   The 3D axis painter class

  This class provide up to 3 axice to any 3D ROOT plot and
  "ZOOM" service.
  ExecuteEvent() method does provide zooming and moving a projection
  3D object within TPad client area. With Zoom mode on the user can access
  TAxis3D context menu and set /change the attributes of axice all together
  or separately.

  To add the 3D rulers to any 3D view one has to create
  an instance of this class and Draw it.

   TAxis3D rulers;

  One can use a static method to create ruler and attach it to the current gPad

   TAxis3D::ToggleRulers(); // Brings the 3D axice up
   TAxis3D::ToggleRulers(); // next calls remove the rulers from the TPad etc

   To activate Zoomer one may call


  each time one needs move or zoom the image. Then the user can:
    -  move:

- zoom:

its 3D view with <left-mouse button> press / move. The "Zoom" deactivates itself just the user release the <left-mouse button> To change attributes of the rulers attached to the current Pad, one may query its pointer first: TAxis3D *axis = TAxis3D::GetPadAxis(); // Ask axis pointer if (axis) { TAxis3D::ToggleRulers() // To pop axice down axis->SetLabelColor(kBlue); // Paint the axice labels with blue color axis->SetAxisColor(kRed); // Paint the axice itself with blue color TAxis3D::ToggleRulers() // To pop axice up } The attributes of the created axice are affected by the current style (see TStyle class ) and Set... methods of this class For example: gStyle->SetAxisColor(kYellow,"X"); gStyle->SetAxisColor(kYellow,"Y"); gStyle->SetAxisColor(kYellow,"Z"); gStyle->SetLabelColor(kYellow,"X"); gStyle->SetLabelColor(kYellow,"Y"); gStyle->SetLabelColor(kYellow,"Z"); TAxis3D::ToggleRulers(); TAxis3D::ToggleRulers(); will draw all axice and labels with yellow color.

TAxis3D() : TNamed(TAxis3D::rulerName,"ruler")

TAxis3D(Option_t *): TNamed(TAxis3D::rulerName,"ruler")

TAxis3D(const TAxis3D &axis)

void Copy(TObject &obj)
*-*-*-*-*-*-*Copy this histogram structure to newth1*-*-*-*-*-*-*-*-*-*-*-*
*-*          =======================================

void InitSet()

void Browse(TBrowser *b)
 Add all 3 axices to the TBrowser

Int_t DistancetoPrimitive(Int_t px, Int_t py)
*-*-*-*-*-*-*-*-*-*-*Compute distance from point px,py to a line*-*-*-*-*-*
*-*                  ===========================================

void ExecuteEvent(Int_t event, Int_t px, Int_t py)
*-*-*-*-*-*-*-*-*-*-*Execute action corresponding to one event*-*-*-*
*-*                  =========================================
*-*  This member function is called when an axis is clicked with the locator

char* GetObjectInfo(Int_t , Int_t )
  Dummy method
  returns the const char * to "axis3d"

void Paint(Option_t *)
 Paint axis over 3D view on the TPad

void PaintAxis(TGaxis *axis, Float_t ang)
*-*-*-*-*-*-*Draw the axis for TView object *-*-*-*-*-*-*-*-*-*
*-*          ==============================
*-* The original idea belongs:
*-* void THistPainter::PaintLegoAxis(TGaxis *axis, Float_t ang)

Axis_t* PixeltoXYZ(Axis_t px, Axis_t py, Axis_t *point3D, TView *view)
 Convert "screen pixel" coordinates to some center of 3D WC coordinate
 if view and gPad present

void SavePrimitive(ofstream &out, Option_t *)
 Save primitive as a C++ statement(s) on output stream out

void UseCurrentStyle()
*-*-*-*-*-*Replace current attributes by current style*-*-*-*-*
*-*        ===========================================

Int_t AxisChoice( Option_t *axis)
  Return the axis index by its name

Int_t GetNdivisions( Option_t *axis)

Color_t GetAxisColor( Option_t *axis)

Color_t GetLabelColor( Option_t *axis)

Style_t GetLabelFont( Option_t *axis)

Float_t GetLabelOffset( Option_t *axis)

Float_t GetLabelSize( Option_t *axis)

Float_t GetTickLength( Option_t *axis)

Float_t GetTitleOffset( Option_t *axis)

void SetNdivisions(Int_t n, Option_t *axis)

void SetAxisColor(Color_t color, Option_t *axis)

void SetAxisRange(Float_t xmin, Float_t xmax, Option_t *axis)

void SetLabelColor(Color_t color, Option_t *axis)

void SetLabelFont(Style_t font, Option_t *axis)

void SetLabelOffset(Float_t offset, Option_t *axis)

void SetLabelSize(Float_t size, Option_t *axis)

void SetTickLength(Float_t length, Option_t *axis)

void SetTitleOffset(Float_t offset, Option_t *axis)

TAxis3D* GetPadAxis(TVirtualPad *pad)
 returns the "pad" Axis3D object pointer if any

TAxis3D* ToggleRulers(TVirtualPad *pad)
 Turn ON / OFF the "Ruler", TAxis3D object attached
 to the current pad

TAxis3D* ToggleZoom(TVirtualPad *pad)
 Turn ON / OFF the "Ruler" and "zoom mode" of the TAxis3D object attached
 to the current pad (if pad = 0; gPad is used "by default")

 User is given a chance to either:
  1.  move the center of the 3D scene at the cursor position
  2.  zoom view with mouse "drugging" the bounder rectangle with "left" mouse
  3.  Change the axuce attributes via TContextMenu with "righ mouse button click"

Inline Functions

               void Build()
             Bool_t SwitchZoom()
               void GetCenter(Axis_t* center)
               void GetLowEdge(Axis_t* edge)
          Option_t* GetOption() const
             TAxis* GetXaxis()
             TAxis* GetYaxis()
             TAxis* GetZaxis()
             Bool_t IsFolder()
               void SetOption(Option_t* option =  )
               void SetXTitle(char* title)
               void SetYTitle(char* title)
               void SetZTitle(char* title)
            TClass* Class()
            TClass* IsA() const
               void ShowMembers(TMemberInspector& insp, char* parent)
               void Streamer(TBuffer& b)
               void ~TAxis3D()

Author: Valery Fine( 07/01/2000
Last update: 2.23/12 26/01/2000 09.24.05 by Rene Brun

ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.