Merge lp:~georg-zotti/stellarium/gz_landscape-switch-lights into lp:stellarium

Proposed by gzotti
Status: Merged
Merged at revision: 7104
Proposed branch: lp:~georg-zotti/stellarium/gz_landscape-switch-lights
Merge into: lp:stellarium
Diff against target: 489 lines (+117/-63)
8 files modified
data/default_config.ini.cmake (+1/-0)
src/core/modules/Landscape.cpp (+28/-21)
src/core/modules/Landscape.hpp (+24/-20)
src/core/modules/LandscapeMgr.cpp (+22/-4)
src/core/modules/LandscapeMgr.hpp (+12/-0)
src/gui/ConfigurationDialog.cpp (+2/-1)
src/gui/ViewDialog.cpp (+1/-0)
src/gui/viewDialog.ui (+27/-17)
To merge this branch: bzr merge lp:~georg-zotti/stellarium/gz_landscape-switch-lights
Reviewer Review Type Date Requested Status
Alexander Wolf Approve
Review via email: mp+239626@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alexander Wolf (alexwolf) wrote :

Proposed solution is very good for people, who not want illumination layer for landscapes.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/default_config.ini.cmake'
2--- data/default_config.ini.cmake 2014-09-10 13:15:56 +0000
3+++ data/default_config.ini.cmake 2014-10-25 00:07:25 +0000
4@@ -186,6 +186,7 @@
5 flag_minimal_brightness = false
6 # This allows use of a minimum value even given in the respective landscape.ini
7 flag_landscape_sets_minimal_brightness = false
8+flag_enable_illumination_layer = true
9
10 [viewing]
11 flag_constellation_drawing = false
12
13=== modified file 'src/core/modules/Landscape.cpp'
14--- src/core/modules/Landscape.cpp 2014-09-07 23:49:52 +0000
15+++ src/core/modules/Landscape.cpp 2014-10-25 00:07:25 +0000
16@@ -517,11 +517,11 @@
17 drawGround(core, painter);
18 drawFog(core, painter);
19
20- // GZ: ALSO HERE - Self-luminous layer (Light pollution etc). This looks striking!
21- if (lightScapeBrightness>0.0f && core->getSkyDrawer()->getFlagHasAtmosphere())
22+ // Self-luminous layer (Light pollution etc). This looks striking!
23+ if (lightScapeBrightness>0.0f && illumFader.getInterstate())
24 {
25 glBlendFunc(GL_SRC_ALPHA, GL_ONE);
26- drawDecor(core, painter, true); // GZ: NEW
27+ drawDecor(core, painter, true);
28 }
29
30 // If a horizon line also has been defined, draw it.
31@@ -545,6 +545,10 @@
32 {
33 if (!fogFader.getInterstate())
34 return;
35+ if(!landFader.getInterstate())
36+ return;
37+ if (!(core->getSkyDrawer()->getFlagHasAtmosphere()))
38+ return;
39
40 const float vpos = (tanMode||calibrated) ? radius*std::tan(fogAngleShift*M_PI/180.) : radius*std::sin(fogAngleShift*M_PI/180.);
41 StelProjector::ModelViewTranformP transfo = core->getAltAzModelViewTransform(StelCore::RefractionOff);
42@@ -555,9 +559,9 @@
43 transfo->combine(Mat4d::translation(Vec3d(0.,0.,vpos)));
44 sPainter.setProjector(core->getProjection(transfo));
45 glBlendFunc(GL_ONE, GL_ONE);
46- sPainter.setColor(fogFader.getInterstate()*(0.1f+0.1f*landscapeBrightness),
47- fogFader.getInterstate()*(0.1f+0.1f*landscapeBrightness),
48- fogFader.getInterstate()*(0.1f+0.1f*landscapeBrightness));
49+ sPainter.setColor(landFader.getInterstate()*fogFader.getInterstate()*(0.1f+0.1f*landscapeBrightness),
50+ landFader.getInterstate()*fogFader.getInterstate()*(0.1f+0.1f*landscapeBrightness),
51+ landFader.getInterstate()*fogFader.getInterstate()*(0.1f+0.1f*landscapeBrightness), landFader.getInterstate());
52 fogTex->bind();
53 const float height = (calibrated?
54 radius*(std::tan((fogAltAngle+fogAngleShift)*M_PI/180.) - std::tan(fogAngleShift*M_PI/180.))
55@@ -576,7 +580,7 @@
56 if (!landFader.getInterstate())
57 return;
58 if (drawLight)
59- sPainter.setColor(lightScapeBrightness, lightScapeBrightness, lightScapeBrightness, landFader.getInterstate());
60+ sPainter.setColor(illumFader.getInterstate()*lightScapeBrightness, illumFader.getInterstate()*lightScapeBrightness, illumFader.getInterstate()*lightScapeBrightness, landFader.getInterstate());
61 else
62 sPainter.setColor(landscapeBrightness, landscapeBrightness, landscapeBrightness, landFader.getInterstate());
63
64@@ -815,21 +819,23 @@
65 mapTex->bind();
66 sPainter.sSphereMap(radius,cols,rows,texFov,1);
67 // NEW since 0.13: Fog also for fisheye...
68- if (mapTexFog)
69+ if ((mapTexFog) && (core->getSkyDrawer()->getFlagHasAtmosphere()))
70 {
71 //glBlendFunc(GL_ONE, GL_ONE); // GZ: Take blending mode as found in the old_style landscapes...
72 glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); // GZ: better?
73- sPainter.setColor(fogFader.getInterstate()*(0.1f+0.1f*landscapeBrightness),
74- fogFader.getInterstate()*(0.1f+0.1f*landscapeBrightness),
75- fogFader.getInterstate()*(0.1f+0.1f*landscapeBrightness), fogFader.getInterstate());
76+ sPainter.setColor(landFader.getInterstate()*fogFader.getInterstate()*(0.1f+0.1f*landscapeBrightness),
77+ landFader.getInterstate()*fogFader.getInterstate()*(0.1f+0.1f*landscapeBrightness),
78+ landFader.getInterstate()*fogFader.getInterstate()*(0.1f+0.1f*landscapeBrightness), landFader.getInterstate());
79 mapTexFog->bind();
80 sPainter.sSphereMap(radius,cols,rows,texFov,1);
81 }
82
83- if (mapTexIllum && lightScapeBrightness>0.0f && core->getSkyDrawer()->getFlagHasAtmosphere())
84+ if (mapTexIllum && lightScapeBrightness>0.0f && illumFader.getInterstate())
85 {
86 glBlendFunc(GL_SRC_ALPHA, GL_ONE);
87- sPainter.setColor(lightScapeBrightness, lightScapeBrightness, lightScapeBrightness, landFader.getInterstate());
88+ sPainter.setColor(illumFader.getInterstate()*lightScapeBrightness,
89+ illumFader.getInterstate()*lightScapeBrightness,
90+ illumFader.getInterstate()*lightScapeBrightness, landFader.getInterstate());
91 mapTexIllum->bind();
92 sPainter.sSphereMap(radius, cols, rows, texFov, 1);
93 }
94@@ -971,22 +977,23 @@
95 // seam is at East, except if angleRotateZ has been given.
96 sPainter.sSphere(radius, 1.0, cols, rows, 1, true, mapTexTop, mapTexBottom);
97 // Since 0.13: Fog also for sphericals...
98- if (mapTexFog)
99+ if ((mapTexFog) && (core->getSkyDrawer()->getFlagHasAtmosphere()))
100 {
101- //glBlendFunc(GL_ONE, GL_ONE); // GZ: blending mode as found in the old_style landscapes...
102- glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); // GZ: better?
103- sPainter.setColor(fogFader.getInterstate()*(0.1f+0.1f*landscapeBrightness),
104- fogFader.getInterstate()*(0.1f+0.1f*landscapeBrightness),
105- fogFader.getInterstate()*(0.1f+0.1f*landscapeBrightness), fogFader.getInterstate());
106+ glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR);
107+ sPainter.setColor(landFader.getInterstate()*fogFader.getInterstate()*(0.1f+0.1f*landscapeBrightness),
108+ landFader.getInterstate()*fogFader.getInterstate()*(0.1f+0.1f*landscapeBrightness),
109+ landFader.getInterstate()*fogFader.getInterstate()*(0.1f+0.1f*landscapeBrightness), landFader.getInterstate());
110 mapTexFog->bind();
111 sPainter.sSphere(radius, 1.0, cols, (int) ceil(rows*(fogTexTop-fogTexBottom)/(mapTexTop-mapTexBottom)), 1, true, fogTexTop, fogTexBottom);
112 }
113
114 // Self-luminous layer (Light pollution etc). This looks striking!
115- if (mapTexIllum && lightScapeBrightness>0.0f && core->getSkyDrawer()->getFlagHasAtmosphere())
116+ if (mapTexIllum && (lightScapeBrightness>0.0f) && illumFader.getInterstate())
117 {
118 glBlendFunc(GL_SRC_ALPHA, GL_ONE);
119- sPainter.setColor(lightScapeBrightness, lightScapeBrightness, lightScapeBrightness, landFader.getInterstate());
120+ sPainter.setColor(lightScapeBrightness*illumFader.getInterstate(),
121+ lightScapeBrightness*illumFader.getInterstate(),
122+ lightScapeBrightness*illumFader.getInterstate(), landFader.getInterstate());
123 mapTexIllum->bind();
124 sPainter.sSphere(radius, 1.0, cols, (int) ceil(rows*(illumTexTop-illumTexBottom)/(mapTexTop-mapTexBottom)), 1, true, illumTexTop, illumTexBottom);
125 }
126
127=== modified file 'src/core/modules/Landscape.hpp'
128--- src/core/modules/Landscape.hpp 2014-09-07 23:49:52 +0000
129+++ src/core/modules/Landscape.hpp 2014-10-25 00:07:25 +0000
130@@ -42,11 +42,11 @@
131 //! Don't use this class directly, use the LandscapeMgr.
132 //! A landscape's most important element is a photo panorama.
133 //! Optional components include:
134-//! - A fog texture that is displayed with the Fog [F] command.
135+//! - A fog texture that is displayed with the Fog [F] command (displayed only if atmosphere is on!).
136 //! - A location. It is possible to auto-move to the location when loading.
137 //! - Atmospheric conditions: temperature/pressure/extinction coefficients.
138 //! - Light pollution information (Bortle index)
139-//! - A night texture that gets blended over the dimmed daylight panorama. (Spherical and Fisheye only)
140+//! - A night texture that gets blended over the dimmed daylight panorama. (All landscapes except Polygonal.)
141 //! - A polygonal horizon line (required for PolygonalLandscape). If present, defines a measured horizon line, which can be plotted or queried for rise/set predictions.
142 //! - You can set a minimum brightness level to prevent too dark landscape. There is
143 //! a global activation setting (config.ini[landscape]flag_minimal_brightness),
144@@ -71,6 +71,7 @@
145 {
146 landFader.update((int)(deltaTime*1000));
147 fogFader.update((int)(deltaTime*1000));
148+ illumFader.update((int)(deltaTime*1000));
149 }
150
151 //! Set the brightness of the landscape plus brightness of optional add-on night lightscape.
152@@ -85,6 +86,10 @@
153 void setFlagShowFog(const bool b) {fogFader=b;}
154 //! Get whether fog is displayed
155 bool getFlagShowFog() const {return (bool)fogFader;}
156+ //! Set whether illumination is displayed
157+ void setFlagShowIllumination(const bool b) {illumFader=b;}
158+ //! Get whether illumination is displayed
159+ bool getFlagShowIllumination() const {return (bool)illumFader;}
160 //! Get landscape name
161 QString getName() const {return name;}
162 //! Get landscape author name
163@@ -126,7 +131,7 @@
164 //! can be used to find sunrise or visibility questions on the real-world landscape horizon.
165 //! Default implementation indicates the horizon equals math horizon.
166 virtual float getOpacity(Vec3d azalt) const {return (azalt[2]<0 ? 1.0f : 0.0f); }
167- //! The list of azimuths and altitudes can come in various formats. We read the first two elements, which can be of formats:
168+ //! The list of azimuths (counted from True North towards East) and altitudes can come in various formats. We read the first two elements, which can be of formats:
169 enum horizonListMode {
170 azDeg_altDeg = 0, //! azimuth[degrees] altitude[degrees]
171 azDeg_zdDeg = 1, //! azimuth[degrees] zenithDistance[degrees]
172@@ -163,11 +168,12 @@
173 bool validLandscape; //! was a landscape loaded properly?
174 LinearFader landFader; //! Used to slowly fade in/out landscape painting.
175 LinearFader fogFader; //! Used to slowly fade in/out fog painting.
176+ LinearFader illumFader;//! Used to slowly fade in/out illumination painting.
177 int rows; //! horizontal rows. May be given in landscape.ini:[landscape]tesselate_rows. More indicates higher accuracy, but is slower.
178 int cols; //! vertical columns. May be given in landscape.ini:[landscape]tesselate_cols. More indicates higher accuracy, but is slower.
179 float angleRotateZ; //! [radians] if pano does not have its left border in the east, rotate in azimuth. Configured in landscape.ini[landscape]angle_rotatez (or decor_angle_rotatez for old_style landscapes)
180 float angleRotateZOffset; //! [radians] This is a rotation changeable at runtime via setZRotation (called by LandscapeMgr::setZRotation).
181- //! Not in landscape.ini: Used in special cases where the horizon may rotate, e.g. on a ship.
182+ //! Not in landscape.ini: Used in special cases where the horizon may rotate, e.g. on a ship.
183
184 StelLocation location; //! OPTIONAL. If present, can be used to set location.
185 int defaultBortleIndex; //! May be given in landscape.ini:[location]light_pollution. Default: -1 (no change).
186@@ -178,10 +184,10 @@
187
188 // Optional elements which, if present, describe a horizon polygon. They can be used to render a line or a filled region, esp. in LandscapePolygonal
189 SphericalRegionP horizonPolygon; //! Optional element describing the horizon line.
190- //! Data shall be read from the file given as landscape.ini[landscape]polygonal_horizon_list
191- //! For LandscapePolygonal, this is the only horizon data item.
192+ //! Data shall be read from the file given as landscape.ini[landscape]polygonal_horizon_list
193+ //! For LandscapePolygonal, this is the only horizon data item.
194 Vec3f horizonPolygonLineColor ; //! for all horizon types, the horizonPolygon line, if specified, will be drawn in this color
195- //! specified in landscape.ini[landscape]horizon_line_color. Negative red (default) indicated "don't draw".
196+ //! specified in landscape.ini[landscape]horizon_line_color. Negative red (default) indicated "don't draw".
197 };
198
199 //! @class LandscapeOldStyle
200@@ -218,7 +224,7 @@
201
202 private:
203 void drawFog(StelCore* core, StelPainter&) const;
204- // GZ NEW: drawLight selects only the self-illuminating panels.
205+ // drawLight==true for illumination layer, it then selects only the self-illuminating panels.
206 void drawDecor(StelCore* core, StelPainter&, const bool drawLight=false) const;
207 void drawGround(StelCore* core, StelPainter&) const;
208 QVector<double> groundVertexArr;
209@@ -228,17 +234,15 @@
210 int nbSide;
211 landscapeTexCoord* sides;
212 StelTextureSP fogTex;
213- //landscapeTexCoord fogTexCoord; // GZ: UNUSED!
214 StelTextureSP groundTex;
215- QVector<QImage*> sidesImages; // GZ: Required for opacity lookup
216- //landscapeTexCoord groundTexCoord; // GZ: UNUSED!
217+ QVector<QImage*> sidesImages; // Required for opacity lookup
218 int nbDecorRepeat;
219 float fogAltAngle;
220 float fogAngleShift;
221 float decorAltAngle; // vertical extent of the side panels
222 float decorAngleShift;
223 float groundAngleShift; //! [radians]: altitude of the bottom plane. Usually negative and equal to decorAngleShift
224- float groundAngleRotateZ; //! [radians]
225+ float groundAngleRotateZ; //! [radians]: rotation to bring top of texture away from due east.
226 int drawGroundFirst;
227 bool tanMode; // Whether the angles should be converted using tan instead of sin, i.e., for a cylindrical pano
228 bool calibrated; // if true, the documented altitudes are indeed correct (the original code is buggy!)
229@@ -302,9 +306,9 @@
230
231 StelTextureSP mapTex; //!< The fisheye image, centered on the zenith.
232 StelTextureSP mapTexFog; //!< Optional panorama of identical size (create as layer over the mapTex image in your favorite image processor).
233- //!< can also be smaller, just the texture is again mapped onto the same geometry.
234+ //!< can also be smaller, just the texture is again mapped onto the same geometry.
235 StelTextureSP mapTexIllum; //!< Optional fisheye image of identical size (create as layer in your favorite image processor) or at least, proportions.
236- //!< To simulate light pollution (skyglow), street lights, light in windows, ... at night
237+ //!< To simulate light pollution (skyglow), street lights, light in windows, ... at night
238 QImage *mapImage; //!< The same image as mapTex, but stored in-mem for sampling.
239
240 float texFov;
241@@ -350,16 +354,16 @@
242
243 StelTextureSP mapTex; //!< The equirectangular panorama texture
244 StelTextureSP mapTexFog; //!< Optional panorama of identical size (create as layer over the mapTex image in your favorite image processor).
245- //!< can also be smaller, just the texture is again mapped onto the same geometry.
246+ //!< can also be smaller, just the texture is again mapped onto the same geometry.
247 StelTextureSP mapTexIllum; //!< Optional panorama of identical size (create as layer over the mapTex image in your favorite image processor).
248- //!< To simulate light pollution (skyglow), street lights, light in windows, ... at night
249+ //!< To simulate light pollution (skyglow), street lights, light in windows, ... at night
250 // These vars are here to conserve texture memory. They must be allowed to be different: a landscape may have its highest elevations at 15°, fog may reach from -25 to +15°,
251 // light pollution may cover -5° (street lamps slightly below) plus parts of or even the whole sky. All have default values to simplify life.
252 float mapTexTop; //!< zenithal top angle of the landscape texture, radians
253- float mapTexBottom; //!< zenithal bottom angle of the landscape texture, radians
254- float fogTexTop; //!< zenithal top angle of the fog texture, radians
255- float fogTexBottom; //!< zenithal bottom angle of the fog texture, radians
256- float illumTexTop; //!< zenithal top angle of the illumination texture, radians
257+ float mapTexBottom; //!< zenithal bottom angle of the landscape texture, radians
258+ float fogTexTop; //!< zenithal top angle of the fog texture, radians
259+ float fogTexBottom; //!< zenithal bottom angle of the fog texture, radians
260+ float illumTexTop; //!< zenithal top angle of the illumination texture, radians
261 float illumTexBottom; //!< zenithal bottom angle of the illumination texture, radians
262 QImage *mapImage; //!< The same image as mapTex, but stored in-mem for opacity sampling.
263 };
264
265=== modified file 'src/core/modules/LandscapeMgr.cpp'
266--- src/core/modules/LandscapeMgr.cpp 2014-08-10 10:34:05 +0000
267+++ src/core/modules/LandscapeMgr.cpp 2014-10-25 00:07:25 +0000
268@@ -295,7 +295,7 @@
269 }
270 else
271 { float lightscapeBrightness=0.0f;
272- // night pollution brightness is mixed in at -3...-8 degrees.
273+ // light pollution layer is mixed in at -3...-8 degrees.
274 if (sunPos[2]<-0.14f) lightscapeBrightness=1.0f;
275 else if (sunPos[2]<-0.05f) lightscapeBrightness = 1.0f-(sunPos[2]+0.14)/(-0.05+0.14);
276 landscape->setBrightness(landscapeBrightness, lightscapeBrightness);
277@@ -337,7 +337,8 @@
278 setDefaultMinimalBrightness(conf->value("landscape/minimal_brightness", 0.01).toFloat());
279 setFlagLandscapeUseMinimalBrightness(conf->value("landscape/flag_minimal_brightness", false).toBool());
280 setFlagLandscapeSetsMinimalBrightness(conf->value("landscape/flag_landscape_sets_minimal_brightness",false).toBool());
281- setFlagAtmosphereAutoEnable(conf->value("viewing/flag_atmopshere_auto_enable",true).toBool());
282+ setFlagAtmosphereAutoEnable(conf->value("viewing/flag_atmosphere_auto_enable",true).toBool());
283+ setFlagIllumination(conf->value("landscape/flag_enable_illumination_layer", true).toBool());
284
285 bool ok =true;
286 setAtmosphereBortleLightPollution(conf->value("stars/init_bortle_scale",3).toInt(&ok));
287@@ -356,6 +357,7 @@
288 addAction("actionShow_Fog", displayGroup, N_("Fog"), "fogDisplayed", "F");
289 addAction("actionShow_Cardinal_Points", displayGroup, N_("Cardinal points"), "cardinalsPointsDisplayed", "Q");
290 addAction("actionShow_Ground", displayGroup, N_("Ground"), "landscapeDisplayed", "G");
291+ addAction("actionShow_LandscapeIllumination", displayGroup, N_("Illumination"), "illuminationDisplayed", "Shift+G");
292 }
293
294 void LandscapeMgr::setStelStyle(const QString& section)
295@@ -386,6 +388,7 @@
296 // Copy display parameters from previous landscape to new one
297 newLandscape->setFlagShow(landscape->getFlagShow());
298 newLandscape->setFlagShowFog(landscape->getFlagShowFog());
299+ newLandscape->setFlagShowIllumination(landscape->getFlagShowIllumination());
300 delete landscape;
301 landscape = newLandscape;
302 }
303@@ -510,6 +513,19 @@
304 return landscape->getFlagShowFog();
305 }
306
307+void LandscapeMgr::setFlagIllumination(const bool displayed)
308+{
309+ if (landscape->getFlagShowIllumination() != displayed) {
310+ landscape->setFlagShowIllumination(displayed);
311+ emit illuminationDisplayedChanged(displayed);
312+ }
313+}
314+
315+bool LandscapeMgr::getFlagIllumination() const
316+{
317+ return landscape->getFlagShowIllumination();
318+}
319+
320 void LandscapeMgr::setFlagLandscapeAutoSelection(bool enableAutoSelect)
321 {
322 flagLandscapeAutoSelection = enableAutoSelect;
323@@ -637,8 +653,10 @@
324 atmosphere->setFlagShow(displayed);
325 StelApp::getInstance().getCore()->getSkyDrawer()->setFlagHasAtmosphere(displayed);
326 emit atmosphereDisplayedChanged(displayed);
327- if (StelApp::getInstance().getSettings()->value("landscape/flag_fog", true).toBool())
328- setFlagFog(displayed); // sync of visibility of fog because this is atmospheric phenomena
329+ //if (StelApp::getInstance().getSettings()->value("landscape/flag_fog", true).toBool())
330+ // setFlagFog(displayed); // sync of visibility of fog because this is atmospheric phenomena
331+ // GZ This did not work as it may have been intended. Switch off fog, switch off atmosphere. Switch on atmosphere, and you have fog?
332+ // --> Fog is only drawn in Landscape if atmosphere is switched on!
333 }
334 }
335
336
337=== modified file 'src/core/modules/LandscapeMgr.hpp'
338--- src/core/modules/LandscapeMgr.hpp 2014-10-13 12:57:39 +0000
339+++ src/core/modules/LandscapeMgr.hpp 2014-10-25 00:07:25 +0000
340@@ -57,6 +57,10 @@
341 READ getFlagLandscape
342 WRITE setFlagLandscape
343 NOTIFY landscapeDisplayedChanged)
344+ Q_PROPERTY(bool illuminationDisplayed
345+ READ getFlagIllumination
346+ WRITE setFlagIllumination
347+ NOTIFY illuminationDisplayedChanged)
348 Q_PROPERTY(bool databaseUsage
349 READ getFlagUseLightPollutionFromDatabase
350 WRITE setFlagUseLightPollutionFromDatabase
351@@ -172,6 +176,10 @@
352 bool getFlagFog() const;
353 //! Set flag for displaying Fog.
354 void setFlagFog(const bool displayed);
355+ //! Get flag for displaying illumination layer
356+ bool getFlagIllumination() const;
357+ //! Set flag for displaying illumination layer
358+ void setFlagIllumination(const bool on);
359
360 //! Return the value of the flag determining if a change of landscape will update the observer location.
361 bool getFlagLandscapeSetsLocation() const {return flagLandscapeSetsLocation;}
362@@ -312,11 +320,14 @@
363 //! Set flag for auto-enable atmosphere for planets with atmospheres in location window
364 void setFlagAtmosphereAutoEnable(bool b);
365
366+
367+
368 signals:
369 void atmosphereDisplayedChanged(const bool displayed);
370 void cardinalsPointsDisplayedChanged(const bool displayed);
371 void fogDisplayedChanged(const bool displayed);
372 void landscapeDisplayedChanged(const bool displayed);
373+ void illuminationDisplayedChanged(const bool displayed);
374 void lightPollutionUsageChanged(const bool usage);
375
376 //! Emitted when a landscape has been installed or un-installed.
377@@ -359,6 +370,7 @@
378 //! Set light pollution luminance level.
379 void setAtmosphereLightPollutionLuminance(const float f);
380
381+
382 //! For a given landscape name, return the landscape ID.
383 //! This takes a name of the landscape, as described in the landscape:name item in the
384 //! landscape.ini, and returns the landscape ID which corresponds to that name.
385
386=== modified file 'src/gui/ConfigurationDialog.cpp'
387--- src/gui/ConfigurationDialog.cpp 2014-10-12 16:44:56 +0000
388+++ src/gui/ConfigurationDialog.cpp 2014-10-25 00:07:25 +0000
389@@ -546,7 +546,7 @@
390 conf->setValue("viewing/flag_constellation_isolate_selected", cmgr->getFlagIsolateSelected());
391 conf->setValue("viewing/flag_landscape_autoselection", lmgr->getFlagLandscapeAutoSelection());
392 conf->setValue("viewing/flag_light_pollution_database", lmgr->getFlagUseLightPollutionFromDatabase());
393- conf->setValue("viewing/flag_atmopshere_auto_enable", lmgr->getFlagAtmosphereAutoEnable());
394+ conf->setValue("viewing/flag_atmosphere_auto_enable", lmgr->getFlagAtmosphereAutoEnable());
395 conf->setValue("viewing/constellation_art_intensity", cmgr->getArtIntensity());
396 conf->setValue("viewing/flag_night", StelApp::getInstance().getVisionModeNight());
397 conf->setValue("astro/flag_star_name", smgr->getFlagLabels());
398@@ -564,6 +564,7 @@
399 conf->setValue("landscape/flag_atmosphere", lmgr->getFlagAtmosphere());
400 conf->setValue("landscape/flag_brightness", lmgr->getFlagLandscapeSetsMinimalBrightness());
401 conf->setValue("landscape/flag_fog", lmgr->getFlagFog());
402+ conf->setValue("landscape/flag_enable_illumination_layer", lmgr->getFlagIllumination());
403 conf->setValue("stars/init_bortle_scale", core->getSkyDrawer()->getBortleScaleIndex());
404 conf->setValue("landscape/atmospheric_extinction_coefficient", core->getSkyDrawer()->getExtinctionCoefficient());
405 conf->setValue("landscape/pressure_mbar", core->getSkyDrawer()->getAtmospherePressure());
406
407=== modified file 'src/gui/ViewDialog.cpp'
408--- src/gui/ViewDialog.cpp 2014-09-10 13:15:56 +0000
409+++ src/gui/ViewDialog.cpp 2014-10-25 00:07:25 +0000
410@@ -222,6 +222,7 @@
411 connectCheckBox(ui->showGroundCheckBox, "actionShow_Ground");
412 connectCheckBox(ui->showFogCheckBox, "actionShow_Fog");
413 connectGroupBox(ui->atmosphereGroupBox, "actionShow_Atmosphere");
414+ connectCheckBox(ui->landscapeIlluminationCheckBox, "actionShow_LandscapeIllumination");
415
416 ui->landscapePositionCheckBox->setChecked(lmgr->getFlagLandscapeSetsLocation());
417 connect(ui->landscapePositionCheckBox, SIGNAL(toggled(bool)), lmgr, SLOT(setFlagLandscapeSetsLocation(bool)));
418
419=== modified file 'src/gui/viewDialog.ui'
420--- src/gui/viewDialog.ui 2014-09-10 13:15:56 +0000
421+++ src/gui/viewDialog.ui 2014-10-25 00:07:25 +0000
422@@ -346,7 +346,7 @@
423 <item alignment="Qt::AlignTop">
424 <widget class="QStackedWidget" name="stackedWidget">
425 <property name="currentIndex">
426- <number>1</number>
427+ <number>2</number>
428 </property>
429 <widget class="QWidget" name="page">
430 <layout class="QGridLayout" name="gridLayout">
431@@ -1643,22 +1643,6 @@
432 </property>
433 </widget>
434 </item>
435- <item row="2" column="1">
436- <widget class="QPushButton" name="pushButtonAddRemoveLandscapes">
437- <property name="minimumSize">
438- <size>
439- <width>0</width>
440- <height>37</height>
441- </size>
442- </property>
443- <property name="styleSheet">
444- <string notr="true">margin-left: 10px; margin-right: 10px; margin-bottom:10px;</string>
445- </property>
446- <property name="text">
447- <string>Add/remove landscapes...</string>
448- </property>
449- </widget>
450- </item>
451 <item row="1" column="1">
452 <widget class="QGroupBox" name="landscapeOptionsGroupBox">
453 <property name="sizePolicy">
454@@ -1721,9 +1705,35 @@
455 </property>
456 </widget>
457 </item>
458+ <item row="5" column="0">
459+ <widget class="QCheckBox" name="landscapeIlluminationCheckBox">
460+ <property name="text">
461+ <string>Show illumination layer (bright windows, light pollution, etc.)</string>
462+ </property>
463+ <property name="checked">
464+ <bool>true</bool>
465+ </property>
466+ </widget>
467+ </item>
468 </layout>
469 </widget>
470 </item>
471+ <item row="2" column="1">
472+ <widget class="QPushButton" name="pushButtonAddRemoveLandscapes">
473+ <property name="minimumSize">
474+ <size>
475+ <width>0</width>
476+ <height>37</height>
477+ </size>
478+ </property>
479+ <property name="styleSheet">
480+ <string notr="true">margin-left: 10px; margin-right: 10px; margin-bottom:10px;</string>
481+ </property>
482+ <property name="text">
483+ <string>Add/remove landscapes...</string>
484+ </property>
485+ </widget>
486+ </item>
487 </layout>
488 </widget>
489 <widget class="QWidget" name="page_4">