4 // Class AliMpRowPainter
5 // ---------------------
6 // Class for drawing a row into canvas
8 // Authors: David Guez, IPN Orsay
10 #include <TVirtualX.h>
14 #include "AliMpRowPainter.h"
15 #include "AliMpGraphContext.h"
17 #include "AliMpRowSegment.h"
19 ClassImp(AliMpRowPainter)
21 //_______________________________________________________________________
22 AliMpRowPainter::AliMpRowPainter()
26 // default dummy constructor
29 //_______________________________________________________________________
30 AliMpRowPainter::AliMpRowPainter(AliMpRow *row)
37 //_____________________________________________________________________________
38 AliMpRowPainter::AliMpRowPainter(const AliMpRowPainter& right)
39 : AliMpVPainter(right) {
41 // copy constructor (not implemented)
43 Fatal("AliMpRowPainter", "Copy constructor not provided.");
46 //_______________________________________________________________________
47 AliMpRowPainter::~AliMpRowPainter()
52 //_____________________________________________________________________________
53 AliMpRowPainter& AliMpRowPainter::operator=(const AliMpRowPainter& right)
55 // assignement operator (not implemented)
57 // check assignement to self
58 if (this == &right) return *this;
60 Fatal("operator =", "Assignement operator not provided.");
65 //_______________________________________________________________________
66 void AliMpRowPainter::DumpObject()
68 // Draw the owned object
73 //_______________________________________________________________________
74 TVector2 AliMpRowPainter::GetPosition() const
76 // Get the owned object's position
77 return fRow->Position();
81 //_______________________________________________________________________
82 TVector2 AliMpRowPainter::GetDimensions() const
84 // Get the owned object's dimensions
85 return fRow->Dimensions();
89 //_______________________________________________________________________
90 void AliMpRowPainter::Draw(Option_t *option)
92 // Draw the sector on the current pad
93 // The first letter of <option> is treated as follows:
94 // case "S" : each row segments are drawn separately
95 // case "" : the whole row is drawn at once
96 // in both cases, the rest of the option is passed
97 // as argument to the Draw function of respectively
98 // zone or row objects.
100 AliMpGraphContext *gr = AliMpGraphContext::Instance();
109 for (Int_t iRowSeg=0;iRowSeg<fRow->GetNofRowSegments();++iRowSeg){
110 AliMpVRowSegment *rowSegment = fRow->GetRowSegment(iRowSeg);
113 gr->SetPadPosForReal(rowSegment->Position(),rowSegment->Dimensions());
114 DrawObject(rowSegment,option+1);
120 default: AppendPad(option);
125 //_______________________________________________________________________
126 void AliMpRowPainter::Paint(Option_t *option)
130 AliMpGraphContext *gr = AliMpGraphContext::Instance();
132 Int_t col=gVirtualX->GetFillColor();
134 gPad->Range(0.,0.,1.,1.);
136 PaintWholeBox(kTRUE);
139 Float_t textSize = gVirtualX->GetTextSize();
140 gVirtualX->SetTextSize(12);
141 gPad->PaintText(GetPadPosition().X()-0.01,GetPadPosition().Y()-0.01,
142 Form("%d",fRow->GetID()));
143 gVirtualX->SetTextSize(textSize);
148 gVirtualX->SetFillColor(col);