Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TCurlyLine.h
Go to the documentation of this file.
1 // @(#)root/graf:$Id$
2 // Author: Otto Schaile 20/11/99
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 #ifndef ROOT_TCurlyLine
12 #define ROOT_TCurlyLine
13 
14 
15 #include "TPolyLine.h"
16 #include "TAttBBox2D.h"
17 #include "GuiTypes.h"
18 
19 class TPoint;
20 
21 class TCurlyLine : public TPolyLine , public TAttBBox2D {
22 
23 protected:
24  Double_t fX1; ///< start x, center for arc
25  Double_t fY1; ///< start y, center for arc
26  Double_t fX2; ///< end x
27  Double_t fY2; ///< end y
28  Double_t fWaveLength; ///< wavelength of sinusoid in percent of pad height
29  Double_t fAmplitude; ///< amplitude of sinusoid in percent of pad height
30  Int_t fNsteps; ///< used internally (controls precision)
31  Bool_t fIsCurly; ///< true: Gluon, false: Gamma
32 
33  static Double_t fgDefaultWaveLength; ///< default wavelength
34  static Double_t fgDefaultAmplitude; ///< default amplitude
35  static Bool_t fgDefaultIsCurly; ///< default curly type
36 
37 public:
38  TCurlyLine();
39  TCurlyLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2,
40  Double_t wl = .02,
41  Double_t amp = .01);
42  virtual ~TCurlyLine(){;}
43  virtual void Build();
44  Int_t DistancetoPrimitive(Int_t px, Int_t py);
45  void ExecuteEvent(Int_t event, Int_t px, Int_t py);
46  Bool_t GetCurly() const {return fIsCurly;}
47  Double_t GetWaveLength() const{return fWaveLength;}
48  Double_t GetAmplitude() const {return fAmplitude;}
49  Double_t GetStartX() const {return fX1;}
50  Double_t GetEndX() const {return fX2;}
51  Double_t GetStartY() const {return fY1;}
52  Double_t GetEndY() const {return fY2;}
53  virtual void SetCurly(); // *MENU*
54  virtual void SetWavy(); // *MENU*
55  virtual void SetWaveLength(Double_t WaveLength); // *MENU* *ARGS={WaveLength=>fWaveLength}
56  virtual void SetAmplitude(Double_t x); // *MENU* *ARGS={x=>fAmplitude}
57  virtual void SetStartPoint(Double_t x1, Double_t y1);
58  virtual void SetEndPoint (Double_t x2, Double_t y2);
59  virtual void SavePrimitive(std::ostream &out, Option_t * = "");
60 
61  static void SetDefaultWaveLength(Double_t WaveLength);
62  static void SetDefaultAmplitude (Double_t Amplitude );
63  static void SetDefaultIsCurly (Bool_t IsCurly );
64  static Double_t GetDefaultWaveLength();
65  static Double_t GetDefaultAmplitude ();
66  static Bool_t GetDefaultIsCurly ();
67  virtual Rectangle_t GetBBox();
68  virtual TPoint GetBBoxCenter();
69  virtual void SetBBoxCenter(const TPoint &p);
70  virtual void SetBBoxCenterX(const Int_t x);
71  virtual void SetBBoxCenterY(const Int_t y);
72  virtual void SetBBoxX1(const Int_t x);
73  virtual void SetBBoxX2(const Int_t x);
74  virtual void SetBBoxY1(const Int_t y);
75  virtual void SetBBoxY2(const Int_t y);
76 
77  ClassDef(TCurlyLine,3) // A curly polyline
78 };
79 
80 #endif