ROOT logo
// @(#)root/graf:$Id: TArc.cxx 20882 2007-11-19 11:31:26Z rdm $
// 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 "Riostream.h"
#include "TROOT.h"
#include "TArc.h"
#include "TVirtualPad.h"

ClassImp(TArc)

//______________________________________________________________________________
//
//  An arc is specified with the position of its centre, its radius
//  a minimum and maximum angle.
//  The attributes of the outline line are given via TAttLine
//  The attributes of the fill area are given via TAttFill
//


//______________________________________________________________________________
TArc::TArc(): TEllipse()
{
  // Arc  default constructor.
}


//______________________________________________________________________________
TArc::TArc(Double_t x1, Double_t y1,Double_t r1,Double_t phimin,Double_t phimax)
      :TEllipse(x1,y1,r1,r1,phimin,phimax,0)
{
   // Arc  normal constructor.
   //
   //  x1,y1  : coordinates of centre of arc
   //  r1     : arc radius
   //  phimin : min and max angle in degrees (default is 0-->360)
   //  phimax :
   //
   //  When a circle sector only is drawn, the lines connecting the center
   //  of the arc to the edges are drawn by default. One can specify
   //  the drawing option "only" to not draw these lines.
}


//______________________________________________________________________________
TArc::TArc(const TArc &arc) : TEllipse(arc)
{
   // Copy constructor.

   ((TArc&)arc).Copy(*this);
}


//______________________________________________________________________________
TArc::~TArc()
{
   // Arc default destructor.
}


//______________________________________________________________________________
void TArc::Copy(TObject &arc) const
{
   // Copy this arc to arc.

   TEllipse::Copy(arc);
}


//______________________________________________________________________________
void TArc::DrawArc(Double_t x1, Double_t y1,Double_t r1,Double_t phimin,Double_t phimax,Option_t *option)
{
   // Draw this arc with new coordinates.

   TArc *newarc = new TArc(x1, y1, r1, phimin, phimax);
   TAttLine::Copy(*newarc);
   TAttFill::Copy(*newarc);
   newarc->SetBit(kCanDelete);
   newarc->AppendPad(option);
}


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

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

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

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

   out<<"   arc->Draw();"<<endl;
}
 TArc.cxx:1
 TArc.cxx:2
 TArc.cxx:3
 TArc.cxx:4
 TArc.cxx:5
 TArc.cxx:6
 TArc.cxx:7
 TArc.cxx:8
 TArc.cxx:9
 TArc.cxx:10
 TArc.cxx:11
 TArc.cxx:12
 TArc.cxx:13
 TArc.cxx:14
 TArc.cxx:15
 TArc.cxx:16
 TArc.cxx:17
 TArc.cxx:18
 TArc.cxx:19
 TArc.cxx:20
 TArc.cxx:21
 TArc.cxx:22
 TArc.cxx:23
 TArc.cxx:24
 TArc.cxx:25
 TArc.cxx:26
 TArc.cxx:27
 TArc.cxx:28
 TArc.cxx:29
 TArc.cxx:30
 TArc.cxx:31
 TArc.cxx:32
 TArc.cxx:33
 TArc.cxx:34
 TArc.cxx:35
 TArc.cxx:36
 TArc.cxx:37
 TArc.cxx:38
 TArc.cxx:39
 TArc.cxx:40
 TArc.cxx:41
 TArc.cxx:42
 TArc.cxx:43
 TArc.cxx:44
 TArc.cxx:45
 TArc.cxx:46
 TArc.cxx:47
 TArc.cxx:48
 TArc.cxx:49
 TArc.cxx:50
 TArc.cxx:51
 TArc.cxx:52
 TArc.cxx:53
 TArc.cxx:54
 TArc.cxx:55
 TArc.cxx:56
 TArc.cxx:57
 TArc.cxx:58
 TArc.cxx:59
 TArc.cxx:60
 TArc.cxx:61
 TArc.cxx:62
 TArc.cxx:63
 TArc.cxx:64
 TArc.cxx:65
 TArc.cxx:66
 TArc.cxx:67
 TArc.cxx:68
 TArc.cxx:69
 TArc.cxx:70
 TArc.cxx:71
 TArc.cxx:72
 TArc.cxx:73
 TArc.cxx:74
 TArc.cxx:75
 TArc.cxx:76
 TArc.cxx:77
 TArc.cxx:78
 TArc.cxx:79
 TArc.cxx:80
 TArc.cxx:81
 TArc.cxx:82
 TArc.cxx:83
 TArc.cxx:84
 TArc.cxx:85
 TArc.cxx:86
 TArc.cxx:87
 TArc.cxx:88
 TArc.cxx:89
 TArc.cxx:90
 TArc.cxx:91
 TArc.cxx:92
 TArc.cxx:93
 TArc.cxx:94
 TArc.cxx:95
 TArc.cxx:96
 TArc.cxx:97
 TArc.cxx:98
 TArc.cxx:99
 TArc.cxx:100
 TArc.cxx:101
 TArc.cxx:102
 TArc.cxx:103
 TArc.cxx:104
 TArc.cxx:105
 TArc.cxx:106
 TArc.cxx:107
 TArc.cxx:108
 TArc.cxx:109
 TArc.cxx:110