ROOT
6.06/09
Reference Guide
|
The 3D axis painter class.
This class provide up to 3 axes 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 axes 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.
One can use a static method to create ruler and attach it to the current gPad
To activate Zoomer one may call
each time one needs move or zoom the image. Then the user can:
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:
The attributes of the created axes are affected by the current style (see TStyle class ) and Set... methods of this class
For example:
will draw all axes and labels with yellow color.
Public Member Functions | |
TAxis3D () | |
TAxis3D (Option_t *option) | |
Normal constructor. More... | |
TAxis3D (const TAxis3D &axis) | |
Copy constructor. More... | |
virtual | ~TAxis3D () |
virtual void | Browse (TBrowser *b) |
Add all 3 axes to the TBrowser. More... | |
virtual Int_t | DistancetoPrimitive (Int_t px, Int_t py) |
Compute distance from point px,py to a line. More... | |
virtual void | ExecuteEvent (Int_t event, Int_t px, Int_t py) |
Execute action corresponding to one event. More... | |
Bool_t & | StickyZoom () |
Bool_t & | Zoom () |
virtual Int_t | GetNdivisions (Option_t *axis="X") const |
Get number of divisions. More... | |
virtual Color_t | GetAxisColor (Option_t *axis="X") const |
Get axis color. More... | |
virtual Color_t | GetLabelColor (Option_t *axis="X") const |
Get label color. More... | |
virtual Style_t | GetLabelFont (Option_t *axis="X") const |
Get label font. More... | |
virtual Float_t | GetLabelOffset (Option_t *axis="X") const |
Get label offset. More... | |
virtual Float_t | GetLabelSize (Option_t *axis="X") const |
Get label size. More... | |
virtual Float_t | GetTitleOffset (Option_t *axis="X") const |
Get title offset. More... | |
virtual Float_t | GetTickLength (Option_t *axis="X") const |
Get tick mark length. More... | |
virtual void | GetCenter (Axis_t *center) |
virtual void | GetLowEdge (Axis_t *edge) |
virtual char * | GetObjectInfo (Int_t px, Int_t py) const |
Dummy method returns the const char * to "axis3d". More... | |
Option_t * | GetOption () const |
virtual TAxis * | GetXaxis () |
virtual TAxis * | GetYaxis () |
virtual TAxis * | GetZaxis () |
virtual Bool_t | IsFolder () const |
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects). More... | |
virtual void | Paint (Option_t *option="") |
Paint axis over 3D view on the TPad. More... | |
void | PaintAxis (TGaxis *axis, Float_t ang) |
Draw the axis for TView object. More... | |
virtual void | SavePrimitive (std::ostream &out, Option_t *option="") |
Save primitive as a C++ statement(s) on output stream out. More... | |
virtual void | SetAxisColor (Color_t color=1, Option_t *axis="*") |
Set axis color. More... | |
virtual void | SetAxisRange (Double_t xmin, Double_t xmax, Option_t *axis="*") |
Set axis range. More... | |
virtual void | SetLabelColor (Color_t color=1, Option_t *axis="*") |
Set label color. More... | |
virtual void | SetLabelFont (Style_t font=62, Option_t *axis="*") |
Set label font. More... | |
virtual void | SetLabelOffset (Float_t offset=0.005, Option_t *axis="*") |
Set label offset. More... | |
virtual void | SetLabelSize (Float_t size=0.02, Option_t *axis="*") |
Set label size. More... | |
virtual void | SetNdivisions (Int_t n=510, Option_t *axis="*") |
Set number of divisions. More... | |
virtual void | SetOption (Option_t *option=" ") |
virtual void | SetTickLength (Float_t length=0.02, Option_t *axis="*") |
Set tick mark length. More... | |
virtual void | SetTitleOffset (Float_t offset=1, Option_t *axis="*") |
Set title offset. More... | |
virtual void | SetXTitle (const char *title) |
virtual void | SetYTitle (const char *title) |
virtual void | SetZTitle (const char *title) |
void | UseCurrentStyle () |
Replace current attributes by current style. More... | |
Public Member Functions inherited from TNamed | |
TNamed () | |
TNamed (const char *name, const char *title) | |
TNamed (const TString &name, const TString &title) | |
TNamed (const TNamed &named) | |
TNamed & | operator= (const TNamed &rhs) |
TNamed assignment operator. More... | |
virtual | ~TNamed () |
virtual void | Clear (Option_t *option="") |
Set name and title to empty strings (""). More... | |
virtual TObject * | Clone (const char *newname="") const |
Make a clone of an object using the Streamer facility. More... | |
virtual Int_t | Compare (const TObject *obj) const |
Compare two TNamed objects. More... | |
virtual void | FillBuffer (char *&buffer) |
Encode TNamed into output buffer. More... | |
virtual const char * | GetName () const |
Returns name of object. More... | |
virtual const char * | GetTitle () const |
Returns title of object. More... | |
virtual ULong_t | Hash () const |
Return hash value for this object. More... | |
virtual Bool_t | IsSortable () const |
virtual void | SetName (const char *name) |
Change (i.e. More... | |
virtual void | SetNameTitle (const char *name, const char *title) |
Change (i.e. set) all the TNamed parameters (name and title). More... | |
virtual void | SetTitle (const char *title="") |
Change (i.e. set) the title of the TNamed. More... | |
virtual void | ls (Option_t *option="") const |
List TNamed name and title. More... | |
virtual void | Print (Option_t *option="") const |
Print TNamed name and title. More... | |
virtual Int_t | Sizeof () const |
Return size of the TNamed part of the TObject. More... | |
Public Member Functions inherited from TObject | |
TObject () | |
TObject (const TObject &object) | |
TObject copy ctor. More... | |
TObject & | operator= (const TObject &rhs) |
TObject assignment operator. More... | |
virtual | ~TObject () |
TObject destructor. More... | |
virtual void | AppendPad (Option_t *option="") |
Append graphics object to current pad. More... | |
virtual const char * | ClassName () const |
Returns name of class to which the object belongs. More... | |
virtual void | Delete (Option_t *option="") |
Delete this object. More... | |
virtual void | Draw (Option_t *option="") |
Default Draw method for all objects. More... | |
virtual void | DrawClass () const |
Draw class inheritance tree of the class to which this object belongs. More... | |
virtual TObject * | DrawClone (Option_t *option="") const |
Draw a clone of this object in the current pad. More... | |
virtual void | Dump () const |
Dump contents of object on stdout. More... | |
virtual void | Execute (const char *method, const char *params, Int_t *error=0) |
Execute method on this object with the given parameter string, e.g. More... | |
virtual void | Execute (TMethod *method, TObjArray *params, Int_t *error=0) |
Execute method on this object with parameters stored in the TObjArray. More... | |
virtual TObject * | FindObject (const char *name) const |
Must be redefined in derived classes. More... | |
virtual TObject * | FindObject (const TObject *obj) const |
Must be redefined in derived classes. More... | |
virtual Option_t * | GetDrawOption () const |
Get option used by the graphics system to draw this object. More... | |
virtual UInt_t | GetUniqueID () const |
Return the unique object id. More... | |
virtual const char * | GetIconName () const |
Returns mime type name of object. More... | |
virtual Bool_t | HandleTimer (TTimer *timer) |
Execute action in response of a timer timing out. More... | |
virtual Bool_t | InheritsFrom (const char *classname) const |
Returns kTRUE if object inherits from class "classname". More... | |
virtual Bool_t | InheritsFrom (const TClass *cl) const |
Returns kTRUE if object inherits from TClass cl. More... | |
virtual void | Inspect () const |
Dump contents of this object in a graphics canvas. More... | |
virtual Bool_t | IsEqual (const TObject *obj) const |
Default equal comparison (objects are equal if they have the same address in memory). More... | |
Bool_t | IsOnHeap () const |
Bool_t | IsZombie () const |
virtual Bool_t | Notify () |
This method must be overridden to handle object notification. More... | |
virtual void | Pop () |
Pop on object drawn in a pad to the top of the display list. More... | |
virtual Int_t | Read (const char *name) |
Read contents of object with specified name from the current directory. More... | |
virtual void | RecursiveRemove (TObject *obj) |
Recursively remove this object from a list. More... | |
virtual void | SaveAs (const char *filename="", Option_t *option="") const |
Save this object in the file specified by filename. More... | |
virtual void | SetDrawOption (Option_t *option="") |
Set drawing option for object. More... | |
virtual void | SetUniqueID (UInt_t uid) |
Set the unique object id. More... | |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) |
Write this object to the current directory. More... | |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const |
Write this object to the current directory. More... | |
void * | operator new (size_t sz) |
void * | operator new[] (size_t sz) |
void * | operator new (size_t sz, void *vp) |
void * | operator new[] (size_t sz, void *vp) |
void | operator delete (void *ptr) |
Operator delete. More... | |
void | operator delete[] (void *ptr) |
Operator delete []. More... | |
void | SetBit (UInt_t f, Bool_t set) |
Set or unset the user status bits as specified in f. More... | |
void | SetBit (UInt_t f) |
void | ResetBit (UInt_t f) |
Bool_t | TestBit (UInt_t f) const |
Int_t | TestBits (UInt_t f) const |
void | InvertBit (UInt_t f) |
virtual void | Info (const char *method, const char *msgfmt,...) const |
Issue info message. More... | |
virtual void | Warning (const char *method, const char *msgfmt,...) const |
Issue warning message. More... | |
virtual void | Error (const char *method, const char *msgfmt,...) const |
Issue error message. More... | |
virtual void | SysError (const char *method, const char *msgfmt,...) const |
Issue system error message. More... | |
virtual void | Fatal (const char *method, const char *msgfmt,...) const |
Issue fatal error message. More... | |
void | AbstractMethod (const char *method) const |
Use this method to implement an "abstract" method that you don't want to leave purely abstract. More... | |
void | MayNotUse (const char *method) const |
Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary). More... | |
void | Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const |
Use this method to declare a method obsolete. More... | |
Static Public Member Functions | |
static TAxis3D * | GetPadAxis (TVirtualPad *pad=0) |
Returns the "pad" Axis3D object pointer if any. More... | |
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. More... | |
static TAxis3D * | ToggleRulers (TVirtualPad *pad=0) |
Turn ON / OFF the "Ruler", TAxis3D object attached to the current pad. More... | |
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 = 0; gPad is used "by default") More... | |
Static Public Member Functions inherited from TObject | |
static Long_t | GetDtorOnly () |
Return destructor only flag. More... | |
static void | SetDtorOnly (void *obj) |
Set destructor only flag. More... | |
static Bool_t | GetObjectStat () |
Get status of object stat flag. More... | |
static void | SetObjectStat (Bool_t stat) |
Turn on/off tracking of objects in the TObjectTable. More... | |
Protected Member Functions | |
virtual void | Copy (TObject &hnew) const |
Copy axis3d. More... | |
void | InitSet () |
Initialization. More... | |
Bool_t | SwitchZoom () |
Protected Member Functions inherited from TObject | |
void | MakeZombie () |
virtual void | DoError (int level, const char *location, const char *fmt, va_list va) const |
Interface to ErrorHandler (protected). More... | |
Protected Attributes | |
TAxis | fAxis [3] |
TString | fOption |
TAxis * | fSelected |
Bool_t | fZoomMode |
The selected axis to play with. More... | |
Bool_t | fStickyZoom |
Protected Attributes inherited from TNamed | |
TString | fName |
TString | fTitle |
Static Protected Attributes | |
static const char * | fgRulerName = "axis3druler" |
Private Member Functions | |
Int_t | AxisChoice (Option_t *axis) const |
Return the axis index by its name. More... | |
void | Build () |
Additional Inherited Members | |
Public Types inherited from TObject | |
enum | EStatusBits { kCanDelete = BIT(0), kMustCleanup = BIT(3), kObjInCanvas = BIT(3), kIsReferenced = BIT(4), kHasUUID = BIT(5), kCannotPick = BIT(6), kNoContextMenu = BIT(8), kInvalidObject = BIT(13) } |
enum | { kIsOnHeap = 0x01000000, kNotDeleted = 0x02000000, kZombie = 0x04000000, kBitMask = 0x00ffffff } |
enum | { kSingleKey = BIT(0), kOverwrite = BIT(1), kWriteDelete = BIT(2) } |
#include <TAxis3D.h>
TAxis3D::TAxis3D | ( | ) |
Referenced by ToggleRulers(), and ToggleZoom().
TAxis3D::TAxis3D | ( | Option_t * | option | ) |
Normal constructor.
Definition at line 121 of file TAxis3D.cxx.
TAxis3D::TAxis3D | ( | const TAxis3D & | axis | ) |
Copy constructor.
Definition at line 132 of file TAxis3D.cxx.
Return the axis index by its name.
Definition at line 543 of file TAxis3D.cxx.
Referenced by GetAxisColor(), GetLabelColor(), GetLabelFont(), GetLabelOffset(), GetLabelSize(), GetNdivisions(), GetTickLength(), GetTitleOffset(), and SetAxisRange().
Add all 3 axes to the TBrowser.
Reimplemented from TObject.
Definition at line 164 of file TAxis3D.cxx.
|
private |
Compute distance from point px,py to a line.
Reimplemented from TObject.
Definition at line 172 of file TAxis3D.cxx.
Execute action corresponding to one event.
This member function is called when an axis is clicked with the locator
Reimplemented from TObject.
Definition at line 190 of file TAxis3D.cxx.
Get axis color.
Definition at line 565 of file TAxis3D.cxx.
Referenced by PaintAxis(), and UseCurrentStyle().
Get label color.
Definition at line 575 of file TAxis3D.cxx.
Referenced by PaintAxis(), and UseCurrentStyle().
Get label font.
Definition at line 585 of file TAxis3D.cxx.
Referenced by PaintAxis(), and UseCurrentStyle().
Get label offset.
Definition at line 595 of file TAxis3D.cxx.
Referenced by PaintAxis(), and UseCurrentStyle().
Get label size.
Definition at line 605 of file TAxis3D.cxx.
Referenced by PaintAxis(), and UseCurrentStyle().
Get number of divisions.
Definition at line 555 of file TAxis3D.cxx.
Referenced by UseCurrentStyle().
Dummy method returns the const char * to "axis3d".
Reimplemented from TObject.
Definition at line 302 of file TAxis3D.cxx.
|
inlinevirtual |
|
static |
Returns the "pad" Axis3D object pointer if any.
Definition at line 721 of file TAxis3D.cxx.
Referenced by ToggleRulers().
Get tick mark length.
Definition at line 615 of file TAxis3D.cxx.
Referenced by PaintAxis(), and UseCurrentStyle().
Get title offset.
Definition at line 625 of file TAxis3D.cxx.
Referenced by PaintAxis(), and UseCurrentStyle().
|
protected |
|
inlinevirtual |
Paint axis over 3D view on the TPad.
Reimplemented from TObject.
Definition at line 310 of file TAxis3D.cxx.
Draw the axis for TView object.
The original idea belongs:
void THistPainter::PaintLegoAxis(TGaxis *axis, Double_t ang)
Definition at line 323 of file TAxis3D.cxx.
Referenced by Paint().
|
static |
Convert "screen pixel" coordinates to some center of 3D WC coordinate if view and gPad present.
Definition at line 457 of file TAxis3D.cxx.
Save primitive as a C++ statement(s) on output stream out.
Reimplemented from TObject.
Definition at line 480 of file TAxis3D.cxx.
Set axis color.
Definition at line 651 of file TAxis3D.cxx.
Set axis range.
Definition at line 659 of file TAxis3D.cxx.
Set label color.
Definition at line 672 of file TAxis3D.cxx.
Set label font.
Definition at line 680 of file TAxis3D.cxx.
Set label offset.
Definition at line 688 of file TAxis3D.cxx.
Set label size.
Definition at line 696 of file TAxis3D.cxx.
Set number of divisions.
Definition at line 643 of file TAxis3D.cxx.
Set tick mark length.
Definition at line 704 of file TAxis3D.cxx.
Set title offset.
Definition at line 712 of file TAxis3D.cxx.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlineprotected |
Definition at line 115 of file TAxis3D.h.
Referenced by ExecuteEvent(), and ToggleZoom().
|
static |
Turn ON / OFF the "Ruler", TAxis3D object attached to the current pad.
Definition at line 738 of file TAxis3D.cxx.
Referenced by TView3D::ToggleRulers().
|
static |
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:
Definition at line 766 of file TAxis3D.cxx.
Referenced by TView3D::ToggleZoom().
|
virtual |
Replace current attributes by current style.
Reimplemented from TObject.
Definition at line 490 of file TAxis3D.cxx.
Referenced by InitSet().
|
protected |
Definition at line 40 of file TAxis3D.h.
Referenced by Browse(), Copy(), DistancetoPrimitive(), GetAxisColor(), GetLabelColor(), GetLabelFont(), GetLabelOffset(), GetLabelSize(), GetNdivisions(), GetTickLength(), GetTitleOffset(), InitSet(), PaintAxis(), SavePrimitive(), SetAxisColor(), SetAxisRange(), SetLabelColor(), SetLabelFont(), SetLabelOffset(), SetLabelSize(), SetNdivisions(), SetTickLength(), SetTitleOffset(), and UseCurrentStyle().
|
staticprotected |
Definition at line 42 of file TAxis3D.h.
Referenced by GetPadAxis(), and ToggleZoom().
|
protected |
Definition at line 43 of file TAxis3D.h.
Referenced by DistancetoPrimitive(), ExecuteEvent(), and TAxis3D().
|
protected |
Definition at line 45 of file TAxis3D.h.
Referenced by ExecuteEvent(), StickyZoom(), and TAxis3D().
|
protected |
The selected axis to play with.
Definition at line 44 of file TAxis3D.h.
Referenced by DistancetoPrimitive(), ExecuteEvent(), SwitchZoom(), TAxis3D(), and Zoom().