#include <THLimitsFinder.h>
#include <TVirtualPad.h>
+#include <RVersion.h>
+
+
//______________________________________________________________________________
//
// Display scaled ITS modules in a paged layout, also providing
fPosition(0),
fSubDet(-1),
+ fModuleFont(), fTextFont(), fSymbolFont(),
fAxis(0),
fMenuHeight(0.13),
fScaleInfo = new AliEveDigitScaleInfo();
fScaleInfo->IncRefCount();
- gEve->GetGLViewer()->AddOverlayElement(this);
+ gEve->GetDefaultGLViewer()->AddOverlayElement(this);
}
AliEveITSModuleStepper::~AliEveITSModuleStepper()
{
// Destructor.
- gEve->GetGLViewer()->RemoveOverlayElement(this);
+ gEve->GetDefaultGLViewer()->RemoveOverlayElement(this);
fScaleInfo->DecRefCount();
fDigitsInfo->DecRefCount();
// configuration.
Int_t n = fStepper->GetNx()*fStepper->GetNy();
- if (n != GetNChildren())
+ if (n != NumChildren())
{
DestroyElements();
for (Int_t m=0; m<n; ++m)
{
if (idx < fModuleIDs.size())
{
- AliEveITSScaledModule* mod = dynamic_cast<AliEveITSScaledModule*>(*childit);
+ AliEveITSScaledModule* mod = static_cast<AliEveITSScaledModule*>(*childit);
mod->SetID(fModuleIDs[idx], kFALSE);
TEveTrans& tr = mod->RefMainTrans();
tr.UnitTrans();
else
mod->SetName(Form("SPD %d", idx));
mod->SetRnrSelf(kTRUE);
- mod->UpdateItems();
fStepper->Step();
idx++;
{
if (idx < fModuleIDs.size())
{
- AliEveITSScaledModule* mod = dynamic_cast<AliEveITSScaledModule*>(*childit);
+ AliEveITSScaledModule* mod = static_cast<AliEveITSScaledModule*>(*childit);
TEveTrans& tr = mod->RefMainTrans();
tr.GetPos(x,y,z);
x += fStepper->GetDx()*0.5;
{
// Render the overlay elements.
- AliEveITSScaledModule* sm = dynamic_cast<AliEveITSScaledModule*>(*BeginChildren());
- Int_t scale = fScaleInfo->GetScale() - 1;
+ AliEveITSScaledModule* sm = static_cast<AliEveITSScaledModule*>(*BeginChildren());
+ Int_t scaleIdx = fScaleInfo->GetScale() - 1;
Int_t cnx = 0, cnz = 0;
switch(sm->GetSubDetID())
{
case 0:
- cnx = fDigitsInfo->fSPDScaleX[scale], cnz = fDigitsInfo->fSPDScaleZ[scale];
+ cnx = fDigitsInfo->fSPDScaleX[scaleIdx];
+ cnz = fDigitsInfo->fSPDScaleZ[scaleIdx];
break;
case 1:
- cnx = fDigitsInfo->fSDDScaleX[scale], cnz = fDigitsInfo->fSDDScaleZ[scale];
+ cnx = fDigitsInfo->fSDDScaleX[scaleIdx];
+ cnz = fDigitsInfo->fSDDScaleZ[scaleIdx];
break;
case 2:
- cnx = fDigitsInfo->fSSDScale[scale], cnz = 1;
+ cnx = fDigitsInfo->fSSDScale[scaleIdx];
+ cnz = 1;
break;
}
// init fonts
if (fTextFont.GetMode() == TGLFont::kUndef)
{
+#if ROOT_VERSION_CODE >= 332547
+ rnrCtx.RegisterFont(fTextSize, 4, TGLFont::kTexture, fTextFont);
+ rnrCtx.RegisterFont(72, 31, TGLFont::kTexture, fSymbolFont);
+ rnrCtx.RegisterFont(14, 4, TGLFont::kPixmap, fModuleFont);
+#else
fTextFont = rnrCtx.GetFont(fTextSize, 4, TGLFont::kTexture);
fSymbolFont = rnrCtx.GetFont(72, 31, TGLFont::kTexture);
fModuleFont = rnrCtx.GetFont(14, 4, TGLFont::kPixmap);
+#endif
}
{
TGLRect rect(*rnrCtx.GetPickRectangle());
rnrCtx.GetCamera()->WindowToViewport(rect);
gluPickMatrix(rect.X(), rect.Y(), rect.Width(), rect.Height(),
- (Int_t*) rnrCtx.GetCamera()->RefViewport().CArr());
+ (Int_t*) rnrCtx.GetCamera()->RefViewport().CArr());
}
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glTranslatef(-1, -1, 0); // translate to lower left corner
- Float_t scale = fMenuHeight/fTextSize*0.5; // scale text
- glScalef(scale, scale, 1.);
+ Float_t txtScale = fMenuHeight/fTextSize*0.5; // scale text
+ glScalef(txtScale, txtScale, 1.);
//menu
glPushName(0);
RenderMenu(GetCurrentPage(), GetPages(), cnx, cnz);
glPopName();
//palette
- Double_t ls = 1.6*scale*fTextSize;
- fAxis->SetLabelsSize(ls);
- fAxis->SetLabelsOffset(ls*1.2);
+ Double_t labelSize = 1.6*txtScale*fTextSize;
+ fAxis->SetLabelsSize(labelSize);
+ fAxis->SetLabelsOffset(1.2*labelSize);
RenderPalette(sm->GetPalette());
glPopMatrix();