File indexing completed on 2026-09-26 09:13:14
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TGLTF3Painter
0013 #define ROOT_TGLTF3Painter
0014
0015 #include <vector>
0016 #include <list>
0017
0018 #include "TGLPlotPainter.h"
0019 #include "TGLIsoMesh.h"
0020 #include "TGLUtil.h"
0021
0022 class TGLPlotCamera;
0023 class TF3;
0024
0025
0026
0027
0028
0029 class TGLTF3Painter : public TGLPlotPainter {
0030 private:
0031 enum ETF3Style {
0032
0033 #if defined(__clang__) && __clang_major__ < 20
0034 #pragma clang diagnostic push
0035 #pragma clang diagnostic ignored "-Wshadow"
0036 #endif
0037 kDefault,
0038 #if defined(__clang__) && __clang_major__ < 20
0039 #pragma clang diagnostic pop
0040 #endif
0041 kMaple0,
0042 kMaple1,
0043 kMaple2
0044 };
0045
0046 ETF3Style fStyle;
0047
0048 Rgl::Mc::TIsoMesh<Double_t> fMesh;
0049 TF3 *fF3;
0050
0051 TGLTH3Slice fXOZSlice;
0052 TGLTH3Slice fYOZSlice;
0053 TGLTH3Slice fXOYSlice;
0054
0055 public:
0056 TGLTF3Painter(TF3 *fun, TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
0057
0058 char *GetPlotInfo(Int_t px, Int_t py) override;
0059 Bool_t InitGeometry() override;
0060 void StartPan(Int_t px, Int_t py) override;
0061 void Pan(Int_t px, Int_t py) override;
0062 void AddOption(const TString &stringOption) override;
0063 void ProcessEvent(Int_t event, Int_t px, Int_t py) override;
0064
0065 private:
0066 void InitGL()const override;
0067 void DeInitGL()const override;
0068
0069 void DrawPlot()const override;
0070
0071 void DrawToSelectionBuffer()const;
0072 void DrawDefaultPlot()const;
0073 void DrawMaplePlot()const;
0074
0075
0076 void SetSurfaceColor()const;
0077 Bool_t HasSections()const;
0078
0079 void DrawSectionXOZ()const override;
0080 void DrawSectionYOZ()const override;
0081 void DrawSectionXOY()const override;
0082
0083 ClassDefOverride(TGLTF3Painter, 0)
0084 };
0085
0086
0087
0088
0089
0090
0091
0092
0093 class TGLIsoPainter : public TGLPlotPainter {
0094 private:
0095 typedef Rgl::Mc::TIsoMesh<Float_t> Mesh_t;
0096 typedef std::list<Mesh_t> MeshList_t;
0097 typedef std::list<Mesh_t>::iterator MeshIter_t;
0098 typedef std::list<Mesh_t>::const_iterator ConstMeshIter_t;
0099
0100 TGLTH3Slice fXOZSlice;
0101 TGLTH3Slice fYOZSlice;
0102 TGLTH3Slice fXOYSlice;
0103
0104 Mesh_t fDummyMesh;
0105
0106 MeshList_t fIsos;
0107
0108
0109 MeshList_t fCache;
0110
0111 Rgl::Range_t fMinMax;
0112
0113 TGLLevelPalette fPalette;
0114
0115 std::vector<Double_t> fColorLevels;
0116
0117
0118 Bool_t fInit;
0119
0120 public:
0121 TGLIsoPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
0122
0123
0124 char *GetPlotInfo(Int_t px, Int_t py) override;
0125 Bool_t InitGeometry() override;
0126 void StartPan(Int_t px, Int_t py) override;
0127 void Pan(Int_t px, Int_t py) override;
0128 void AddOption(const TString &option) override;
0129 void ProcessEvent(Int_t event, Int_t px, Int_t py) override;
0130
0131 private:
0132
0133 void InitGL()const override;
0134 void DeInitGL()const override;
0135
0136 void DrawPlot()const override;
0137 void DrawSectionXOZ()const override;
0138 void DrawSectionYOZ()const override;
0139 void DrawSectionXOY()const override;
0140
0141 Bool_t HasSections()const;
0142 void SetSurfaceColor(Int_t ind)const;
0143 void SetMesh(Mesh_t &mesh, Double_t isoValue);
0144 void DrawMesh(const Mesh_t &mesh, Int_t level)const;
0145 void FindMinMax();
0146
0147 TGLIsoPainter(const TGLIsoPainter &);
0148 TGLIsoPainter &operator = (const TGLIsoPainter &);
0149
0150 ClassDefOverride(TGLIsoPainter, 0)
0151 };
0152
0153 #endif