1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 // $MpId: AliMpPCBPainter.cxx,v 1.8 2006/05/24 13:58:32 ivana Exp $
20 /// \class AliMpPCBPainter
22 /// Class for drawing a PCB into canvas
24 /// \author L. Aphecetche
26 #include "AliMpPCBPainter.h"
28 #include "AliMpGraphContext.h"
29 #include "AliMpMotifPosition.h"
34 #include "TVirtualX.h"
40 ClassImp(AliMpPCBPainter)
43 //_____________________________________________________________________________
44 AliMpPCBPainter::AliMpPCBPainter(AliMpPCB* pcb)
45 : AliMpVPainter(), fPCB(pcb)
52 //_____________________________________________________________________________
53 AliMpPCBPainter::~AliMpPCBPainter()
60 //_____________________________________________________________________________
62 AliMpPCBPainter::GetDimensions() const
65 // Returns the half-sizes of the PCB.
67 return TVector2(fPCB->DX(),fPCB->DY());
70 //_____________________________________________________________________________
72 AliMpPCBPainter::GetPosition() const
75 // Returns the (x,y) position of the PCB.
77 return TVector2(fPCB->X(),fPCB->Y());
80 //_____________________________________________________________________________
82 AliMpPCBPainter::Draw(Option_t* option)
87 AliMpGraphContext *gr = AliMpGraphContext::Instance();
96 for ( AliMpPCB::Size_t i = 0; i < fPCB->GetSize(); ++i )
98 AliMpMotifPosition* pos = fPCB->GetMotifPosition(i);
101 gr->SetPadPosForReal(pos->Position(),
103 gr->SetColor(gr->GetColor()+i);
105 DrawObject(pos,option+1);
117 //_____________________________________________________________________________
119 AliMpPCBPainter::Paint(Option_t* /*option*/)
124 AliMpGraphContext* gr = AliMpGraphContext::Instance();
126 Int_t col=gVirtualX->GetFillColor();
128 gPad->Range(0.,0.,1.,1.);
131 PaintWholeBox(kTRUE);
134 gVirtualX->SetFillColor(col);