Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TVirtualPadPainter.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/base:$Id$
0002 // Author: Timur Pocheptsov   6/5/2009
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2012, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TVirtualPadPainter
0013 #define ROOT_TVirtualPadPainter
0014 
0015 #include "Rtypes.h"
0016 
0017 class TVirtualPad;
0018 
0019 class TVirtualPadPainter {
0020 public:
0021    enum EBoxMode  {kHollow, kFilled};
0022    enum ETextMode {kClear,  kOpaque};
0023 
0024    virtual ~TVirtualPadPainter();
0025 
0026    //Line attributes to be set up in TPad.
0027    virtual Color_t  GetLineColor() const = 0;
0028    virtual Style_t  GetLineStyle() const = 0;
0029    virtual Width_t  GetLineWidth() const = 0;
0030 
0031    virtual void     SetLineColor(Color_t lcolor) = 0;
0032    virtual void     SetLineStyle(Style_t lstyle) = 0;
0033    virtual void     SetLineWidth(Width_t lwidth) = 0;
0034 
0035    //Fill attributes to be set up in TPad.
0036    virtual Color_t  GetFillColor() const = 0;
0037    virtual Style_t  GetFillStyle() const = 0;
0038    virtual Bool_t   IsTransparent() const = 0;
0039 
0040    virtual void     SetFillColor(Color_t fcolor) = 0;
0041    virtual void     SetFillStyle(Style_t fstyle) = 0;
0042    virtual void     SetOpacity(Int_t percent) = 0;
0043 
0044    //Text attributes.
0045    virtual Short_t  GetTextAlign() const = 0;
0046    virtual Float_t  GetTextAngle() const = 0;
0047    virtual Color_t  GetTextColor() const = 0;
0048    virtual Font_t   GetTextFont() const = 0;
0049    virtual Float_t  GetTextSize() const = 0;
0050    virtual Float_t  GetTextMagnitude() const = 0;
0051 
0052    virtual void     SetTextAlign(Short_t align=11) = 0;
0053    virtual void     SetTextAngle(Float_t tangle=0) = 0;
0054    virtual void     SetTextColor(Color_t tcolor=1) = 0;
0055    virtual void     SetTextFont(Font_t tfont=62) = 0;
0056    virtual void     SetTextSize(Float_t tsize=1) = 0;
0057    virtual void     SetTextSizePixels(Int_t npixels) = 0;
0058 
0059    //This part is an interface to X11 pixmap management and to save sub-pads off-screens for OpenGL.
0060    //Currently, must be implemented only for X11/GDI
0061    virtual Int_t    CreateDrawable(UInt_t w, UInt_t h) = 0;//gVirtualX->OpenPixmap
0062    virtual void     ClearDrawable() = 0;//gVirtualX->Clear()
0063    virtual void     CopyDrawable(Int_t device, Int_t px, Int_t py) = 0;
0064    virtual void     DestroyDrawable(Int_t device) = 0;//gVirtualX->CloseWindow
0065    virtual void     SelectDrawable(Int_t device) = 0;//gVirtualX->SelectWindow
0066 
0067    //TASImage support.
0068    virtual void     DrawPixels(const unsigned char *pixelData, UInt_t width, UInt_t height,
0069                                Int_t dstX, Int_t dstY, Bool_t enableAlphaBlending) = 0;
0070    //
0071    //These functions are not required by X11/GDI.
0072    virtual void     InitPainter();
0073    virtual void     InvalidateCS();
0074    virtual void     LockPainter();
0075 
0076    //Now, drawing primitives.
0077    virtual void     DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2) = 0;
0078    virtual void     DrawLineNDC(Double_t u1, Double_t v1, Double_t u2, Double_t v2) = 0;
0079 
0080    virtual void     DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, EBoxMode mode) = 0;
0081 
0082    virtual void     DrawFillArea(Int_t n, const Double_t *x, const Double_t *y) = 0;
0083    virtual void     DrawFillArea(Int_t n, const Float_t *x, const Float_t *y) = 0;
0084 
0085    virtual void     DrawPolyLine(Int_t n, const Double_t *x, const Double_t *y) = 0;
0086    virtual void     DrawPolyLine(Int_t n, const Float_t *x, const Float_t *y) = 0;
0087    virtual void     DrawPolyLineNDC(Int_t n, const Double_t *u, const Double_t *v) = 0;
0088 
0089    virtual void     DrawPolyMarker(Int_t n, const Double_t *x, const Double_t *y) = 0;
0090    virtual void     DrawPolyMarker(Int_t n, const Float_t *x, const Float_t *y) = 0;
0091 
0092    virtual void     DrawText(Double_t x, Double_t y, const char *text, ETextMode mode) = 0;
0093    virtual void     DrawText(Double_t x, Double_t y, const wchar_t *text, ETextMode mode) = 0;
0094    virtual void     DrawTextNDC(Double_t u, Double_t v, const char *text, ETextMode mode) = 0;
0095    virtual void     DrawTextNDC(Double_t u, Double_t v, const wchar_t *text, ETextMode mode) = 0;
0096 
0097    //gif, jpg, png, bmp output.
0098    virtual void     SaveImage(TVirtualPad *pad, const char *fileName, Int_t type) const = 0;
0099 
0100 
0101    static TVirtualPadPainter *PadPainter(Option_t *opt = "");
0102 
0103    ClassDef(TVirtualPadPainter, 0)//Painter interface for pad.
0104 };
0105 
0106 #endif