48 TH3GL::TH3GL(TH3 *th3, TPolyMarker3D *pm) :
51 SetPainter(
new TGLBoxPainter(th3, pm, 0, &fCoord));
52 fPlotPainter->InitGeometry();
65 Bool_t TH3GL::SetModel(TObject* obj,
const Option_t* opt)
70 fM = SetModelDynCast<TH3>(obj);
72 if (option.Index(
"iso") != kNPOS)
73 SetPainter(
new TGLIsoPainter(fM, 0, &fCoord) );
74 else if (option.Index(
"box") != kNPOS)
75 SetPainter(
new TGLBoxPainter(fM, 0, &fCoord) );
77 Warning(
"SetModel",
"Option '%s' not supported, assuming 'box'.", option.Data());
78 SetPainter(
new TGLBoxPainter(fM, 0, &fCoord) );
81 fPlotPainter->AddOption(option);
83 Ssiz_t pos = option.Index(
"fb");
85 option.Remove(pos, 2);
86 fPlotPainter->SetDrawFrontBox(kFALSE);
89 pos = option.Index(
"bb");
91 fPlotPainter->SetDrawBackBox(kFALSE);
93 pos = option.Index(
"a");
95 fPlotPainter->SetDrawAxes(kFALSE);
98 fPlotPainter->InitGeometry();
106 void TH3GL::SetBBox()
108 fBoundingBox.Set(fPlotPainter->RefBackBox().Get3DBox());
114 void TH3GL::DirectDraw(TGLRnrCtx & rnrCtx)
const
117 fPlotPainter->SetPhysicalShapeColor(fFirstPhysical->Color());
119 fPlotPainter->RefBackBox().FindFrontPoint();
121 glPushAttrib(GL_ENABLE_BIT | GL_LIGHTING_BIT);
123 glEnable(GL_NORMALIZE);
124 glDisable(GL_COLOR_MATERIAL);
126 fPlotPainter->InitGL();
127 fPlotPainter->DrawPlot();
129 glDisable(GL_CULL_FACE);
133 const Rgl::PlotTranslation trGuard(fPlotPainter);
135 if (fPlotPainter->GetDrawAxes()) {
136 TGLAxisPainterBox axe_painter;
137 axe_painter.SetUseAxisColors(kFALSE);
138 axe_painter.SetFontMode(TGLFont::kPixmap);
139 axe_painter.PlotStandard(rnrCtx, fM, fBoundingBox);