34 #include <TVirtualX.h>
76 TVector2 point = TVector2(gPad->AbsPixeltoX(x), gPad->AbsPixeltoY(y));
91 Double_t value = (point-pos).Mod();
92 if (value<res) res=value;
115 TVector2 bl(9999,9999),ur(-9999,-9999);
146 TVector2 bl(9999,9999),ur(-9999,-9999);
193 Double_t blx= 9999, bly= 9999;
194 Double_t urx= -9999, ury= -9999;
204 if (bl.X()<blx) blx=bl.X();
205 if (bl.Y()<bly) bly=bl.Y();
206 if (ur.X()>urx) urx=ur.X();
207 if (ur.Y()>ury) ury=ur.Y();
209 TVector2 position ( (urx+blx)/2.,(ury+bly)/2. );
210 TVector2 dimensions( (urx-blx)/2.,(ury-bly)/2. );
220 default: AppendPad(option);
234 gPad->Range(0.,0.,1.,1.);
236 Int_t col=gVirtualX->GetFillColor();
239 gVirtualX->SetFillColor(
GetColor());
240 Float_t textSize = gVirtualX->GetTextSize();
249 gPad->PaintBox(pos.X()-dim.X(),pos.Y()-dim.Y(),
250 pos.X()+dim.X(),pos.Y()+dim.Y());
252 gVirtualX->SetTextSize(15);
253 gPad->PaintText(pos.X()-0.01,pos.Y()-0.01,
258 gVirtualX->SetTextSize(textSize);
259 gVirtualX->SetFillColor(col);
virtual TVector2 GetDimensions() const
Return the owned object's dimensions.
virtual Double_t GetDimensionX() const =0
Return the x dimension of the row segment centre.
Int_t GetColor() const
Return the color.
Int_t GetNofRowSegments() const
static AliMpGraphContext * Instance()
void SetPadPosForReal(const TVector2 &position, const TVector2 &dimensions)
void SetColor(Int_t color)
Set color to use.
A region of pads of the same dimensions composed of subzones.
Int_t GetNofSubZones() const
Bool_t IsInside(const TVector2 &point, const TVector2 &pos, const TVector2 &dim)
An interface for a row segment.
virtual void Draw(Option_t *option)
Class for drawing a zone into canvas.
virtual Double_t GetPositionX() const =0
Return the x position of the row segment centre.
virtual Double_t GetPositionY() const =0
Return the y position of the row segment centre.
virtual void DumpObject()
Abstract base class for drawing objects into canvas.
AliMpZone * fZone
the zone to draw
virtual ~AliMpZonePainter()
virtual TVector2 GetPosition() const
Return the owned object's position.
virtual Double_t GetDimensionY() const =0
Return the y dimension of the row segment centre.
UInt_t GetID() const
Return ID.
AliMpVPainter * DrawObject(TObject *object, Option_t *option="")
Not implemented.
TVector2 RealToPad(const TVector2 &position) const
AliMpSubZone * GetSubZone(Int_t i) const
Class describing the correspondance between a given area in pad, and a zone of real (cm) position...
virtual Int_t DistancetoPrimitive(Int_t x, Int_t y)
AliMpVRowSegment * GetRowSegment(Int_t i) const
virtual void Paint(Option_t *option)
Paint the associated object.
A region in zone composed of the row segments with the same motif type.