Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:37

0001 // @(#)root/graf:$Id$
0002 // Author: Otto Schaile   20/11/99
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 #ifndef ROOT_TCurlyLine
0012 #define ROOT_TCurlyLine
0013 
0014 #include "TPolyLine.h"
0015 #include "TAttBBox2D.h"
0016 
0017 class TPoint;
0018 
0019 class TCurlyLine : public TPolyLine, public TAttBBox2D {
0020 
0021 protected:
0022    Double_t fX1;             ///< start x, center for arc
0023    Double_t fY1;             ///< start y, center for arc
0024    Double_t fX2;             ///< end x
0025    Double_t fY2;             ///< end y
0026    Double_t fWaveLength;     ///< wavelength of sinusoid in percent of pad height
0027    Double_t fAmplitude;      ///< amplitude of sinusoid in percent of pad height
0028    Int_t    fNsteps;         ///< used internally (controls precision)
0029    Bool_t   fIsCurly;        ///< true: Gluon, false: Gamma
0030 
0031    static Double_t fgDefaultWaveLength;   ///< default wavelength
0032    static Double_t fgDefaultAmplitude;    ///< default amplitude
0033    static Bool_t   fgDefaultIsCurly;      ///< default curly type
0034 
0035 public:
0036    TCurlyLine();
0037    TCurlyLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2,
0038               Double_t wl = .02,
0039               Double_t amp = .01);
0040    ~TCurlyLine() override{}
0041    virtual void Build();
0042    Int_t        DistancetoPrimitive(Int_t px, Int_t py) override;
0043    void         ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
0044    Bool_t       GetCurly() const     {return fIsCurly;}
0045    Double_t     GetWaveLength() const{return fWaveLength;}
0046    Double_t     GetAmplitude() const {return fAmplitude;}
0047    Double_t     GetStartX() const    {return fX1;}
0048    Double_t     GetEndX() const      {return fX2;}
0049    Double_t     GetStartY() const    {return fY1;}
0050    Double_t     GetEndY() const      {return fY2;}
0051    virtual void SetCurly();                             // *MENU*
0052    virtual void SetWavy();                              // *MENU*
0053    virtual void SetWaveLength(Double_t WaveLength);     // *MENU* *ARGS={WaveLength=>fWaveLength}
0054    virtual void SetAmplitude(Double_t x);               // *MENU* *ARGS={x=>fAmplitude}
0055    virtual void SetStartPoint(Double_t x1, Double_t y1);
0056    virtual void SetEndPoint  (Double_t x2, Double_t y2);
0057    void         SavePrimitive(std::ostream &out, Option_t * = "") override;
0058 
0059    static void     SetDefaultWaveLength(Double_t WaveLength);
0060    static void     SetDefaultAmplitude (Double_t Amplitude );
0061    static void     SetDefaultIsCurly   (Bool_t   IsCurly   );
0062    static Double_t GetDefaultWaveLength();
0063    static Double_t GetDefaultAmplitude ();
0064    static Bool_t   GetDefaultIsCurly   ();
0065 
0066    Rectangle_t  GetBBox() override;
0067    TPoint       GetBBoxCenter() override;
0068    void         SetBBoxCenter(const TPoint &p) override;
0069    void         SetBBoxCenterX(const Int_t x) override;
0070    void         SetBBoxCenterY(const Int_t y) override;
0071    void         SetBBoxX1(const Int_t x) override;
0072    void         SetBBoxX2(const Int_t x) override;
0073    void         SetBBoxY1(const Int_t y) override;
0074    void         SetBBoxY2(const Int_t y) override;
0075 
0076    ClassDefOverride(TCurlyLine,3) // A curly polyline
0077 };
0078 
0079 #endif