]>
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> | |
17 | #include <TVector2.h> | |
18 | ||
19 | class AliMpArea : public TObject | |
20 | { | |
21 | public: | |
22 | AliMpArea(const TVector2& position, const TVector2& dimensions); | |
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 | ||
36 | TVector2 LeftDownCorner() const; | |
37 | TVector2 LeftUpCorner() const; | |
38 | TVector2 RightDownCorner() const; | |
39 | TVector2 RightUpCorner() const; | |
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 |
48 | TVector2 Position() const; | |
49 | TVector2 Dimensions() const; | |
50 | Bool_t IsValid() const; | |
51 | ||
52dd0c39 | 52 | |
5f91c9e8 | 53 | private: |
54 | // data members | |
829425a5 | 55 | TVector2 fPosition; ///< position |
56 | TVector2 fDimensions;///< dimensions (half lengths) | |
57 | Bool_t fValidity; ///< validity | |
5f91c9e8 | 58 | |
59 | ClassDef(AliMpArea,1) //utility class for area iterators | |
60 | }; | |
61 | ||
62 | ostream& operator << (ostream &stream,const AliMpArea& area); | |
63 | ||
64 | // inline functions | |
65 | ||
f5671fc3 | 66 | /// Return position |
5f91c9e8 | 67 | inline TVector2 AliMpArea::Position() const { return fPosition; } |
f5671fc3 | 68 | /// Return dimensions |
5f91c9e8 | 69 | inline TVector2 AliMpArea::Dimensions() const { return fDimensions; } |
f5671fc3 | 70 | /// Return validity |
5f91c9e8 | 71 | inline Bool_t AliMpArea::IsValid() const { return fValidity; } |
72 | ||
73 | #endif //ALI_MP_AREA_H |