X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EVE%2FAlieve%2FTPCSector2DGL.cxx;h=6350b595a6697d6d5c9eb3cd9c1559b3f0644054;hb=092578a72f170a403728f2968a2888e55609d579;hp=f5bce4d0c9288add840177599322319ee645c4a6;hpb=227613db3f62bd5925ba30f10e853e242ea83722;p=u%2Fmrichter%2FAliRoot.git diff --git a/EVE/Alieve/TPCSector2DGL.cxx b/EVE/Alieve/TPCSector2DGL.cxx index f5bce4d0c92..6350b595a66 100644 --- a/EVE/Alieve/TPCSector2DGL.cxx +++ b/EVE/Alieve/TPCSector2DGL.cxx @@ -4,8 +4,6 @@ #include -#include -#include #include #include @@ -56,28 +54,6 @@ void TPCSector2DGL::SetBBox() /**************************************************************************/ -void TPCSector2DGL::SetCol(Float_t z, UChar_t* pixel) const -{ - - Int_t n_col = gStyle->GetNumberOfColors(); - - Int_t ci = gStyle->GetColorPalette - (TMath::Min(n_col - 1, - Int_t((n_col*(z - fSector->fThreshold))/(fSector->fMaxVal - fSector->fThreshold)))); - - TColor* c = gROOT->GetColor(ci); - - if(c) { - // UChar_t *x = (UChar_t*) &c; - pixel[0] = (UChar_t)(255*c->GetRed()); - pixel[1] = (UChar_t)(255*c->GetGreen()); - pixel[2] = (UChar_t)(255*c->GetBlue()); - pixel[3] = 255; - } -} - -/**************************************************************************/ - void TPCSector2DGL::DirectDraw(const TGLDrawFlags& /*flags*/) const { // Actual GL drawing. @@ -201,7 +177,7 @@ void TPCSector2DGL::LoadPadrow(TPCSectorData::RowIterator& iter, } padVal = TMath::Min(padVal, fSector->fMaxVal); if(padVal > fSector->fThreshold) - SetCol(padVal, img_pos); + fSector->SetupColor(padVal, img_pos); img_pos += 4; } } @@ -221,7 +197,7 @@ void TPCSector2DGL::CreateTexture() const rowOff[0] = 0; rowOff[1] = rowOff[2] = -TPCSectorData::GetSeg(1).GetFirstRow(); colOff[0] = colOff[2] = 0; - colOff[1] = TPCSectorData::GetSeg(0).GetNMaxPads(); + colOff[1] = TPCSectorData::GetSeg(0).GetNMaxPads(); isOn[0] = fSector->fRnrInn; isOn[1] = fSector->fRnrOut1; isOn[2] = fSector->fRnrOut2; @@ -337,15 +313,9 @@ void TPCSector2DGL::TraceStepsDown(const TPCSectorData::SegmentInfo& s) void TPCSector2DGL::DisplayFrame() const { - TColor* c = gROOT->GetColor(fSector->fFrameCol); - if(c == 0) return; - - // x[0] = (UChar_t)(255*c->GetRed()); x[1] = (UChar_t)(255*c->GetGreen()); - // x[2] = (UChar_t)(255*c->GetBlue()); x[3] = 255; - - glColor3ub((UChar_t)(255*c->GetRed()), - (UChar_t)(255*c->GetGreen()), - (UChar_t)(255*c->GetBlue())); + UChar_t col[4]; + ColorFromIdx(fSector->fFrameColor, col); + glColor4ubv(col); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); if(fSector->fRnrInn) {