Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TPadPainter.h
Go to the documentation of this file.
1// @(#)root/gpad:$Id$
2// Author: Olivier Couet, Timur Pocheptsov 06/05/2009
3
4/*************************************************************************
5 * Copyright (C) 1995-2009, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TPadPainter
13#define ROOT_TPadPainter
14
15#include "TPadPainterBase.h"
16
17/*
18TPadPainter is implementation of TVirtualPadPainter interface for TVirtualX.
19gVirtualX can be X11 or GDI, but pad painter can be gVirtualX (X11 or GDI),
20or gl pad painter.
21*/
22
23class TVirtualPad;
24
28
29public:
31
32 void SetOpacity(Int_t percent) override;
33 Float_t GetTextMagnitude() const override;
34
35 //Overall attributes
36 void SetAttFill(const TAttFill &att) override;
37 void SetAttLine(const TAttLine &att) override;
38 void SetAttMarker(const TAttMarker &att) override;
39 void SetAttText(const TAttText &att) override;
40
41 //2. "Off-screen management" part.
43 void ClearDrawable() override;
45 void CopyDrawable(Int_t device, Int_t px, Int_t py) override;
46 void DestroyDrawable(Int_t device) override;
47 void SelectDrawable(Int_t device) override;
48 void UpdateDrawable(Int_t mode) override;
49 void SetDrawMode(Int_t device, Int_t mode) override;
50 void SetDoubleBuffer(Int_t device, Int_t mode) override;
51
52
53 //TASImage support (noop for a non-gl pad).
54 void DrawPixels(const unsigned char *pixelData, UInt_t width, UInt_t height,
56
59
61
62 //TPad needs double and float versions.
63 void DrawFillArea(Int_t n, const Double_t *x, const Double_t *y) override;
64 void DrawFillArea(Int_t n, const Float_t *x, const Float_t *y) override;
65
66 //TPad needs both double and float versions of DrawPolyLine.
67 void DrawPolyLine(Int_t n, const Double_t *x, const Double_t *y) override;
68 void DrawPolyLine(Int_t n, const Float_t *x, const Float_t *y) override;
69 void DrawPolyLineNDC(Int_t n, const Double_t *u, const Double_t *v) override;
70
71 void DrawSegments(Int_t n, Double_t *x, Double_t *y) override;
72 void DrawSegmentsNDC(Int_t n, Double_t *u, Double_t *v) override;
73
74 //TPad needs both versions.
75 void DrawPolyMarker(Int_t n, const Double_t *x, const Double_t *y) override;
76 void DrawPolyMarker(Int_t n, const Float_t *x, const Float_t *y) override;
77
78 void DrawText(Double_t x, Double_t y, const char *text, ETextMode mode) override;
79 void DrawText(Double_t x, Double_t y, const wchar_t *text, ETextMode mode) override;
80 void DrawTextNDC(Double_t u, Double_t v, const char *text, ETextMode mode) override;
81 void DrawTextNDC(Double_t u, Double_t v, const wchar_t *text, ETextMode mode) override;
82
83 //jpg, png, bmp, gif output.
84 void SaveImage(TVirtualPad *pad, const char *fileName, Int_t type) const override;
85
86 Bool_t IsNative() const override { return kTRUE; }
87
88 Bool_t IsCocoa() const override;
89
90 Bool_t IsSupportAlpha() const override;
91
92private:
93 //Let's make this clear:
94 TPadPainter(const TPadPainter &) = delete;
96 TPadPainter &operator=(const TPadPainter &) = delete;
98
99 ClassDefOverride(TPadPainter, 0) //TPad painting
100};
101
102#endif
Handle_t WinContext_t
Window drawing context.
Definition GuiTypes.h:30
#define h(i)
Definition RSha256.hxx:106
bool Bool_t
Boolean (0=false, 1=true) (bool)
Definition RtypesCore.h:77
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void SetDoubleBuffer
Option_t Option_t DrawFillArea
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint DrawPolyMarker
Option_t Option_t TPoint TPoint const char DrawLine
Option_t Option_t width
Option_t Option_t TPoint TPoint percent
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint DrawText
Option_t Option_t TPoint TPoint SetOpacity
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Option_t Option_t TPoint TPoint const char text
Option_t Option_t TPoint TPoint const char y1
Fill Area Attributes class.
Definition TAttFill.h:21
Line Attributes class.
Definition TAttLine.h:21
Marker Attributes class.
Definition TAttMarker.h:21
Text Attributes class.
Definition TAttText.h:21
Extends TVirtualPadPainter interface to simplify work with graphical attributes.
Implement TVirtualPadPainter which abstracts painting operations.
Definition TPadPainter.h:25
void DrawSegments(Int_t n, Double_t *x, Double_t *y) override
Paint N segments on the pad.
TPadPainter()
Empty ctor. We need it only because of explicit copy ctor.
void SetAttText(const TAttText &att) override
Set text attributes.
void DrawPixels(const unsigned char *pixelData, UInt_t width, UInt_t height, Int_t dstX, Int_t dstY, Bool_t enableAlphaBlending) override
Noop, for non-gl pad TASImage calls gVirtualX->CopyArea.
void UpdateDrawable(Int_t mode) override
Call low-level update of selected drawable, redirect to gVirtualX.
void CopyDrawable(Int_t device, Int_t px, Int_t py) override
Copy a gVirtualX pixmap.
void SetAttMarker(const TAttMarker &att) override
Set marker attributes.
TPadPainter & operator=(TPadPainter &&)=delete
void DrawPolyLine(Int_t n, const Double_t *x, const Double_t *y) override
Paint Polyline.
Int_t fDoubleBuffer
Definition TPadPainter.h:27
Int_t ResizeDrawable(Int_t device, UInt_t w, UInt_t h) override
Resize a gVirtualX Pixmap.
Float_t GetTextMagnitude() const override
Delegate to gVirtualX.
Bool_t IsSupportAlpha() const override
Returns true if trasnparent colors are supported.
Int_t CreateDrawable(UInt_t w, UInt_t h) override
Create a gVirtualX Pixmap.
void SetAttFill(const TAttFill &att) override
Set fill attributes.
void DrawTextNDC(Double_t u, Double_t v, const char *text, ETextMode mode) override
Paint text in normalized coordinates.
Bool_t IsCocoa() const override
Returns true when cocoa backend is used.
void SaveImage(TVirtualPad *pad, const char *fileName, Int_t type) const override
Save the image displayed in the canvas pointed by "pad" into a binary file.
TPadPainter(const TPadPainter &)=delete
void DrawPolyLineNDC(Int_t n, const Double_t *u, const Double_t *v) override
Paint polyline in normalized coordinates.
void SetDrawMode(Int_t device, Int_t mode) override
Set drawing mode for specified device.
void ClearDrawable() override
Clear the current gVirtualX window.
void DestroyDrawable(Int_t device) override
Close the current gVirtualX pixmap.
WinContext_t fWinContext
Definition TPadPainter.h:26
Bool_t IsNative() const override
Definition TPadPainter.h:86
void DrawSegmentsNDC(Int_t n, Double_t *u, Double_t *v) override
Paint N segments in normalized coordinates on the pad.
void SetAttLine(const TAttLine &att) override
Set line attributes.
void SelectDrawable(Int_t device) override
Select the window in which the graphics will go.
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, EBoxMode mode) override
Paint a simple box.
void DrawLineNDC(Double_t u1, Double_t v1, Double_t u2, Double_t v2) override
Paint a simple line in normalized coordinates.
TPadPainter(TPadPainter &&)=delete
TPadPainter & operator=(const TPadPainter &)=delete
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16