38 TF2GL::TF2GL() : TGLPlot3D(), fM(0), fH(0)
53 Bool_t TF2GL::SetModel(TObject* obj,
const Option_t* opt)
58 fM = SetModelDynCast<TF2>(obj);
60 fH = (TH2*) fM->CreateHistogram();
61 if (!fH)
return kFALSE;
63 fH->GetZaxis()->SetLimits(fH->GetMinimum(), fH->GetMaximum());
65 if (dynamic_cast<TF3*>(fM))
66 SetPainter(
new TGLTF3Painter((TF3*)fM, fH, 0, &fCoord) );
68 SetPainter(
new TGLSurfacePainter(fH, 0, &fCoord) );
70 if (option.Index(
"sph") != kNPOS)
71 fCoord.SetCoordType(kGLSpherical);
72 else if (option.Index(
"pol") != kNPOS)
73 fCoord.SetCoordType(kGLPolar);
74 else if (option.Index(
"cyl") != kNPOS)
75 fCoord.SetCoordType(kGLCylindrical);
77 fPlotPainter->AddOption(option);
78 fPlotPainter->InitGeometry();
88 fBoundingBox.Set(fPlotPainter->RefBackBox().Get3DBox());
94 void TF2GL::DirectDraw(TGLRnrCtx & rnrCtx)
const
96 fPlotPainter->RefBackBox().FindFrontPoint();
98 glPushAttrib(GL_ENABLE_BIT | GL_LIGHTING_BIT);
100 glEnable(GL_NORMALIZE);
101 glDisable(GL_COLOR_MATERIAL);
103 fPlotPainter->InitGL();
104 fPlotPainter->DrawPlot();
106 glDisable(GL_CULL_FACE);
110 TGLAxisPainterBox axe_painter;
111 axe_painter.SetUseAxisColors(kFALSE);
112 axe_painter.SetFontMode(TGLFont::kPixmap);
113 axe_painter.PlotStandard(rnrCtx, fH, fBoundingBox);