#ifndef ROOT_TGLTF3Painter
#define ROOT_TGLTF3Painter
#include <vector>
#include <list>
#ifndef ROOT_TGLPlotPainter
#include "TGLPlotPainter.h"
#endif
#ifndef ROOT_TGLUtil
#include "TGLUtil.h"
#endif
class TGLOrthoCamera;
class TF3;
class TGLTF3Painter : public TGLPlotPainter {
private:
enum ETF3Style {
kDefault,
kMaple0,
kMaple1,
kMaple2
};
ETF3Style fStyle;
public:
struct TriFace_t {
TGLVertex3 fXYZ[3];
TGLVector3 fNormals[3];
};
private:
std::vector<TriFace_t> fMesh;
TF3 *fF3;
TGLTH3Slice fXOZSlice;
TGLTH3Slice fYOZSlice;
TGLTH3Slice fXOYSlice;
public:
TGLTF3Painter(TF3 *fun, TH1 *hist, TGLOrthoCamera *camera, TGLPlotCoordinates *coord,
TGLPaintDevice *dev = 0);
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 DrawPlot()const;
void SetSurfaceColor()const;
Bool_t HasSections()const;
void DrawSectionXOZ()const;
void DrawSectionYOZ()const;
void DrawSectionXOY()const;
ClassDef(TGLTF3Painter, 0)
};
class TGLIsoPainter : public TGLPlotPainter {
public:
struct TriFace_t {
TGLVertex3 fXYZ[3];
TGLVector3 fNormal;
TGLVector3 fPerVertexNormals[3];
};
struct Range_t {
Range_t() : fFirst(-1), fLast(0)
{
}
Range_t(Int_t f, Int_t l) : fFirst(f), fLast(l)
{
}
Int_t fFirst;
Int_t fLast;
};
struct Mesh_t {
std::vector<TriFace_t> fMesh;
void Swap(Mesh_t &rhs)
{
std::swap(fMesh, rhs.fMesh);
}
};
private:
TGLTH3Slice fXOZSlice;
TGLTH3Slice fYOZSlice;
TGLTH3Slice fXOYSlice;
Mesh_t fDummyMesh;
typedef std::list<Mesh_t> MeshList_t;
typedef std::list<Mesh_t>::iterator MeshIter_t;
typedef std::list<Mesh_t>::const_iterator ConstMeshIter_t;
MeshList_t fIsos;
MeshList_t fCache;
Rgl::Range_t fMinMax;
TGLLevelPalette fPalette;
std::vector<Double_t> fColorLevels;
Bool_t fInit;
public:
TGLIsoPainter(TH1 *hist, TGLOrthoCamera *camera, TGLPlotCoordinates *coord,
TGLPaintDevice *dev = 0);
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 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 CheckBox(const std::vector<TriFace_t> &mesh, TriFace_t &face, const Range_t &box);
void FindMinMax();
TGLIsoPainter(const TGLIsoPainter &);
TGLIsoPainter &operator = (const TGLIsoPainter &);
ClassDef(TGLIsoPainter, 0)
};
#endif
Last change: Wed Jun 25 08:40:58 2008
Last generated: 2008-06-25 08:40
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.