1 #ifndef INCLUDE_ONCE_02040F35_0604_4759_A47D_71849AAC953D 2 #define INCLUDE_ONCE_02040F35_0604_4759_A47D_71849AAC953D 13 #include "Settings.hpp" 14 #include "Exception.hpp" 17 #ifdef SHOWMYSKY_COMPILING_SHARED_LIB 18 # define SHOWMYSKY_DLL_PUBLIC Q_DECL_EXPORT 19 #elif defined SHOWMYSKY_COMPILING_CALCMYSKY 20 # define SHOWMYSKY_DLL_PUBLIC 22 # define SHOWMYSKY_DLL_PUBLIC Q_DECL_IMPORT 28 class QOpenGLShaderProgram;
29 class QOpenGLFunctions_3_3_Core;
84 virtual void setDrawSurfaceCallback(std::function<
void(QOpenGLShaderProgram& shprog)>
const& drawSurface) = 0;
97 virtual int initDataLoading(QByteArray viewDirVertShaderSrc, QByteArray viewDirFragShaderSrc,
98 std::vector<std::pair<std::string,GLuint>> viewDirBindAttribLocations={}) = 0;
177 virtual void draw(
double brightness,
bool clear) = 0;
186 virtual void resizeEvent(
int width,
int height) = 0;
222 virtual void setSolarSpectrum(std::vector<float>
const& spectralIrradianceAtTOA) = 0;
281 QString
const* pathToData,
283 std::function<
void(QOpenGLShaderProgram&)>
const* drawSurface);
291 #define ShowMySky_ABI_version (13+QT_VERSION_MAJOR*100000000u) 298 #if QT_VERSION < QT_VERSION_CHECK(6,0,0) 299 # define SHOWMYSKY_LIB_NAME "ShowMySky-Qt5" 301 # define SHOWMYSKY_LIB_NAME "ShowMySky-Qt6" virtual bool canGrabRadiance() const =0
Tell whether radiance of a pixel can be queried.
virtual int initPreparationToDraw()=0
Initialize step-by-step process of preparation to render.
virtual void resetSolarSpectrum()=0
Reset solar spectrum to the default.
Scene settings for AtmosphereRenderer.
Definition: Settings.hpp:9
virtual bool canSetSolarSpectrum() const =0
Tell whether solar spectrum can be changed.
Definition: AtmosphereRenderer.hpp:34
virtual void draw(double brightness, bool clear)=0
Do the drawing.
virtual LoadingStatus stepPreparationToDraw()=0
Perform a single step of preparation to draw.
virtual SpectralRadiance getPixelSpectralRadiance(QPoint const &pixelPos)=0
Get spectral radiance of a pixel.
virtual LoadingStatus stepDataLoading()=0
Perform a single step of data loading.
virtual LoadingStatus stepShaderReloading()=0
Perform a single step of reloading of shaders.
Status of data loading process.
Definition: AtmosphereRenderer.hpp:66
float azimuth
Azimuth from which this radiance was measured, in degrees.
Definition: AtmosphereRenderer.hpp:45
virtual void setDrawSurfaceCallback(std::function< void(QOpenGLShaderProgram &shprog)> const &drawSurface)=0
Set the callback that will draw the screen surface.
float elevation
View elevation angle, in degrees.
Definition: AtmosphereRenderer.hpp:60
virtual Direction getViewDirection(QPoint const &pixelPos)=0
Get view direction of a pixel.
virtual void setSolarSpectrum(std::vector< float > const &spectralIrradianceAtTOA)=0
Set a custom solar spectrum.
virtual QVector4D getPixelLuminance(QPoint const &pixelPos)=0
Get luminance of a pixel.
int stepsDone
Number of steps done.
Definition: AtmosphereRenderer.hpp:68
float elevation
Elevation angle from which this radiance was measured, in degrees.
Definition: AtmosphereRenderer.hpp:46
virtual bool isLoading() const =0
Tell whether the renderer is in process of loading data.
unsigned size() const
Number of points in the spectrum.
Definition: AtmosphereRenderer.hpp:49
virtual int initShaderReloading()=0
Initialize step-by-step process of reloading of shaders.
virtual void setScattererEnabled(QString const &name, bool enable)=0
Enable or disable a single-scattering layer.
SHOWMYSKY_DLL_PUBLIC ShowMySky::AtmosphereRenderer * ShowMySky_AtmosphereRenderer_create(QOpenGLFunctions_3_3_Core *gl, QString const *pathToData, ShowMySky::Settings *tools, std::function< void(QOpenGLShaderProgram &)> const *drawSurface)
Entry point for the creator of AtmosphereRenderer.
Definition: AtmosphereRenderer.cpp:12
std::vector< float > radiances
Spectral radiance in .
Definition: AtmosphereRenderer.hpp:43
virtual bool canRenderPrecomputedEclipsedDoubleScattering() const =0
Tell whether precomputed eclipsed double scattering can be rendered.
bool empty() const
true if the spectrum has no points.
Definition: AtmosphereRenderer.hpp:51
virtual bool isReadyToRender() const =0
Tell whether the renderer is ready for a draw call.
virtual void resizeEvent(int width, int height)=0
Update render target size.
virtual int initDataLoading(QByteArray viewDirVertShaderSrc, QByteArray viewDirFragShaderSrc, std::vector< std::pair< std::string, GLuint >> viewDirBindAttribLocations={})=0
Initialize step-by-step process of loading of data.
float azimuth
View azimuth, in degrees.
Definition: AtmosphereRenderer.hpp:59
Spectral radiance of a pixel.
Definition: AtmosphereRenderer.hpp:40
virtual GLuint getLuminanceTexture()=0
Get OpenGL name of the luminance render target.
View direction of a pixel.
Definition: AtmosphereRenderer.hpp:57
virtual std::vector< float > getWavelengths()=0
Get the wavelengths used in computations.
virtual QString currentActivity() const =0
Get a string describing current activity.
std::vector< float > wavelengths
Wavelengths in nanometers.
Definition: AtmosphereRenderer.hpp:42
int stepsToDo
Total number of steps to do. Negative in case of error (e.g. when a step function was called at inapp...
Definition: AtmosphereRenderer.hpp:69