]>
Commit | Line | Data |
---|---|---|
dee1d5f1 | 1 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
2 | * See cxx source for full Copyright notice */ | |
3 | ||
5f91c9e8 | 4 | // $Id$ |
13985652 | 5 | // $MpId: AliMpArea.h,v 1.9 2006/05/24 13:58:07 ivana Exp $ |
dee1d5f1 | 6 | |
7 | /// \ingroup basic | |
8 | /// \class AliMpArea | |
9 | /// \brief A rectangle area positioned in plane.. | |
10 | /// | |
13985652 | 11 | /// \author David Guez, Ivana Hrivnacova; IPN Orsay |
5f91c9e8 | 12 | |
13 | #ifndef ALI_MP_AREA_H | |
14 | #define ALI_MP_AREA_H | |
15 | ||
16 | #include <TObject.h> | |
5f91c9e8 | 17 | |
18 | class AliMpArea : public TObject | |
19 | { | |
20 | public: | |
6e97fbb8 | 21 | AliMpArea(Double_t x, Double_t y, |
22 | Double_t dx, Double_t dy); | |
5f91c9e8 | 23 | AliMpArea(const AliMpArea& rhs); |
24 | AliMpArea(); | |
25 | virtual ~AliMpArea(); | |
26 | ||
27 | // operators | |
28 | AliMpArea& operator = (const AliMpArea& right); | |
29 | ||
30 | // methods | |
31 | Double_t LeftBorder() const; | |
32 | Double_t RightBorder() const; | |
33 | Double_t UpBorder() const; | |
34 | Double_t DownBorder() const; | |
35 | ||
6e97fbb8 | 36 | void LeftDownCorner(Double_t& x, Double_t& y) const; |
37 | void LeftUpCorner(Double_t& x, Double_t& y) const; | |
38 | void RightDownCorner(Double_t& x, Double_t& y) const; | |
39 | void RightUpCorner(Double_t& x, Double_t& y) const; | |
5f91c9e8 | 40 | |
94f2b22c | 41 | AliMpArea Intersect(const AliMpArea& area) const; |
42 | Bool_t Overlap(const AliMpArea& area) const; | |
43 | Bool_t Contains(const AliMpArea& area) const; | |
44 | ||
45 | void Print(Option_t* opt="") const; | |
46 | ||
5f91c9e8 | 47 | // get methods |
6e97fbb8 | 48 | void GetParameters(Double_t& x, Double_t& y, |
49 | Double_t& dx, Double_t& dy) const; | |
50 | Double_t GetPositionX() const; | |
51 | Double_t GetPositionY() const; | |
52 | Double_t GetDimensionX() const; | |
53 | Double_t GetDimensionY() const; | |
5f91c9e8 | 54 | Bool_t IsValid() const; |
55 | ||
52dd0c39 | 56 | |
5f91c9e8 | 57 | private: |
58 | // data members | |
6e97fbb8 | 59 | Double_t fPositionX; ///< x position |
60 | Double_t fPositionY; ///< y position | |
61 | Double_t fDimensionX; ///< x dimension (half lengths) | |
62 | Double_t fDimensionY; ///< y dimension (half lengths) | |
63 | Bool_t fValidity; ///< validity | |
5f91c9e8 | 64 | |
6e97fbb8 | 65 | ClassDef(AliMpArea,2) //utility class for area iterators |
5f91c9e8 | 66 | }; |
67 | ||
68 | ostream& operator << (ostream &stream,const AliMpArea& area); | |
69 | ||
70 | // inline functions | |
71 | ||
cddcc1f3 | 72 | /// Return x position |
6e97fbb8 | 73 | inline Double_t AliMpArea::GetPositionX() const { return fPositionX; } |
cddcc1f3 | 74 | /// Return y position |
6e97fbb8 | 75 | inline Double_t AliMpArea::GetPositionY() const { return fPositionY; } |
cddcc1f3 | 76 | /// Return x dimensions |
6e97fbb8 | 77 | inline Double_t AliMpArea::GetDimensionX() const { return fDimensionX; } |
cddcc1f3 | 78 | /// Return y dimensions |
6e97fbb8 | 79 | inline Double_t AliMpArea::GetDimensionY() const { return fDimensionY; } |
f5671fc3 | 80 | /// Return validity |
5f91c9e8 | 81 | inline Bool_t AliMpArea::IsValid() const { return fValidity; } |
82 | ||
83 | #endif //ALI_MP_AREA_H |