00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGL5DPainter
00013 #define ROOT_TGL5DPainter
00014
00015 #include <vector>
00016 #include <list>
00017
00018 #ifndef ROOT_TGLMarchingCubes
00019 #include "TGLMarchingCubes.h"
00020 #endif
00021 #ifndef ROOT_TGLPlotPainter
00022 #include "TGLPlotPainter.h"
00023 #endif
00024 #ifndef ROOT_TGLIsoMesh
00025 #include "TGLIsoMesh.h"
00026 #endif
00027 #ifndef ROOT_TKDEFGT
00028 #include "TKDEFGT.h"
00029 #endif
00030 #ifndef ROOT_TGLUtil
00031 #include "TGLUtil.h"
00032 #endif
00033
00034
00035 class TGLPlotCamera;
00036 class TGL5DDataSet;
00037
00038
00039
00040
00041
00042 class TGL5DPainter : public TGLPlotPainter {
00043 public:
00044 enum EDefaults {
00045 kNContours = 4,
00046 kNLowPts = 50
00047 };
00048
00049 typedef Rgl::Mc::TIsoMesh<Float_t> Mesh_t;
00050
00051
00052 struct Surf_t {
00053 Surf_t()
00054 : f4D(0.), fRange(0.), fShowCloud(kFALSE), fHide(kFALSE),
00055 fColor(0), fHighlight(kFALSE), fAlpha(100)
00056 {
00057 }
00058
00059 Mesh_t fMesh;
00060 Double_t f4D;
00061 Double_t fRange;
00062 Bool_t fShowCloud;
00063 Bool_t fHide;
00064 Color_t fColor;
00065 std::vector<Double_t> fPreds;
00066 Bool_t fHighlight;
00067 Int_t fAlpha;
00068 };
00069
00070 typedef std::list<Surf_t> SurfList_t;
00071 typedef SurfList_t::iterator SurfIter_t;
00072 typedef SurfList_t::const_iterator ConstSurfIter_t;
00073
00074 private:
00075 TKDEFGT fKDE;
00076 Rgl::Mc::TMeshBuilder<TKDEFGT, Float_t> fMeshBuilder;
00077
00078 const Surf_t fDummy;
00079 Bool_t fInit;
00080
00081 SurfList_t fIsos;
00082 TGL5DDataSet *fData;
00083
00084 typedef std::vector<Double_t>::size_type size_type;
00085
00086 Rgl::Range_t fV5PredictedRange;
00087 Rgl::Range_t fV5SliderRange;
00088 Bool_t fShowSlider;
00089
00090 Double_t fAlpha;
00091 Int_t fNContours;
00092
00093 public:
00094 TGL5DPainter(TGL5DDataSet *data, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
00095
00096
00097 SurfIter_t AddSurface(Double_t v4, Color_t ci, Double_t isoVal = 1., Double_t sigma = 1.,
00098 Double_t range = 1e-3, Int_t lowNumOfPoints = kNLowPts);
00099
00100 void AddSurface(Double_t v4);
00101 void RemoveSurface(SurfIter_t surf);
00102
00103
00104 char *GetPlotInfo(Int_t px, Int_t py);
00105 Bool_t InitGeometry();
00106 void StartPan(Int_t px, Int_t py);
00107 void Pan(Int_t px, Int_t py);
00108 void AddOption(const TString &option);
00109 void ProcessEvent(Int_t event, Int_t px, Int_t py);
00110
00111
00112 void ShowBoxCut(Bool_t show) {fBoxCut.SetActive(show);}
00113 Bool_t IsBoxCutShown()const{return fBoxCut.IsActive();}
00114
00115 void SetAlpha(Double_t newAlpha);
00116 Double_t GetAlpha()const{return fAlpha;}
00117
00118 void SetNContours(Int_t num);
00119 Int_t GetNContours()const{return fNContours;}
00120
00121 void ResetGeometryRanges();
00122
00123 SurfIter_t SurfacesBegin();
00124 SurfIter_t SurfacesEnd();
00125
00126 private:
00127
00128 void InitGL()const;
00129 void DeInitGL()const;
00130
00131 void DrawPlot()const;
00132
00133
00134 void DrawSectionXOZ()const{}
00135 void DrawSectionYOZ()const{}
00136 void DrawSectionXOY()const{}
00137
00138
00139 void SetSurfaceColor(ConstSurfIter_t surf)const;
00140 void DrawCloud()const;
00141 void DrawSubCloud(Double_t v4, Double_t range, Color_t ci)const;
00142 void DrawMesh(ConstSurfIter_t surf)const;
00143
00144 TGL5DPainter(const TGL5DPainter &);
00145 TGL5DPainter &operator = (const TGL5DPainter &);
00146 };
00147
00148 #endif