From bca9cec2cf8020e4811e0348c0b5cebc97244592 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov <Timur.Pocheptsov@cern.ch> Date: Mon, 7 Nov 2011 12:46:54 +0000 Subject: [PATCH] Remove redundant inheritance. git-svn-id: http://root.cern.ch/svn/root/trunk@41796 27541ba8-7e3a-0410-8455-c3a389f83636 --- graf2d/ios/inc/IOSPainter.h | 41 ++------- graf2d/ios/src/IOSPainter.cxx | 156 +--------------------------------- 2 files changed, 9 insertions(+), 188 deletions(-) diff --git a/graf2d/ios/inc/IOSPainter.h b/graf2d/ios/inc/IOSPainter.h index ae3f639619c..e65478fa277 100644 --- a/graf2d/ios/inc/IOSPainter.h +++ b/graf2d/ios/inc/IOSPainter.h @@ -66,7 +66,7 @@ private: Double_t fYConv; }; -class Painter : public TVirtualPadPainter { +class Painter { public: Painter(); @@ -78,7 +78,7 @@ public: void DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2); void DrawLineNDC(Double_t u1, Double_t v1, Double_t u2, Double_t v2); - void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, EBoxMode mode); + void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, TVirtualPadPainter::EBoxMode mode); void DrawFillArea(Int_t n, const Double_t *x, const Double_t *y); void DrawFillArea(Int_t n, const Float_t *x, const Float_t *y); @@ -90,8 +90,8 @@ public: void DrawPolyMarker(Int_t n, const Double_t *x, const Double_t *y); void DrawPolyMarker(Int_t n, const Float_t *x, const Float_t *y); - void DrawText(Double_t x, Double_t y, const char *text, ETextMode mode); - void DrawTextNDC(Double_t u, Double_t v, const char *text, ETextMode mode); + void DrawText(Double_t x, Double_t y, const char *text, TVirtualPadPainter::ETextMode mode); + void DrawTextNDC(Double_t u, Double_t v, const char *text, TVirtualPadPainter::ETextMode mode); void SetContext(CGContextRef ctx); void SetTransform(UInt_t w, Double_t xMin, Double_t xMax, UInt_t h, Double_t yMin, Double_t yMax); @@ -124,38 +124,7 @@ public: } void GetTextExtent(UInt_t &w, UInt_t &h, const char *text); - - //Line attributes to be set up in TPad. - Color_t GetLineColor() const; - Style_t GetLineStyle() const; - Width_t GetLineWidth() const; - - void SetLineColor(Color_t lcolor); - void SetLineStyle(Style_t lstyle); - void SetLineWidth(Width_t lwidth); - - //Fill attributes to be set up in TPad. - Color_t GetFillColor() const; - Style_t GetFillStyle() const; - - void SetFillColor(Color_t fcolor); - void SetFillStyle(Style_t fstyle); - - //Text attributes. - Short_t GetTextAlign() const; - Float_t GetTextAngle() const; - Color_t GetTextColor() const; - Font_t GetTextFont() const; - Float_t GetTextSize() const; - Float_t GetTextMagnitude() const; - - void SetTextAlign(Short_t align); - void SetTextAngle(Float_t tangle); - void SetTextColor(Color_t tcolor); - void SetTextFont(Font_t tfont); - void SetTextSize(Float_t tsize); - void SetTextSizePixels(Int_t); - + private: //Polygon parameters. diff --git a/graf2d/ios/src/IOSPainter.cxx b/graf2d/ios/src/IOSPainter.cxx index d9a6713aab5..30ee50bee77 100644 --- a/graf2d/ios/src/IOSPainter.cxx +++ b/graf2d/ios/src/IOSPainter.cxx @@ -301,7 +301,7 @@ void Painter::DrawBoxOutline(Double_t x1, Double_t y1, Double_t x2, Double_t y2) } //_________________________________________________________________ -void Painter::DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, EBoxMode mode) +void Painter::DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, TVirtualPadPainter::EBoxMode mode) { const Double_t x1p = fConverter.XToView(x1); const Double_t y1p = fConverter.YToView(y1); @@ -314,7 +314,7 @@ void Painter::DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, EBoxMo if (fPainterMode == kPaintToSelectionBuffer && PolygonHasStipple()) return DrawBoxOutline(x1p, y1p, x2p, y2p); - if (mode == kFilled) + if (mode == TVirtualPadPainter::kFilled) PolygonHasStipple() ? FillBoxWithPattern(x1p, y1p, x2p, y2p) : FillBox(x1p, y1p, x2p, y2p); else DrawBoxOutline(x1p, y1p, x2p, y2p); @@ -539,7 +539,7 @@ void Painter::DrawText(Double_t x, Double_t y, const CTLineGuard &ctLine) } //_________________________________________________________________ -void Painter::DrawText(Double_t x, Double_t y, const char *text, ETextMode /*mode*/) +void Painter::DrawText(Double_t x, Double_t y, const char *text, TVirtualPadPainter::ETextMode /*mode*/) { //TODO: mode parameter. const Util::CGStateGuard contextGuard(fCtx); @@ -563,7 +563,7 @@ void Painter::DrawText(Double_t x, Double_t y, const char *text, ETextMode /*mod } //_________________________________________________________________ -void Painter::DrawTextNDC(Double_t, Double_t, const char *, ETextMode) +void Painter::DrawTextNDC(Double_t, Double_t, const char *, TVirtualPadPainter::ETextMode) { } @@ -608,153 +608,5 @@ void Painter::SetLineColorHighlighted() const CGContextSetRGBStrokeColor(fCtx, 1.f, 0.f, 0.5f, 0.5f); } - -//The set of functions below is not required by iOS::Painter and iOS::Pad, -//but they are pure-virtual in a base class, so I have to implement them here. - -//_________________________________________________________________ -Color_t Painter::GetLineColor() const -{ - //Dummy implementation. - return 0; -} - -//_________________________________________________________________ -Style_t Painter::GetLineStyle() const -{ - //Dummy implementation. - return 0; -} - -//_________________________________________________________________ -Width_t Painter::GetLineWidth() const -{ - //Dummy implementation. - return 0; -} - -//_________________________________________________________________ -void Painter::SetLineColor(Color_t) -{ - //Dummy implementation. -} - -//_________________________________________________________________ -void Painter::SetLineStyle(Style_t) -{ - //Dummy implementation. -} - -//_________________________________________________________________ -void Painter::SetLineWidth(Width_t) -{ - //Dummy implementation. -} - -//_________________________________________________________________ -Color_t Painter::GetFillColor() const -{ - //Dummy implementation. - return 0; -} - -//_________________________________________________________________ -Style_t Painter::GetFillStyle() const -{ - //Dummy implementation. - return 0; -} - -//_________________________________________________________________ -void Painter::SetFillColor(Color_t) -{ - //Dummy implementation. -} - -//_________________________________________________________________ -void Painter::SetFillStyle(Style_t) -{ - //Dummy implementation. -} - -//_________________________________________________________________ -Short_t Painter::GetTextAlign() const -{ - //Dummy implementation. - return 0; -} - -//_________________________________________________________________ -Float_t Painter::GetTextAngle() const -{ - //Dummy implementation. - return 0.f; -} - -//_________________________________________________________________ -Color_t Painter::GetTextColor() const -{ - //Dummy implementation. - return 0; -} - -//_________________________________________________________________ -Font_t Painter::GetTextFont() const -{ - //Dummy implementation. - return 0; -} - -//_________________________________________________________________ -Float_t Painter::GetTextSize() const -{ - //Dummy implementation. - return 0.f; -} - -//_________________________________________________________________ -Float_t Painter::GetTextMagnitude() const -{ - //Dummy implementation. - return 0.f; -} - -//_________________________________________________________________ -void Painter::SetTextAlign(Short_t) -{ - //Dummy implementation. -} - -//_________________________________________________________________ -void Painter::SetTextAngle(Float_t) -{ - //Dummy implementation. -} - -//_________________________________________________________________ -void Painter::SetTextColor(Color_t) -{ - //Dummy implementation. -} - -//_________________________________________________________________ -void Painter::SetTextFont(Font_t) -{ - //Dummy implementation. -} - -//_________________________________________________________________ -void Painter::SetTextSize(Float_t) -{ - //Dummy implementation. -} - -//_________________________________________________________________ -void Painter::SetTextSizePixels(Int_t) -{ - //Dummy implementation. -} - - }//namespace iOS }//namespace ROOT -- GitLab