Logo ROOT  
Reference Guide
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
19class TPoint;
20
21class TCurlyLine : public TPolyLine , public TAttBBox2D {
22
23protected:
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
37public:
38 TCurlyLine();
40 Double_t wl = .02,
41 Double_t amp = .01);
42 virtual ~TCurlyLine(){;}
43 virtual void Build();
45 void ExecuteEvent(Int_t event, Int_t px, Int_t py);
46 Bool_t GetCurly() const {return fIsCurly;}
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 );
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
static const double x2[5]
static const double x1[5]
int Int_t
Definition: RtypesCore.h:43
bool Bool_t
Definition: RtypesCore.h:61
double Double_t
Definition: RtypesCore.h:57
const char Option_t
Definition: RtypesCore.h:64
#define ClassDef(name, id)
Definition: Rtypes.h:322
Abstract base class for elements drawn in the editor.
Definition: TAttBBox2D.h:19
Implements curly or wavy polylines used to draw Feynman diagrams.
Definition: TCurlyLine.h:21
TCurlyLine()
Default constructor.
Definition: TCurlyLine.cxx:46
virtual void SetWaveLength(Double_t WaveLength)
Set wave length.
Definition: TCurlyLine.cxx:378
virtual void SetCurly()
Set curly.
Definition: TCurlyLine.cxx:360
Double_t fY1
start y, center for arc
Definition: TCurlyLine.h:25
virtual void SetAmplitude(Double_t x)
Set amplitude.
Definition: TCurlyLine.cxx:387
virtual void SetBBoxY1(const Int_t y)
Set top of BoundingBox to a value (resize in y direction on top)
Definition: TCurlyLine.cxx:585
Double_t fWaveLength
wavelength of sinusoid in percent of pad height
Definition: TCurlyLine.h:28
Double_t fAmplitude
amplitude of sinusoid in percent of pad height
Definition: TCurlyLine.h:29
virtual void SetStartPoint(Double_t x1, Double_t y1)
Set start point.
Definition: TCurlyLine.cxx:396
Double_t GetAmplitude() const
Definition: TCurlyLine.h:48
Int_t fNsteps
used internally (controls precision)
Definition: TCurlyLine.h:30
virtual Rectangle_t GetBBox()
Return the bounding Box of the CurlyLine.
Definition: TCurlyLine.cxx:464
virtual void SetBBoxCenter(const TPoint &p)
Set center of the BoundingBox.
Definition: TCurlyLine.cxx:499
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:574
virtual TPoint GetBBoxCenter()
Return the center of the BoundingBox as TPoint in pixels.
Definition: TCurlyLine.cxx:488
Double_t GetEndY() const
Definition: TCurlyLine.h:52
static Double_t GetDefaultWaveLength()
Get default wave length.
Definition: TCurlyLine.cxx:440
static Bool_t GetDefaultIsCurly()
Get default "IsCurly".
Definition: TCurlyLine.cxx:456
virtual void Build()
Create a curly (Gluon) or wavy (Gamma) line.
Definition: TCurlyLine.cxx:77
static void SetDefaultAmplitude(Double_t Amplitude)
Set default amplitude.
Definition: TCurlyLine.cxx:424
Double_t GetStartY() const
Definition: TCurlyLine.h:51
static void SetDefaultWaveLength(Double_t WaveLength)
Set default wave length.
Definition: TCurlyLine.cxx:416
static Bool_t fgDefaultIsCurly
default curly type
Definition: TCurlyLine.h:35
virtual ~TCurlyLine()
Definition: TCurlyLine.h:42
Double_t fY2
end y
Definition: TCurlyLine.h:27
static Double_t GetDefaultAmplitude()
Get default amplitude.
Definition: TCurlyLine.cxx:448
virtual void SetEndPoint(Double_t x2, Double_t y2)
Set end point.
Definition: TCurlyLine.cxx:406
virtual void SetBBoxCenterX(const Int_t x)
Set X coordinate of the center of the BoundingBox.
Definition: TCurlyLine.cxx:529
virtual void SetBBoxY2(const Int_t y)
Set bottom of BoundingBox to a value (resize in y direction on bottom)
Definition: TCurlyLine.cxx:597
virtual void SetBBoxCenterY(const Int_t y)
Set Y coordinate of the center of the BoundingBox.
Definition: TCurlyLine.cxx:545
Double_t fX1
start x, center for arc
Definition: TCurlyLine.h:24
static Double_t fgDefaultWaveLength
default wavelength
Definition: TCurlyLine.h:33
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TCurlyLine.cxx:340
Bool_t GetCurly() const
Definition: TCurlyLine.h:46
static void SetDefaultIsCurly(Bool_t IsCurly)
Set default "IsCurly".
Definition: TCurlyLine.cxx:432
virtual void SetWavy()
Set wavy.
Definition: TCurlyLine.cxx:369
Double_t GetWaveLength() const
Definition: TCurlyLine.h:47
static Double_t fgDefaultAmplitude
default amplitude
Definition: TCurlyLine.h:34
Double_t GetStartX() const
Definition: TCurlyLine.h:49
Double_t fX2
end x
Definition: TCurlyLine.h:26
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:562
Bool_t fIsCurly
true: Gluon, false: Gamma
Definition: TCurlyLine.h:31
void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TCurlyLine.cxx:185
Double_t GetEndX() const
Definition: TCurlyLine.h:50
Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a line.
Definition: TCurlyLine.cxx:169
Definition: TPoint.h:31
Defined by an array on N points in a 2-D space.
Definition: TPolyLine.h:23
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17