Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-15 09:25:34

0001 // @(#)root/gpad:$Id$
0002 // Author:  Olivier Couet, Timur Pocheptsov  06/05/2009
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2009, 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_TPadPainter
0013 #define ROOT_TPadPainter
0014 
0015 #include "TPadPainterBase.h"
0016 
0017 /*
0018 TPadPainter is implementation of TVirtualPadPainter interface for TVirtualX.
0019 gVirtualX can be X11 or GDI, but pad painter can be gVirtualX (X11 or GDI),
0020 or gl pad painter.
0021 */
0022 
0023 class TVirtualPad;
0024 
0025 class TPadPainter : public TPadPainterBase {
0026    WinContext_t   fWinContext;
0027    Int_t          fDoubleBuffer;
0028 
0029 public:
0030    TPadPainter();
0031 
0032    void     SetOpacity(Int_t percent) override;
0033    Float_t  GetTextMagnitude() const override;
0034 
0035    //Overall attributes
0036    void      SetAttFill(const TAttFill &att) override;
0037    void      SetAttLine(const TAttLine &att) override;
0038    void      SetAttMarker(const TAttMarker &att) override;
0039    void      SetAttText(const TAttText &att) override;
0040 
0041    //2. "Off-screen management" part.
0042    Int_t    CreateDrawable(UInt_t w, UInt_t h) override;
0043    void     ClearDrawable() override;
0044    void     ClearWindow(Int_t device) override;
0045    Int_t    ResizeDrawable(Int_t device, UInt_t w, UInt_t h) override;
0046    void     CopyDrawable(Int_t device, Int_t px, Int_t py) override;
0047    void     DestroyDrawable(Int_t device) override;
0048    void     SelectDrawable(Int_t device) override;
0049    void     UpdateDrawable(Int_t mode) override;
0050    void     SetDrawMode(Int_t device, Int_t mode) override;
0051    void     SetDoubleBuffer(Int_t device, Int_t mode) override;
0052 
0053 
0054    //TASImage support (noop for a non-gl pad).
0055    void     DrawPixels(const unsigned char *pixelData, UInt_t width, UInt_t height,
0056                        Int_t dstX, Int_t dstY, Bool_t enableAlphaBlending) override;
0057 
0058    void     DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override;
0059    void     DrawLineNDC(Double_t u1, Double_t v1, Double_t u2, Double_t v2) override;
0060 
0061    void     DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, EBoxMode mode) override;
0062 
0063    //TPad needs double and float versions.
0064    void     DrawFillArea(Int_t n, const Double_t *x, const Double_t *y) override;
0065    void     DrawFillArea(Int_t n, const Float_t *x, const Float_t *y) override;
0066 
0067    //TPad needs both double and float versions of DrawPolyLine.
0068    void     DrawPolyLine(Int_t n, const Double_t *x, const Double_t *y) override;
0069    void     DrawPolyLine(Int_t n, const Float_t *x, const Float_t *y) override;
0070    void     DrawPolyLineNDC(Int_t n, const Double_t *u, const Double_t *v) override;
0071 
0072    void     DrawSegments(Int_t n, Double_t *x, Double_t *y) override;
0073    void     DrawSegmentsNDC(Int_t n, Double_t *u, Double_t *v) override;
0074 
0075    //TPad needs both versions.
0076    void     DrawPolyMarker(Int_t n, const Double_t *x, const Double_t *y) override;
0077    void     DrawPolyMarker(Int_t n, const Float_t *x, const Float_t *y) override;
0078 
0079    void     DrawText(Double_t x, Double_t y, const char *text, ETextMode mode) override;
0080    void     DrawText(Double_t x, Double_t y, const wchar_t *text, ETextMode mode) override;
0081    void     DrawTextNDC(Double_t u, Double_t v, const char *text, ETextMode mode) override;
0082    void     DrawTextNDC(Double_t u, Double_t v, const wchar_t *text, ETextMode mode) override;
0083 
0084    //jpg, png, bmp, gif output.
0085    void     SaveImage(TVirtualPad *pad, const char *fileName, Int_t type) const override;
0086 
0087    Bool_t   IsNative() const override { return kTRUE; }
0088 
0089    Bool_t   IsCocoa() const override;
0090 
0091    Bool_t   IsSupportAlpha() const override;
0092 
0093 private:
0094    //Let's make this clear:
0095    TPadPainter(const TPadPainter &) = delete;
0096    TPadPainter(TPadPainter &&) = delete;
0097    TPadPainter &operator=(const TPadPainter &) = delete;
0098    TPadPainter &operator=(TPadPainter &&) = delete;
0099 
0100    ClassDefOverride(TPadPainter, 0) //TPad painting
0101 };
0102 
0103 #endif