AliRoot Core  v5-06-15 (45dab64)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMpPCBPainter.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
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  **************************************************************************/
15 
16 // $Id$
17 // $MpId: AliMpPCBPainter.cxx,v 1.8 2006/05/24 13:58:32 ivana Exp $
18 
19 
20 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
27 
28 #include "AliMpPCBPainter.h"
29 
30 #include "AliMpGraphContext.h"
31 #include "AliMpMotifPosition.h"
32 #include "AliMpPCB.h"
33 
34 #include "AliLog.h"
35 
36 #include "TVirtualX.h"
37 #include "TPad.h"
38 
39 #include <iostream>
40 
44 
45 //_____________________________________________________________________________
47  : AliMpVPainter(), fPCB(pcb)
48 {
52 }
53 
54 //_____________________________________________________________________________
56 {
60 }
61 
62 //_____________________________________________________________________________
63 TVector2
65 {
69  return TVector2(fPCB->DX(),fPCB->DY());
70 }
71 
72 //_____________________________________________________________________________
73 TVector2
75 {
79  return TVector2(fPCB->X(),fPCB->Y());
80 }
81 
82 //_____________________________________________________________________________
83 void
84 AliMpPCBPainter::Draw(Option_t* option)
85 {
90  if (!fPCB) return;
91 
92  gr->Push();
94 
95  switch (option[0])
96  {
97  case 'M':
98  for ( Int_t i = 0; i < fPCB->GetSize(); ++i )
99  {
101 
102  gr->Push();
103  gr->SetPadPosForReal(TVector2(pos->GetPositionX(),pos->GetPositionY()),
104  TVector2(pos->GetDimensionX(),pos->GetDimensionY()));
105  gr->SetColor(gr->GetColor()+i);
106 
107  DrawObject(pos,option+1);
108 
109  gr->Pop();
110  }
111  break;
112  default:
113  AppendPad(option);
114  }
115 
116  gr->Pop();
117 }
118 
119 //_____________________________________________________________________________
120 void
121 AliMpPCBPainter::Paint(Option_t* /*option*/)
122 {
127  if (!fPCB) return;
128  Int_t col=gVirtualX->GetFillColor();
129  gr->Push();
130  gPad->Range(0.,0.,1.,1.);
132 
133  PaintWholeBox(kTRUE);
134 
135  gr->Pop();
136  gVirtualX->SetFillColor(col);
137 }
Double_t GetPositionY() const
Return y position.
Double_t DX() const
Definition: AliMpPCB.cxx:454
Double_t GetDimensionY() const
Return y dimension.
Class for drawing a PCB into canvas.
Double_t X() const
Definition: AliMpPCB.cxx:756
A PCB for station 3,4 or 5.
Definition: AliMpPCB.h:46
Double_t GetDimensionX() const
Return x dimension.
void Paint(Option_t *option)
Paint the associated object.
Int_t GetSize() const
The number of motifs, aka manus.
Definition: AliMpPCB.cxx:588
static AliMpGraphContext * Instance()
AliMpPCB * fPCB
! PCB to be plotted.
Int_t GetColor() const
Return color to use.
void SetPadPosForReal(const TVector2 &position, const TVector2 &dimensions)
void SetColor(Int_t color)
Set color to use.
TVector2 GetPosition() const
Return the owned object's position.
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
A placed motif.
TVector2 GetDimensions() const
Return the owned object's dimensions.
TGraph * gr
Definition: CalibTime.C:25
Abstract base class for drawing objects into canvas.
Definition: AliMpVPainter.h:21
void PaintWholeBox(Bool_t fill=kTRUE)
AliMpMotifPosition * GetMotifPosition(Int_t i) const
Definition: AliMpPCB.cxx:553
Double_t DY() const
Definition: AliMpPCB.cxx:480
AliMpVPainter * DrawObject(TObject *object, Option_t *option="")
Not implemented.
virtual ~AliMpPCBPainter()
Double_t GetPositionX() const
Return x position.
Double_t Y() const
Definition: AliMpPCB.cxx:789
Class describing the correspondance between a given area in pad, and a zone of real (cm) position...
void Draw(Option_t *option)
void InitGraphContext()