Skip to content

Commit bec4118

Browse files
committed
[padpainterps] use base class with attributes handling
Significantly reduce number of methods which need to be redefined.
1 parent e26e540 commit bec4118

2 files changed

Lines changed: 50 additions & 292 deletions

File tree

graf2d/gpad/inc/TPadPainterPS.h

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#ifndef ROOT_TPadPainterPS
1313
#define ROOT_TPadPainterPS
1414

15-
#include "TVirtualPadPainter.h"
15+
#include "TPadPainterBase.h"
1616

1717
/*
1818
TPadPainterPS is an attempt to abstract
@@ -23,57 +23,23 @@ one also will be able to produce vector-based and binary images */
2323
class TVirtualPad;
2424
class TVirtualPS;
2525

26-
class TPadPainterPS : public TVirtualPadPainter {
26+
class TPadPainterPS : public TPadPainterBase {
2727
private:
2828
TVirtualPS *fPS = nullptr;
2929
TVirtualPad *fPad = nullptr;
3030
public:
3131
TPadPainterPS(TVirtualPS *ps);
3232

33-
//Final overriders for TVirtualPadPainter pure virtual functions.
34-
//1. Part, which simply delegates to TVirtualX.
35-
36-
//Line attributes.
37-
Color_t GetLineColor() const override;
38-
Style_t GetLineStyle() const override;
39-
Width_t GetLineWidth() const override;
40-
41-
void SetLineColor(Color_t lcolor) override;
42-
void SetLineStyle(Style_t lstyle) override;
43-
void SetLineWidth(Width_t lwidth) override;
44-
45-
//Fill attributes.
46-
Color_t GetFillColor() const override;
47-
Style_t GetFillStyle() const override;
48-
Bool_t IsTransparent() const override;
49-
50-
void SetFillColor(Color_t fcolor) override;
51-
void SetFillStyle(Style_t fstyle) override;
5233
void SetOpacity(Int_t percent) override;
5334

54-
//Text attributes.
55-
Short_t GetTextAlign() const override;
56-
Float_t GetTextAngle() const override;
57-
Color_t GetTextColor() const override;
58-
Font_t GetTextFont() const override;
59-
Float_t GetTextSize() const override;
60-
Float_t GetTextMagnitude() const override;
61-
62-
void SetTextAlign(Short_t align) override;
63-
void SetTextAngle(Float_t tangle) override;
64-
void SetTextColor(Color_t tcolor) override;
65-
void SetTextFont(Font_t tfont) override;
66-
void SetTextSize(Float_t tsize) override;
67-
void SetTextSizePixels(Int_t npixels) override;
68-
69-
//Marker attributes
70-
Color_t GetMarkerColor() const override;
71-
Style_t GetMarkerStyle() const override;
72-
Size_t GetMarkerSize() const override;
73-
74-
void SetMarkerColor(Color_t mcolor) override;
75-
void SetMarkerStyle(Style_t mstyle) override;
76-
void SetMarkerSize(Size_t msize) override;
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+
//Final overriders for TVirtualPadPainter pure virtual functions.
42+
//1. Part, which simply delegates to TVirtualX.
7743

7844
//2. "Off-screen management" part.
7945
Int_t CreateDrawable(UInt_t w, UInt_t h) override;

0 commit comments

Comments
 (0)