00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGLTF3Painter
00013 #define ROOT_TGLTF3Painter
00014
00015 #include <vector>
00016 #include <list>
00017
00018 #ifndef ROOT_TGLPlotPainter
00019 #include "TGLPlotPainter.h"
00020 #endif
00021 #ifndef ROOT_TGLIsoMesh
00022 #include "TGLIsoMesh.h"
00023 #endif
00024 #ifndef ROOT_TGLUtil
00025 #include "TGLUtil.h"
00026 #endif
00027
00028 class TGLPlotCamera;
00029 class TF3;
00030
00031
00032
00033
00034
00035 class TGLTF3Painter : public TGLPlotPainter {
00036 private:
00037 enum ETF3Style {
00038 kDefault,
00039 kMaple0,
00040 kMaple1,
00041 kMaple2
00042 };
00043
00044 ETF3Style fStyle;
00045
00046 Rgl::Mc::TIsoMesh<Double_t> fMesh;
00047 TF3 *fF3;
00048
00049 TGLTH3Slice fXOZSlice;
00050 TGLTH3Slice fYOZSlice;
00051 TGLTH3Slice fXOYSlice;
00052
00053 public:
00054 TGLTF3Painter(TF3 *fun, TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
00055
00056 char *GetPlotInfo(Int_t px, Int_t py);
00057 Bool_t InitGeometry();
00058 void StartPan(Int_t px, Int_t py);
00059 void Pan(Int_t px, Int_t py);
00060 void AddOption(const TString &stringOption);
00061 void ProcessEvent(Int_t event, Int_t px, Int_t py);
00062
00063 private:
00064 void InitGL()const;
00065 void DeInitGL()const;
00066
00067 void DrawPlot()const;
00068
00069 void DrawToSelectionBuffer()const;
00070 void DrawDefaultPlot()const;
00071 void DrawMaplePlot()const;
00072
00073
00074 void SetSurfaceColor()const;
00075 Bool_t HasSections()const;
00076
00077 void DrawSectionXOZ()const;
00078 void DrawSectionYOZ()const;
00079 void DrawSectionXOY()const;
00080
00081 ClassDef(TGLTF3Painter, 0)
00082 };
00083
00084
00085
00086
00087
00088
00089
00090
00091 class TGLIsoPainter : public TGLPlotPainter {
00092 private:
00093 typedef Rgl::Mc::TIsoMesh<Float_t> Mesh_t;
00094 typedef std::list<Mesh_t> MeshList_t;
00095 typedef std::list<Mesh_t>::iterator MeshIter_t;
00096 typedef std::list<Mesh_t>::const_iterator ConstMeshIter_t;
00097
00098 TGLTH3Slice fXOZSlice;
00099 TGLTH3Slice fYOZSlice;
00100 TGLTH3Slice fXOYSlice;
00101
00102 Mesh_t fDummyMesh;
00103
00104 MeshList_t fIsos;
00105
00106
00107 MeshList_t fCache;
00108
00109 Rgl::Range_t fMinMax;
00110
00111 TGLLevelPalette fPalette;
00112
00113 std::vector<Double_t> fColorLevels;
00114
00115
00116 Bool_t fInit;
00117
00118 public:
00119 TGLIsoPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
00120
00121
00122 char *GetPlotInfo(Int_t px, Int_t py);
00123 Bool_t InitGeometry();
00124 void StartPan(Int_t px, Int_t py);
00125 void Pan(Int_t px, Int_t py);
00126 void AddOption(const TString &option);
00127 void ProcessEvent(Int_t event, Int_t px, Int_t py);
00128
00129 private:
00130
00131 void InitGL()const;
00132 void DeInitGL()const;
00133
00134 void DrawPlot()const;
00135 void DrawSectionXOZ()const;
00136 void DrawSectionYOZ()const;
00137 void DrawSectionXOY()const;
00138
00139 Bool_t HasSections()const;
00140 void SetSurfaceColor(Int_t ind)const;
00141 void SetMesh(Mesh_t &mesh, Double_t isoValue);
00142 void DrawMesh(const Mesh_t &mesh, Int_t level)const;
00143 void FindMinMax();
00144
00145 TGLIsoPainter(const TGLIsoPainter &);
00146 TGLIsoPainter &operator = (const TGLIsoPainter &);
00147
00148 ClassDef(TGLIsoPainter, 0)
00149 };
00150
00151 #endif