From 14eb32985e558b53f71e8a5b1eda63e2ddb8c005 Mon Sep 17 00:00:00 2001
From: Timur Pocheptsov <Timur.Pocheptsov@cern.ch>
Date: Thu, 27 Mar 2014 08:37:42 +0100
Subject: [PATCH] Cleanup includes and small cosmetic mods.

---
 tutorials/cocoa/gradients.C       | 10 ++--------
 tutorials/cocoa/radialgradients.C |  3 ---
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/tutorials/cocoa/gradients.C b/tutorials/cocoa/gradients.C
index bff5d017445..a46524e43d0 100644
--- a/tutorials/cocoa/gradients.C
+++ b/tutorials/cocoa/gradients.C
@@ -9,8 +9,8 @@
 
 
 //Includes for ACLiC:
-
 #include "TColorGradient.h"
+#include "TVirtualX.h"
 #include "TCanvas.h"
 #include "TError.h"
 #include "TText.h"
@@ -46,8 +46,6 @@ void gradients()
       return;
    }
 
-   c->cd();
-
    //Linear gradient is defined by: 1) colors (to interpolate between them),
    //2) coordinates for these colors along the gradient axis [0., 1.] (must be sorted!).
    //3) Start and end points for a gradient, you specify them in some NDC rect ([0,0 - 1,1]),
@@ -60,13 +58,12 @@ void gradients()
    //Colour positions in the gradient's palette (here I place colors at the
    //ends of 0-1):
    const Double_t locations[] = {0., 1.};
-   
    //Linear gradient fill (with an axis angle == 45):
    const Double_t rgbaData1[] = {0.2, 0.2, 0.2, 1.,/*gray*/
                                  0.8, 1., 0.9, 1.  /*pale green*/};
    TLinearGradient * const gradientFill1 = new TLinearGradient(linearFill, 2, locations, rgbaData1);
    //45 degrees:
-   gradientFill1->SetStartEnd(TColorGradient::Point(0, 0), TColorGradient::Point(1, 1));
+   gradientFill1->SetStartEnd(TColorGradient::Point(0., 0.), TColorGradient::Point(1., 1.));
    //Set as a background color in the canvas:
    c->SetFillColor(linearFill);
 
@@ -87,12 +84,10 @@ void gradients()
    pad->Draw();
    pad->cd();
 
-
    //Radial gradient fill for a TPie object:
    const Double_t rgbaData2[] = {/*opaque orange at the start:*/1., 0.8, 0., 1.,
                                  /*transparent red at the end:*/1., 0.2, 0., 0.8};
 
-
    //
    //With Quartz/Cocoa we support the "extended" radial gradient:
    //you can specify two centers and two radiuses - the start and
@@ -110,7 +105,6 @@ void gradients()
    gradientFill2->SetStartEndR1R2(TColorGradient::Point(0.5, 0.5), 0.1,
                                   TColorGradient::Point(0.5, 0.5), 0.4);
 
-
    const UInt_t nSlices = 5;
    //Values for a TPie (non-const, that's how TPie's ctor is declared):
    Double_t values[nSlices] = {0.8, 1.2, 1.2, 0.8, 1.};
diff --git a/tutorials/cocoa/radialgradients.C b/tutorials/cocoa/radialgradients.C
index 42ee1401653..e9304e7ae96 100644
--- a/tutorials/cocoa/radialgradients.C
+++ b/tutorials/cocoa/radialgradients.C
@@ -9,12 +9,10 @@
 #include <cstdlib>
 
 #include "TColorGradient.h"
-#include "TVirtualPad.h"
 #include "TVirtualX.h"
 #include "TEllipse.h"
 #include "TRandom.h"
 #include "TCanvas.h"
-#include "Rtypes.h"
 #include "TError.h"
 
 //Cocoa aux. functions.
@@ -89,7 +87,6 @@ bool add_ellipse(const Double_t xC, const Double_t yC, const Double_t r)
    }
 
    TEllipse * const newEllipse = new TEllipse(xC, yC, r, r);
-   
    newEllipse->SetFillColor(newColor);
    newEllipse->Draw();
    
-- 
GitLab