21 #ifndef _SCENERY3DMGR_HPP_
22 #define _SCENERY3DMGR_HPP_
25 #include <QStringList>
27 #include <QtConcurrent>
29 #include "StelCore.hpp"
30 #include "StelPluginInterface.hpp"
31 #include "StelModule.hpp"
32 #include "StelUtils.hpp"
33 #include "StelFader.hpp"
34 #include "StelActionMgr.hpp"
35 #include "StelProgressController.hpp"
37 #include "SceneInfo.hpp"
38 #include "S3DEnum.hpp"
53 Q_PROPERTY(
bool enableScene READ getEnableScene WRITE
setEnableScene NOTIFY enableSceneChanged)
54 Q_PROPERTY(
bool enablePixelLighting READ getEnablePixelLighting WRITE setEnablePixelLighting NOTIFY enablePixelLightingChanged)
55 Q_PROPERTY(
bool enableShadows READ getEnableShadows WRITE
setEnableShadows NOTIFY enableShadowsChanged)
56 Q_PROPERTY(
bool useSimpleShadows READ getUseSimpleShadows WRITE
setUseSimpleShadows NOTIFY useSimpleShadowsChanged)
57 Q_PROPERTY(
bool enableBumps READ getEnableBumps WRITE
setEnableBumps NOTIFY enableBumpsChanged)
59 Q_PROPERTY(
bool enablePCSS READ getEnablePCSS WRITE setEnablePCSS NOTIFY enablePCSSChanged)
61 Q_PROPERTY(
bool useFullCubemapShadows READ getUseFullCubemapShadows WRITE setUseFullCubemapShadows NOTIFY useFullCubemapShadowsChanged)
62 Q_PROPERTY(
bool enableDebugInfo READ getEnableDebugInfo WRITE
setEnableDebugInfo NOTIFY enableDebugInfoChanged)
63 Q_PROPERTY(
bool enableLocationInfo READ getEnableLocationInfo WRITE
setEnableLocationInfo NOTIFY enableLocationInfoChanged)
64 Q_PROPERTY(
bool enableTorchLight READ getEnableTorchLight WRITE
setEnableTorchLight NOTIFY enableTorchLightChanged)
65 Q_PROPERTY(
float torchStrength READ getTorchStrength WRITE
setTorchStrength NOTIFY torchStrengthChanged)
66 Q_PROPERTY(
float torchRange READ getTorchRange WRITE
setTorchRange NOTIFY torchRangeChanged)
67 Q_PROPERTY(
bool enableLazyDrawing READ getEnableLazyDrawing WRITE
setEnableLazyDrawing NOTIFY enableLazyDrawingChanged)
68 Q_PROPERTY(
double lazyDrawingInterval READ getLazyDrawingInterval WRITE
setLazyDrawingInterval NOTIFY lazyDrawingIntervalChanged)
69 Q_PROPERTY(
bool onlyDominantFaceWhenMoving READ getOnlyDominantFaceWhenMoving WRITE
setOnlyDominantFaceWhenMoving NOTIFY onlyDominantFaceWhenMovingChanged)
70 Q_PROPERTY(
bool secondDominantFaceWhenMoving READ getSecondDominantFaceWhenMoving WRITE setSecondDominantFaceWhenMoving NOTIFY secondDominantFaceWhenMovingChanged)
71 Q_PROPERTY(uint cubemapSize READ getCubemapSize WRITE
setCubemapSize NOTIFY cubemapSizeChanged)
72 Q_PROPERTY(uint shadowmapSize READ getShadowmapSize WRITE
setShadowmapSize NOTIFY shadowmapSizeChanged)
75 Q_PROPERTY(
bool isGeometryShaderSupported READ getIsGeometryShaderSupported)
76 Q_PROPERTY(
bool areShadowsSupported READ getAreShadowsSupported)
77 Q_PROPERTY(
bool isShadowFilteringSupported READ getIsShadowFilteringSupported)
78 Q_PROPERTY(
bool isANGLE READ getIsANGLE)
79 Q_PROPERTY(uint maximumFramebufferSize READ getMaximumFramebufferSize)
87 virtual void deinit();
89 virtual void update(
double deltaTime);
90 virtual double getCallOrder(StelModuleActionName actionName)
const;
91 virtual bool configureGui(
bool show);
92 virtual void handleKeys(QKeyEvent* e);
95 void updateProgress(
const QString& str,
int val,
int min,
int max);
97 void enableSceneChanged(
const bool val);
98 void enablePixelLightingChanged(
const bool val);
99 void enableShadowsChanged(
const bool val);
100 void useSimpleShadowsChanged(
const bool val);
101 void enableBumpsChanged(
const bool val);
103 void enablePCSSChanged(
const bool val);
104 void cubemappingModeChanged(
const S3DEnum::CubemappingMode val);
105 void useFullCubemapShadowsChanged(
const bool val);
106 void enableDebugInfoChanged(
const bool val);
107 void enableLocationInfoChanged(
const bool val);
108 void enableTorchLightChanged(
const bool val);
109 void torchStrengthChanged(
const float val);
110 void torchRangeChanged(
const float val);
111 void enableLazyDrawingChanged(
const bool val);
112 void lazyDrawingIntervalChanged(
const double val);
113 void onlyDominantFaceWhenMovingChanged(
const bool val);
114 void secondDominantFaceWhenMovingChanged(
const bool val);
115 void cubemapSizeChanged(
const uint val);
116 void shadowmapSizeChanged(
const uint val);
118 void currentSceneChanged(
const SceneInfo& sceneInfo);
121 void progressReport(
const QString& str,
int val,
int min,
int max);
135 bool getEnableScene()
const {
return flagEnabled; }
137 void setEnablePixelLighting(
const bool val);
138 bool getEnablePixelLighting(
void)
const;
143 bool getEnableShadows(
void)
const;
147 bool getUseSimpleShadows()
const;
152 bool getEnableBumps(
void)
const;
159 void setEnablePCSS(
const bool val);
160 bool getEnablePCSS()
const;
167 bool getUseFullCubemapShadows()
const;
168 void setUseFullCubemapShadows(
const bool useFullCubemapShadows);
172 bool getEnableDebugInfo()
const;
176 bool getEnableLocationInfo()
const;
180 bool getEnableTorchLight()
const;
184 float getTorchStrength()
const;
188 float getTorchRange()
const;
192 bool getEnableLazyDrawing()
const;
196 bool getOnlyDominantFaceWhenMoving()
const;
198 void setSecondDominantFaceWhenMoving(
const bool val);
199 bool getSecondDominantFaceWhenMoving()
const;
206 double getLazyDrawingInterval()
const;
211 uint getCubemapSize()
const;
216 uint getShadowmapSize()
const;
219 bool getIsGeometryShaderSupported()
const;
220 bool getAreShadowsSupported()
const;
221 bool getIsShadowFilteringSupported()
const;
222 bool getIsANGLE()
const;
223 uint getMaximumFramebufferSize()
const;
242 QString getDefaultScenery3dID()
const {
return defaultScenery3dID; }
243 void setDefaultScenery3dID(
const QString&
id);
253 void loadSceneCompleted();
254 void progressReceive(
const QString& str,
int val,
int min,
int max);
261 void createActions();
263 void createToolbarButtons()
const;
266 bool loadSceneBackground();
274 QString defaultScenery3dID;
278 StelCore::ProjectionType oldProjectionType;
282 QTimer* messageTimer;
285 QString currentMessage;
289 QFutureWatcher<bool> currentLoadFuture;
294 #include "StelPluginInterface.hpp"
300 Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
void setEnableLocationInfo(const bool enableLocationInfo)
Set to true to show the current standing positin as text on screen.
S3DEnum::CubemappingMode getCubemappingMode(void) const
Returns the current cubemapping mode.
void setUseSimpleShadows(const bool simpleShadows)
If true, only 1 shadow cascade is used, giving a speedup.
void setCubemappingMode(const S3DEnum::CubemappingMode val)
Sets the cubemapping mode.
StoredView getCurrentView()
Returns a StoredView that represents the current observer position + view direction.
void setOnlyDominantFaceWhenMoving(const bool val)
When true, only the face which currently is most dominantly visible is updated while moving...
void setShadowFilterQuality(const S3DEnum::ShadowFilterQuality val)
Sets the shadow filter quality.
void setLazyDrawingInterval(const double val)
Sets the interval for cubemap lazy-drawing mode.
void setEnableShadows(const bool enableShadows)
Use this to set/get the enableShadows flag.
Contains all the metadata necessary for a Scenery3d scene, and can be loaded from special ...
void forceCubemapRedraw()
Forces a redraw of the cubemap.
void setTorchRange(const float torchRange)
Sets the range of the torchlight.
void reloadShaders()
Clears the shader cache, forcing a reload of shaders on use.
void setEnableScene(const bool val)
Enables/Disables the plugin.
void setCubemapSize(const uint val)
Sets the size used for cubemap rendering.
S3DEnum::ShadowFilterQuality getShadowFilterQuality(void) const
Returns the current shadow filter quality.
virtual StelPluginInfo getPluginInfo() const =0
Main class of the module, inherits from StelModule.
void setEnableTorchLight(const bool enableTorchLight)
Set to true to add an additional light source centered at the current position, useful in night scene...
SceneInfo getLoadingScene() const
Gets the SceneInfo of the scene that is currently in the process of being loaded. ...
void setEnableLazyDrawing(const bool val)
Sets the state of the cubemap lazy-drawing mode.
void showStoredViewDialog()
Shows the stored view dialog.
Representation of a complete 3D scenery.
void showMessage(const QString &message)
Display text message on screen, fade out automatically.
ShadowFilterQuality
Contains different shadow filter settings.
void progressReport(const QString &str, int val, int min, int max)
This signal is emitted from another thread than this QObject belongs to, so use QueuedConnection.
virtual class StelModule * getStelModule() const =0
SceneInfo loadScenery3dByID(const QString &id)
This starts the scene loading process.
void setView(const StoredView &view, const bool setDate)
Changes the current view to the given view. JD is updated only if view contains valid data and setDat...
void updateProgress(const QString &str, int val, int min, int max)
Sends the progressReport() signal, which eventually updates the progress bar. Can be called from anot...
SceneInfo loadScenery3dByName(const QString &name)
This starts the scene loading process.
void setEnableDebugInfo(const bool debugEnabled)
Set to true to show some rendering debug information.
A structure which stores a specific view position, view direction and FOV, together with a textual de...
SceneInfo getCurrentScene() const
Gets the SceneInfo of the scene that is currently being displayed.
void setEnableBumps(const bool enableBumps)
Use this to set/get the enableBumps flag.
void setTorchStrength(const float torchStrength)
Sets the strength of the additional illumination that can be toggled when pressing a button...
void setShadowmapSize(const uint val)
Sets the size used for shadowmap rendering.
This class is used by Qt to manage a plug-in interface.