File indexing completed on 2025-01-18 10:11:37
0001
0002
0003
0004
0005
0006
0007
0008
0009
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;
0023 Double_t fY1;
0024 Double_t fX2;
0025 Double_t fY2;
0026 Double_t fWaveLength;
0027 Double_t fAmplitude;
0028 Int_t fNsteps;
0029 Bool_t fIsCurly;
0030
0031 static Double_t fgDefaultWaveLength;
0032 static Double_t fgDefaultAmplitude;
0033 static Bool_t fgDefaultIsCurly;
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();
0052 virtual void SetWavy();
0053 virtual void SetWaveLength(Double_t WaveLength);
0054 virtual void SetAmplitude(Double_t x);
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)
0077 };
0078
0079 #endif