Logo ROOT  
Reference Guide
Go to the documentation of this file.
1// @(#)root/graf:$Id$
2// Author: Otto Schaile 20/11/99
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
14#include "TPolyLine.h"
15#include "TAttBBox2D.h"
17class TPoint;
19class TCurlyLine : public TPolyLine, public TAttBBox2D {
22 Double_t fX1; ///< start x, center for arc
23 Double_t fY1; ///< start y, center for arc
24 Double_t fX2; ///< end x
25 Double_t fY2; ///< end y
26 Double_t fWaveLength; ///< wavelength of sinusoid in percent of pad height
27 Double_t fAmplitude; ///< amplitude of sinusoid in percent of pad height
28 Int_t fNsteps; ///< used internally (controls precision)
29 Bool_t fIsCurly; ///< true: Gluon, false: Gamma
31 static Double_t fgDefaultWaveLength; ///< default wavelength
32 static Double_t fgDefaultAmplitude; ///< default amplitude
33 static Bool_t fgDefaultIsCurly; ///< default curly type
36 TCurlyLine();
38 Double_t wl = .02,
39 Double_t amp = .01);
40 virtual ~TCurlyLine(){}
41 virtual void Build();
42 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
43 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
44 Bool_t GetCurly() const {return fIsCurly;}
47 Double_t GetStartX() const {return fX1;}
48 Double_t GetEndX() const {return fX2;}
49 Double_t GetStartY() const {return fY1;}
50 Double_t GetEndY() const {return fY2;}
51 virtual void SetCurly(); // *MENU*
52 virtual void SetWavy(); // *MENU*
53 virtual void SetWaveLength(Double_t WaveLength); // *MENU* *ARGS={WaveLength=>fWaveLength}
54 virtual void SetAmplitude(Double_t x); // *MENU* *ARGS={x=>fAmplitude}
55 virtual void SetStartPoint(Double_t x1, Double_t y1);
56 virtual void SetEndPoint (Double_t x2, Double_t y2);
57 void SavePrimitive(std::ostream &out, Option_t * = "") override;
59 static void SetDefaultWaveLength(Double_t WaveLength);
60 static void SetDefaultAmplitude (Double_t Amplitude );
61 static void SetDefaultIsCurly (Bool_t IsCurly );
64 static Bool_t GetDefaultIsCurly ();
66 Rectangle_t GetBBox() override;
67 TPoint GetBBoxCenter() override;
68 void SetBBoxCenter(const TPoint &p) override;
69 void SetBBoxCenterX(const Int_t x) override;
70 void SetBBoxCenterY(const Int_t y) override;
71 void SetBBoxX1(const Int_t x) override;
72 void SetBBoxX2(const Int_t x) override;
73 void SetBBoxY1(const Int_t y) override;
74 void SetBBoxY2(const Int_t y) override;
76 ClassDefOverride(TCurlyLine,3) // A curly polyline
bool Bool_t
Definition: RtypesCore.h:63
int Int_t
Definition: RtypesCore.h:45
double Double_t
Definition: RtypesCore.h:59
const char Option_t
Definition: RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char y1
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:19
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:23
virtual void SetAmplitude(Double_t x)
Set amplitude.
Definition: TCurlyLine.cxx:387
Double_t fWaveLength
wavelength of sinusoid in percent of pad height
Definition: TCurlyLine.h:26
Double_t fAmplitude
amplitude of sinusoid in percent of pad height
Definition: TCurlyLine.h:27
void SetBBoxY1(const Int_t y) override
Set top of BoundingBox to a value (resize in y direction on top)
Definition: TCurlyLine.cxx:582
virtual void SetStartPoint(Double_t x1, Double_t y1)
Set start point.
Definition: TCurlyLine.cxx:396
Double_t GetAmplitude() const
Definition: TCurlyLine.h:46
void SetBBoxX2(const Int_t x) override
Set right hands ide of BoundingBox to a value (resize in x direction on right)
Definition: TCurlyLine.cxx:571
Int_t fNsteps
used internally (controls precision)
Definition: TCurlyLine.h:28
void SetBBoxCenter(const TPoint &p) override
Set center of the BoundingBox.
Definition: TCurlyLine.cxx:499
void SetBBoxY2(const Int_t y) override
Set bottom of BoundingBox to a value (resize in y direction on bottom)
Definition: TCurlyLine.cxx:594
Rectangle_t GetBBox() override
Return the bounding Box of the CurlyLine.
Definition: TCurlyLine.cxx:464
TPoint GetBBoxCenter() override
Return the center of the BoundingBox as TPoint in pixels.
Definition: TCurlyLine.cxx:488
Double_t GetEndY() const
Definition: TCurlyLine.h:50
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
void SavePrimitive(std::ostream &out, Option_t *="") override
Save primitive as a C++ statement(s) on output stream out.
Definition: TCurlyLine.cxx:340
static void SetDefaultAmplitude(Double_t Amplitude)
Set default amplitude.
Definition: TCurlyLine.cxx:424
Double_t GetStartY() const
Definition: TCurlyLine.h:49
static void SetDefaultWaveLength(Double_t WaveLength)
Set default wave length.
Definition: TCurlyLine.cxx:416
static Bool_t fgDefaultIsCurly
default curly type
Definition: TCurlyLine.h:33
virtual ~TCurlyLine()
Definition: TCurlyLine.h:40
Double_t fY2
end y
Definition: TCurlyLine.h:25
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
void SetBBoxX1(const Int_t x) override
Set left hand side of BoundingBox to a value (resize in x direction on left)
Definition: TCurlyLine.cxx:559
Double_t fX1
start x, center for arc
Definition: TCurlyLine.h:22
static Double_t fgDefaultWaveLength
default wavelength
Definition: TCurlyLine.h:31
void SetBBoxCenterX(const Int_t x) override
Set X coordinate of the center of the BoundingBox.
Definition: TCurlyLine.cxx:526
Bool_t GetCurly() const
Definition: TCurlyLine.h:44
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:45
static Double_t fgDefaultAmplitude
default amplitude
Definition: TCurlyLine.h:32
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a line.
Definition: TCurlyLine.cxx:169
Double_t GetStartX() const
Definition: TCurlyLine.h:47
Double_t fX2
end x
Definition: TCurlyLine.h:24
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
Definition: TCurlyLine.cxx:185
Bool_t fIsCurly
true: Gluon, false: Gamma
Definition: TCurlyLine.h:29
Double_t GetEndX() const
Definition: TCurlyLine.h:48
void SetBBoxCenterY(const Int_t y) override
Set Y coordinate of the center of the BoundingBox.
Definition: TCurlyLine.cxx:542
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
Rectangle structure (maps to the X11 XRectangle structure)
Definition: GuiTypes.h:361