From 395a797f5491a71475b1ac4815b16e35b4d3e717 Mon Sep 17 00:00:00 2001
From: Olivier Couet <Olivier.Couet@cern.ch>
Date: Thu, 11 Oct 2007 12:45:04 +0000
Subject: [PATCH] - The signatures of the two SetPointError methods were
 incomplete. The shift   values in the various directions were missing. To
 preserve the backward   compatibility, the missing parameters have been added
 with default value = 0.   The new signature is now used in SavePrimitive
 which allows a correct saving   of the TGraphBentErrors.

git-svn-id: http://root.cern.ch/svn/root/trunk@20309 27541ba8-7e3a-0410-8455-c3a389f83636
---
 graf/inc/TGraphBentErrors.h   |  8 ++++++--
 graf/src/TGraphBentErrors.cxx | 36 ++++++++++++++++++++++++-----------
 2 files changed, 31 insertions(+), 13 deletions(-)

diff --git a/graf/inc/TGraphBentErrors.h b/graf/inc/TGraphBentErrors.h
index ba2d3d14753..7899b1ba3ae 100644
--- a/graf/inc/TGraphBentErrors.h
+++ b/graf/inc/TGraphBentErrors.h
@@ -86,10 +86,14 @@ public:
    virtual void    Print(Option_t *chopt="") const;
    virtual void    SavePrimitive(ostream &out, Option_t *option = "");
    virtual void    SetPointError(Double_t exl, Double_t exh,
-                                 Double_t eyl, Double_t eyh); // *MENU*
+                                 Double_t eyl, Double_t eyh,
+                                 Double_t exld=0, Double_t exhd=0,  
+                                 Double_t eyld=0, Double_t eyhd=0); // *MENU*
    virtual void    SetPointError(Int_t i,
                                  Double_t exl, Double_t exh,
-                                 Double_t eyl, Double_t eyh);
+                                 Double_t eyl, Double_t eyh,
+                                 Double_t exld=0, Double_t exhd=0,  
+                                 Double_t eyld=0, Double_t eyhd=0);
 
    ClassDef(TGraphBentErrors,1)  //A graph with bent, asymmetric error bars
 };
diff --git a/graf/src/TGraphBentErrors.cxx b/graf/src/TGraphBentErrors.cxx
index 0478daca69d..ae14404f235 100644
--- a/graf/src/TGraphBentErrors.cxx
+++ b/graf/src/TGraphBentErrors.cxx
@@ -676,7 +676,11 @@ void TGraphBentErrors::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    for (Int_t i=0;i<fNpoints;i++) {
       out<<"   grbe->SetPoint("<<i<<","<<fX[i]<<","<<fY[i]<<");"<<endl;
-      out<<"   grbe->SetPointError("<<i<<","<<fEXlow[i]<<","<<fEXhigh[i]<<","<<fEYlow[i]<<","<<fEYhigh[i]<<");"<<endl;
+      out<<"   grbe->SetPointError("<<i<<","<<fEXlow[i]<<","<<fEXhigh[i]
+                                       <<","<<fEYlow[i]<<","<<fEYhigh[i]              
+                                       <<","<<fEXlowd[i]<<","<<fEXhighd[i]
+                                       <<","<<fEYlowd[i]<<","<<fEYhighd[i]
+                                       <<");"<<endl;
    }
 
    static Int_t frameNumber = 0;
@@ -711,7 +715,8 @@ void TGraphBentErrors::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
 
 //______________________________________________________________________________
-void TGraphBentErrors::SetPointError(Double_t exl, Double_t exh, Double_t eyl, Double_t eyh)
+void TGraphBentErrors::SetPointError(Double_t exl, Double_t exh, Double_t eyl, Double_t eyh,
+                                     Double_t exld, Double_t exhd, Double_t eyld, Double_t eyhd)
 {
    // Set ex and ey values for point pointed by the mouse.
 
@@ -729,16 +734,21 @@ void TGraphBentErrors::SetPointError(Double_t exl, Double_t exh, Double_t eyl, D
    }
    if (ipoint == -2) return;
 
-   fEXlow[ipoint]  = exl;
-   fEYlow[ipoint]  = eyl;
-   fEXhigh[ipoint] = exh;
-   fEYhigh[ipoint] = eyh;
+   fEXlow[ipoint]   = exl;
+   fEYlow[ipoint]   = eyl;
+   fEXhigh[ipoint]  = exh;
+   fEYhigh[ipoint]  = eyh;
+   fEXlowd[ipoint]  = exld;
+   fEXhighd[ipoint] = exhd;
+   fEYlowd[ipoint]  = eyld;
+   fEYhighd[ipoint] = eyhd;
    gPad->Modified();
 }
 
 
 //______________________________________________________________________________
-void TGraphBentErrors::SetPointError(Int_t i, Double_t exl, Double_t exh, Double_t eyl, Double_t eyh)
+void TGraphBentErrors::SetPointError(Int_t i, Double_t exl, Double_t exh, Double_t eyl, Double_t eyh,
+                                     Double_t exld, Double_t exhd, Double_t eyld, Double_t eyhd)
 {
    // Set ex and ey values for point number i.
 
@@ -747,10 +757,14 @@ void TGraphBentErrors::SetPointError(Int_t i, Double_t exl, Double_t exh, Double
    // re-allocate the object
       TGraphBentErrors::SetPoint(i,0,0);
    }
-   fEXlow[i]  = exl;
-   fEYlow[i]  = eyl;
-   fEXhigh[i] = exh;
-   fEYhigh[i] = eyh;
+   fEXlow[i]   = exl;
+   fEYlow[i]   = eyl;
+   fEXhigh[i]  = exh;
+   fEYhigh[i]  = eyh;
+   fEXlowd[i]  = exld;
+   fEXhighd[i] = exhd;
+   fEYlowd[i]  = eyld;
+   fEYhighd[i] = eyhd;
 }
 
 
-- 
GitLab