4 // Class AliMpRowPainter
5 // ---------------------
6 // Class for drawing a row into canvas
8 // Authors: David Guez, IPN Orsay
10 #include "AliMpRowPainter.h"
11 #include "AliMpGraphContext.h"
13 #include "AliMpRowSegment.h"
15 ClassImp(AliMpRowPainter)
17 //_______________________________________________________________________
18 AliMpRowPainter::AliMpRowPainter()
22 // default dummy constructor
25 //_______________________________________________________________________
26 AliMpRowPainter::AliMpRowPainter(AliMpRow *row)
33 //_______________________________________________________________________
34 void AliMpRowPainter::DumpObject()
36 // Draw the owned object
41 //_______________________________________________________________________
42 TVector2 AliMpRowPainter::GetPosition() const
44 // Get the owned object's position
45 return fRow->Position();
49 //_______________________________________________________________________
50 TVector2 AliMpRowPainter::GetDimensions() const
52 // Get the owned object's dimensions
53 return fRow->Dimensions();
57 //_______________________________________________________________________
58 void AliMpRowPainter::Draw(Option_t *option)
60 // Draw the sector on the current pad
61 // The first letter of <option> is treated as follows:
62 // case "S" : each row segments are drawn separately
63 // case "" : the whole row is drawn at once
64 // in both cases, the rest of the option is passed
65 // as argument to the Draw function of respectively
66 // zone or row objects.
68 AliMpGraphContext *gr = AliMpGraphContext::Instance();
77 for (Int_t iRowSeg=0;iRowSeg<fRow->GetNofRowSegments();++iRowSeg){
78 AliMpVRowSegment *rowSegment = fRow->GetRowSegment(iRowSeg);
81 gr->SetPadPosForReal(rowSegment->Position(),rowSegment->Dimensions());
82 DrawObject(rowSegment,option+1);
88 default: AppendPad(option);
93 //_______________________________________________________________________
94 void AliMpRowPainter::Paint(Option_t *option)
98 AliMpGraphContext *gr = AliMpGraphContext::Instance();
100 Int_t col=gVirtualX->GetFillColor();
102 gPad->Range(0.,0.,1.,1.);
104 PaintWholeBox(kTRUE);
107 Float_t textSize = gVirtualX->GetTextSize();
108 gVirtualX->SetTextSize(12);
109 gPad->PaintText(GetPadPosition().X()-0.01,GetPadPosition().Y()-0.01,
110 Form("%d",fRow->GetID()));
111 gVirtualX->SetTextSize(textSize);
116 gVirtualX->SetFillColor(col);