Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 #include "TString.h"
25 #include "TLine.h"
26 #include "TAttFill.h"
27 
28 
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
34 
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
38 
39 public:
40  TArrow();
41  TArrow(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2
42  ,Float_t arrowsize=0.05
43  ,Option_t *option=">");
44  TArrow(const TArrow &arrow);
45  virtual ~TArrow();
46  void Copy(TObject &arrow) const;
47 
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;}
61 
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 ();
66  static Float_t GetDefaultArrowSize();
67  static Option_t *GetDefaultOption ();
68 
69  ClassDef(TArrow,1) // An arrow (line with a arrowhead)
70 };
71 
72 #endif