ROOT  6.06/09
Reference Guide
TArrow.h
Go to the documentation of this file.
1 // @(#)root/graf:$Id$
2 // Author: Rene Brun 17/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 #ifndef ROOT_TArrow
13 #define ROOT_TArrow
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TArrow //
19 // //
20 // One arrow --->. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #ifndef ROOT_TString
25 #include "TString.h"
26 #endif
27 #ifndef ROOT_TLine
28 #include "TLine.h"
29 #endif
30 #ifndef ROOT_TAttFill
31 #include "TAttFill.h"
32 #endif
33 
34 
35 class TArrow : public TLine, public TAttFill {
36 protected:
37  Float_t fAngle; //Arrow opening angle (degrees)
38  Float_t fArrowSize; //Arrow Size
39  TString fOption; //Arrow shapes
40 
41  static Float_t fgDefaultAngle; //default Arrow opening angle (degrees)
42  static Float_t fgDefaultArrowSize; //default Arrow Size
43  static TString fgDefaultOption; //default Arrow shapes
44 
45 public:
46  TArrow();
48  ,Float_t arrowsize=0.05
49  ,Option_t *option=">");
50  TArrow(const TArrow &arrow);
51  virtual ~TArrow();
52  void Copy(TObject &arrow) const;
53 
54  virtual void Draw(Option_t *option="");
55  virtual void DrawArrow(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2
56  ,Float_t arrowsize=0 ,Option_t *option="");
57  Float_t GetAngle() const {return fAngle;}
58  Float_t GetArrowSize() const {return fArrowSize;}
59  Option_t *GetOption() const { return fOption.Data();}
60  virtual void Paint(Option_t *option="");
61  virtual void PaintArrow(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2
62  ,Float_t arrowsize=0.05 ,Option_t *option=">");
63  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
64  virtual void SetAngle(Float_t angle=60) {fAngle=angle;} // *MENU*
65  virtual void SetArrowSize(Float_t arrowsize=0.05) {fArrowSize=arrowsize;} // *MENU*
66  virtual void SetOption(Option_t *option=">"){ fOption = option;}
67 
68  static void SetDefaultAngle (Float_t Angle );
69  static void SetDefaultArrowSize (Float_t ArrowSize);
70  static void SetDefaultOption (Option_t *Option );
71  static Float_t GetDefaultAngle ();
73  static Option_t *GetDefaultOption ();
74 
75  ClassDef(TArrow,1) // An arrow (line with a arrowhead)
76 };
77 
78 #endif
virtual void Paint(Option_t *option="")
Paint this arrow with its current attributes.
Definition: TArrow.cxx:159
static Float_t GetDefaultAngle()
Get default angle.
Definition: TArrow.cxx:408
Option_t * GetOption() const
Definition: TArrow.h:59
ClassDef(TAttBBox2D, 0)
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
virtual void DrawArrow(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Float_t arrowsize=0, Option_t *option="")
Draw this arrow with new coordinates.
Definition: TArrow.cxx:138
Basic string class.
Definition: TString.h:137
Float_t GetAngle() const
Definition: TArrow.h:57
static void SetDefaultAngle(Float_t Angle)
Set default angle.
Definition: TArrow.cxx:378
static TString fgDefaultOption
Definition: TArrow.h:43
static Float_t fgDefaultArrowSize
Definition: TArrow.h:42
const char * Data() const
Definition: TString.h:349
static const double x2[5]
Fill Area Attributes class.
Definition: TAttFill.h:32
static Float_t GetDefaultArrowSize()
Get default arrow size.
Definition: TArrow.cxx:418
TArrow * arrow
virtual void Draw(Option_t *option="")
Draw this arrow with its current attributes.
Definition: TArrow.cxx:121
static void SetDefaultOption(Option_t *Option)
Set default option.
Definition: TArrow.cxx:398
virtual void SetArrowSize(Float_t arrowsize=0.05)
Definition: TArrow.h:65
void Copy(TObject &arrow) const
Copy this arrow to arrow.
Definition: TArrow.cxx:108
char * out
Definition: TBase64.cxx:29
static void SetDefaultArrowSize(Float_t ArrowSize)
Set default arrow sive.
Definition: TArrow.cxx:388
Float_t GetArrowSize() const
Definition: TArrow.h:58
static Float_t fgDefaultAngle
Definition: TArrow.h:41
virtual void PaintArrow(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Float_t arrowsize=0.05, Option_t *option=">")
Draw this arrow.
Definition: TArrow.cxx:172
A simple line.
Definition: TLine.h:41
Float_t fAngle
Definition: TArrow.h:37
virtual void SetOption(Option_t *option=">")
Definition: TArrow.h:66
static const double x1[5]
double Double_t
Definition: RtypesCore.h:55
Mother of all ROOT objects.
Definition: TObject.h:58
static Option_t * GetDefaultOption()
Get default option.
Definition: TArrow.cxx:428
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TArrow.cxx:352
TString fOption
Definition: TArrow.h:39
Float_t fArrowSize
Definition: TArrow.h:38
Draw all kinds of Arrows.
Definition: TArrow.h:35
Double_t Angle(const TVector2 &v1, const TVector2 &v2)
Definition: CsgOps.cxx:368
virtual ~TArrow()
Arrow default destructor.
Definition: TArrow.cxx:90
virtual void SetAngle(Float_t angle=60)
Definition: TArrow.h:64