2 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
5 * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
7 * See cxx source for full Copyright notice
9 #ifndef ALIFMDPOLYGON_H
10 #define ALIFMDPOLYGON_H
12 # include <TVector2.h>
14 #ifndef ROOT_TObjArray
15 # include <TObjArray.h>
18 class AliFMDPolygon : public TObject
27 // List of coordinates
29 // Force convexity check
30 bool ConvexCheck() const;
31 // Check if a point is at the right-hand side of a segment
32 bool IsOnLeftHand(const TVector2* c, size_t i1, size_t i2) const;
34 // Construct a alipolygon with N sides
36 virtual ~AliFMDPolygon();
39 void Clear(Option_t* option="");
42 bool AddVertex(TVector2* c);
43 bool AddVertex(double x, double y);
46 const TVector2& GetVertex(size_t i) const;
48 // Check if a point is inside the polygon
49 bool Contains(const TVector2* c) const;
50 bool Contains(double x, double y) const;
52 // Get the number of verticies
53 size_t GetNVerticies() const { return fVerticies.GetEntries(); }
54 // Get the coordinates
55 const TObjArray& GetVerticies() const { return fVerticies; }
57 void Draw(const char* option="PL", const char* name=0) const;
59 ClassDef(AliFMDPolygon,1) // Polygon parameters