library: libGraf3d
#include "TAxis3D.h"

TAxis3D


class description - header file - source file - inheritance tree (.pdf)

class TAxis3D : public TNamed

Inheritance Chart:
TObject
<-
TNamed
<-
TAxis3D
    private:
Int_t AxisChoice(Option_t* axis) const void Build() protected:
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) static 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") const virtual void GetCenter(Axis_t* center) 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 virtual void GetLowEdge(Axis_t* edge) virtual Int_t GetNdivisions(Option_t* axis = "X") const virtual char* GetObjectInfo(Int_t px, Int_t py) const virtual Option_t* GetOption() const static TAxis3D* GetPadAxis(TVirtualPad* pad = 0) virtual Float_t GetTickLength(Option_t* axis = "X") const virtual Float_t GetTitleOffset(Option_t* axis = "X") const virtual TAxis* GetXaxis() virtual TAxis* GetYaxis() virtual TAxis* GetZaxis() virtual TClass* IsA() const virtual Bool_t IsFolder() const 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 = "*") virtual void SetAxisRange(Double_t xmin, Double_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(const char* title) virtual void SetYTitle(const char* title) virtual void SetZTitle(const char* title) virtual void ShowMembers(TMemberInspector& insp, char* parent) Bool_t& StickyZoom() virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) static TAxis3D* ToggleRulers(TVirtualPad* pad = 0) static TAxis3D* ToggleZoom(TVirtualPad* pad = 0) virtual void UseCurrentStyle() Bool_t& Zoom()

Data Members


    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

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;
   rulers.Draw();

  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

   TAxis3D::ToggleZoom();

  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()
 Normal constructor.
TAxis3D(Option_t *)
 Normal constructor.
TAxis3D(const TAxis3D &axis)
 Copy  constructor.
void Copy(TObject &obj)
 Copy axis3d
void InitSet()
 Initialization.
void Browse(TBrowser *b)
 Add all 3 axes 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, Double_t ang)
Double_t * PixeltoXYZ(Double_t px, Double_t py, Double_t *point3D, TView *view)
 Convert "screen pixel" coordinates to some center of 3D WC coordinate
 if view and gPad present
void SavePrimitive(ostream &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)
 Get number of divisions.
Color_t GetAxisColor( Option_t *axis)
 Get axis color.
Color_t GetLabelColor( Option_t *axis)
 Get label color.
Style_t GetLabelFont( Option_t *axis)
 Get label font.
Float_t GetLabelOffset( Option_t *axis)
 Get label offset.
Float_t GetLabelSize( Option_t *axis)
 Get label size.
Float_t GetTickLength( Option_t *axis)
 Get tick mark length.
Float_t GetTitleOffset( Option_t *axis)
 Get title offset.
void SetNdivisions(Int_t n, Option_t *axis)
 Set number of divisions.
void SetAxisColor(Color_t color, Option_t *axis)
 Set axis color.
void SetAxisRange(Double_t xmin, Double_t xmax, Option_t *axis)
 Set axis range.
void SetLabelColor(Color_t color, Option_t *axis)
 Set label color.
void SetLabelFont(Style_t font, Option_t *axis)
 Set label font.
void SetLabelOffset(Float_t offset, Option_t *axis)
 Set label offset.
void SetLabelSize(Float_t size, Option_t *axis)
 Set label size.
void SetTickLength(Float_t length, Option_t *axis)
 Set tick mark length.
void SetTitleOffset(Float_t offset, Option_t *axis)
 Set title offset.
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"

void Build()
Bool_t SwitchZoom()
Bool_t & StickyZoom()
Bool_t & Zoom()
void GetCenter(Axis_t *center)
void GetLowEdge(Axis_t *edge)
Bool_t IsFolder()
void SetOption(Option_t *option=" ")
void SetXTitle(const char *title)
void SetYTitle(const char *title)
void SetZTitle(const char *title)

Author: Valery Fine(fine@mail.cern.ch) 07/01/2000
Last update: root/g3d:$Name: $:$Id: TAxis3D.cxx,v 1.20 2006/07/11 09:05:01 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - 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.