4 // Class AliMpRowPainter
5 // ---------------------
6 // Class for drawing a row into canvas
8 // Authors: David Guez, IPN Orsay
10 #include <TVirtualX.h>
13 #include "AliMpRowPainter.h"
14 #include "AliMpGraphContext.h"
16 #include "AliMpRowSegment.h"
18 ClassImp(AliMpRowPainter)
20 //_______________________________________________________________________
21 AliMpRowPainter::AliMpRowPainter()
25 // default dummy constructor
28 //_______________________________________________________________________
29 AliMpRowPainter::AliMpRowPainter(AliMpRow *row)
36 //_______________________________________________________________________
37 AliMpRowPainter::~AliMpRowPainter()
42 //_______________________________________________________________________
43 void AliMpRowPainter::DumpObject()
45 // Draw the owned object
50 //_______________________________________________________________________
51 TVector2 AliMpRowPainter::GetPosition() const
53 // Get the owned object's position
54 return fRow->Position();
58 //_______________________________________________________________________
59 TVector2 AliMpRowPainter::GetDimensions() const
61 // Get the owned object's dimensions
62 return fRow->Dimensions();
66 //_______________________________________________________________________
67 void AliMpRowPainter::Draw(Option_t *option)
69 // Draw the sector on the current pad
70 // The first letter of <option> is treated as follows:
71 // case "S" : each row segments are drawn separately
72 // case "" : the whole row is drawn at once
73 // in both cases, the rest of the option is passed
74 // as argument to the Draw function of respectively
75 // zone or row objects.
77 AliMpGraphContext *gr = AliMpGraphContext::Instance();
86 for (Int_t iRowSeg=0;iRowSeg<fRow->GetNofRowSegments();++iRowSeg){
87 AliMpVRowSegment *rowSegment = fRow->GetRowSegment(iRowSeg);
90 gr->SetPadPosForReal(rowSegment->Position(),rowSegment->Dimensions());
91 DrawObject(rowSegment,option+1);
97 default: AppendPad(option);
102 //_______________________________________________________________________
103 void AliMpRowPainter::Paint(Option_t *option)
107 AliMpGraphContext *gr = AliMpGraphContext::Instance();
109 Int_t col=gVirtualX->GetFillColor();
111 gPad->Range(0.,0.,1.,1.);
113 PaintWholeBox(kTRUE);
116 Float_t textSize = gVirtualX->GetTextSize();
117 gVirtualX->SetTextSize(12);
118 gPad->PaintText(GetPadPosition().X()-0.01,GetPadPosition().Y()-0.01,
119 Form("%d",fRow->GetID()));
120 gVirtualX->SetTextSize(textSize);
125 gVirtualX->SetFillColor(col);