Logo ROOT   6.08/07
Reference Guide
Go to the documentation of this file.
1 // @(#)root/graf:$Id$
2 // Author: Otto Schaile 20/11/99
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
15 #ifndef ROOT_Riosfwd
16 #include "Riosfwd.h"
17 #endif
18 #ifndef ROOT_TPolyLine
19 #include "TPolyLine.h"
20 #endif
21 #ifndef ROOT_TAttBBox2D
22 #include "TAttBBox2D.h"
23 #endif
24 #ifndef ROOT_GuiTypes
25 #include "GuiTypes.h"
26 #endif
28 class TPoint;
30 class TCurlyLine : public TPolyLine , public TAttBBox2D {
32 protected:
33  Double_t fX1; ///< start x, center for arc
34  Double_t fY1; ///< start y, center for arc
35  Double_t fX2; ///< end x
36  Double_t fY2; ///< end y
37  Double_t fWaveLength; ///< wavelength of sinusoid in percent of pad height
38  Double_t fAmplitude; ///< amplitude of sinusoid in percent of pad height
39  Int_t fNsteps; ///< used internally (controls precision)
40  Bool_t fIsCurly; ///< true: Gluon, false: Gamma
42  static Double_t fgDefaultWaveLength; ///< default wavelength
43  static Double_t fgDefaultAmplitude; ///< default amplitude
44  static Bool_t fgDefaultIsCurly; ///< default curly type
46 public:
47  TCurlyLine();
49  Double_t wl = .02,
50  Double_t amp = .01);
51  virtual ~TCurlyLine(){;}
52  virtual void Build();
54  void ExecuteEvent(Int_t event, Int_t px, Int_t py);
55  Bool_t GetCurly() const {return fIsCurly;}
57  Double_t GetAmplitude() const {return fAmplitude;}
58  Double_t GetStartX() const {return fX1;}
59  Double_t GetEndX() const {return fX2;}
60  Double_t GetStartY() const {return fY1;}
61  Double_t GetEndY() const {return fY2;}
62  virtual void SetCurly(); // *MENU*
63  virtual void SetWavy(); // *MENU*
64  virtual void SetWaveLength(Double_t WaveLength); // *MENU* *ARGS={WaveLength=>fWaveLength}
65  virtual void SetAmplitude(Double_t x); // *MENU* *ARGS={x=>fAmplitude}
66  virtual void SetStartPoint(Double_t x1, Double_t y1);
67  virtual void SetEndPoint (Double_t x2, Double_t y2);
68  virtual void SavePrimitive(std::ostream &out, Option_t * = "");
70  static void SetDefaultWaveLength(Double_t WaveLength);
71  static void SetDefaultAmplitude (Double_t Amplitude );
72  static void SetDefaultIsCurly (Bool_t IsCurly );
74  static Double_t GetDefaultAmplitude ();
75  static Bool_t GetDefaultIsCurly ();
76  virtual Rectangle_t GetBBox();
77  virtual TPoint GetBBoxCenter();
78  virtual void SetBBoxCenter(const TPoint &p);
79  virtual void SetBBoxCenterX(const Int_t x);
80  virtual void SetBBoxCenterY(const Int_t y);
81  virtual void SetBBoxX1(const Int_t x);
82  virtual void SetBBoxX2(const Int_t x);
83  virtual void SetBBoxY1(const Int_t y);
84  virtual void SetBBoxY2(const Int_t y);
86  ClassDef(TCurlyLine,3) // A curly polyline
87 };
89 #endif
static Double_t GetDefaultWaveLength()
Get default wave length.
Definition: TCurlyLine.cxx:441
virtual Rectangle_t GetBBox()
Return the bounding Box of the CurlyLine.
Definition: TCurlyLine.cxx:465
static Bool_t GetDefaultIsCurly()
Get default "IsCurly".
Definition: TCurlyLine.cxx:457
Default constructor.
Definition: TCurlyLine.cxx:47
Bool_t fIsCurly
true: Gluon, false: Gamma
Definition: TCurlyLine.h:40
Double_t fY2
end y
Definition: TCurlyLine.h:36
const char Option_t
Definition: RtypesCore.h:62
virtual void SetBBoxCenterX(const Int_t x)
Set X coordinate of the center of the BoundingBox.
Definition: TCurlyLine.cxx:530
Double_t fX1
start x, center for arc
Definition: TCurlyLine.h:33
Double_t fY1
start y, center for arc
Definition: TCurlyLine.h:34
static void SetDefaultIsCurly(Bool_t IsCurly)
Set default "IsCurly".
Definition: TCurlyLine.cxx:433
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual ~TCurlyLine()
Definition: TCurlyLine.h:51
static const double x2[5]
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual void SetWaveLength(Double_t WaveLength)
Set wave length.
Definition: TCurlyLine.cxx:379
virtual void SetStartPoint(Double_t x1, Double_t y1)
Set start point.
Definition: TCurlyLine.cxx:397
Implements curly or wavy polylines used to draw Feynman diagrams.
Definition: TCurlyLine.h:30
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TCurlyLine.cxx:341
virtual void SetCurly()
Set curly.
Definition: TCurlyLine.cxx:361
virtual void SetBBoxCenter(const TPoint &p)
Set center of the BoundingBox.
Definition: TCurlyLine.cxx:500
virtual void SetBBoxX2(const Int_t x)
Set right hands ide of BoundingBox to a value (resize in x direction on right)
Definition: TCurlyLine.cxx:575
Int_t fNsteps
used internally (controls precision)
Definition: TCurlyLine.h:39
Definition: TPoint.h:33
Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a line.
Definition: TCurlyLine.cxx:170
static Double_t GetDefaultAmplitude()
Get default amplitude.
Definition: TCurlyLine.cxx:449
virtual void SetEndPoint(Double_t x2, Double_t y2)
Set end point.
Definition: TCurlyLine.cxx:407
Bool_t GetCurly() const
Definition: TCurlyLine.h:55
static Double_t fgDefaultWaveLength
default wavelength
Definition: TCurlyLine.h:42
Double_t GetEndX() const
Definition: TCurlyLine.h:59
void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TCurlyLine.cxx:186
Double_t GetStartX() const
Definition: TCurlyLine.h:58
static void SetDefaultAmplitude(Double_t Amplitude)
Set default amplitude.
Definition: TCurlyLine.cxx:425
static Bool_t fgDefaultIsCurly
default curly type
Definition: TCurlyLine.h:44
static const double x1[5]
Double_t GetWaveLength() const
Definition: TCurlyLine.h:56
Double_t GetStartY() const
Definition: TCurlyLine.h:60
double Double_t
Definition: RtypesCore.h:55
virtual void SetWavy()
Set wavy.
Definition: TCurlyLine.cxx:370
virtual TPoint GetBBoxCenter()
Return the center of the BoundingBox as TPoint in pixels.
Definition: TCurlyLine.cxx:489
Double_t y[n]
Definition: legend1.C:17
static void SetDefaultWaveLength(Double_t WaveLength)
Set default wave length.
Definition: TCurlyLine.cxx:417
Double_t GetAmplitude() const
Definition: TCurlyLine.h:57
Double_t fX2
end x
Definition: TCurlyLine.h:35
Double_t fWaveLength
wavelength of sinusoid in percent of pad height
Definition: TCurlyLine.h:37
Abstract base class for elements drawn in the editor.
Definition: TAttBBox2D.h:23
virtual void SetBBoxY1(const Int_t y)
Set top of BoundingBox to a value (resize in y direction on top)
Definition: TCurlyLine.cxx:586
Double_t fAmplitude
amplitude of sinusoid in percent of pad height
Definition: TCurlyLine.h:38
Defined by an array on N points in a 2-D space.
Definition: TPolyLine.h:31
virtual void SetBBoxCenterY(const Int_t y)
Set Y coordinate of the center of the BoundingBox.
Definition: TCurlyLine.cxx:546
virtual void SetBBoxX1(const Int_t x)
Set left hand side of BoundingBox to a value (resize in x direction on left)
Definition: TCurlyLine.cxx:563
Double_t GetEndY() const
Definition: TCurlyLine.h:61
virtual void SetBBoxY2(const Int_t y)
Set bottom of BoundingBox to a value (resize in y direction on bottom)
Definition: TCurlyLine.cxx:598
virtual void SetAmplitude(Double_t x)
Set amplitude.
Definition: TCurlyLine.cxx:388
virtual void Build()
Create a curly (Gluon) or wavy (Gamma) line.
Definition: TCurlyLine.cxx:78
static Double_t fgDefaultAmplitude
default amplitude
Definition: TCurlyLine.h:43