TCurlyLine.h

Go to the documentation of this file.
00001 // @(#)root/graf:$Id: TCurlyLine.h 35127 2010-09-03 13:09:41Z couet $
00002 // Author: Otto Schaile   20/11/99
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 #ifndef ROOT_TCurlyLine
00012 #define ROOT_TCurlyLine
00013 
00014 //
00015 // This class implements a curly or wavy polyline typically
00016 // used to draw Feynman diagrams.
00017 
00018 #ifndef ROOT_Riosfwd
00019 #include "Riosfwd.h"
00020 #endif
00021 #ifndef ROOT_TPolyLine
00022 #include "TPolyLine.h"
00023 #endif
00024 
00025 class TCurlyLine : public TPolyLine {
00026 
00027 protected:
00028    Double_t fX1;             // start x, center for arc
00029    Double_t fY1;             // start y, center for arc
00030    Double_t fX2;             // end x
00031    Double_t fY2;             // end y
00032    Double_t fWaveLength;     // wavelength of sinusoid in percent of pad height
00033    Double_t fAmplitude;      // amplitude of sinusoid in percent of pad height
00034    Int_t    fNsteps;         // used internally (controls precision)
00035    Bool_t   fIsCurly;        // true: Gluon, false: Gamma
00036 
00037    static Double_t fgDefaultWaveLength;   //default wavelength
00038    static Double_t fgDefaultAmplitude;    //default amplitude
00039    static Bool_t   fgDefaultIsCurly;      //default curly type
00040 
00041 public:
00042    // TCurlyLine status bits
00043    enum {
00044       kTooShort = BIT(11)
00045    };
00046    TCurlyLine();
00047    TCurlyLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2,
00048               Double_t wl = .02,
00049               Double_t amp = .01);
00050    virtual ~TCurlyLine(){;}
00051    virtual void Build();
00052    Int_t        DistancetoPrimitive(Int_t px, Int_t py);
00053    void         ExecuteEvent(Int_t event, Int_t px, Int_t py);
00054    Bool_t       GetCurly() const     {return fIsCurly;}
00055    Double_t     GetWaveLength() const{return fWaveLength;}
00056    Double_t     GetAmplitude() const {return fAmplitude;}
00057    Double_t     GetStartX() const    {return fX1;}
00058    Double_t     GetEndX() const      {return fX2;}
00059    Double_t     GetStartY() const    {return fY1;}
00060    Double_t     GetEndY() const      {return fY2;}
00061    virtual void SetCurly();                             // *MENU*
00062    virtual void SetWavy();                              // *MENU*
00063    virtual void SetWaveLength(Double_t WaveLength);     // *MENU* *ARGS={WaveLength=>fWaveLength}
00064    virtual void SetAmplitude(Double_t x);               // *MENU* *ARGS={x=>fAmplitude}
00065    virtual void SetStartPoint(Double_t x1, Double_t y1);
00066    virtual void SetEndPoint  (Double_t x2, Double_t y2);
00067    virtual void SavePrimitive(ostream &out, Option_t * = "");
00068 
00069    static void     SetDefaultWaveLength(Double_t WaveLength);
00070    static void     SetDefaultAmplitude (Double_t Amplitude );
00071    static void     SetDefaultIsCurly   (Bool_t   IsCurly   );
00072    static Double_t GetDefaultWaveLength();
00073    static Double_t GetDefaultAmplitude ();
00074    static Bool_t   GetDefaultIsCurly   ();
00075 
00076    ClassDef(TCurlyLine,2) // A curly polyline
00077 };
00078 
00079 #endif

Generated on Tue Jul 5 14:14:08 2011 for ROOT_528-00b_version by  doxygen 1.5.1