AliRoot Core  edcc906 (edcc906)
AliMUONPolygon Class Reference

A planar polygon. More...

#include <AliMUONPolygon.h>

Inheritance diagram for AliMUONPolygon:

Public Member Functions

 AliMUONPolygon (Int_t nvertices=5)
 
 AliMUONPolygon (Double_t xpos, Double_t ypos, Double_t halfsizex, Double_t halfsizey)
 
 AliMUONPolygon (const AliMUONPolygon &rhs)
 
AliMUONPolygonoperator= (const AliMUONPolygon &rhs)
 
virtual ~AliMUONPolygon ()
 
virtual TObject * Clone (const char *="") const
 Create a full copy of this object. More...
 
Bool_t Contains (Double_t x, Double_t y) const
 
Double_t SignedArea () const
 
Bool_t IsCounterClockwiseOriented () const
 Whether this polygon is oriented counter clockwise. More...
 
void ReverseOrientation ()
 
void SetVertex (Int_t i, Double_t x, Double_t y)
 
Double_t X (Int_t i) const
 Return the x-coordinate of the i-th vertex. More...
 
Double_t Y (Int_t i) const
 Return the y-coordinate of the i-th vertex. More...
 
Int_t NumberOfVertices () const
 Get the number of vertices of this polygon. More...
 
void Print (Option_t *opt="") const
 
void Close ()
 

Private Attributes

Int_t fN
 Number of vertices. More...
 
Double_t * fX
 Vertices x coordinates. More...
 
Double_t * fY
 Vertices y coordinates. More...
 

Detailed Description

A planar polygon.

A simple planar polygon, with a given orientation

Author
Laurent Aphecetche, Subatech

Definition at line 19 of file AliMUONPolygon.h.

Constructor & Destructor Documentation

AliMUONPolygon::AliMUONPolygon ( Int_t  nvertices = 5)

Ctor with a predefined number of vertices.

Definition at line 37 of file AliMUONPolygon.cxx.

Referenced by Clone().

AliMUONPolygon::AliMUONPolygon ( Double_t  xpos,
Double_t  ypos,
Double_t  halfsizex,
Double_t  halfsizey 
)

Ctor. Polygon will be a rectangle.

Definition at line 47 of file AliMUONPolygon.cxx.

AliMUONPolygon::AliMUONPolygon ( const AliMUONPolygon rhs)

Copy constructor.

Definition at line 79 of file AliMUONPolygon.cxx.

AliMUONPolygon::~AliMUONPolygon ( )
virtual

dtor

Definition at line 71 of file AliMUONPolygon.cxx.

Member Function Documentation

virtual TObject* AliMUONPolygon::Clone ( const char *  = "") const
inlinevirtual

Create a full copy of this object.

Definition at line 29 of file AliMUONPolygon.h.

Referenced by AliMUONContour::Copy().

void AliMUONPolygon::Close ( )

Make that last point = first point

Definition at line 149 of file AliMUONPolygon.cxx.

Referenced by AliMUONPolygon(), and NumberOfVertices().

Bool_t AliMUONPolygon::Contains ( Double_t  x,
Double_t  y 
) const

Whether the polygon contains point (x,y)

Definition at line 137 of file AliMUONPolygon.cxx.

Referenced by Clone(), and AliMUONContour::IsInside().

Bool_t AliMUONPolygon::IsCounterClockwiseOriented ( ) const
inline

Whether this polygon is oriented counter clockwise.

Definition at line 36 of file AliMUONPolygon.h.

Referenced by AliMUONContour::AssertOrientation(), and AliMUONContourMaker::CreateContour().

Int_t AliMUONPolygon::NumberOfVertices ( ) const
inline
AliMUONPolygon & AliMUONPolygon::operator= ( const AliMUONPolygon rhs)

Assignment operator

Definition at line 104 of file AliMUONPolygon.cxx.

void AliMUONPolygon::Print ( Option_t *  opt = "") const

Printout

Definition at line 157 of file AliMUONPolygon.cxx.

Referenced by NumberOfVertices(), and AliMUONContour::Print().

void AliMUONPolygon::ReverseOrientation ( )

Reverse the orientation of this polygon

Definition at line 187 of file AliMUONPolygon.cxx.

Referenced by AliMUONContour::AssertOrientation(), and IsCounterClockwiseOriented().

void AliMUONPolygon::SetVertex ( Int_t  i,
Double_t  x,
Double_t  y 
)
Double_t AliMUONPolygon::SignedArea ( ) const

Compute the signed area of this polygon Algorithm from F. Feito, J.C. Torres and A. Urena, Comput. & Graphics, Vol. 19, pp. 595-600, 1995

Definition at line 169 of file AliMUONPolygon.cxx.

Referenced by Clone(), IsCounterClockwiseOriented(), and Print().

Double_t AliMUONPolygon::X ( Int_t  i) const
inline
Double_t AliMUONPolygon::Y ( Int_t  i) const
inline

Member Data Documentation

Int_t AliMUONPolygon::fN
private

Number of vertices.

Definition at line 56 of file AliMUONPolygon.h.

Referenced by AliMUONPolygon(), Close(), Contains(), NumberOfVertices(), operator=(), ReverseOrientation(), and SetVertex().

Double_t* AliMUONPolygon::fX
private

Vertices x coordinates.

Definition at line 59 of file AliMUONPolygon.h.

Referenced by AliMUONPolygon(), Contains(), operator=(), ReverseOrientation(), SetVertex(), X(), and ~AliMUONPolygon().

Double_t* AliMUONPolygon::fY
private

Vertices y coordinates.

Definition at line 62 of file AliMUONPolygon.h.

Referenced by AliMUONPolygon(), Contains(), operator=(), ReverseOrientation(), SetVertex(), Y(), and ~AliMUONPolygon().


The documentation for this class was generated from the following files: