1 #ifndef INCLUDE_ONCE_71D92E37_E297_472C_8495_1BF8EA61DC99 2 #define INCLUDE_ONCE_71D92E37_E297_472C_8495_1BF8EA61DC99 5 #include <QOpenGLWidget> 6 #include <QOpenGLTexture> 7 #include <QOpenGLFunctions_3_3_Core> 9 #include "../common/AtmosphereParameters.hpp" 12 class GLWidget :
public QOpenGLWidget,
public QOpenGLFunctions_3_3_Core
30 sRGBlChromaticityToMax,
34 std::unique_ptr<ShowMySky::AtmosphereRenderer> renderer;
35 std::unique_ptr<QOpenGLShaderProgram> luminanceToScreenRGB_;
36 std::unique_ptr<QOpenGLShaderProgram> glareProgram_;
37 QOpenGLTexture ditherPatternTexture_;
38 GLuint glareTextures_[2] = {};
39 GLuint glareFBOs_[2] = {};
42 GLuint vao_=0, vbo_=0;
43 QPoint lastRadianceCapturePosition{-1,-1};
44 decltype(::ShowMySky_AtmosphereRenderer_create)* ShowMySky_AtmosphereRenderer_create=
nullptr;
45 Projection currentProjection_ = Projection::Equirectangular;
46 ColorMode currentColorMode_ = ColorMode::sRGB;
53 } dragMode_=DragMode::None;
54 int prevMouseX_, prevMouseY_;
75 void initializeGL()
override;
76 void paintGL()
override;
77 void resizeGL(
int w,
int h)
override;
78 void wheelEvent(QWheelEvent* event)
override;
79 void mouseMoveEvent(QMouseEvent* event)
override;
80 void mousePressEvent(QMouseEvent* event)
override;
81 void mouseReleaseEvent(QMouseEvent* event)
override;
82 bool eventFilter(QObject*
object, QEvent* event)
override;
83 void keyPressEvent(QKeyEvent* event)
override;
88 void stepDataLoading();
89 void stepShaderReloading();
90 void stepPreparationToDraw(
bool emitProgressStatus);
91 QVector3D rgbMaxValue()
const;
92 void makeGlareRenderTarget();
93 void makeDitherPatternTexture();
94 void updateSpectralRadiance(QPoint
const& pixelPos);
95 void setDragMode(DragMode mode,
int x=0,
int y=0) { dragMode_=mode; prevMouseX_=x; prevMouseY_=y; }
96 void setFlatSolarSpectrum();
97 void resetSolarSpectrum();
98 void setBlackBodySolarSpectrum(
double temperature);
99 void saveScreenshot();
100 Projection currentProjection()
const {
return currentProjection_; }
101 ColorMode currentColorMode ()
const {
return currentColorMode_; }
104 void frameFinished(
long long timeInUS);
105 void loadProgress(QString
const& currentActivity,
int stepsDone,
int stepsToDo);