ROOT logo
// @(#)root/base:$Id: TVirtualPad.h 26760 2008-12-09 15:56:43Z brun $
// Author: Rene Brun   05/12/95

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TVirtualPad
#define ROOT_TVirtualPad


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TVirtualPad                                                          //
//                                                                      //
// Abstract base class for Pads and Canvases                            //
//                                                                      //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TAttPad
#include "TAttPad.h"
#endif

#ifndef ROOT_TVirtualX
#include "TVirtualX.h"
#endif

#ifndef ROOT_TString
#include "TString.h"
#endif

#ifndef ROOT_Buttons
#include "Buttons.h"
#endif

#ifndef ROOT_TQObject
#include "TQObject.h"
#endif

// forward declarations
class TAxis;
class TObject;
class TObjLink;
class TView;
class TCanvas;
class TH1F;
class TFrame;
class TBox;
class TVirtualViewer3D;

class TVirtualPad : public TObject, public TAttLine, public TAttFill,
                    public TAttPad, public TQObject {

protected:
   Bool_t         fResizing;         //!true when resizing the pad

   virtual void  *GetSender() { return this; }  //used to set gTQSender

public:
   TVirtualPad();
   TVirtualPad(const char *name, const char *title, Double_t xlow,
               Double_t ylow, Double_t xup, Double_t yup,
               Color_t color=19, Short_t bordersize=4, Short_t bordermode=1);
   virtual ~TVirtualPad();
   virtual void     AbsCoordinates(Bool_t set) = 0;
   virtual Double_t AbsPixeltoX(Int_t px) = 0;
   virtual Double_t AbsPixeltoY(Int_t py) = 0;
   virtual void     AddExec(const char *name, const char *command) = 0;
   virtual TVirtualPad* cd(Int_t subpadnumber=0) = 0;
   virtual void     Clear(Option_t *option="") = 0;
   virtual void     Close(Option_t *option="") = 0;
   virtual void     CopyPixmap() = 0;
   virtual void     CopyPixmaps() = 0;
   virtual void     DeleteExec(const char *name) = 0;
   virtual void     Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) = 0;
   virtual void     Draw(Option_t *option="") = 0;
   virtual void     DrawClassObject(const TObject *obj, Option_t *option="") = 0;
   virtual TH1F    *DrawFrame(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, const char *title="") = 0;
   virtual void     ExecuteEventAxis(Int_t event, Int_t px, Int_t py, TAxis *axis) = 0;
   virtual Short_t  GetBorderMode() const = 0;
   virtual Short_t  GetBorderSize() const = 0;
   virtual Int_t    GetCanvasID() const = 0;
   virtual TCanvas  *GetCanvas() const = 0;
   virtual TVirtualPad *GetVirtCanvas() const = 0;
   virtual Int_t    GetEvent() const  = 0;
   virtual Int_t    GetEventX() const = 0;
   virtual Int_t    GetEventY() const = 0;
   virtual TFrame   *GetFrame() = 0;
   virtual Color_t  GetHighLightColor() const = 0;
   virtual Int_t    GetNumber() const = 0;
   virtual void     GetRange(Double_t &x1, Double_t &y1, Double_t &x2, Double_t &y2) = 0;
   virtual void     GetRangeAxis(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) = 0;
   virtual void     GetPadPar(Double_t &xlow, Double_t &ylow, Double_t &xup, Double_t &yup) = 0;
   virtual Double_t GetXlowNDC() const = 0;
   virtual Double_t GetYlowNDC() const = 0;
   virtual Double_t GetWNDC() const = 0;
   virtual Double_t GetHNDC() const = 0;
   virtual UInt_t   GetWw() const = 0;
   virtual UInt_t   GetWh() const = 0;
   virtual Double_t GetAbsXlowNDC() const = 0;
   virtual Double_t GetAbsYlowNDC() const = 0;
   virtual Double_t GetAbsWNDC() const = 0;
   virtual Double_t GetAbsHNDC() const = 0;
   virtual Double_t GetAspectRatio() const = 0;
   virtual Double_t GetPhi() const = 0;
   virtual Double_t GetTheta() const = 0;
   virtual Double_t GetUxmin() const = 0;
   virtual Double_t GetUymin() const = 0;
   virtual Double_t GetUxmax() const = 0;
   virtual Double_t GetUymax() const = 0;
   virtual Bool_t   GetGridx() const = 0;
   virtual Bool_t   GetGridy() const = 0;
   virtual Int_t    GetTickx() const = 0;
   virtual Int_t    GetTicky() const = 0;
   virtual Double_t GetX1() const = 0;
   virtual Double_t GetX2() const = 0;
   virtual Double_t GetY1() const = 0;
   virtual Double_t GetY2() const = 0;
   virtual TList    *GetListOfPrimitives() const = 0;
   virtual TList    *GetListOfExecs() const = 0;
   virtual TObject  *GetPrimitive(const char *name) const = 0;
   virtual TObject  *GetSelected() const = 0;
   virtual TVirtualPad  *GetPad(Int_t subpadnumber) const = 0;
   virtual TObject  *GetPadPointer() const = 0;
   virtual TVirtualPad  *GetPadSave() const = 0;
   virtual TVirtualPad  *GetSelectedPad() const = 0;
   virtual TView    *GetView() const = 0;
   virtual Int_t    GetLogx() const = 0;
   virtual Int_t    GetLogy() const = 0;
   virtual Int_t    GetLogz() const = 0;
   virtual TVirtualPad  *GetMother() const = 0;
   virtual const char *GetName() const = 0;
   virtual const char *GetTitle() const = 0;
   virtual Int_t    GetPadPaint() const = 0;
   virtual Int_t    GetPixmapID() const = 0;
   virtual TObject *GetView3D() const = 0;
   virtual Bool_t   HasCrosshair() const = 0;
   virtual void     HighLight(Color_t col=kRed, Bool_t set=kTRUE) = 0;
   virtual Bool_t   HasFixedAspectRatio() const = 0;
   virtual Bool_t   IsBatch() const = 0;
   Bool_t           IsBeingResized() const { return fResizing; }
   virtual Bool_t   IsEditable() const = 0;
   virtual Bool_t   IsModified() const = 0;
   virtual Bool_t   IsRetained() const = 0;
   virtual Bool_t   IsVertical() const = 0;
   virtual void     ls(Option_t *option="") const = 0;
   virtual void     Modified(Bool_t flag=1) = 0;
   virtual Bool_t   OpaqueMoving() const = 0;
   virtual Bool_t   OpaqueResizing() const = 0;
   virtual Double_t PadtoX(Double_t x) const = 0;
   virtual Double_t PadtoY(Double_t y) const = 0;
   virtual void     Paint(Option_t *option="") = 0;
   virtual void     PaintBorderPS(Double_t xl,Double_t yl,Double_t xt,Double_t yt,Int_t bmode,Int_t bsize,Int_t dark,Int_t light) = 0;
   virtual void     PaintBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t *option="") = 0;
   virtual void     PaintFillArea(Int_t n, Float_t *x, Float_t *y, Option_t *option="") = 0;
   virtual void     PaintFillArea(Int_t n, Double_t *x, Double_t *y, Option_t *option="") = 0;
   virtual void     PaintPadFrame(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax) = 0;
   virtual void     PaintLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2) = 0;
   virtual void     PaintLineNDC(Double_t u1, Double_t v1,Double_t u2, Double_t v2) = 0;
   virtual void     PaintLine3D(Float_t *p1, Float_t *p2) = 0;
   virtual void     PaintLine3D(Double_t *p1, Double_t *p2) = 0;
   virtual void     PaintPolyLine(Int_t n, Float_t *x, Float_t *y, Option_t *option="") = 0;
   virtual void     PaintPolyLine(Int_t n, Double_t *x, Double_t *y, Option_t *option="") = 0;
   virtual void     PaintPolyLine3D(Int_t n, Double_t *p) = 0;
   virtual void     PaintPolyLineNDC(Int_t n, Double_t *x, Double_t *y, Option_t *option="") = 0;
   virtual void     PaintPolyMarker(Int_t n, Float_t *x, Float_t *y, Option_t *option="") = 0;
   virtual void     PaintPolyMarker(Int_t n, Double_t *x, Double_t *y, Option_t *option="") = 0;
   virtual void     PaintModified() = 0;
   virtual void     PaintText(Double_t x, Double_t y, const char *text) = 0;
   virtual void     PaintTextNDC(Double_t u, Double_t v, const char *text) = 0;
   virtual Double_t PixeltoX(Int_t px) = 0;
   virtual Double_t PixeltoY(Int_t py) = 0;
   virtual void     Pop() = 0;
   virtual void     Print(const char *filename="") const = 0;
   virtual void     Print(const char *filename, Option_t *option) = 0;
   virtual void     Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2) = 0;
   virtual void     RangeAxis(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax) = 0;
   virtual void     RecursiveRemove(TObject *obj) = 0;
   virtual void     RedrawAxis(Option_t *option="") = 0;
   virtual void     ResetView3D(TObject *view=0) = 0;
   virtual void     ResizePad(Option_t *option="") = 0;
   virtual void     SaveAs(const char *filename="",Option_t *option="") const = 0;
   virtual void     SetBatch(Bool_t batch=kTRUE) = 0;
   virtual void     SetBorderMode(Short_t bordermode) = 0;
   virtual void     SetBorderSize(Short_t bordersize) = 0;
   virtual void     SetCanvas(TCanvas *c) = 0;
   virtual void     SetCanvasSize(UInt_t ww, UInt_t wh) = 0;
   virtual void     SetCrosshair(Int_t crhair=1) = 0;
   virtual void     SetCursor(ECursor cursor) = 0;
   virtual void     SetDoubleBuffer(Int_t mode=1) = 0;
   virtual void     SetEditable(Bool_t mode=kTRUE) = 0;
   virtual void     SetFixedAspectRatio(Bool_t fixed = kTRUE) = 0;
   virtual void     SetGrid(Int_t valuex = 1, Int_t valuey = 1) = 0;
   virtual void     SetGridx(Int_t value = 1) = 0;
   virtual void     SetGridy(Int_t value = 1) = 0;
   virtual void     SetLogx(Int_t value = 1) = 0;
   virtual void     SetLogy(Int_t value = 1) = 0;
   virtual void     SetLogz(Int_t value = 1) = 0;
   virtual void     SetPad(const char *name, const char *title,
                           Double_t xlow, Double_t ylow, Double_t xup,
                           Double_t yup, Color_t color=35,
                           Short_t bordersize=5, Short_t bordermode=-1) = 0;
   virtual void     SetPad(Double_t xlow, Double_t ylow, Double_t xup, Double_t yup) = 0;
   virtual void     SetAttFillPS(Color_t color, Style_t style) = 0;
   virtual void     SetAttLinePS(Color_t color, Style_t style, Width_t lwidth) = 0;
   virtual void     SetAttMarkerPS(Color_t color, Style_t style, Size_t msize) = 0;
   virtual void     SetAttTextPS(Int_t align, Float_t angle, Color_t color, Style_t font, Float_t tsize) = 0;
   virtual void     SetName(const char *name) = 0;
   virtual void     SetSelected(TObject *obj) = 0;
   virtual void     SetTicks(Int_t valuex = 1, Int_t valuey = 1) = 0;
   virtual void     SetTickx(Int_t value = 1) = 0;
   virtual void     SetTicky(Int_t value = 1) = 0;
   virtual void     SetTitle(const char *title="") = 0;
   virtual void     SetTheta(Double_t theta=30) = 0;
   virtual void     SetPhi(Double_t phi=30) = 0;
   virtual void     SetToolTipText(const char *text, Long_t delayms = 1000) = 0;
   virtual void     SetVertical(Bool_t vert=kTRUE) = 0;
   virtual void     SetView(TView *view=0) = 0;
   virtual void     SetViewer3D(TVirtualViewer3D * /*viewer3d*/) {}
   virtual TObject *WaitPrimitive(const char *pname="", const char *emode="") = 0;
   virtual void     Update() = 0;
   virtual Int_t    UtoAbsPixel(Double_t u) const = 0;
   virtual Int_t    VtoAbsPixel(Double_t v) const = 0;
   virtual Int_t    UtoPixel(Double_t u) const = 0;
   virtual Int_t    VtoPixel(Double_t v) const = 0;
   virtual Int_t    XtoAbsPixel(Double_t x) const = 0;
   virtual Int_t    YtoAbsPixel(Double_t y) const = 0;
   virtual Double_t XtoPad(Double_t x) const = 0;
   virtual Double_t YtoPad(Double_t y) const = 0;
   virtual Int_t    XtoPixel(Double_t x) const = 0;
   virtual Int_t    YtoPixel(Double_t y) const = 0;

   virtual TObject *CreateToolTip(const TBox *b, const char *text, Long_t delayms) = 0;
   virtual void     DeleteToolTip(TObject *tip) = 0;
   virtual void     ResetToolTip(TObject *tip) = 0;
   virtual void     CloseToolTip(TObject *tip) = 0;

   virtual TVirtualViewer3D *GetViewer3D(Option_t * type = "") = 0;
   virtual Bool_t            HasViewer3D() const = 0;
   virtual void              ReleaseViewer3D(Option_t * type = "")  = 0;

   virtual Int_t    GetGLDevice() = 0;
   virtual void     SetCopyGLDevice(Bool_t copy) = 0;

   static TVirtualPad *&Pad();

   ClassDef(TVirtualPad,2)  //Abstract base class for Pads and Canvases
};

#ifndef __CINT__
#define gPad (TVirtualPad::Pad())

R__EXTERN void **(*gThreadTsd)(void*,Int_t);
#endif
R__EXTERN Int_t (*gThreadXAR)(const char *xact, Int_t nb, void **ar, Int_t *iret);

#endif
 TVirtualPad.h:1
 TVirtualPad.h:2
 TVirtualPad.h:3
 TVirtualPad.h:4
 TVirtualPad.h:5
 TVirtualPad.h:6
 TVirtualPad.h:7
 TVirtualPad.h:8
 TVirtualPad.h:9
 TVirtualPad.h:10
 TVirtualPad.h:11
 TVirtualPad.h:12
 TVirtualPad.h:13
 TVirtualPad.h:14
 TVirtualPad.h:15
 TVirtualPad.h:16
 TVirtualPad.h:17
 TVirtualPad.h:18
 TVirtualPad.h:19
 TVirtualPad.h:20
 TVirtualPad.h:21
 TVirtualPad.h:22
 TVirtualPad.h:23
 TVirtualPad.h:24
 TVirtualPad.h:25
 TVirtualPad.h:26
 TVirtualPad.h:27
 TVirtualPad.h:28
 TVirtualPad.h:29
 TVirtualPad.h:30
 TVirtualPad.h:31
 TVirtualPad.h:32
 TVirtualPad.h:33
 TVirtualPad.h:34
 TVirtualPad.h:35
 TVirtualPad.h:36
 TVirtualPad.h:37
 TVirtualPad.h:38
 TVirtualPad.h:39
 TVirtualPad.h:40
 TVirtualPad.h:41
 TVirtualPad.h:42
 TVirtualPad.h:43
 TVirtualPad.h:44
 TVirtualPad.h:45
 TVirtualPad.h:46
 TVirtualPad.h:47
 TVirtualPad.h:48
 TVirtualPad.h:49
 TVirtualPad.h:50
 TVirtualPad.h:51
 TVirtualPad.h:52
 TVirtualPad.h:53
 TVirtualPad.h:54
 TVirtualPad.h:55
 TVirtualPad.h:56
 TVirtualPad.h:57
 TVirtualPad.h:58
 TVirtualPad.h:59
 TVirtualPad.h:60
 TVirtualPad.h:61
 TVirtualPad.h:62
 TVirtualPad.h:63
 TVirtualPad.h:64
 TVirtualPad.h:65
 TVirtualPad.h:66
 TVirtualPad.h:67
 TVirtualPad.h:68
 TVirtualPad.h:69
 TVirtualPad.h:70
 TVirtualPad.h:71
 TVirtualPad.h:72
 TVirtualPad.h:73
 TVirtualPad.h:74
 TVirtualPad.h:75
 TVirtualPad.h:76
 TVirtualPad.h:77
 TVirtualPad.h:78
 TVirtualPad.h:79
 TVirtualPad.h:80
 TVirtualPad.h:81
 TVirtualPad.h:82
 TVirtualPad.h:83
 TVirtualPad.h:84
 TVirtualPad.h:85
 TVirtualPad.h:86
 TVirtualPad.h:87
 TVirtualPad.h:88
 TVirtualPad.h:89
 TVirtualPad.h:90
 TVirtualPad.h:91
 TVirtualPad.h:92
 TVirtualPad.h:93
 TVirtualPad.h:94
 TVirtualPad.h:95
 TVirtualPad.h:96
 TVirtualPad.h:97
 TVirtualPad.h:98
 TVirtualPad.h:99
 TVirtualPad.h:100
 TVirtualPad.h:101
 TVirtualPad.h:102
 TVirtualPad.h:103
 TVirtualPad.h:104
 TVirtualPad.h:105
 TVirtualPad.h:106
 TVirtualPad.h:107
 TVirtualPad.h:108
 TVirtualPad.h:109
 TVirtualPad.h:110
 TVirtualPad.h:111
 TVirtualPad.h:112
 TVirtualPad.h:113
 TVirtualPad.h:114
 TVirtualPad.h:115
 TVirtualPad.h:116
 TVirtualPad.h:117
 TVirtualPad.h:118
 TVirtualPad.h:119
 TVirtualPad.h:120
 TVirtualPad.h:121
 TVirtualPad.h:122
 TVirtualPad.h:123
 TVirtualPad.h:124
 TVirtualPad.h:125
 TVirtualPad.h:126
 TVirtualPad.h:127
 TVirtualPad.h:128
 TVirtualPad.h:129
 TVirtualPad.h:130
 TVirtualPad.h:131
 TVirtualPad.h:132
 TVirtualPad.h:133
 TVirtualPad.h:134
 TVirtualPad.h:135
 TVirtualPad.h:136
 TVirtualPad.h:137
 TVirtualPad.h:138
 TVirtualPad.h:139
 TVirtualPad.h:140
 TVirtualPad.h:141
 TVirtualPad.h:142
 TVirtualPad.h:143
 TVirtualPad.h:144
 TVirtualPad.h:145
 TVirtualPad.h:146
 TVirtualPad.h:147
 TVirtualPad.h:148
 TVirtualPad.h:149
 TVirtualPad.h:150
 TVirtualPad.h:151
 TVirtualPad.h:152
 TVirtualPad.h:153
 TVirtualPad.h:154
 TVirtualPad.h:155
 TVirtualPad.h:156
 TVirtualPad.h:157
 TVirtualPad.h:158
 TVirtualPad.h:159
 TVirtualPad.h:160
 TVirtualPad.h:161
 TVirtualPad.h:162
 TVirtualPad.h:163
 TVirtualPad.h:164
 TVirtualPad.h:165
 TVirtualPad.h:166
 TVirtualPad.h:167
 TVirtualPad.h:168
 TVirtualPad.h:169
 TVirtualPad.h:170
 TVirtualPad.h:171
 TVirtualPad.h:172
 TVirtualPad.h:173
 TVirtualPad.h:174
 TVirtualPad.h:175
 TVirtualPad.h:176
 TVirtualPad.h:177
 TVirtualPad.h:178
 TVirtualPad.h:179
 TVirtualPad.h:180
 TVirtualPad.h:181
 TVirtualPad.h:182
 TVirtualPad.h:183
 TVirtualPad.h:184
 TVirtualPad.h:185
 TVirtualPad.h:186
 TVirtualPad.h:187
 TVirtualPad.h:188
 TVirtualPad.h:189
 TVirtualPad.h:190
 TVirtualPad.h:191
 TVirtualPad.h:192
 TVirtualPad.h:193
 TVirtualPad.h:194
 TVirtualPad.h:195
 TVirtualPad.h:196
 TVirtualPad.h:197
 TVirtualPad.h:198
 TVirtualPad.h:199
 TVirtualPad.h:200
 TVirtualPad.h:201
 TVirtualPad.h:202
 TVirtualPad.h:203
 TVirtualPad.h:204
 TVirtualPad.h:205
 TVirtualPad.h:206
 TVirtualPad.h:207
 TVirtualPad.h:208
 TVirtualPad.h:209
 TVirtualPad.h:210
 TVirtualPad.h:211
 TVirtualPad.h:212
 TVirtualPad.h:213
 TVirtualPad.h:214
 TVirtualPad.h:215
 TVirtualPad.h:216
 TVirtualPad.h:217
 TVirtualPad.h:218
 TVirtualPad.h:219
 TVirtualPad.h:220
 TVirtualPad.h:221
 TVirtualPad.h:222
 TVirtualPad.h:223
 TVirtualPad.h:224
 TVirtualPad.h:225
 TVirtualPad.h:226
 TVirtualPad.h:227
 TVirtualPad.h:228
 TVirtualPad.h:229
 TVirtualPad.h:230
 TVirtualPad.h:231
 TVirtualPad.h:232
 TVirtualPad.h:233
 TVirtualPad.h:234
 TVirtualPad.h:235
 TVirtualPad.h:236
 TVirtualPad.h:237
 TVirtualPad.h:238
 TVirtualPad.h:239
 TVirtualPad.h:240
 TVirtualPad.h:241
 TVirtualPad.h:242
 TVirtualPad.h:243
 TVirtualPad.h:244
 TVirtualPad.h:245
 TVirtualPad.h:246
 TVirtualPad.h:247
 TVirtualPad.h:248
 TVirtualPad.h:249
 TVirtualPad.h:250
 TVirtualPad.h:251
 TVirtualPad.h:252
 TVirtualPad.h:253
 TVirtualPad.h:254
 TVirtualPad.h:255
 TVirtualPad.h:256
 TVirtualPad.h:257
 TVirtualPad.h:258
 TVirtualPad.h:259
 TVirtualPad.h:260
 TVirtualPad.h:261
 TVirtualPad.h:262