**************************************************************************/
// $Id$
-// $MpId: AliMpZonePainter.cxx,v 1.7 2006/03/17 11:35:29 ivana Exp $
+// $MpId: AliMpZonePainter.cxx,v 1.8 2006/05/24 13:58:32 ivana Exp $
// Category: graphics
-//
+
+//-----------------------------------------------------------------------------
// Class AliMpZonePainter
// ----------------------
// Class for drawing a zone into canvas
// Included in AliRoot: 2003/05/02
// Authors: David Guez, IPN Orsay
+//-----------------------------------------------------------------------------
#include "AliMpZonePainter.h"
#include "AliMpGraphContext.h"
#include <TVirtualX.h>
#include <TPad.h>
+/// \cond CLASSIMP
ClassImp(AliMpZonePainter)
+/// \endcond
//_______________________________________________________________________
AliMpZonePainter::AliMpZonePainter()
}
-//_____________________________________________________________________________
-AliMpZonePainter::AliMpZonePainter(const AliMpZonePainter& right)
- : AliMpVPainter(right)
-{
- /// Protected copy constructor (not provided)
-
- Fatal("AliMpZonePainter", "Copy constructor not provided.");
-}
-
//_______________________________________________________________________
AliMpZonePainter::~AliMpZonePainter()
{
/// Destructor
}
-//_____________________________________________________________________________
-AliMpZonePainter&
-AliMpZonePainter::operator=(const AliMpZonePainter& right)
-{
- /// Assignment operator (not provided)
-
- // check assignment to self
- if (this == &right) return *this;
-
- Fatal("operator =", "Assignment operator not provided.");
-
- return *this;
-}
-
//_______________________________________________________________________
Int_t AliMpZonePainter::DistancetoPrimitive(Int_t x, Int_t y)
{
AliMpVRowSegment* seg = sub->GetRowSegment(iseg);
TVector2 pos,dim;
- gr->RealToPad(seg->Position(),seg->Dimensions(),pos,dim);
+ gr->RealToPad(TVector2(seg->GetPositionX(), seg->GetPositionY()),
+ TVector2(seg->GetDimensionX(),seg->GetDimensionY()),pos,dim);
if ( IsInside(point,pos,dim) ){
Double_t value = (point-pos).Mod();
AliMpVRowSegment* seg = sub->GetRowSegment(iseg);
// update the bottom-left corner
- if (bl.X()>seg->Position().X()-seg->Dimensions().X())
- bl.Set(seg->Position().X()-seg->Dimensions().X(),bl.Y());
- if (bl.Y()>seg->Position().Y()-seg->Dimensions().Y())
- bl.Set(bl.X(),seg->Position().Y()-seg->Dimensions().Y());
+ if (bl.X()>seg->GetPositionX()-seg->GetDimensionX())
+ bl.Set(seg->GetPositionX()-seg->GetDimensionX(),bl.Y());
+ if (bl.Y()>seg->GetPositionY()-seg->GetDimensionY())
+ bl.Set(bl.X(),seg->GetPositionY()-seg->GetDimensionY());
// update the upper-right corner
- if (ur.X()<seg->Position().X()+seg->Dimensions().X())
- ur.Set(seg->Position().X()+seg->Dimensions().X(),ur.Y());
- if (ur.Y()<seg->Position().Y()+seg->Dimensions().Y())
- ur.Set(ur.X(),seg->Position().Y()+seg->Dimensions().Y());
+ if (ur.X()<seg->GetPositionX()+seg->GetDimensionX())
+ ur.Set(seg->GetPositionX()+seg->GetDimensionX(),ur.Y());
+ if (ur.Y()<seg->GetPositionY()+seg->GetDimensionY())
+ ur.Set(ur.X(),seg->GetPositionY()+seg->GetDimensionY());
} //iseg
} //isub
return (ur+bl)/2.;
AliMpVRowSegment* seg = sub->GetRowSegment(iseg);
// update the bottom-left corner
- if (bl.X()>seg->Position().X()-seg->Dimensions().X())
- bl.Set(seg->Position().X()-seg->Dimensions().X(),bl.Y());
- if (bl.Y()>seg->Position().Y()-seg->Dimensions().Y())
- bl.Set(bl.X(),seg->Position().Y()-seg->Dimensions().Y());
+ if (bl.X()>seg->GetPositionX()-seg->GetDimensionX())
+ bl.Set(seg->GetPositionX()-seg->GetDimensionX(),bl.Y());
+ if (bl.Y()>seg->GetPositionY()-seg->GetDimensionY())
+ bl.Set(bl.X(),seg->GetPositionY()-seg->GetDimensionY());
// update the upper-right corner
- if (ur.X()<seg->Position().X()+seg->Dimensions().X())
- ur.Set(seg->Position().X()+seg->Dimensions().X(),ur.Y());
- if (ur.Y()<seg->Position().Y()+seg->Dimensions().Y())
- ur.Set(ur.X(),seg->Position().Y()+seg->Dimensions().Y());
+ if (ur.X()<seg->GetPositionX()+seg->GetDimensionX())
+ ur.Set(seg->GetPositionX()+seg->GetDimensionX(),ur.Y());
+ if (ur.Y()<seg->GetPositionY()+seg->GetDimensionY())
+ ur.Set(ur.X(),seg->GetPositionY()+seg->GetDimensionY());
} //iseg
} //isub
return (ur-bl)/2.;
void AliMpZonePainter::Draw(Option_t *option)
{
/// Draw the sector on the current pad
-/// The first letter of <option> is treated as follows:
+/// The first letter of \a option is treated as follows:
/// - case "S" : each sub zones are drawn separately
/// - case "" : the whole zone is drawn at once
/// in both cases, the rest of the option is passed
for (Int_t iRowSeg=0;iRowSeg<subZone->GetNofRowSegments();++iRowSeg){
AliMpVRowSegment *rowSegment = subZone->GetRowSegment(iRowSeg);
- TVector2 bl = rowSegment->Position();
- bl-=rowSegment->Dimensions();
- TVector2 ur = rowSegment->Position();
- ur+=rowSegment->Dimensions();
+ TVector2 bl = TVector2(rowSegment->GetPositionX(),rowSegment->GetPositionY());
+ bl -= TVector2(rowSegment->GetDimensionX(),rowSegment->GetDimensionY());
+ TVector2 ur = TVector2(rowSegment->GetPositionX(),rowSegment->GetPositionY());
+ ur += TVector2(rowSegment->GetDimensionX(),rowSegment->GetDimensionY());
if (bl.X()<blx) blx=bl.X();
if (bl.Y()<bly) bly=bl.Y();
for (Int_t iRowSeg=0;iRowSeg<subZone->GetNofRowSegments();++iRowSeg){
AliMpVRowSegment *rowSegment = subZone->GetRowSegment(iRowSeg);
TVector2 pos,dim;
- gr->RealToPad(rowSegment->Position(),rowSegment->Dimensions(),
+ gr->RealToPad(TVector2(rowSegment->GetPositionX(),rowSegment->GetPositionY()),
+ TVector2(rowSegment->GetDimensionX(),rowSegment->GetDimensionY()),
pos,dim);
gPad->PaintBox(pos.X()-dim.X(),pos.Y()-dim.Y(),
pos.X()+dim.X(),pos.Y()+dim.Y());