Logo ROOT   6.10/09
Reference Guide
Go to the documentation of this file.
1 // @(#)root/graf:$Id$
2 // Author: Rene Brun 17/10/95
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  *************************************************************************/
12 #ifndef ROOT_TArrow
13 #define ROOT_TArrow
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TArrow //
19 // //
20 // One arrow --->. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
24 #include "TString.h"
25 #include "TLine.h"
26 #include "TAttFill.h"
29 class TArrow : public TLine, public TAttFill {
30 protected:
31  Float_t fAngle; ///< Arrow opening angle (degrees)
32  Float_t fArrowSize; ///< Arrow Size
33  TString fOption; ///< Arrow shapes
35  static Float_t fgDefaultAngle; ///< Default Arrow opening angle (degrees)
36  static Float_t fgDefaultArrowSize; ///< Default Arrow Size
37  static TString fgDefaultOption; ///< Default Arrow shapes
39 public:
40  TArrow();
42  ,Float_t arrowsize=0.05
43  ,Option_t *option=">");
44  TArrow(const TArrow &arrow);
45  virtual ~TArrow();
46  void Copy(TObject &arrow) const;
48  virtual void Draw(Option_t *option="");
49  virtual void DrawArrow(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2
50  ,Float_t arrowsize=0 ,Option_t *option="");
51  Float_t GetAngle() const {return fAngle;}
52  Float_t GetArrowSize() const {return fArrowSize;}
53  Option_t *GetOption() const { return fOption.Data();}
54  virtual void Paint(Option_t *option="");
55  virtual void PaintArrow(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2
56  ,Float_t arrowsize=0.05 ,Option_t *option=">");
57  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
58  virtual void SetAngle(Float_t angle=60) {fAngle=angle;} // *MENU*
59  virtual void SetArrowSize(Float_t arrowsize=0.05) {fArrowSize=arrowsize;} // *MENU*
60  virtual void SetOption(Option_t *option=">"){ fOption = option;}
62  static void SetDefaultAngle (Float_t Angle );
63  static void SetDefaultArrowSize (Float_t ArrowSize);
64  static void SetDefaultOption (Option_t *Option );
65  static Float_t GetDefaultAngle ();
67  static Option_t *GetDefaultOption ();
69  ClassDef(TArrow,1) // An arrow (line with a arrowhead)
70 };
72 #endif
virtual void Paint(Option_t *option="")
Paint this arrow with its current attributes.
Definition: TArrow.cxx:160
Float_t GetArrowSize() const
Definition: TArrow.h:52
static Float_t GetDefaultAngle()
Get default angle.
Definition: TArrow.cxx:413
float Float_t
Definition: RtypesCore.h:53
void Copy(TObject &arrow) const
Copy this arrow to arrow.
Definition: TArrow.cxx:109
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:139
Basic string class.
Definition: TString.h:129
static void SetDefaultAngle(Float_t Angle)
Set default angle.
Definition: TArrow.cxx:383
static TString fgDefaultOption
Default Arrow shapes.
Definition: TArrow.h:37
static Float_t fgDefaultArrowSize
Default Arrow Size.
Definition: TArrow.h:36
static const double x2[5]
Fill Area Attributes class.
Definition: TAttFill.h:19
static Float_t GetDefaultArrowSize()
Get default arrow size.
Definition: TArrow.cxx:423
#define ClassDef(name, id)
Definition: Rtypes.h:297
TArrow * arrow
virtual void Draw(Option_t *option="")
Draw this arrow with its current attributes.
Definition: TArrow.cxx:122
static void SetDefaultOption(Option_t *Option)
Set default option.
Definition: TArrow.cxx:403
virtual void SetArrowSize(Float_t arrowsize=0.05)
Definition: TArrow.h:59
static void SetDefaultArrowSize(Float_t ArrowSize)
Set default arrow sive.
Definition: TArrow.cxx:393
double Angle(const Vector1 &v1, const Vector2 &v2)
Find Angle between two vectors.
Definition: VectorUtil.h:138
static Float_t fgDefaultAngle
Default Arrow opening angle (degrees)
Definition: TArrow.h:35
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:173
Arrow default constructor.
Definition: TArrow.cxx:47
A simple line.
Definition: TLine.h:23
Float_t fAngle
Arrow opening angle (degrees)
Definition: TArrow.h:31
virtual void SetOption(Option_t *option=">")
Definition: TArrow.h:60
static const double x1[5]
Option_t * GetOption() const
Definition: TArrow.h:53
double Double_t
Definition: RtypesCore.h:55
Mother of all ROOT objects.
Definition: TObject.h:37
static Option_t * GetDefaultOption()
Get default option.
Definition: TArrow.cxx:433
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TArrow.cxx:357
Float_t GetAngle() const
Definition: TArrow.h:51
TString fOption
Arrow shapes.
Definition: TArrow.h:33
Float_t fArrowSize
Arrow Size.
Definition: TArrow.h:32
Draw all kinds of Arrows.
Definition: TArrow.h:29
virtual ~TArrow()
Arrow default destructor.
Definition: TArrow.cxx:91
virtual void SetAngle(Float_t angle=60)
Definition: TArrow.h:58
const char * Data() const
Definition: TString.h:347