ROOT logo
// @(#)root/graf:$Id: TEllipse.cxx 29055 2009-06-17 14:15:02Z couet $
// Author: Rene Brun   16/10/95

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#include <stdlib.h>

#include "Riostream.h"
#include "TROOT.h"
#include "TEllipse.h"
#include "TVirtualPad.h"
#include "TMath.h"
#include "TClass.h"

const Double_t kPI = 3.14159265358979323846;

ClassImp(TEllipse)


//______________________________________________________________________________
/* Begin_Html
<center><h2>TEllipse : to draw ellipses</h2></center>
The ellipse can be truncated and rotated.
It is defined by its center <tt>(x1,y1)</tt> and two radius 
<tt>r1</tt> and <tt>r2</tt>.
A minimum and maximum angle may be specified <tt>(phimin, phimax)</tt>.
The ellipse may be rotated with an angle <tt>theta</tt>. All these
angles are in degrees.
The attributes of the outline line are given via <tt>TAttLine</tt>.
The attributes of the fill area are given via <tt>TAttFill</tt>.
The picture below illustrates different types of ellipses.
<p>
When an ellipse sector only is drawn, the lines connecting the center
of the ellipse to the edges are drawn by default. One can specify
the drawing option "only" to not draw these lines or alternatively
call the function <tt>SetNoEdges()</tt>. To remove completely the ellipse
outline it is enough to specify 0 as line style.
End_Html
Begin_Macro(source)
../../../tutorials/graphics/ellipse.C
End_Macro */


//______________________________________________________________________________
TEllipse::TEllipse(): TObject(), TAttLine(), TAttFill()
{
   // Ellipse default constructor.

   fX1 = 0;
   fY1 = 0;
   fR1 = 1;
   fR2 = 1;
   fPhimin = 0;
   fPhimax = 360;
   fTheta  = 0;
}


//______________________________________________________________________________
TEllipse::TEllipse(Double_t x1, Double_t y1,Double_t r1,Double_t r2,Double_t phimin,Double_t phimax,Double_t theta)
      :TObject(), TAttLine(), TAttFill(0,1001)
{
   // Ellipse normal constructor.

   fX1     = x1;
   fY1     = y1;
   fR1     = r1;
   fR2     = r2;
   fPhimin = phimin;
   fPhimax = phimax;
   fTheta  = theta;
   if (r2 <= 0) fR2 = fR1;
}


//______________________________________________________________________________
TEllipse::~TEllipse()
{
   // Ellipse default destructor.

}


//______________________________________________________________________________
TEllipse::TEllipse(const TEllipse &ellipse) : TObject(ellipse), TAttLine(ellipse), TAttFill(ellipse)
{
   // Copy constructor.

   ((TEllipse&)ellipse).Copy(*this);
}


//______________________________________________________________________________
void TEllipse::Copy(TObject &obj) const
{
   // Copy this ellipse to ellipse.

   TObject::Copy(obj);
   TAttLine::Copy(((TEllipse&)obj));
   TAttFill::Copy(((TEllipse&)obj));
   ((TEllipse&)obj).fX1 = fX1;
   ((TEllipse&)obj).fY1 = fY1;
   ((TEllipse&)obj).fR1 = fR1;
   ((TEllipse&)obj).fR2 = fR2;
   ((TEllipse&)obj).fPhimin = fPhimin;
   ((TEllipse&)obj).fPhimax = fPhimax;
   ((TEllipse&)obj).fTheta  = fTheta;
}


//______________________________________________________________________________
Int_t TEllipse::DistancetoPrimitive(Int_t px, Int_t py)
{
   // Compute distance from point px,py to an ellipse.
   //
   // Compute the closest distance of approach from point px,py to this
   // ellipse. The distance is computed in pixels units.
   //
   // In case of a filled ellipse the distance returned is 0 if the point
   // (px,py) is inside the ellipse, and is huge if the point is outside.

   Double_t x = gPad->PadtoX(gPad->AbsPixeltoX(px));
   Double_t y = gPad->PadtoY(gPad->AbsPixeltoY(py));

   Double_t dxnr = x - fX1;
   Double_t dynr = y - fY1;

   Double_t ct = TMath::Cos(kPI*GetTheta()/180.0);
   Double_t st = TMath::Sin(kPI*GetTheta()/180.0);

   Double_t dx =  dxnr*ct + dynr*st;
   Double_t dy = -dxnr*st + dynr*ct;

   Double_t r1 = fR1;
   Double_t r2 = fR2;

   if (dx == 0 || r1 == 0 || r2 == 0) return 9999;
   Double_t distp = TMath::Sqrt(dx*dx + dy*dy);

   Double_t tana = dy/dx;
   tana *= tana;
   Double_t distr = TMath::Sqrt((1+tana)/(1.0/(r1*r1) + tana/(r2*r2)));
   Int_t dist = 9999;
   if (GetFillColor() && GetFillStyle()) {
      if (distr > distp) dist = 0;
   } else {
      if (TMath::Abs(distr-distp)/(r1+r2) < 0.01) dist = 0;
   }
   return dist;
}


//______________________________________________________________________________
void TEllipse::Draw(Option_t *option)
{
   // Draw this ellipse with its current attributes.

   AppendPad(option);

}


//______________________________________________________________________________
void TEllipse::DrawEllipse(Double_t x1, Double_t y1,Double_t r1,Double_t r2,Double_t phimin,Double_t phimax,Double_t theta,Option_t *option)
{
   // Draw this ellipse with new coordinates.

   TEllipse *newellipse = new TEllipse(x1, y1, r1, r2, phimin, phimax,theta);
   TAttLine::Copy(*newellipse);
   TAttFill::Copy(*newellipse);
   newellipse->SetBit(kCanDelete);
   newellipse->AppendPad(option);
   if (TestBit(kNoEdges)) newellipse->SetBit(kNoEdges);
}


//______________________________________________________________________________
void TEllipse::ExecuteEvent(Int_t event, Int_t px, Int_t py)
{
   // Execute action corresponding to one event.
   //
   //  This member function is called when a line is clicked with the locator
   //
   //  If Left button clicked on one of the line end points, this point
   //     follows the cursor until button is released.
   //
   //  if Middle button clicked, the line is moved parallel to itself
   //     until the button is released.
   //
   //  NOTE that support for log scale is not implemented

   Int_t kMaxDiff = 10;
   const Int_t kMinSize = 25;
   const Int_t np = 40;
   static Int_t x[np+2], y[np+2];
   static Int_t px1,py1,npe,r1,r2,sav1,sav2;
   static Int_t pxold, pyold;
   static Int_t sig,impair;
   Int_t i, dpx, dpy;
   Double_t angle,dx,dy,dphi,ct,st,fTy,fBy,fLx,fRx;
   static Bool_t pTop, pL, pR, pBot, pINSIDE;
   static Int_t pTx,pTy,pLx,pLy,pRx,pRy,pBx,pBy;

   if (!gPad->IsEditable()) return;

   switch (event) {

   case kButton1Down:
      gVirtualX->SetLineColor(-1);
      TAttLine::Modify();
      dphi = (fPhimax-fPhimin)*kPI/(180*np);
      ct   = TMath::Cos(kPI*fTheta/180);
      st   = TMath::Sin(kPI*fTheta/180);
      for (i=0;i<np;i++) {
         angle = fPhimin*kPI/180 + Double_t(i)*dphi;
         dx    = fR1*TMath::Cos(angle);
         dy    = fR2*TMath::Sin(angle);
         x[i]  = gPad->XtoAbsPixel(fX1 + dx*ct - dy*st);
         y[i]  = gPad->YtoAbsPixel(fY1 + dx*st + dy*ct);
      }
      if (fPhimax-fPhimin >= 360 ) {
         x[np] = x[0];
         y[np] = y[0];
         npe = np;
      } else {
         x[np]   = gPad->XtoAbsPixel(fX1);
         y[np]   = gPad->YtoAbsPixel(fY1);
         x[np+1] = x[0];
         y[np+1] = y[0];
         npe = np + 1;
      }
      impair = 0;
      px1 = gPad->XtoAbsPixel(fX1);
      py1 = gPad->YtoAbsPixel(fY1);
      pTx = pBx = px1;
      pLy = pRy = py1;
      pTy = gPad->YtoAbsPixel(fR2+fY1);
      pBy = gPad->YtoAbsPixel(-fR2+fY1);
      pLx = gPad->XtoAbsPixel(-fR1+fX1);
      pRx = gPad->XtoAbsPixel(fR1+fX1);
      r2 = (pBy-pTy)/2;
      r1 = (pRx-pLx)/2;
      gVirtualX->DrawLine(pRx+4, py1+4, pRx-4, py1+4);
      gVirtualX->DrawLine(pRx-4, py1+4, pRx-4, py1-4);
      gVirtualX->DrawLine(pRx-4, py1-4, pRx+4, py1-4);
      gVirtualX->DrawLine(pRx+4, py1-4, pRx+4, py1+4);
      gVirtualX->DrawLine(pLx+4, py1+4, pLx-4, py1+4);
      gVirtualX->DrawLine(pLx-4, py1+4, pLx-4, py1-4);
      gVirtualX->DrawLine(pLx-4, py1-4, pLx+4, py1-4);
      gVirtualX->DrawLine(pLx+4, py1-4, pLx+4, py1+4);
      gVirtualX->DrawLine(px1+4, pBy+4, px1-4, pBy+4);
      gVirtualX->DrawLine(px1-4, pBy+4, px1-4, pBy-4);
      gVirtualX->DrawLine(px1-4, pBy-4, px1+4, pBy-4);
      gVirtualX->DrawLine(px1+4, pBy-4, px1+4, pBy+4);
      gVirtualX->DrawLine(px1+4, pTy+4, px1-4, pTy+4);
      gVirtualX->DrawLine(px1-4, pTy+4, px1-4, pTy-4);
      gVirtualX->DrawLine(px1-4, pTy-4, px1+4, pTy-4);
      gVirtualX->DrawLine(px1+4, pTy-4, px1+4, pTy+4);
      // No break !!!

   case kMouseMotion:
      px1 = gPad->XtoAbsPixel(fX1);
      py1 = gPad->YtoAbsPixel(fY1);
      pTx = pBx = px1;
      pLy = pRy = py1;
      pTy = gPad->YtoAbsPixel(fR2+fY1);
      pBy = gPad->YtoAbsPixel(-fR2+fY1);
      pLx = gPad->XtoAbsPixel(-fR1+fX1);
      pRx = gPad->XtoAbsPixel(fR1+fX1);
      pTop = pL = pR = pBot = pINSIDE = kFALSE;
      if ((TMath::Abs(px - pTx) < kMaxDiff) &&
          (TMath::Abs(py - pTy) < kMaxDiff)) {             // top edge
         pTop = kTRUE;
         gPad->SetCursor(kTopSide);
      }
      else
      if ((TMath::Abs(px - pBx) < kMaxDiff) &&
          (TMath::Abs(py - pBy) < kMaxDiff)) {             // bottom edge
         pBot = kTRUE;
         gPad->SetCursor(kBottomSide);
      }
      else
      if ((TMath::Abs(py - pLy) < kMaxDiff) &&
          (TMath::Abs(px - pLx) < kMaxDiff)) {             // left edge
         pL = kTRUE;
         gPad->SetCursor(kLeftSide);
      }
      else
      if ((TMath::Abs(py - pRy) < kMaxDiff) &&
          (TMath::Abs(px - pRx) < kMaxDiff)) {             // right edge
         pR = kTRUE;
         gPad->SetCursor(kRightSide);
      }
      else {pINSIDE= kTRUE; gPad->SetCursor(kMove); }
      pxold = px;  pyold = py;

      break;

   case kButton1Motion:
      gVirtualX->DrawLine(pRx+4, py1+4, pRx-4, py1+4);
      gVirtualX->DrawLine(pRx-4, py1+4, pRx-4, py1-4);
      gVirtualX->DrawLine(pRx-4, py1-4, pRx+4, py1-4);
      gVirtualX->DrawLine(pRx+4, py1-4, pRx+4, py1+4);
      gVirtualX->DrawLine(pLx+4, py1+4, pLx-4, py1+4);
      gVirtualX->DrawLine(pLx-4, py1+4, pLx-4, py1-4);
      gVirtualX->DrawLine(pLx-4, py1-4, pLx+4, py1-4);
      gVirtualX->DrawLine(pLx+4, py1-4, pLx+4, py1+4);
      gVirtualX->DrawLine(px1+4, pBy+4, px1-4, pBy+4);
      gVirtualX->DrawLine(px1-4, pBy+4, px1-4, pBy-4);
      gVirtualX->DrawLine(px1-4, pBy-4, px1+4, pBy-4);
      gVirtualX->DrawLine(px1+4, pBy-4, px1+4, pBy+4);
      gVirtualX->DrawLine(px1+4, pTy+4, px1-4, pTy+4);
      gVirtualX->DrawLine(px1-4, pTy+4, px1-4, pTy-4);
      gVirtualX->DrawLine(px1-4, pTy-4, px1+4, pTy-4);
      gVirtualX->DrawLine(px1+4, pTy-4, px1+4, pTy+4);
      for (i=0;i<npe;i++) gVirtualX->DrawLine(x[i], y[i], x[i+1], y[i+1]);
      if (pTop) {
         sav1 = py1;
         sav2 = r2;
         py1 += (py - pyold)/2;
         r2 -= (py - pyold)/2;
         if (TMath::Abs(pyold-py)%2==1) impair++;
         if (py-pyold>0) sig=+1;
         else sig=-1;
         if (impair==2) { impair = 0; py1 += sig; r2 -= sig;}
         if (py1 > pBy-kMinSize) {py1 = sav1; r2 = sav2; py = pyold;}
      }
      if (pBot) {
         sav1 = py1;
         sav2 = r2;
         py1 += (py - pyold)/2;
         r2 += (py - pyold)/2;
         if (TMath::Abs(pyold-py)%2==1) impair++;
         if (py-pyold>0) sig=+1;
         else sig=-1;
         if (impair==2) { impair = 0; py1 += sig; r2 += sig;}
         if (py1 < pTy+kMinSize) {py1 = sav1; r2 = sav2; py = pyold;}
      }
      if (pL) {
         sav1 = px1;
         sav2 = r1;
         px1 += (px - pxold)/2;
         r1 -= (px - pxold)/2;
         if (TMath::Abs(pxold-px)%2==1) impair++;
         if (px-pxold>0) sig=+1;
         else sig=-1;
         if (impair==2) { impair = 0; px1 += sig; r1 -= sig;}
         if (px1 > pRx-kMinSize) {px1 = sav1; r1 = sav2; px = pxold;}
      }
      if (pR) {
         sav1 = px1;
         sav2 = r1;
         px1 += (px - pxold)/2;
         r1 += (px - pxold)/2;
         if (TMath::Abs(pxold-px)%2==1) impair++;
         if (px-pxold>0) sig=+1;
         else sig=-1;
         if (impair==2) { impair = 0; px1 += sig; r1 += sig;}
         if (px1 < pLx+kMinSize) {px1 = sav1; r1 = sav2; px = pxold;}
      }
      if (pTop || pBot || pL || pR) {
         gVirtualX->SetLineColor(-1);
         TAttLine::Modify();
         dphi = (fPhimax-fPhimin)*kPI/(180*np);
         ct   = TMath::Cos(kPI*fTheta/180);
         st   = TMath::Sin(kPI*fTheta/180);
         for (i=0;i<np;i++) {
            angle = fPhimin*kPI/180 + Double_t(i)*dphi;
            dx    = r1*TMath::Cos(angle);
            dy    = r2*TMath::Sin(angle);
            x[i]  = px1 + Int_t(dx*ct - dy*st);
            y[i]  = py1 + Int_t(dx*st + dy*ct);
         }
         if (fPhimax-fPhimin >= 360 ) {
            x[np] = x[0];
            y[np] = y[0];
            npe = np;
         } else {
            x[np]   = px1;
            y[np]   = py1;
            x[np+1] = x[0];
            y[np+1] = y[0];
            npe = np + 1;
         }
         for (i=0;i<npe;i++) gVirtualX->DrawLine(x[i], y[i], x[i+1], y[i+1]);
      }
      if (pINSIDE) {
         dpx  = px-pxold;  dpy = py-pyold;
         px1 += dpx; py1 += dpy;
         for (i=0;i<=npe;i++) { x[i] += dpx; y[i] += dpy;}
         for (i=0;i<npe;i++) gVirtualX->DrawLine(x[i], y[i], x[i+1], y[i+1]);
      }
      pTx = pBx = px1;
      pRx = px1+r1;
      pLx = px1-r1;
      pRy = pLy = py1;
      pTy = py1-r2;
      pBy = py1+r2;
      gVirtualX->DrawLine(pRx+4, py1+4, pRx-4, py1+4);
      gVirtualX->DrawLine(pRx-4, py1+4, pRx-4, py1-4);
      gVirtualX->DrawLine(pRx-4, py1-4, pRx+4, py1-4);
      gVirtualX->DrawLine(pRx+4, py1-4, pRx+4, py1+4);
      gVirtualX->DrawLine(pLx+4, py1+4, pLx-4, py1+4);
      gVirtualX->DrawLine(pLx-4, py1+4, pLx-4, py1-4);
      gVirtualX->DrawLine(pLx-4, py1-4, pLx+4, py1-4);
      gVirtualX->DrawLine(pLx+4, py1-4, pLx+4, py1+4);
      gVirtualX->DrawLine(px1+4, pBy+4, px1-4, pBy+4);
      gVirtualX->DrawLine(px1-4, pBy+4, px1-4, pBy-4);
      gVirtualX->DrawLine(px1-4, pBy-4, px1+4, pBy-4);
      gVirtualX->DrawLine(px1+4, pBy-4, px1+4, pBy+4);
      gVirtualX->DrawLine(px1+4, pTy+4, px1-4, pTy+4);
      gVirtualX->DrawLine(px1-4, pTy+4, px1-4, pTy-4);
      gVirtualX->DrawLine(px1-4, pTy-4, px1+4, pTy-4);
      gVirtualX->DrawLine(px1+4, pTy-4, px1+4, pTy+4);
      pxold = px;
      pyold = py;
      break;

   case kButton1Up:
      if (gROOT->IsEscaped()) {
         gROOT->SetEscape(kFALSE);
         break;
      }

      fX1 = gPad->AbsPixeltoX(px1);
      fY1 = gPad->AbsPixeltoY(py1);
      fBy = gPad->AbsPixeltoY(py1+r2);
      fTy = gPad->AbsPixeltoY(py1-r2);
      fLx = gPad->AbsPixeltoX(px1+r1);
      fRx = gPad->AbsPixeltoX(px1-r1);
      fR1 = TMath::Abs(fRx-fLx)/2;
      fR2 = TMath::Abs(fTy-fBy)/2;
      gPad->Modified(kTRUE);
      gVirtualX->SetLineColor(-1);
   }
}


//______________________________________________________________________________
void TEllipse::ls(Option_t *) const
{
   // List this ellipse with its attributes.

   TROOT::IndentLevel();
   printf("%s:  X1= %f Y1=%f R1=%f R2=%f\n",GetName(),fX1,fY1,fR1,fR2);
}


//______________________________________________________________________________
void TEllipse::Paint(Option_t *option)
{
   // Paint this ellipse with its current attributes.

   PaintEllipse(fX1,fY1,fR1,fR2,fPhimin,fPhimax,fTheta,option);
}


//______________________________________________________________________________
void TEllipse::PaintEllipse(Double_t x1, Double_t y1, Double_t r1, Double_t r2,
                            Double_t phimin, Double_t phimax, Double_t theta,
                            Option_t *option)
{
   // Draw this ellipse with new coordinates.

   const Int_t np = 200;
   static Double_t x[np+3], y[np+3];
   TAttLine::Modify();  //Change line attributes only if necessary
   TAttFill::Modify();  //Change fill attributes only if necessary

   Double_t phi1 = TMath::Min(phimin,phimax);
   Double_t phi2 = TMath::Max(phimin,phimax);

   //set number of points approximatively proportional to the ellipse circumference
   Double_t circ = kPI*(r1+r2)*(phi2-phi1)/360;
   Int_t n = (Int_t)(np*circ/((gPad->GetX2()-gPad->GetX1())+(gPad->GetY2()-gPad->GetY1())));
   if (n < 8) n= 8;
   if (n > np) n = np;
   Double_t angle,dx,dy;
   Double_t dphi = (phi2-phi1)*kPI/(180*n);
   Double_t ct   = TMath::Cos(kPI*theta/180);
   Double_t st   = TMath::Sin(kPI*theta/180);
   for (Int_t i=0;i<=n;i++) {
      angle = phi1*kPI/180 + Double_t(i)*dphi;
      dx    = r1*TMath::Cos(angle);
      dy    = r2*TMath::Sin(angle);
      x[i]  = gPad->XtoPad(x1 + dx*ct - dy*st);
      y[i]  = gPad->YtoPad(y1 + dx*st + dy*ct);
   }
   TString opt = option;
   opt.ToLower();
   if (phi2-phi1 >= 360 ) {
      if (GetFillStyle()) gPad->PaintFillArea(n,x,y);
      if (GetLineStyle()) gPad->PaintPolyLine(n+1,x,y);
   } else {
      x[n+1] = gPad->XtoPad(x1);
      y[n+1] = gPad->YtoPad(y1);
      x[n+2] = x[0];
      y[n+2] = y[0];
      if (GetFillStyle()) gPad->PaintFillArea(n+2,x,y);
      if (GetLineStyle()) {
         if (TestBit(kNoEdges) || opt.Contains("only")) gPad->PaintPolyLine(n+1,x,y);
         else                                           gPad->PaintPolyLine(n+3,x,y);
      }
   }
}


//______________________________________________________________________________
void TEllipse::Print(Option_t *) const
{
   // Dump this ellipse with its attributes.

   printf("Ellipse:  X1=%f Y1=%f R1=%f R2=%f",fX1,fY1,fR1,fR2);
   if (GetLineColor() != 1) printf(" Color=%d",GetLineColor());
   if (GetLineStyle() != 1) printf(" Style=%d",GetLineStyle());
   if (GetLineWidth() != 1) printf(" Width=%d",GetLineWidth());
   printf("\n");
}


//______________________________________________________________________________
void TEllipse::SavePrimitive(ostream &out, Option_t * /*= ""*/)
{
   // Save primitive as a C++ statement(s) on output stream out

   out<<"   "<<endl;
   if (gROOT->ClassSaved(TEllipse::Class())) {
      out<<"   ";
   } else {
      out<<"   TEllipse *";
   }
   out<<"ellipse = new TEllipse("<<fX1<<","<<fY1<<","<<fR1<<","<<fR2
      <<","<<fPhimin<<","<<fPhimax<<","<<fTheta<<");"<<endl;

   SaveFillAttributes(out,"ellipse",0,1001);
   SaveLineAttributes(out,"ellipse",1,1,1);

   if (GetNoEdges()) out<<"   ellipse->SetNoEdges();"<<endl;

   out<<"   ellipse->Draw();"<<endl;
}


//______________________________________________________________________________
Bool_t TEllipse::GetNoEdges() const
{
   // Return kTRUE if kNoEdges bit is set, kFALSE otherwise.

   return TestBit(kNoEdges) ? kTRUE : kFALSE;
}


//______________________________________________________________________________
void TEllipse::SetNoEdges(Bool_t noEdges)
{
   // if  noEdges = kTRUE the lines connecting the center to the edges
   // will not be drawn.
   // default is to draw the edges.

   if (noEdges) SetBit(kNoEdges);
   else         ResetBit(kNoEdges);
}


//______________________________________________________________________________
void TEllipse::Streamer(TBuffer &R__b)
{
   // Stream an object of class TEllipse.

   if (R__b.IsReading()) {
      UInt_t R__s, R__c;
      Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
      if (R__v > 1) {
         R__b.ReadClassBuffer(TEllipse::Class(), this, R__v, R__s, R__c);
         return;
      }
      //====process old versions before automatic schema evolution
      TObject::Streamer(R__b);
      TAttLine::Streamer(R__b);
      TAttFill::Streamer(R__b);
      Float_t x1,y1,r1,r2,phimin,phimax,theta;
      R__b >> x1;     fX1 = x1;
      R__b >> y1;     fY1 = y1;
      R__b >> r1;     fR1 = r1;
      R__b >> r2;     fR2 = r2;
      R__b >> phimin; fPhimin = phimin;
      R__b >> phimax; fPhimax = phimax;
      R__b >> theta;  fTheta  = theta;
      R__b.CheckByteCount(R__s, R__c, TEllipse::IsA());
      //====end of old versions

   } else {
      R__b.WriteClassBuffer(TEllipse::Class(),this);
   }
}
 TEllipse.cxx:1
 TEllipse.cxx:2
 TEllipse.cxx:3
 TEllipse.cxx:4
 TEllipse.cxx:5
 TEllipse.cxx:6
 TEllipse.cxx:7
 TEllipse.cxx:8
 TEllipse.cxx:9
 TEllipse.cxx:10
 TEllipse.cxx:11
 TEllipse.cxx:12
 TEllipse.cxx:13
 TEllipse.cxx:14
 TEllipse.cxx:15
 TEllipse.cxx:16
 TEllipse.cxx:17
 TEllipse.cxx:18
 TEllipse.cxx:19
 TEllipse.cxx:20
 TEllipse.cxx:21
 TEllipse.cxx:22
 TEllipse.cxx:23
 TEllipse.cxx:24
 TEllipse.cxx:25
 TEllipse.cxx:26
 TEllipse.cxx:27
 TEllipse.cxx:28
 TEllipse.cxx:29
 TEllipse.cxx:30
 TEllipse.cxx:31
 TEllipse.cxx:32
 TEllipse.cxx:33
 TEllipse.cxx:34
 TEllipse.cxx:35
 TEllipse.cxx:36
 TEllipse.cxx:37
 TEllipse.cxx:38
 TEllipse.cxx:39
 TEllipse.cxx:40
 TEllipse.cxx:41
 TEllipse.cxx:42
 TEllipse.cxx:43
 TEllipse.cxx:44
 TEllipse.cxx:45
 TEllipse.cxx:46
 TEllipse.cxx:47
 TEllipse.cxx:48
 TEllipse.cxx:49
 TEllipse.cxx:50
 TEllipse.cxx:51
 TEllipse.cxx:52
 TEllipse.cxx:53
 TEllipse.cxx:54
 TEllipse.cxx:55
 TEllipse.cxx:56
 TEllipse.cxx:57
 TEllipse.cxx:58
 TEllipse.cxx:59
 TEllipse.cxx:60
 TEllipse.cxx:61
 TEllipse.cxx:62
 TEllipse.cxx:63
 TEllipse.cxx:64
 TEllipse.cxx:65
 TEllipse.cxx:66
 TEllipse.cxx:67
 TEllipse.cxx:68
 TEllipse.cxx:69
 TEllipse.cxx:70
 TEllipse.cxx:71
 TEllipse.cxx:72
 TEllipse.cxx:73
 TEllipse.cxx:74
 TEllipse.cxx:75
 TEllipse.cxx:76
 TEllipse.cxx:77
 TEllipse.cxx:78
 TEllipse.cxx:79
 TEllipse.cxx:80
 TEllipse.cxx:81
 TEllipse.cxx:82
 TEllipse.cxx:83
 TEllipse.cxx:84
 TEllipse.cxx:85
 TEllipse.cxx:86
 TEllipse.cxx:87
 TEllipse.cxx:88
 TEllipse.cxx:89
 TEllipse.cxx:90
 TEllipse.cxx:91
 TEllipse.cxx:92
 TEllipse.cxx:93
 TEllipse.cxx:94
 TEllipse.cxx:95
 TEllipse.cxx:96
 TEllipse.cxx:97
 TEllipse.cxx:98
 TEllipse.cxx:99
 TEllipse.cxx:100
 TEllipse.cxx:101
 TEllipse.cxx:102
 TEllipse.cxx:103
 TEllipse.cxx:104
 TEllipse.cxx:105
 TEllipse.cxx:106
 TEllipse.cxx:107
 TEllipse.cxx:108
 TEllipse.cxx:109
 TEllipse.cxx:110
 TEllipse.cxx:111
 TEllipse.cxx:112
 TEllipse.cxx:113
 TEllipse.cxx:114
 TEllipse.cxx:115
 TEllipse.cxx:116
 TEllipse.cxx:117
 TEllipse.cxx:118
 TEllipse.cxx:119
 TEllipse.cxx:120
 TEllipse.cxx:121
 TEllipse.cxx:122
 TEllipse.cxx:123
 TEllipse.cxx:124
 TEllipse.cxx:125
 TEllipse.cxx:126
 TEllipse.cxx:127
 TEllipse.cxx:128
 TEllipse.cxx:129
 TEllipse.cxx:130
 TEllipse.cxx:131
 TEllipse.cxx:132
 TEllipse.cxx:133
 TEllipse.cxx:134
 TEllipse.cxx:135
 TEllipse.cxx:136
 TEllipse.cxx:137
 TEllipse.cxx:138
 TEllipse.cxx:139
 TEllipse.cxx:140
 TEllipse.cxx:141
 TEllipse.cxx:142
 TEllipse.cxx:143
 TEllipse.cxx:144
 TEllipse.cxx:145
 TEllipse.cxx:146
 TEllipse.cxx:147
 TEllipse.cxx:148
 TEllipse.cxx:149
 TEllipse.cxx:150
 TEllipse.cxx:151
 TEllipse.cxx:152
 TEllipse.cxx:153
 TEllipse.cxx:154
 TEllipse.cxx:155
 TEllipse.cxx:156
 TEllipse.cxx:157
 TEllipse.cxx:158
 TEllipse.cxx:159
 TEllipse.cxx:160
 TEllipse.cxx:161
 TEllipse.cxx:162
 TEllipse.cxx:163
 TEllipse.cxx:164
 TEllipse.cxx:165
 TEllipse.cxx:166
 TEllipse.cxx:167
 TEllipse.cxx:168
 TEllipse.cxx:169
 TEllipse.cxx:170
 TEllipse.cxx:171
 TEllipse.cxx:172
 TEllipse.cxx:173
 TEllipse.cxx:174
 TEllipse.cxx:175
 TEllipse.cxx:176
 TEllipse.cxx:177
 TEllipse.cxx:178
 TEllipse.cxx:179
 TEllipse.cxx:180
 TEllipse.cxx:181
 TEllipse.cxx:182
 TEllipse.cxx:183
 TEllipse.cxx:184
 TEllipse.cxx:185
 TEllipse.cxx:186
 TEllipse.cxx:187
 TEllipse.cxx:188
 TEllipse.cxx:189
 TEllipse.cxx:190
 TEllipse.cxx:191
 TEllipse.cxx:192
 TEllipse.cxx:193
 TEllipse.cxx:194
 TEllipse.cxx:195
 TEllipse.cxx:196
 TEllipse.cxx:197
 TEllipse.cxx:198
 TEllipse.cxx:199
 TEllipse.cxx:200
 TEllipse.cxx:201
 TEllipse.cxx:202
 TEllipse.cxx:203
 TEllipse.cxx:204
 TEllipse.cxx:205
 TEllipse.cxx:206
 TEllipse.cxx:207
 TEllipse.cxx:208
 TEllipse.cxx:209
 TEllipse.cxx:210
 TEllipse.cxx:211
 TEllipse.cxx:212
 TEllipse.cxx:213
 TEllipse.cxx:214
 TEllipse.cxx:215
 TEllipse.cxx:216
 TEllipse.cxx:217
 TEllipse.cxx:218
 TEllipse.cxx:219
 TEllipse.cxx:220
 TEllipse.cxx:221
 TEllipse.cxx:222
 TEllipse.cxx:223
 TEllipse.cxx:224
 TEllipse.cxx:225
 TEllipse.cxx:226
 TEllipse.cxx:227
 TEllipse.cxx:228
 TEllipse.cxx:229
 TEllipse.cxx:230
 TEllipse.cxx:231
 TEllipse.cxx:232
 TEllipse.cxx:233
 TEllipse.cxx:234
 TEllipse.cxx:235
 TEllipse.cxx:236
 TEllipse.cxx:237
 TEllipse.cxx:238
 TEllipse.cxx:239
 TEllipse.cxx:240
 TEllipse.cxx:241
 TEllipse.cxx:242
 TEllipse.cxx:243
 TEllipse.cxx:244
 TEllipse.cxx:245
 TEllipse.cxx:246
 TEllipse.cxx:247
 TEllipse.cxx:248
 TEllipse.cxx:249
 TEllipse.cxx:250
 TEllipse.cxx:251
 TEllipse.cxx:252
 TEllipse.cxx:253
 TEllipse.cxx:254
 TEllipse.cxx:255
 TEllipse.cxx:256
 TEllipse.cxx:257
 TEllipse.cxx:258
 TEllipse.cxx:259
 TEllipse.cxx:260
 TEllipse.cxx:261
 TEllipse.cxx:262
 TEllipse.cxx:263
 TEllipse.cxx:264
 TEllipse.cxx:265
 TEllipse.cxx:266
 TEllipse.cxx:267
 TEllipse.cxx:268
 TEllipse.cxx:269
 TEllipse.cxx:270
 TEllipse.cxx:271
 TEllipse.cxx:272
 TEllipse.cxx:273
 TEllipse.cxx:274
 TEllipse.cxx:275
 TEllipse.cxx:276
 TEllipse.cxx:277
 TEllipse.cxx:278
 TEllipse.cxx:279
 TEllipse.cxx:280
 TEllipse.cxx:281
 TEllipse.cxx:282
 TEllipse.cxx:283
 TEllipse.cxx:284
 TEllipse.cxx:285
 TEllipse.cxx:286
 TEllipse.cxx:287
 TEllipse.cxx:288
 TEllipse.cxx:289
 TEllipse.cxx:290
 TEllipse.cxx:291
 TEllipse.cxx:292
 TEllipse.cxx:293
 TEllipse.cxx:294
 TEllipse.cxx:295
 TEllipse.cxx:296
 TEllipse.cxx:297
 TEllipse.cxx:298
 TEllipse.cxx:299
 TEllipse.cxx:300
 TEllipse.cxx:301
 TEllipse.cxx:302
 TEllipse.cxx:303
 TEllipse.cxx:304
 TEllipse.cxx:305
 TEllipse.cxx:306
 TEllipse.cxx:307
 TEllipse.cxx:308
 TEllipse.cxx:309
 TEllipse.cxx:310
 TEllipse.cxx:311
 TEllipse.cxx:312
 TEllipse.cxx:313
 TEllipse.cxx:314
 TEllipse.cxx:315
 TEllipse.cxx:316
 TEllipse.cxx:317
 TEllipse.cxx:318
 TEllipse.cxx:319
 TEllipse.cxx:320
 TEllipse.cxx:321
 TEllipse.cxx:322
 TEllipse.cxx:323
 TEllipse.cxx:324
 TEllipse.cxx:325
 TEllipse.cxx:326
 TEllipse.cxx:327
 TEllipse.cxx:328
 TEllipse.cxx:329
 TEllipse.cxx:330
 TEllipse.cxx:331
 TEllipse.cxx:332
 TEllipse.cxx:333
 TEllipse.cxx:334
 TEllipse.cxx:335
 TEllipse.cxx:336
 TEllipse.cxx:337
 TEllipse.cxx:338
 TEllipse.cxx:339
 TEllipse.cxx:340
 TEllipse.cxx:341
 TEllipse.cxx:342
 TEllipse.cxx:343
 TEllipse.cxx:344
 TEllipse.cxx:345
 TEllipse.cxx:346
 TEllipse.cxx:347
 TEllipse.cxx:348
 TEllipse.cxx:349
 TEllipse.cxx:350
 TEllipse.cxx:351
 TEllipse.cxx:352
 TEllipse.cxx:353
 TEllipse.cxx:354
 TEllipse.cxx:355
 TEllipse.cxx:356
 TEllipse.cxx:357
 TEllipse.cxx:358
 TEllipse.cxx:359
 TEllipse.cxx:360
 TEllipse.cxx:361
 TEllipse.cxx:362
 TEllipse.cxx:363
 TEllipse.cxx:364
 TEllipse.cxx:365
 TEllipse.cxx:366
 TEllipse.cxx:367
 TEllipse.cxx:368
 TEllipse.cxx:369
 TEllipse.cxx:370
 TEllipse.cxx:371
 TEllipse.cxx:372
 TEllipse.cxx:373
 TEllipse.cxx:374
 TEllipse.cxx:375
 TEllipse.cxx:376
 TEllipse.cxx:377
 TEllipse.cxx:378
 TEllipse.cxx:379
 TEllipse.cxx:380
 TEllipse.cxx:381
 TEllipse.cxx:382
 TEllipse.cxx:383
 TEllipse.cxx:384
 TEllipse.cxx:385
 TEllipse.cxx:386
 TEllipse.cxx:387
 TEllipse.cxx:388
 TEllipse.cxx:389
 TEllipse.cxx:390
 TEllipse.cxx:391
 TEllipse.cxx:392
 TEllipse.cxx:393
 TEllipse.cxx:394
 TEllipse.cxx:395
 TEllipse.cxx:396
 TEllipse.cxx:397
 TEllipse.cxx:398
 TEllipse.cxx:399
 TEllipse.cxx:400
 TEllipse.cxx:401
 TEllipse.cxx:402
 TEllipse.cxx:403
 TEllipse.cxx:404
 TEllipse.cxx:405
 TEllipse.cxx:406
 TEllipse.cxx:407
 TEllipse.cxx:408
 TEllipse.cxx:409
 TEllipse.cxx:410
 TEllipse.cxx:411
 TEllipse.cxx:412
 TEllipse.cxx:413
 TEllipse.cxx:414
 TEllipse.cxx:415
 TEllipse.cxx:416
 TEllipse.cxx:417
 TEllipse.cxx:418
 TEllipse.cxx:419
 TEllipse.cxx:420
 TEllipse.cxx:421
 TEllipse.cxx:422
 TEllipse.cxx:423
 TEllipse.cxx:424
 TEllipse.cxx:425
 TEllipse.cxx:426
 TEllipse.cxx:427
 TEllipse.cxx:428
 TEllipse.cxx:429
 TEllipse.cxx:430
 TEllipse.cxx:431
 TEllipse.cxx:432
 TEllipse.cxx:433
 TEllipse.cxx:434
 TEllipse.cxx:435
 TEllipse.cxx:436
 TEllipse.cxx:437
 TEllipse.cxx:438
 TEllipse.cxx:439
 TEllipse.cxx:440
 TEllipse.cxx:441
 TEllipse.cxx:442
 TEllipse.cxx:443
 TEllipse.cxx:444
 TEllipse.cxx:445
 TEllipse.cxx:446
 TEllipse.cxx:447
 TEllipse.cxx:448
 TEllipse.cxx:449
 TEllipse.cxx:450
 TEllipse.cxx:451
 TEllipse.cxx:452
 TEllipse.cxx:453
 TEllipse.cxx:454
 TEllipse.cxx:455
 TEllipse.cxx:456
 TEllipse.cxx:457
 TEllipse.cxx:458
 TEllipse.cxx:459
 TEllipse.cxx:460
 TEllipse.cxx:461
 TEllipse.cxx:462
 TEllipse.cxx:463
 TEllipse.cxx:464
 TEllipse.cxx:465
 TEllipse.cxx:466
 TEllipse.cxx:467
 TEllipse.cxx:468
 TEllipse.cxx:469
 TEllipse.cxx:470
 TEllipse.cxx:471
 TEllipse.cxx:472
 TEllipse.cxx:473
 TEllipse.cxx:474
 TEllipse.cxx:475
 TEllipse.cxx:476
 TEllipse.cxx:477
 TEllipse.cxx:478
 TEllipse.cxx:479
 TEllipse.cxx:480
 TEllipse.cxx:481
 TEllipse.cxx:482
 TEllipse.cxx:483
 TEllipse.cxx:484
 TEllipse.cxx:485
 TEllipse.cxx:486
 TEllipse.cxx:487
 TEllipse.cxx:488
 TEllipse.cxx:489
 TEllipse.cxx:490
 TEllipse.cxx:491
 TEllipse.cxx:492
 TEllipse.cxx:493
 TEllipse.cxx:494
 TEllipse.cxx:495
 TEllipse.cxx:496
 TEllipse.cxx:497
 TEllipse.cxx:498
 TEllipse.cxx:499
 TEllipse.cxx:500
 TEllipse.cxx:501
 TEllipse.cxx:502
 TEllipse.cxx:503
 TEllipse.cxx:504
 TEllipse.cxx:505
 TEllipse.cxx:506
 TEllipse.cxx:507
 TEllipse.cxx:508
 TEllipse.cxx:509
 TEllipse.cxx:510
 TEllipse.cxx:511
 TEllipse.cxx:512
 TEllipse.cxx:513
 TEllipse.cxx:514
 TEllipse.cxx:515
 TEllipse.cxx:516
 TEllipse.cxx:517
 TEllipse.cxx:518
 TEllipse.cxx:519
 TEllipse.cxx:520
 TEllipse.cxx:521
 TEllipse.cxx:522
 TEllipse.cxx:523
 TEllipse.cxx:524
 TEllipse.cxx:525
 TEllipse.cxx:526
 TEllipse.cxx:527
 TEllipse.cxx:528
 TEllipse.cxx:529
 TEllipse.cxx:530
 TEllipse.cxx:531
 TEllipse.cxx:532
 TEllipse.cxx:533
 TEllipse.cxx:534
 TEllipse.cxx:535
 TEllipse.cxx:536
 TEllipse.cxx:537
 TEllipse.cxx:538
 TEllipse.cxx:539
 TEllipse.cxx:540
 TEllipse.cxx:541
 TEllipse.cxx:542
 TEllipse.cxx:543
 TEllipse.cxx:544
 TEllipse.cxx:545
 TEllipse.cxx:546
 TEllipse.cxx:547
 TEllipse.cxx:548
 TEllipse.cxx:549
 TEllipse.cxx:550
 TEllipse.cxx:551
 TEllipse.cxx:552
 TEllipse.cxx:553
 TEllipse.cxx:554
 TEllipse.cxx:555
 TEllipse.cxx:556
 TEllipse.cxx:557
 TEllipse.cxx:558
 TEllipse.cxx:559
 TEllipse.cxx:560
 TEllipse.cxx:561
 TEllipse.cxx:562
 TEllipse.cxx:563
 TEllipse.cxx:564
 TEllipse.cxx:565
 TEllipse.cxx:566
 TEllipse.cxx:567
 TEllipse.cxx:568
 TEllipse.cxx:569
 TEllipse.cxx:570
 TEllipse.cxx:571
 TEllipse.cxx:572
 TEllipse.cxx:573
 TEllipse.cxx:574
 TEllipse.cxx:575
 TEllipse.cxx:576
 TEllipse.cxx:577
 TEllipse.cxx:578
 TEllipse.cxx:579
 TEllipse.cxx:580
 TEllipse.cxx:581
 TEllipse.cxx:582
 TEllipse.cxx:583
 TEllipse.cxx:584
 TEllipse.cxx:585
 TEllipse.cxx:586
 TEllipse.cxx:587
 TEllipse.cxx:588
 TEllipse.cxx:589
 TEllipse.cxx:590
 TEllipse.cxx:591
 TEllipse.cxx:592
 TEllipse.cxx:593
 TEllipse.cxx:594
 TEllipse.cxx:595
 TEllipse.cxx:596
 TEllipse.cxx:597
 TEllipse.cxx:598
 TEllipse.cxx:599
 TEllipse.cxx:600
 TEllipse.cxx:601