File indexing completed on 2025-01-18 10:11:58
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TGL5DPainter
0013 #define ROOT_TGL5DPainter
0014
0015 #include <vector>
0016 #include <list>
0017
0018 #include "TGLMarchingCubes.h"
0019 #include "TGLPlotPainter.h"
0020 #include "TGLIsoMesh.h"
0021 #include "TKDEFGT.h"
0022 #include "TGLUtil.h"
0023
0024
0025 class TGLPlotCamera;
0026 class TGL5DDataSet;
0027
0028
0029
0030
0031
0032 class TGL5DPainter : public TGLPlotPainter {
0033 public:
0034 enum EDefaults {
0035 kNContours = 4,
0036 kNLowPts = 50
0037 };
0038
0039 typedef Rgl::Mc::TIsoMesh<Float_t> Mesh_t;
0040
0041
0042 struct Surf_t {
0043 Surf_t()
0044 : f4D(0.), fRange(0.), fShowCloud(kFALSE), fHide(kFALSE),
0045 fColor(0), fHighlight(kFALSE), fAlpha(100)
0046 {
0047 }
0048
0049 Mesh_t fMesh;
0050 Double_t f4D;
0051 Double_t fRange;
0052 Bool_t fShowCloud;
0053 Bool_t fHide;
0054 Color_t fColor;
0055 std::vector<Double_t> fPreds;
0056 Bool_t fHighlight;
0057 Int_t fAlpha;
0058 };
0059
0060 typedef std::list<Surf_t> SurfList_t;
0061 typedef SurfList_t::iterator SurfIter_t;
0062 typedef SurfList_t::const_iterator ConstSurfIter_t;
0063
0064 private:
0065 TKDEFGT fKDE;
0066 Rgl::Mc::TMeshBuilder<TKDEFGT, Float_t> fMeshBuilder;
0067
0068 const Surf_t fDummy;
0069 Bool_t fInit;
0070
0071 SurfList_t fIsos;
0072 TGL5DDataSet *fData;
0073
0074 typedef std::vector<Double_t>::size_type size_type;
0075
0076 Rgl::Range_t fV5PredictedRange;
0077 Rgl::Range_t fV5SliderRange;
0078 Bool_t fShowSlider;
0079
0080 Double_t fAlpha;
0081 Int_t fNContours;
0082
0083 public:
0084 TGL5DPainter(TGL5DDataSet *data, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
0085
0086
0087 SurfIter_t AddSurface(Double_t v4, Color_t ci, Double_t isoVal = 1., Double_t sigma = 1.,
0088 Double_t range = 1e-3, Int_t lowNumOfPoints = kNLowPts);
0089
0090 void AddSurface(Double_t v4);
0091 void RemoveSurface(SurfIter_t surf);
0092
0093
0094 char *GetPlotInfo(Int_t px, Int_t py) override;
0095 Bool_t InitGeometry() override;
0096 void StartPan(Int_t px, Int_t py) override;
0097 void Pan(Int_t px, Int_t py) override;
0098 void AddOption(const TString &option) override;
0099 void ProcessEvent(Int_t event, Int_t px, Int_t py) override;
0100
0101
0102 void ShowBoxCut(Bool_t show) {fBoxCut.SetActive(show);}
0103 Bool_t IsBoxCutShown()const{return fBoxCut.IsActive();}
0104
0105 void SetAlpha(Double_t newAlpha);
0106 Double_t GetAlpha()const{return fAlpha;}
0107
0108 void SetNContours(Int_t num);
0109 Int_t GetNContours()const{return fNContours;}
0110
0111 void ResetGeometryRanges();
0112
0113 SurfIter_t SurfacesBegin();
0114 SurfIter_t SurfacesEnd();
0115
0116 private:
0117
0118 void InitGL()const override;
0119 void DeInitGL()const override;
0120
0121 void DrawPlot()const override;
0122
0123
0124 void DrawSectionXOZ()const override{}
0125 void DrawSectionYOZ()const override{}
0126 void DrawSectionXOY()const override{}
0127
0128
0129 void SetSurfaceColor(ConstSurfIter_t surf)const;
0130 void DrawCloud()const;
0131 void DrawSubCloud(Double_t v4, Double_t range, Color_t ci)const;
0132 void DrawMesh(ConstSurfIter_t surf)const;
0133
0134 TGL5DPainter(const TGL5DPainter &);
0135 TGL5DPainter &operator = (const TGL5DPainter &);
0136 };
0137
0138 #endif