Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TArc.cxx
Go to the documentation of this file.
1// @(#)root/graf:$Id$
2// Author: Rene Brun 16/10/95
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include "TArc.h"
13#include "TString.h"
14
15#include <iostream>
16
17
18/** \class TArc
19\ingroup BasicGraphics
20
21Create an Arc.
22
23An arc is specified with the position of its centre, its radius a minimum and
24maximum angle. The attributes of the outline line are given via TAttLine. The
25attributes of the fill area are given via TAttFill
26*/
27
28////////////////////////////////////////////////////////////////////////////////
29/// Arc default constructor.
30
32{
33}
34
35////////////////////////////////////////////////////////////////////////////////
36/// Arc normal constructor.
37///
38/// \param[in] x1,y1 coordinates of centre of arc
39/// \param[in] r1 arc radius
40/// \param[in] phimin min angle in degrees (default is 0-->360)
41/// \param[in] phimax max angle in degrees (default is 0-->360)
42///
43/// When a circle sector only is drawn, the lines connecting the center
44/// of the arc to the edges are drawn by default. One can specify
45/// the drawing option "only" to not draw these lines.
46
51
52////////////////////////////////////////////////////////////////////////////////
53/// Copy constructor.
54
56{
57 arc.TArc::Copy(*this);
58}
59
60////////////////////////////////////////////////////////////////////////////////
61/// Arc default destructor.
62
64{
65}
66
67////////////////////////////////////////////////////////////////////////////////
68/// Copy this arc to arc.
69
71{
73}
74
75////////////////////////////////////////////////////////////////////////////////
76/// Draw this arc with new coordinates.
77
87
88////////////////////////////////////////////////////////////////////////////////
89/// Save primitive as a C++ statement(s) on output stream out
90
91void TArc::SavePrimitive(std::ostream &out, Option_t *option)
92{
93 SavePrimitiveConstructor(out, Class(), "arc",
94 TString::Format("%g, %g, %g, %g, %g", fX1, fY1, fR1, fPhimin, fPhimax));
95
96 SaveFillAttributes(out, "arc", 0, 1001);
97 SaveLineAttributes(out, "arc", 1, 1, 1);
98
99 if (GetNoEdges())
100 out << " arc->SetNoEdges();\n";
101
102 SavePrimitiveDraw(out, "arc", option);
103}
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t option
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y1
Create an Arc.
Definition TArc.h:26
~TArc() override
Arc default destructor.
Definition TArc.cxx:63
static TClass * Class()
TArc()
Arc default constructor.
Definition TArc.cxx:31
virtual TArc * DrawArc(Double_t x1, Double_t y1, Double_t radius, Double_t phimin=0, Double_t phimax=360, Option_t *option="")
Draw this arc with new coordinates.
Definition TArc.cxx:78
void Copy(TObject &arc) const override
Copy this arc to arc.
Definition TArc.cxx:70
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
Definition TArc.cxx:91
void Copy(TAttFill &attfill) const
Copy this fill attributes to a new TAttFill.
Definition TAttFill.cxx:206
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
Save fill attributes as C++ statement(s) on output stream out.
Definition TAttFill.cxx:238
void Copy(TAttLine &attline) const
Copy this line attributes to a new TAttLine.
Definition TAttLine.cxx:176
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
Definition TAttLine.cxx:274
Draw Ellipses.
Definition TEllipse.h:23
Double_t fPhimax
Maximum angle (degrees)
Definition TEllipse.h:31
Double_t fX1
X coordinate of centre.
Definition TEllipse.h:26
Bool_t GetNoEdges() const
Return kTRUE if kNoEdges bit is set, kFALSE otherwise.
Definition TEllipse.cxx:641
Double_t fY1
Y coordinate of centre.
Definition TEllipse.h:27
void Copy(TObject &ellipse) const override
Copy this ellipse to ellipse.
Definition TEllipse.cxx:109
Double_t fPhimin
Minimum angle (degrees)
Definition TEllipse.h:30
Double_t fR1
first radius
Definition TEllipse.h:28
Mother of all ROOT objects.
Definition TObject.h:41
static void SavePrimitiveDraw(std::ostream &out, const char *variable_name, Option_t *option=nullptr)
Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
Definition TObject.cxx:822
static void SavePrimitiveConstructor(std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
Save object constructor in the output stream "out".
Definition TObject.cxx:771
@ kCanDelete
if object in a list can be deleted
Definition TObject.h:68
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2384