36 #include <TVirtualX.h>
59 AliDebug(1,
"Default ctor");
71 AliDebug(1,
"Ctor from motifType");
73 const Double_t kdx = 5;
74 const Double_t kdy = 5;
121 Int_t col=gVirtualX->GetFillColor();
123 gPad->Range(0.,0.,1.,1.);
126 gVirtualX->SetLineWidth(1);
134 Float_t textSize = gVirtualX->GetTextSize();
135 gVirtualX->SetTextSize(10);
160 gVirtualX->SetTextSize(textSize);
173 Double_t localPosX, localPosY;
175 TVector2 realPadPos =
181 TVector2 padPadPos,padPadDim;
184 padPadPos,padPadDim);
185 TVector2 bl = padPadPos - padPadDim;
186 TVector2 ur = padPadPos + padPadDim;
188 Style_t sty = gVirtualX->GetFillStyle();
189 gVirtualX->SetFillStyle(1);
190 gPad->PaintBox(bl.X(),bl.Y(),ur.X(),ur.Y());
191 gVirtualX->SetFillStyle(0);
192 gPad->PaintBox(bl.X(),bl.Y(),ur.X(),ur.Y());
193 gVirtualX->SetFillStyle(sty);
196 Float_t textSize = gVirtualX->GetTextSize();
197 gVirtualX->SetTextSize(10);
198 gVirtualX->SetTextAlign(22);
199 gPad->PaintText((bl.X()+ur.X())/2.0,(bl.Y()+ur.Y())/2.0,
202 gVirtualX->SetTextSize(textSize);
207 if ( option[0]==
'Z' )
222 gVirtualX->SetFillColor(col);
235 Int_t searchMotif = -1;
236 TVector2 bl0 = TVector2(999, 999);
237 TVector2 ur0 = TVector2(0,0);
238 TVector2 padPadPos,padPadDim;
246 gVirtualX->SetFillColor(0);
248 gVirtualX->SetFillColor(38);
250 gVirtualX->SetFillColor(33);
252 gVirtualX->SetFillColor(16);
254 gVirtualX->SetFillColor(44);
257 Width_t lineW = gPad->GetLineWidth();
258 Width_t lw = lineW*3;
259 Double_t xlw = gPad->PixeltoX(lw/2);
262 if (option[1] ==
'I' && option[2] ==
':')
263 searchMotif = atoi(&option[3]);
265 gVirtualX->SetLineWidth(lw);
267 for (Int_t i = 0; i < motifType->
GetNofPadsX(); i++){
269 for (Int_t j = 0; j < motifType->
GetNofPadsY(); j++){
274 Double_t localPosX, localPosY;
277 TVector2 realPadPos =
285 padPadPos, padPadDim);
287 TVector2 bl = padPadPos - padPadDim;
288 TVector2 ur = padPadPos + padPadDim;
290 if (bl0.X() > bl.X())
293 if (ur0.Y() < ur.Y())
298 Style_t csty = gVirtualX->GetFillColor();
299 Style_t sty = gVirtualX->GetFillStyle();
300 gVirtualX->SetFillStyle(1);
301 if (manuId == searchMotif)
302 gVirtualX->SetFillColor(5);
303 gPad->PaintBox(bl.X(),bl.Y(),ur.X(),ur.Y());
304 gVirtualX->SetFillStyle(sty);
305 gVirtualX->SetFillColor(csty);
310 gPad->PaintLine(bl.X()-xlw, bl.Y(), bl.X()+ padPadDim.X()*2 + xlw, bl.Y());
315 gPad->PaintLine(bl.X()-xlw, bl.Y() + padPadDim.Y()*2, bl.X()+ padPadDim.X()*2+xlw, bl.Y() + padPadDim.Y()*2);
319 gPad->PaintLine(bl.X(), bl.Y(), bl.X(), bl.Y()+ padPadDim.Y()*2);
324 gPad->PaintLine(bl.X()+padPadDim.X()*2, bl.Y(), bl.X()+padPadDim.X()*2, bl.Y()+ padPadDim.Y()*2);
334 xl = bl0.X()+ padPadDim.X()/2.;
336 yl = bl0.Y() + 1.5*padPadDim.Y();
338 Float_t textSize = gVirtualX->GetTextSize();
339 gVirtualX->SetTextSize(12);
340 gVirtualX->SetTextAlign(13);
341 gVirtualX->SetTextAngle(90.);
343 gPad->PaintText(xl, yl, Form(
"%d", manuId));
345 gVirtualX->SetTextAngle(0.);
346 gVirtualX->SetTextSize(textSize);
350 gVirtualX->SetLineWidth(lineW);
Double_t GetPositionY() const
Return y position.
void PaintContour(Option_t *option, Bool_t fill)
AliMpMotifPosition * fMotifPos
the motif to draw
Int_t GetLowLimitIx() const
Double_t GetDimensionY() const
Return y dimension.
virtual Double_t DimensionY() const =0
Return y dimensions.
Double_t GetDimensionX() const
Return x dimension.
Int_t GetLowLimitIy() const
Int_t GetHighLimitIy() const
virtual TVector2 GetPosition() const
Return the owned object's position.
AliMpConnection * FindConnectionByLocalIndices(MpPair_t localIndices) const
static AliMpGraphContext * Instance()
virtual TVector2 GetDimensions() const
Return the owned object's dimensions.
AliMpMotifType * GetMotifType() const
Return the motif type.
Int_t GetID() const
Return motif position ID = manu id.
Int_t GetNofPadsX() const
Return number of pads in x direction.
Int_t GetNofPadsY() const
Return number of pads in y direction.
Abstract base class for drawing objects into canvas.
AliMpVMotif * GetMotif() const
Return motif.
Class for drawing a motif into canvas.
virtual Double_t DimensionX() const =0
Return x dimensions.
void PaintWholeBox(Bool_t fill=kTRUE)
virtual void PadPositionLocal(MpPair_t localIndices, Double_t &posx, Double_t &posy) const =0
Fill local position of the pad specified by local indices.
virtual void Paint(Option_t *option)
Paint the associated object.
Abstract base class for a motif with its unique ID and the motif type.
TString GetID() const
Return unique motif ID.
Int_t GetManuChannel() const
Return manu channel number.
TVector2 RealToPad(const TVector2 &position) const
virtual void DumpObject()
virtual ~AliMpMotifPainter()
Double_t GetPositionX() const
Return x position.
TVector2 GetPadPosition() const
Return the position inside the graphics pad.
A motif with its unique ID and the motif type.
Int_t GetHighLimitIx() const
Class describing the correspondance between a given area in pad, and a zone of real (cm) position...
Class that defines the motif properties.
virtual void GetPadDimensionsByIndices(MpPair_t localIndices, Double_t &dx, Double_t &dy) const =0
Return the dimensions of the pad specified by localIndices.