AliRoot Core  v5-06-30 (35d6c57)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONPolygon.h
Go to the documentation of this file.
1 #ifndef ALIMUONPOLYGON_H
2 #define ALIMUONPOLYGON_H
3 
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6 
7 // $Id$
8 
13 // author Laurent Aphecetche
14 
15 #ifndef ROOT_TObject
16 # include "TObject.h"
17 #endif
18 
19 class AliMUONPolygon : public TObject
20 {
21 public:
22  AliMUONPolygon(Int_t nvertices=5);
23  AliMUONPolygon(Double_t xpos, Double_t ypos, Double_t halfsizex, Double_t halfsizey);
24  AliMUONPolygon(const AliMUONPolygon& rhs);
26  virtual ~AliMUONPolygon();
27 
29  virtual TObject* Clone(const char* /*newname*/="") const { return new AliMUONPolygon(*this); }
30 
31  Bool_t Contains(Double_t x, Double_t y) const;
32 
33  Double_t SignedArea() const;
34 
36  Bool_t IsCounterClockwiseOriented() const { return SignedArea() > 0.0; }
37 
38  void ReverseOrientation();
39 
40  void SetVertex(Int_t i, Double_t x, Double_t y);
41 
43  Double_t X(Int_t i) const { return fX[i]; }
44 
46  Double_t Y(Int_t i) const { return fY[i]; }
47 
49  Int_t NumberOfVertices() const { return fN; }
50 
51  void Print(Option_t* opt="") const;
52 
53  void Close();
54 
55 private:
56  Int_t fN;
57 
59  Double_t* fX; //[fN]
60 
62  Double_t* fY; //[fN]
63 
64  ClassDef(AliMUONPolygon,1) // A simple polygon
65 };
66 
67 #endif
Int_t fN
Number of vertices.
Double_t Y(Int_t i) const
Return the y-coordinate of the i-th vertex.
AliMUONPolygon(Int_t nvertices=5)
Double_t * fX
Vertices x coordinates.
A planar polygon.
Double_t SignedArea() const
Bool_t IsCounterClockwiseOriented() const
Whether this polygon is oriented counter clockwise.
void Print(Option_t *opt="") const
Int_t NumberOfVertices() const
Get the number of vertices of this polygon.
Double_t X(Int_t i) const
Return the x-coordinate of the i-th vertex.
virtual ~AliMUONPolygon()
void SetVertex(Int_t i, Double_t x, Double_t y)
AliMUONPolygon & operator=(const AliMUONPolygon &rhs)
virtual TObject * Clone(const char *="") const
Create a full copy of this object.
Double_t * fY
Vertices y coordinates.
Bool_t Contains(Double_t x, Double_t y) const