ROOT logo
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

// $Id$
// $MpId: AliMpArea.h,v 1.9 2006/05/24 13:58:07 ivana Exp $

/// \ingroup basic
/// \class AliMpArea
/// \brief A rectangle area positioned in plane..
///
/// \author David Guez, Ivana Hrivnacova; IPN Orsay

#ifndef ALI_MP_AREA_H
#define ALI_MP_AREA_H

#include <TObject.h>

using std::ostream;

class AliMpArea : public TObject
{
 public:
  AliMpArea(Double_t x, Double_t y, 
            Double_t dx, Double_t dy);
  AliMpArea(const AliMpArea& rhs);
  AliMpArea();
  virtual ~AliMpArea();

  // operators
  AliMpArea& operator = (const AliMpArea& right);

  // methods
  Double_t LeftBorder() const;
  Double_t RightBorder() const;
  Double_t UpBorder() const;
  Double_t DownBorder() const;

  void LeftDownCorner(Double_t& x, Double_t& y) const;
  void LeftUpCorner(Double_t& x, Double_t& y) const;
  void RightDownCorner(Double_t& x, Double_t& y) const;
  void RightUpCorner(Double_t& x, Double_t& y) const;

  AliMpArea Intersect(const AliMpArea& area) const;
  Bool_t    Overlap(const AliMpArea& area) const;
  Bool_t    Contains(const AliMpArea& area) const;
  
  void Print(Option_t* opt="") const;

  // get methods
  void      GetParameters(Double_t& x, Double_t& y,
                          Double_t& dx, Double_t& dy) const;
  Double_t  GetPositionX() const;
  Double_t  GetPositionY() const;
  Double_t  GetDimensionX() const;    
  Double_t  GetDimensionY() const;    
  Bool_t    IsValid() const;
  
  
 private:
  // data members
  Double_t  fPositionX;  ///<  x position
  Double_t  fPositionY;  ///<  y position
  Double_t  fDimensionX; ///<   x dimension (half lengths)
  Double_t  fDimensionY; ///<   y dimension (half lengths)
  Bool_t    fValidity;   ///<  validity

  ClassDef(AliMpArea,2) //utility class for area iterators
};

ostream& operator << (ostream &stream,const AliMpArea& area);

// inline functions

                 /// Return x position
inline Double_t  AliMpArea::GetPositionX() const   { return fPositionX; }
                 /// Return y position
inline Double_t  AliMpArea::GetPositionY() const   { return fPositionY; }
                 /// Return x dimensions
inline Double_t  AliMpArea::GetDimensionX() const { return fDimensionX; }    
                 /// Return y dimensions
inline Double_t  AliMpArea::GetDimensionY() const { return fDimensionY; }    
                 /// Return validity
inline Bool_t    AliMpArea::IsValid() const    { return fValidity; }

#endif //ALI_MP_AREA_H
 AliMpArea.h:1
 AliMpArea.h:2
 AliMpArea.h:3
 AliMpArea.h:4
 AliMpArea.h:5
 AliMpArea.h:6
 AliMpArea.h:7
 AliMpArea.h:8
 AliMpArea.h:9
 AliMpArea.h:10
 AliMpArea.h:11
 AliMpArea.h:12
 AliMpArea.h:13
 AliMpArea.h:14
 AliMpArea.h:15
 AliMpArea.h:16
 AliMpArea.h:17
 AliMpArea.h:18
 AliMpArea.h:19
 AliMpArea.h:20
 AliMpArea.h:21
 AliMpArea.h:22
 AliMpArea.h:23
 AliMpArea.h:24
 AliMpArea.h:25
 AliMpArea.h:26
 AliMpArea.h:27
 AliMpArea.h:28
 AliMpArea.h:29
 AliMpArea.h:30
 AliMpArea.h:31
 AliMpArea.h:32
 AliMpArea.h:33
 AliMpArea.h:34
 AliMpArea.h:35
 AliMpArea.h:36
 AliMpArea.h:37
 AliMpArea.h:38
 AliMpArea.h:39
 AliMpArea.h:40
 AliMpArea.h:41
 AliMpArea.h:42
 AliMpArea.h:43
 AliMpArea.h:44
 AliMpArea.h:45
 AliMpArea.h:46
 AliMpArea.h:47
 AliMpArea.h:48
 AliMpArea.h:49
 AliMpArea.h:50
 AliMpArea.h:51
 AliMpArea.h:52
 AliMpArea.h:53
 AliMpArea.h:54
 AliMpArea.h:55
 AliMpArea.h:56
 AliMpArea.h:57
 AliMpArea.h:58
 AliMpArea.h:59
 AliMpArea.h:60
 AliMpArea.h:61
 AliMpArea.h:62
 AliMpArea.h:63
 AliMpArea.h:64
 AliMpArea.h:65
 AliMpArea.h:66
 AliMpArea.h:67
 AliMpArea.h:68
 AliMpArea.h:69
 AliMpArea.h:70
 AliMpArea.h:71
 AliMpArea.h:72
 AliMpArea.h:73
 AliMpArea.h:74
 AliMpArea.h:75
 AliMpArea.h:76
 AliMpArea.h:77
 AliMpArea.h:78
 AliMpArea.h:79
 AliMpArea.h:80
 AliMpArea.h:81
 AliMpArea.h:82
 AliMpArea.h:83
 AliMpArea.h:84
 AliMpArea.h:85