library: libGraf #include "TCurlyLine.h"

# TCurlyLine

class description - source file - inheritance tree (.pdf)

## class TCurlyLine : public TPolyLine

| Inheritance Chart:
`TObject`
`TAttLine`
`TAttFill`
| <- | `TPolyLine`
| <- | `TCurlyLine` |
<- |
`TCurlyArc` |

        public:

                          TCurlyLine()
                          TCurlyLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Double_t wl = .02, Double_t amp = .01)
                          TCurlyLine(const TCurlyLine&)
                  virtual ~TCurlyLine()
             virtual void Build()
           static TClass* Class()
            virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
             virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
                 Double_t GetAmplitude() const
                   Bool_t GetCurly() const
          static Double_t GetDefaultAmplitude()
            static Bool_t GetDefaultIsCurly()
          static Double_t GetDefaultWaveLength()
                 Double_t GetEndX() const
                 Double_t GetEndY() const
                 Double_t GetStartX() const
                 Double_t GetStartY() const
                 Double_t GetWaveLength() const
          virtual TClass* IsA() const
              TCurlyLine& operator=(const TCurlyLine&)
             virtual void SavePrimitive(ofstream& out, Option_t*)
             virtual void SetAmplitude(Double_t x)
             virtual void SetCurly()
              static void SetDefaultAmplitude(Double_t Amplitude)
              static void SetDefaultIsCurly(Bool_t IsCurly)
              static void SetDefaultWaveLength(Double_t WaveLength)
             virtual void SetEndPoint(Double_t x2, Double_t y2)
             virtual void SetStartPoint(Double_t x1, Double_t y1)
             virtual void SetWaveLength(Double_t WaveLength)
             virtual void SetWavy()
             virtual void ShowMembers(TMemberInspector& insp, char* parent)
             virtual void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)

### Data Members

        protected:

                 Double_t fX1                  start x, center for arc
                 Double_t fY1                  start y, center for arc
                 Double_t fX2                  end x
                 Double_t fY2                  end y
                 Double_t fWaveLength          wavelength of sinusoid in percent of pad height
                 Double_t fAmplitude           amplitude of sinusoid in percent of pad height
                    Int_t fNsteps              used internally (controls precision)
                   Bool_t fIsCurly             true: Gluon, false: Gamma
          static Double_t fgDefaultWaveLength  default wavelength
          static Double_t fgDefaultAmplitude   default amplitude
            static Bool_t fgDefaultIsCurly     default curly type

        public:

          static const enum TCurlyLine:: kTooShort

## Class Description

     This class implements curly or wavy polylines typically used to draw Feynman diagrams.
     Amplitudes and wavelengths may be specified in the constructors,
     via commands or interactively from popup menus.
     The class make use of TPolyLine by inheritance, ExecuteEvent methods
     are highly inspired from the methods used in TPolyLine and TArc.
     The picture below has been generated by the tutorial feynman.

/* */

    ________________________________________________________________________

TCurlyLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Double_t wl, Double_t amp)

     create a new TCurlyLine with starting point (x1, y1), end point (x2,y2)
     The wavelength and amplitude are given in percent of the pad height

void Build()

    *-*-*-*-*-*-*-*-*-*-*Create a curly (Gluon) or wavy (Gamma) line*-*-*-*-*-*
    *-*                  ===========================================
    ---

Int_t DistancetoPrimitive(Int_t px, Int_t py)

    *-*-*-*-*-*-*-*-*-*-*Compute distance from point px,py to a line*-*-*-*-*-*
    *-*                  ===========================================

void ExecuteEvent(Int_t event, Int_t px, Int_t py)

    *-*-*-*-*-*-*-*-*-*-*Execute action corresponding to one event*-*-*-*
    *-*                  =========================================
      This member function is called when a  TCurlyLine is clicked with the locator

      If Left button clicked on one of the line end points, this point
         follows the cursor until button is released.

      if Middle button clicked, the line is moved parallel to itself
         until the button is released.

void SavePrimitive(ofstream &out, Option_t *)

     Save primitive as a C++ statement(s) on output stream out

void SetCurly()

void SetWavy()

void SetWaveLength(Double_t x)

void SetAmplitude(Double_t x)

void SetStartPoint(Double_t x, Double_t y)

void SetEndPoint(Double_t x, Double_t y)

void SetDefaultWaveLength(Double_t WaveLength)

void SetDefaultAmplitude(Double_t Amplitude)

void SetDefaultIsCurly(Bool_t IsCurly)

Double_t GetDefaultWaveLength()

Double_t GetDefaultAmplitude()

Bool_t GetDefaultIsCurly()

### Inline Functions

                   void ~TCurlyLine()
             TCurlyLine TCurlyLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Double_t wl = .02, Double_t amp = .01)
                 Bool_t GetCurly() const
               Double_t GetWaveLength() const
               Double_t GetAmplitude() const
               Double_t GetStartX() const
               Double_t GetEndX() const
               Double_t GetStartY() const
               Double_t GetEndY() const
                TClass* Class()
                TClass* IsA() const
                   void ShowMembers(TMemberInspector& insp, char* parent)
                   void Streamer(TBuffer& b)
                   void StreamerNVirtual(TBuffer& b)
             TCurlyLine TCurlyLine(const TCurlyLine&)
            TCurlyLine& operator=(const TCurlyLine&)

Author: Otto Schaile 20/11/99
Last update: root/graf:$Name: $:$Id: TCurlyLine.cxx,v 1.8 2005/04/20 14:59:38 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *