56 Bool_t TH2GL::SetModel(TObject* obj,
const Option_t* opt)
61 fM = SetModelDynCast<TH2>(obj);
64 if (option.Index(
"surf") != kNPOS)
65 SetPainter(
new TGLSurfacePainter(fM, 0, &fCoord) );
67 SetPainter(
new TGLLegoPainter(fM, 0, &fCoord) );
69 if (option.Index(
"sph") != kNPOS)
70 fCoord.SetCoordType(kGLSpherical);
71 else if (option.Index(
"pol") != kNPOS)
72 fCoord.SetCoordType(kGLPolar);
73 else if (option.Index(
"cyl") != kNPOS)
74 fCoord.SetCoordType(kGLCylindrical);
76 fPlotPainter->AddOption(option);
78 Ssiz_t pos = option.Index(
"fb");
80 option.Remove(pos, 2);
81 fPlotPainter->SetDrawFrontBox(kFALSE);
84 pos = option.Index(
"bb");
86 fPlotPainter->SetDrawBackBox(kFALSE);
88 pos = option.Index(
"a");
90 fPlotPainter->SetDrawAxes(kFALSE);
92 fPlotPainter->InitGeometry();
100 void TH2GL::SetBBox()
102 fBoundingBox.Set(fPlotPainter->RefBackBox().Get3DBox());
108 void TH2GL::DirectDraw(TGLRnrCtx & rnrCtx)
const
110 fPlotPainter->RefBackBox().FindFrontPoint();
112 glPushAttrib(GL_ENABLE_BIT | GL_LIGHTING_BIT);
114 glEnable(GL_NORMALIZE);
115 glDisable(GL_COLOR_MATERIAL);
117 fPlotPainter->InitGL();
118 fPlotPainter->DrawPlot();
120 glDisable(GL_CULL_FACE);
124 if (fPlotPainter->GetDrawAxes()) {
125 TGLAxisPainterBox axe_painter;
126 axe_painter.SetUseAxisColors(kFALSE);
127 axe_painter.SetFontMode(TGLFont::kPixmap);
128 axe_painter.PlotStandard(rnrCtx, fM, fBoundingBox);