#ifndef ROOT_TGLTF3Painter
#define ROOT_TGLTF3Painter
#include <vector>
#include <list>
#ifndef ROOT_TGLPlotPainter
#include "TGLPlotPainter.h"
#endif
#ifndef ROOT_TGLIsoMesh
#include "TGLIsoMesh.h"
#endif
#ifndef ROOT_TGLUtil
#include "TGLUtil.h"
#endif
class TGLPlotCamera;
class TF3;
class TGLTF3Painter : public TGLPlotPainter {
private:
enum ETF3Style {
kDefault,
kMaple0,
kMaple1,
kMaple2
};
ETF3Style fStyle;
Rgl::Mc::TIsoMesh<Double_t> fMesh;
TF3 *fF3;
TGLTH3Slice fXOZSlice;
TGLTH3Slice fYOZSlice;
TGLTH3Slice fXOYSlice;
public:
TGLTF3Painter(TF3 *fun, TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
char *GetPlotInfo(Int_t px, Int_t py);
Bool_t InitGeometry();
void StartPan(Int_t px, Int_t py);
void Pan(Int_t px, Int_t py);
void AddOption(const TString &stringOption);
void ProcessEvent(Int_t event, Int_t px, Int_t py);
private:
void InitGL()const;
void DeInitGL()const;
void DrawPlot()const;
void DrawToSelectionBuffer()const;
void DrawDefaultPlot()const;
void DrawMaplePlot()const;
void SetSurfaceColor()const;
Bool_t HasSections()const;
void DrawSectionXOZ()const;
void DrawSectionYOZ()const;
void DrawSectionXOY()const;
ClassDef(TGLTF3Painter, 0)
};
class TGLIsoPainter : public TGLPlotPainter {
private:
typedef Rgl::Mc::TIsoMesh<Float_t> Mesh_t;
typedef std::list<Mesh_t> MeshList_t;
typedef std::list<Mesh_t>::iterator MeshIter_t;
typedef std::list<Mesh_t>::const_iterator ConstMeshIter_t;
TGLTH3Slice fXOZSlice;
TGLTH3Slice fYOZSlice;
TGLTH3Slice fXOYSlice;
Mesh_t fDummyMesh;
MeshList_t fIsos;
MeshList_t fCache;
Rgl::Range_t fMinMax;
TGLLevelPalette fPalette;
std::vector<Double_t> fColorLevels;
Bool_t fInit;
public:
TGLIsoPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
char *GetPlotInfo(Int_t px, Int_t py);
Bool_t InitGeometry();
void StartPan(Int_t px, Int_t py);
void Pan(Int_t px, Int_t py);
void AddOption(const TString &option);
void ProcessEvent(Int_t event, Int_t px, Int_t py);
private:
void InitGL()const;
void DeInitGL()const;
void DrawPlot()const;
void DrawSectionXOZ()const;
void DrawSectionYOZ()const;
void DrawSectionXOY()const;
Bool_t HasSections()const;
void SetSurfaceColor(Int_t ind)const;
void SetMesh(Mesh_t &mesh, Double_t isoValue);
void DrawMesh(const Mesh_t &mesh, Int_t level)const;
void FindMinMax();
TGLIsoPainter(const TGLIsoPainter &);
TGLIsoPainter &operator = (const TGLIsoPainter &);
ClassDef(TGLIsoPainter, 0)
};
#endif