Merge lp:~stellarium/stellarium/gz_viewportOffset into lp:stellarium
- gz_viewportOffset
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Alexander Wolf |
Approved revision: | 7738 |
Merged at revision: | 7746 |
Proposed branch: | lp:~stellarium/stellarium/gz_viewportOffset |
Merge into: | lp:stellarium |
Diff against target: |
651 lines (+263/-60) 11 files modified
src/core/StelCore.cpp (+5/-1) src/core/StelMovementMgr.cpp (+119/-39) src/core/StelMovementMgr.hpp (+15/-7) src/core/StelProjector.cpp (+5/-1) src/core/StelProjector.hpp (+2/-0) src/gui/ConfigurationDialog.cpp (+2/-0) src/gui/ViewDialog.cpp (+16/-5) src/gui/ViewDialog.hpp (+1/-0) src/gui/viewDialog.ui (+63/-7) src/scripting/StelMainScriptAPI.cpp (+34/-0) src/scripting/StelMainScriptAPI.hpp (+1/-0) |
To merge this branch: | bzr merge lp:~stellarium/stellarium/gz_viewportOffset |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexander Wolf | Approve | ||
gzotti | Needs Resubmitting | ||
Review via email: mp+264395@code.launchpad.net |
Commit message
Description of the change
Introducing the option to have a vertically offset screen center. Useful to have e.g. cylindrical views with straight landcape horizon in lower part of the screen.
Object tracking¢ering brings those objects into visible screen center. Centering on coordinates puts those coordinates into the offset projection center now, this is intended.
I hope I have not overlooked something in the view geometry?
gzotti (georg-zotti) wrote : | # |
Oops... yes, I must have a look into that!
gzotti (georg-zotti) wrote : | # |
OK, zooming now runs smooth, and in all mount modes. Also made galactic mount mode reachable at least for scripting.
Alexander Wolf (alexwolf) wrote : | # |
Zooming with movement is not exactly smooth. Please try simple use case for both versions (trunk and gz_viewportOffset): disable atmosphere and ground, select any object on screen near border and press "/" (zoom in). Movement is stepwize yet.
gzotti (georg-zotti) wrote : | # |
Ouch. Again one of the keys/functions I never found in 7 years because they don't work on German keyboards. OK, after reconfiguring I can see what you mean. Practically object is immediately centered, right?
Are there any other ways of zooming/centering? I always only used the mouse or PgUp/Down.
gzotti (georg-zotti) wrote : | # |
OK, next try please? The selected object is now not immediately centered. I hope it was what you meant?
Alexander Wolf (alexwolf) wrote : | # |
Apparently he is not broke a frequently used features now.
Alexander Wolf (alexwolf) wrote : | # |
P.S. This feature introduced an issue in projection of the sky (artifacts at the bottom side of the screen).
gzotti (georg-zotti) wrote : | # |
Well, yes, if you zoom out too far, some artifacts/
Preview Diff
1 | === modified file 'src/core/StelCore.cpp' | |||
2 | --- src/core/StelCore.cpp 2015-07-08 10:37:11 +0000 | |||
3 | +++ src/core/StelCore.cpp 2015-07-24 14:57:31 +0000 | |||
4 | @@ -86,6 +86,10 @@ | |||
5 | 86 | const float viewportCenterX = conf->value("projection/viewport_center_x",0.5f*viewport_width).toFloat(); | 86 | const float viewportCenterX = conf->value("projection/viewport_center_x",0.5f*viewport_width).toFloat(); |
6 | 87 | const float viewportCenterY = conf->value("projection/viewport_center_y",0.5f*viewport_height).toFloat(); | 87 | const float viewportCenterY = conf->value("projection/viewport_center_y",0.5f*viewport_height).toFloat(); |
7 | 88 | currentProjectorParams.viewportCenter.set(viewportCenterX, viewportCenterY); | 88 | currentProjectorParams.viewportCenter.set(viewportCenterX, viewportCenterY); |
8 | 89 | const float viewportCenterOffsetX = conf->value("projection/viewport_center_offset_x",0.f).toFloat(); | ||
9 | 90 | const float viewportCenterOffsetY = conf->value("projection/viewport_center_offset_y",0.f).toFloat(); | ||
10 | 91 | currentProjectorParams.viewportCenterOffset.set(viewportCenterOffsetX, viewportCenterOffsetY); | ||
11 | 92 | |||
12 | 89 | currentProjectorParams.viewportFovDiameter = conf->value("projection/viewport_fov_diameter", qMin(viewport_width,viewport_height)).toFloat(); | 93 | currentProjectorParams.viewportFovDiameter = conf->value("projection/viewport_fov_diameter", qMin(viewport_width,viewport_height)).toFloat(); |
13 | 90 | currentProjectorParams.flipHorz = conf->value("projection/flip_horz",false).toBool(); | 94 | currentProjectorParams.flipHorz = conf->value("projection/flip_horz",false).toBool(); |
14 | 91 | currentProjectorParams.flipVert = conf->value("projection/flip_vert",false).toBool(); | 95 | currentProjectorParams.flipVert = conf->value("projection/flip_vert",false).toBool(); |
15 | @@ -384,7 +388,7 @@ | |||
16 | 384 | { | 388 | { |
17 | 385 | // Maximize display when resized since it invalidates previous options anyway | 389 | // Maximize display when resized since it invalidates previous options anyway |
18 | 386 | currentProjectorParams.viewportXywh.set(x, y, width, height); | 390 | currentProjectorParams.viewportXywh.set(x, y, width, height); |
20 | 387 | currentProjectorParams.viewportCenter.set(x+0.5*width, y+0.5*height); | 391 | currentProjectorParams.viewportCenter.set(x+(0.5+currentProjectorParams.viewportCenterOffset.v[0])*width, y+(0.5+currentProjectorParams.viewportCenterOffset.v[1])*height); |
21 | 388 | currentProjectorParams.viewportFovDiameter = qMin(width,height); | 392 | currentProjectorParams.viewportFovDiameter = qMin(width,height); |
22 | 389 | } | 393 | } |
23 | 390 | 394 | ||
24 | 391 | 395 | ||
25 | === modified file 'src/core/StelMovementMgr.cpp' | |||
26 | --- src/core/StelMovementMgr.cpp 2015-04-01 14:36:44 +0000 | |||
27 | +++ src/core/StelMovementMgr.cpp 2015-07-24 14:57:31 +0000 | |||
28 | @@ -1,6 +1,7 @@ | |||
29 | 1 | /* | 1 | /* |
30 | 2 | * Stellarium | 2 | * Stellarium |
31 | 3 | * Copyright (C) 2007 Fabien Chereau | 3 | * Copyright (C) 2007 Fabien Chereau |
32 | 4 | * Copyright (C) 2015 Georg Zotti (offset view adaptations) | ||
33 | 4 | * | 5 | * |
34 | 5 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or |
35 | 6 | * modify it under the terms of the GNU General Public License | 7 | * modify it under the terms of the GNU General Public License |
36 | @@ -102,9 +103,7 @@ | |||
37 | 102 | flagAutoZoomOutResetsDirection = conf->value("navigation/auto_zoom_out_resets_direction", true).toBool(); | 103 | flagAutoZoomOutResetsDirection = conf->value("navigation/auto_zoom_out_resets_direction", true).toBool(); |
38 | 103 | flagEnableMouseNavigation = conf->value("navigation/flag_enable_mouse_navigation",true).toBool(); | 104 | flagEnableMouseNavigation = conf->value("navigation/flag_enable_mouse_navigation",true).toBool(); |
39 | 104 | 105 | ||
43 | 105 | minFov = 0.001389; // minimal FOV = 5" | 106 | minFov = conf->value("navigation/min_fov",0.001389).toDouble(); // default: minimal FOV = 5" |
41 | 106 | // GZ: This value should be configurable! Zooming in too much is useless for archaeoastronomy. | ||
42 | 107 | minFov = conf->value("navigation/min_fov",minFov).toDouble(); | ||
44 | 108 | maxFov = 100.; | 107 | maxFov = 100.; |
45 | 109 | initFov = conf->value("navigation/init_fov",60.f).toFloat(); | 108 | initFov = conf->value("navigation/init_fov",60.f).toFloat(); |
46 | 110 | currentFov = initFov; | 109 | currentFov = initFov; |
47 | @@ -464,7 +463,7 @@ | |||
48 | 464 | } | 463 | } |
49 | 465 | 464 | ||
50 | 466 | /************************************************************************* | 465 | /************************************************************************* |
52 | 467 | The selected objects changed, follow it it we were already following another one | 466 | The selected objects changed, follow it if we were already following another one |
53 | 468 | *************************************************************************/ | 467 | *************************************************************************/ |
54 | 469 | void StelMovementMgr::selectedObjectChange(StelModule::StelModuleSelectAction) | 468 | void StelMovementMgr::selectedObjectChange(StelModule::StelModuleSelectAction) |
55 | 470 | { | 469 | { |
56 | @@ -561,29 +560,24 @@ | |||
57 | 561 | if (deltaAz<-0.2) | 560 | if (deltaAz<-0.2) |
58 | 562 | deltaAz = -0.2; | 561 | deltaAz = -0.2; |
59 | 563 | } | 562 | } |
61 | 564 | else | 563 | else if (deltaAz>0) |
62 | 565 | { | 564 | { |
69 | 566 | if (deltaAz>0) | 565 | deltaAz = (depl/30); |
70 | 567 | { | 566 | if (deltaAz>0.2) |
71 | 568 | deltaAz = (depl/30); | 567 | deltaAz = 0.2; |
66 | 569 | if (deltaAz>0.2) | ||
67 | 570 | deltaAz = 0.2; | ||
68 | 571 | } | ||
72 | 572 | } | 568 | } |
73 | 569 | |||
74 | 573 | if (deltaAlt<0) | 570 | if (deltaAlt<0) |
75 | 574 | { | 571 | { |
76 | 575 | deltaAlt = -depl/30; | 572 | deltaAlt = -depl/30; |
77 | 576 | if (deltaAlt<-0.2) | 573 | if (deltaAlt<-0.2) |
78 | 577 | deltaAlt = -0.2; | 574 | deltaAlt = -0.2; |
79 | 578 | } | 575 | } |
81 | 579 | else | 576 | else if (deltaAlt>0) |
82 | 580 | { | 577 | { |
89 | 581 | if (deltaAlt>0) | 578 | deltaAlt = depl/30; |
90 | 582 | { | 579 | if (deltaAlt>0.2) |
91 | 583 | deltaAlt = depl/30; | 580 | deltaAlt = 0.2; |
86 | 584 | if (deltaAlt>0.2) | ||
87 | 585 | deltaAlt = 0.2; | ||
88 | 586 | } | ||
92 | 587 | } | 581 | } |
93 | 588 | 582 | ||
94 | 589 | if (deltaFov<0) | 583 | if (deltaFov<0) |
95 | @@ -592,14 +586,11 @@ | |||
96 | 592 | if (deltaFov<-0.15*currentFov) | 586 | if (deltaFov<-0.15*currentFov) |
97 | 593 | deltaFov = -0.15*currentFov; | 587 | deltaFov = -0.15*currentFov; |
98 | 594 | } | 588 | } |
100 | 595 | else | 589 | else if (deltaFov>0) |
101 | 596 | { | 590 | { |
108 | 597 | if (deltaFov>0) | 591 | deltaFov = deplzoom*5; |
109 | 598 | { | 592 | if (deltaFov>20) |
110 | 599 | deltaFov = deplzoom*5; | 593 | deltaFov = 20; |
105 | 600 | if (deltaFov>20) | ||
106 | 601 | deltaFov = 20; | ||
107 | 602 | } | ||
111 | 603 | } | 594 | } |
112 | 604 | 595 | ||
113 | 605 | if (deltaFov != 0 ) | 596 | if (deltaFov != 0 ) |
114 | @@ -618,7 +609,32 @@ | |||
115 | 618 | if (!move.targetObject.isNull()) | 609 | if (!move.targetObject.isNull()) |
116 | 619 | { | 610 | { |
117 | 620 | // if zooming in, object may be moving so be sure to zoom to latest position | 611 | // if zooming in, object may be moving so be sure to zoom to latest position |
119 | 621 | move.aim = core->altAzToJ2000(move.targetObject->getAltAzPosAuto(core), StelCore::RefractionOff); | 612 | // In case we have offset center, we want object still visible in center. |
120 | 613 | // Note that if we do not center on an object, we set view direction of the potentially offset screen center! | ||
121 | 614 | // This is by design, to allow accurate setting of display coordinates. | ||
122 | 615 | Vec3d v; | ||
123 | 616 | switch (mountMode) | ||
124 | 617 | { | ||
125 | 618 | case MountAltAzimuthal: | ||
126 | 619 | v = move.targetObject->getAltAzPosAuto(core); | ||
127 | 620 | break; | ||
128 | 621 | case MountEquinoxEquatorial: | ||
129 | 622 | v = move.targetObject->getEquinoxEquatorialPos(core); | ||
130 | 623 | break; | ||
131 | 624 | case MountGalactic: | ||
132 | 625 | v = move.targetObject->getGalacticPos(core); | ||
133 | 626 | break; | ||
134 | 627 | default: | ||
135 | 628 | qWarning() << "StelMovementMgr: unexpected mountMode" << mountMode; | ||
136 | 629 | Q_ASSERT(0); | ||
137 | 630 | } | ||
138 | 631 | |||
139 | 632 | double lat, lon; | ||
140 | 633 | StelUtils::rectToSphe(&lon, &lat, v); | ||
141 | 634 | float altOffset=core->getCurrentStelProjectorParams().viewportCenterOffset[1]*currentFov*M_PI/180.0f; | ||
142 | 635 | lat+=altOffset; | ||
143 | 636 | StelUtils::spheToRect(lon, lat, v); | ||
144 | 637 | move.aim=mountFrameToJ2000(v); | ||
145 | 622 | move.aim.normalize(); | 638 | move.aim.normalize(); |
146 | 623 | move.aim*=2.; | 639 | move.aim*=2.; |
147 | 624 | } | 640 | } |
148 | @@ -686,8 +702,30 @@ | |||
149 | 686 | { | 702 | { |
150 | 687 | if (flagTracking && objectMgr->getWasSelected()) // Equatorial vision vector locked on selected object | 703 | if (flagTracking && objectMgr->getWasSelected()) // Equatorial vision vector locked on selected object |
151 | 688 | { | 704 | { |
154 | 689 | Vec3d v = objectMgr->getSelectedObject()[0]->getAltAzPosAuto(core); | 705 | Vec3d v; |
155 | 690 | setViewDirectionJ2000(core->altAzToJ2000(v, StelCore::RefractionOff)); | 706 | switch (mountMode) |
156 | 707 | { | ||
157 | 708 | case MountAltAzimuthal: | ||
158 | 709 | v = objectMgr->getSelectedObject()[0]->getAltAzPosAuto(core); | ||
159 | 710 | break; | ||
160 | 711 | case MountEquinoxEquatorial: | ||
161 | 712 | v = objectMgr->getSelectedObject()[0]->getEquinoxEquatorialPos(core); | ||
162 | 713 | break; | ||
163 | 714 | case MountGalactic: | ||
164 | 715 | v = objectMgr->getSelectedObject()[0]->getGalacticPos(core); | ||
165 | 716 | break; | ||
166 | 717 | default: | ||
167 | 718 | qWarning() << "StelMovementMgr: unexpected mountMode" << mountMode; | ||
168 | 719 | Q_ASSERT(0); | ||
169 | 720 | } | ||
170 | 721 | |||
171 | 722 | double lat, lon; // general: longitudinal, latitudinal | ||
172 | 723 | StelUtils::rectToSphe(&lon, &lat, v); | ||
173 | 724 | float latOffset=core->getCurrentStelProjectorParams().viewportCenterOffset[1]*currentFov*M_PI/180.0f; | ||
174 | 725 | lat+=latOffset; | ||
175 | 726 | StelUtils::spheToRect(lon, lat, v); | ||
176 | 727 | |||
177 | 728 | setViewDirectionJ2000(mountFrameToJ2000(v)); | ||
178 | 691 | } | 729 | } |
179 | 692 | else | 730 | else |
180 | 693 | { | 731 | { |
181 | @@ -705,7 +743,7 @@ | |||
182 | 705 | } | 743 | } |
183 | 706 | } | 744 | } |
184 | 707 | 745 | ||
186 | 708 | // Go and zoom to the selected object. | 746 | // Go and zoom to the selected object. (Action linked to key, default "/") |
187 | 709 | void StelMovementMgr::autoZoomIn(float moveDuration, bool allowManualZoom) | 747 | void StelMovementMgr::autoZoomIn(float moveDuration, bool allowManualZoom) |
188 | 710 | { | 748 | { |
189 | 711 | if (!objectMgr->getWasSelected()) | 749 | if (!objectMgr->getWasSelected()) |
190 | @@ -716,7 +754,7 @@ | |||
191 | 716 | float manualMoveDuration; | 754 | float manualMoveDuration; |
192 | 717 | if (!getFlagTracking()) | 755 | if (!getFlagTracking()) |
193 | 718 | { | 756 | { |
195 | 719 | setFlagTracking(true); | 757 | setFlagTracking(true); // includes a call to moveToObject(), but without zooming=1! |
196 | 720 | moveToObject(objectMgr->getSelectedObject()[0], moveDuration, 1); | 758 | moveToObject(objectMgr->getSelectedObject()[0], moveDuration, 1); |
197 | 721 | manualMoveDuration = moveDuration; | 759 | manualMoveDuration = moveDuration; |
198 | 722 | } | 760 | } |
199 | @@ -784,7 +822,7 @@ | |||
200 | 784 | } | 822 | } |
201 | 785 | } | 823 | } |
202 | 786 | 824 | ||
204 | 787 | 825 | // This is called when you press SPACEBAR: slowly centering&tracking object | |
205 | 788 | void StelMovementMgr::setFlagTracking(bool b) | 826 | void StelMovementMgr::setFlagTracking(bool b) |
206 | 789 | { | 827 | { |
207 | 790 | if (!b || !objectMgr->getWasSelected()) | 828 | if (!b || !objectMgr->getWasSelected()) |
208 | @@ -801,6 +839,7 @@ | |||
209 | 801 | 839 | ||
210 | 802 | //////////////////////////////////////////////////////////////////////////////// | 840 | //////////////////////////////////////////////////////////////////////////////// |
211 | 803 | // Move to the given J2000 equatorial position | 841 | // Move to the given J2000 equatorial position |
212 | 842 | |||
213 | 804 | void StelMovementMgr::moveToJ2000(const Vec3d& aim, float moveDuration, int zooming) | 843 | void StelMovementMgr::moveToJ2000(const Vec3d& aim, float moveDuration, int zooming) |
214 | 805 | { | 844 | { |
215 | 806 | moveDuration /= movementsSpeedFactor; | 845 | moveDuration /= movementsSpeedFactor; |
216 | @@ -935,23 +974,64 @@ | |||
217 | 935 | // Use a smooth function | 974 | // Use a smooth function |
218 | 936 | double c; | 975 | double c; |
219 | 937 | 976 | ||
221 | 938 | if( zoomMove.start > zoomMove.aim ) | 977 | if( zoomMove.startFov > zoomMove.aimFov ) |
222 | 939 | { | 978 | { |
224 | 940 | // slow down as approach final view | 979 | // slow down as we approach final view |
225 | 941 | c = 1 - (1-zoomMove.coef)*(1-zoomMove.coef)*(1-zoomMove.coef); | 980 | c = 1 - (1-zoomMove.coef)*(1-zoomMove.coef)*(1-zoomMove.coef); |
226 | 942 | } | 981 | } |
227 | 943 | else | 982 | else |
228 | 944 | { | 983 | { |
230 | 945 | // speed up as leave zoom target | 984 | // speed up as we leave zoom target |
231 | 946 | c = (zoomMove.coef)*(zoomMove.coef)*(zoomMove.coef); | 985 | c = (zoomMove.coef)*(zoomMove.coef)*(zoomMove.coef); |
232 | 947 | } | 986 | } |
233 | 948 | 987 | ||
235 | 949 | setFov(zoomMove.start + (zoomMove.aim - zoomMove.start) * c); | 988 | double newFov=zoomMove.startFov + (zoomMove.aimFov - zoomMove.startFov) * c; |
236 | 989 | |||
237 | 950 | zoomMove.coef+=zoomMove.speed*deltaTime*1000; | 990 | zoomMove.coef+=zoomMove.speed*deltaTime*1000; |
238 | 951 | if (zoomMove.coef>=1.) | 991 | if (zoomMove.coef>=1.) |
239 | 952 | { | 992 | { |
240 | 953 | flagAutoZoom = 0; | 993 | flagAutoZoom = 0; |
242 | 954 | setFov(zoomMove.aim); | 994 | newFov=zoomMove.aimFov; |
243 | 995 | } | ||
244 | 996 | |||
245 | 997 | setFov(newFov); // updates currentFov->don't use newFov later! | ||
246 | 998 | |||
247 | 999 | // In case we have offset center, we want object still visible in center. | ||
248 | 1000 | if (flagTracking && objectMgr->getWasSelected()) // vision vector locked on selected object | ||
249 | 1001 | { | ||
250 | 1002 | Vec3d v; | ||
251 | 1003 | switch (mountMode) | ||
252 | 1004 | { | ||
253 | 1005 | case MountAltAzimuthal: | ||
254 | 1006 | v = objectMgr->getSelectedObject()[0]->getAltAzPosAuto(core); | ||
255 | 1007 | break; | ||
256 | 1008 | case MountEquinoxEquatorial: | ||
257 | 1009 | v = objectMgr->getSelectedObject()[0]->getEquinoxEquatorialPos(core); | ||
258 | 1010 | break; | ||
259 | 1011 | case MountGalactic: | ||
260 | 1012 | v = objectMgr->getSelectedObject()[0]->getGalacticPos(core); | ||
261 | 1013 | break; | ||
262 | 1014 | default: | ||
263 | 1015 | qWarning() << "StelMovementMgr: unexpected mountMode" << mountMode; | ||
264 | 1016 | Q_ASSERT(0); | ||
265 | 1017 | } | ||
266 | 1018 | |||
267 | 1019 | double lat, lon; // general: longitudinal, latitudinal | ||
268 | 1020 | StelUtils::rectToSphe(&lon, &lat, v); | ||
269 | 1021 | float latOffset=core->getCurrentStelProjectorParams().viewportCenterOffset[1]*currentFov*M_PI/180.0f; | ||
270 | 1022 | lat+=latOffset; | ||
271 | 1023 | StelUtils::spheToRect(lon, lat, v); | ||
272 | 1024 | |||
273 | 1025 | if (flagAutoMove) | ||
274 | 1026 | { | ||
275 | 1027 | move.aim=mountFrameToJ2000(v); | ||
276 | 1028 | move.aim.normalize(); | ||
277 | 1029 | move.aim*=2.; | ||
278 | 1030 | } | ||
279 | 1031 | else | ||
280 | 1032 | { | ||
281 | 1033 | setViewDirectionJ2000(mountFrameToJ2000(v)); | ||
282 | 1034 | } | ||
283 | 955 | } | 1035 | } |
284 | 956 | } | 1036 | } |
285 | 957 | } | 1037 | } |
286 | @@ -961,8 +1041,8 @@ | |||
287 | 961 | { | 1041 | { |
288 | 962 | moveDuration /= movementsSpeedFactor; | 1042 | moveDuration /= movementsSpeedFactor; |
289 | 963 | 1043 | ||
292 | 964 | zoomMove.aim=aim_fov; | 1044 | zoomMove.aimFov=aim_fov; |
293 | 965 | zoomMove.start=currentFov; | 1045 | zoomMove.startFov=currentFov; |
294 | 966 | zoomMove.speed=1.f/(moveDuration*1000); | 1046 | zoomMove.speed=1.f/(moveDuration*1000); |
295 | 967 | zoomMove.coef=0.; | 1047 | zoomMove.coef=0.; |
296 | 968 | flagAutoZoom = true; | 1048 | flagAutoZoom = true; |
297 | @@ -991,7 +1071,7 @@ | |||
298 | 991 | 1071 | ||
299 | 992 | double StelMovementMgr::getAimFov(void) const | 1072 | double StelMovementMgr::getAimFov(void) const |
300 | 993 | { | 1073 | { |
302 | 994 | return (flagAutoZoom ? zoomMove.aim : currentFov); | 1074 | return (flagAutoZoom ? zoomMove.aimFov : currentFov); |
303 | 995 | } | 1075 | } |
304 | 996 | 1076 | ||
305 | 997 | void StelMovementMgr::setMaxFov(double max) | 1077 | void StelMovementMgr::setMaxFov(double max) |
306 | 998 | 1078 | ||
307 | === modified file 'src/core/StelMovementMgr.hpp' | |||
308 | --- src/core/StelMovementMgr.hpp 2015-03-25 18:18:33 +0000 | |||
309 | +++ src/core/StelMovementMgr.hpp 2015-07-24 14:57:31 +0000 | |||
310 | @@ -1,6 +1,7 @@ | |||
311 | 1 | /* | 1 | /* |
312 | 2 | * Stellarium | 2 | * Stellarium |
313 | 3 | * Copyright (C) 2007 Fabien Chereau | 3 | * Copyright (C) 2007 Fabien Chereau |
314 | 4 | * Copyright (C) 2015 Georg Zotti (offset view adaptations) | ||
315 | 4 | * | 5 | * |
316 | 5 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or |
317 | 6 | * modify it under the terms of the GNU General Public License | 7 | * modify it under the terms of the GNU General Public License |
318 | @@ -38,6 +39,8 @@ | |||
319 | 38 | public: | 39 | public: |
320 | 39 | 40 | ||
321 | 40 | //! Possible mount modes defining the reference frame in which head movements occur. | 41 | //! Possible mount modes defining the reference frame in which head movements occur. |
322 | 42 | //! MountGalactic is currently only available via scripting API: core.clear("galactic") | ||
323 | 43 | // TODO: add others like MountEcliptical | ||
324 | 41 | enum MountMode { MountAltAzimuthal, MountEquinoxEquatorial, MountGalactic}; | 44 | enum MountMode { MountAltAzimuthal, MountEquinoxEquatorial, MountGalactic}; |
325 | 42 | 45 | ||
326 | 43 | StelMovementMgr(StelCore* core); | 46 | StelMovementMgr(StelCore* core); |
327 | @@ -157,7 +160,7 @@ | |||
328 | 157 | 160 | ||
329 | 158 | //! Change the zoom level. | 161 | //! Change the zoom level. |
330 | 159 | //! @param aimFov The desired field of view in degrees. | 162 | //! @param aimFov The desired field of view in degrees. |
332 | 160 | //! @param moveDuration The time that the operation should take to complete. | 163 | //! @param moveDuration The time that the operation should take to complete. [seconds] |
333 | 161 | void zoomTo(double aimFov, float moveDuration = 1.); | 164 | void zoomTo(double aimFov, float moveDuration = 1.); |
334 | 162 | //! Get the current Field Of View in degrees | 165 | //! Get the current Field Of View in degrees |
335 | 163 | double getCurrentFov() const {return currentFov;} | 166 | double getCurrentFov() const {return currentFov;} |
336 | @@ -221,10 +224,10 @@ | |||
337 | 221 | Vec3d j2000ToMountFrame(const Vec3d& v) const; | 224 | Vec3d j2000ToMountFrame(const Vec3d& v) const; |
338 | 222 | Vec3d mountFrameToJ2000(const Vec3d& v) const; | 225 | Vec3d mountFrameToJ2000(const Vec3d& v) const; |
339 | 223 | 226 | ||
341 | 224 | double currentFov; // The current FOV in degree | 227 | double currentFov; // The current FOV in degrees |
342 | 225 | double initFov; // The FOV at startup | 228 | double initFov; // The FOV at startup |
345 | 226 | double minFov; // Minimum FOV in degree | 229 | double minFov; // Minimum FOV in degrees |
346 | 227 | double maxFov; // Maximum FOV in degree | 230 | double maxFov; // Maximum FOV in degrees |
347 | 228 | double initConstellationIntensity; // The initial constellation art intensity (level at startup) | 231 | double initConstellationIntensity; // The initial constellation art intensity (level at startup) |
348 | 229 | 232 | ||
349 | 230 | void setFov(double f) | 233 | void setFov(double f) |
350 | @@ -287,7 +290,7 @@ | |||
351 | 287 | double deltaFov,deltaAlt,deltaAz; // View movement | 290 | double deltaFov,deltaAlt,deltaAz; // View movement |
352 | 288 | 291 | ||
353 | 289 | bool flagManualZoom; // Define whether auto zoom can go further | 292 | bool flagManualZoom; // Define whether auto zoom can go further |
355 | 290 | float autoMoveDuration; // Duration of movement for the auto move to a selected objectin seconds | 293 | float autoMoveDuration; // Duration of movement for the auto move to a selected object in seconds |
356 | 291 | 294 | ||
357 | 292 | // Mouse control options | 295 | // Mouse control options |
358 | 293 | bool isDragging, hasDragged; | 296 | bool isDragging, hasDragged; |
359 | @@ -311,10 +314,15 @@ | |||
360 | 311 | 314 | ||
361 | 312 | //! @internal | 315 | //! @internal |
362 | 313 | //! Store data for auto-zoom. | 316 | //! Store data for auto-zoom. |
363 | 317 | // Components: | ||
364 | 318 | // startFov: field of view at start | ||
365 | 319 | // aimFov: intended field of view at end of zoom move | ||
366 | 320 | // speed: rate of change. UNITS? | ||
367 | 321 | // coef: set to 0 at begin of zoom, will increase to 1 during autozoom motion. | ||
368 | 314 | struct AutoZoom | 322 | struct AutoZoom |
369 | 315 | { | 323 | { |
372 | 316 | double start; | 324 | double startFov; |
373 | 317 | double aim; | 325 | double aimFov; |
374 | 318 | float speed; | 326 | float speed; |
375 | 319 | float coef; | 327 | float coef; |
376 | 320 | }; | 328 | }; |
377 | 321 | 329 | ||
378 | === modified file 'src/core/StelProjector.cpp' | |||
379 | --- src/core/StelProjector.cpp 2014-11-06 10:59:07 +0000 | |||
380 | +++ src/core/StelProjector.cpp 2015-07-24 14:57:31 +0000 | |||
381 | @@ -22,6 +22,8 @@ | |||
382 | 22 | 22 | ||
383 | 23 | #include "StelProjector.hpp" | 23 | #include "StelProjector.hpp" |
384 | 24 | #include "StelProjectorClasses.hpp" | 24 | #include "StelProjectorClasses.hpp" |
385 | 25 | #include "StelApp.hpp" | ||
386 | 26 | #include "StelCore.hpp" | ||
387 | 25 | 27 | ||
388 | 26 | #include <QDebug> | 28 | #include <QDebug> |
389 | 27 | #include <QString> | 29 | #include <QString> |
390 | @@ -385,7 +387,9 @@ | |||
391 | 385 | void StelProjector::computeBoundingCap() | 387 | void StelProjector::computeBoundingCap() |
392 | 386 | { | 388 | { |
393 | 387 | bool ok = unProject(viewportXywh[0]+0.5f*viewportXywh[2], viewportXywh[1]+0.5f*viewportXywh[3], boundingCap.n); | 389 | bool ok = unProject(viewportXywh[0]+0.5f*viewportXywh[2], viewportXywh[1]+0.5f*viewportXywh[3], boundingCap.n); |
395 | 388 | Q_ASSERT(ok); // The central point should be at a valid position by definition | 390 | // The central point should be at a valid position by definition. |
396 | 391 | // When center is offset, this assumption may not hold however. | ||
397 | 392 | Q_ASSERT(ok || (StelApp::getInstance().getCore()->getCurrentStelProjectorParams().viewportCenterOffset.lengthSquared()>0.0) ); | ||
398 | 389 | const bool needNormalization = fabs(boundingCap.n.lengthSquared()-1.)>0.00000001; | 393 | const bool needNormalization = fabs(boundingCap.n.lengthSquared()-1.)>0.00000001; |
399 | 390 | 394 | ||
400 | 391 | // Now need to determine the aperture | 395 | // Now need to determine the aperture |
401 | 392 | 396 | ||
402 | === modified file 'src/core/StelProjector.hpp' | |||
403 | --- src/core/StelProjector.hpp 2014-11-06 10:59:07 +0000 | |||
404 | +++ src/core/StelProjector.hpp 2015-07-24 14:57:31 +0000 | |||
405 | @@ -102,6 +102,7 @@ | |||
406 | 102 | , zNear(0.f) | 102 | , zNear(0.f) |
407 | 103 | , zFar(0.f) | 103 | , zFar(0.f) |
408 | 104 | , viewportCenter(128.f, 128.f) | 104 | , viewportCenter(128.f, 128.f) |
409 | 105 | , viewportCenterOffset(0.f, 0.f) | ||
410 | 105 | , viewportFovDiameter(0.f) | 106 | , viewportFovDiameter(0.f) |
411 | 106 | , flipHorz(false) | 107 | , flipHorz(false) |
412 | 107 | , flipVert(false) | 108 | , flipVert(false) |
413 | @@ -114,6 +115,7 @@ | |||
414 | 114 | StelProjectorMaskType maskType; //! The current projector mask | 115 | StelProjectorMaskType maskType; //! The current projector mask |
415 | 115 | float zNear, zFar; //! Near and far clipping planes | 116 | float zNear, zFar; //! Near and far clipping planes |
416 | 116 | Vec2f viewportCenter; //! Viewport center in screen pixel | 117 | Vec2f viewportCenter; //! Viewport center in screen pixel |
417 | 118 | Vec2f viewportCenterOffset; //! GZ: Viewport center's offset in fractions of screen width/height. Usable e.g. in cylindrical projection to move horizon down. | ||
418 | 117 | float viewportFovDiameter; //! diameter of the FOV disk in pixel | 119 | float viewportFovDiameter; //! diameter of the FOV disk in pixel |
419 | 118 | bool flipHorz, flipVert; //! Whether to flip in horizontal or vertical directions | 120 | bool flipHorz, flipVert; //! Whether to flip in horizontal or vertical directions |
420 | 119 | float devicePixelsPerPixel; //! The number of device pixel per "Device Independent Pixels" (value is usually 1, but 2 for mac retina screens) | 121 | float devicePixelsPerPixel; //! The number of device pixel per "Device Independent Pixels" (value is usually 1, but 2 for mac retina screens) |
421 | 120 | 122 | ||
422 | === modified file 'src/gui/ConfigurationDialog.cpp' | |||
423 | --- src/gui/ConfigurationDialog.cpp 2015-05-23 20:00:14 +0000 | |||
424 | +++ src/gui/ConfigurationDialog.cpp 2015-07-24 14:57:31 +0000 | |||
425 | @@ -695,6 +695,8 @@ | |||
426 | 695 | conf->setValue("gui/flag_show_flip_buttons", gui->getFlagShowFlipButtons()); | 695 | conf->setValue("gui/flag_show_flip_buttons", gui->getFlagShowFlipButtons()); |
427 | 696 | conf->setValue("video/viewport_effect", StelApp::getInstance().getViewportEffect()); | 696 | conf->setValue("video/viewport_effect", StelApp::getInstance().getViewportEffect()); |
428 | 697 | conf->setValue("projection/viewport", StelProjector::maskTypeToString(proj->getMaskType())); | 697 | conf->setValue("projection/viewport", StelProjector::maskTypeToString(proj->getMaskType())); |
429 | 698 | conf->setValue("projection/viewport_center_offset_x", core->getCurrentStelProjectorParams().viewportCenterOffset[0]); | ||
430 | 699 | conf->setValue("projection/viewport_center_offset_y", core->getCurrentStelProjectorParams().viewportCenterOffset[1]); | ||
431 | 698 | conf->setValue("viewing/flag_gravity_labels", proj->getFlagGravityLabels()); | 700 | conf->setValue("viewing/flag_gravity_labels", proj->getFlagGravityLabels()); |
432 | 699 | conf->setValue("navigation/auto_zoom_out_resets_direction", mvmgr->getFlagAutoZoomOutResetsDirection()); | 701 | conf->setValue("navigation/auto_zoom_out_resets_direction", mvmgr->getFlagAutoZoomOutResetsDirection()); |
433 | 700 | conf->setValue("gui/flag_mouse_cursor_timeout", StelMainView::getInstance().getFlagCursorTimeout()); | 702 | conf->setValue("gui/flag_mouse_cursor_timeout", StelMainView::getInstance().getFlagCursorTimeout()); |
434 | 701 | 703 | ||
435 | === modified file 'src/gui/ViewDialog.cpp' | |||
436 | --- src/gui/ViewDialog.cpp 2015-05-23 20:00:14 +0000 | |||
437 | +++ src/gui/ViewDialog.cpp 2015-07-24 14:57:31 +0000 | |||
438 | @@ -134,8 +134,11 @@ | |||
439 | 134 | connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); | 134 | connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); |
440 | 135 | 135 | ||
441 | 136 | populateLists(); | 136 | populateLists(); |
442 | 137 | ui->viewportOffsetSpinBox->setValue((int) round(StelApp::getInstance().getCore()->getCurrentStelProjectorParams().viewportCenterOffset[1] * 100.0f)); | ||
443 | 138 | |||
444 | 137 | connect(ui->culturesListWidget, SIGNAL(currentTextChanged(const QString&)), this, SLOT(skyCultureChanged(const QString&))); | 139 | connect(ui->culturesListWidget, SIGNAL(currentTextChanged(const QString&)), this, SLOT(skyCultureChanged(const QString&))); |
445 | 138 | connect(ui->projectionListWidget, SIGNAL(currentTextChanged(const QString&)), this, SLOT(projectionChanged(const QString&))); | 140 | connect(ui->projectionListWidget, SIGNAL(currentTextChanged(const QString&)), this, SLOT(projectionChanged(const QString&))); |
446 | 141 | connect(ui->viewportOffsetSpinBox, SIGNAL(valueChanged(int)), this, SLOT(viewportVerticalShiftChanged(int))); | ||
447 | 139 | connect(ui->landscapesListWidget, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(landscapeChanged(QListWidgetItem*))); | 142 | connect(ui->landscapesListWidget, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(landscapeChanged(QListWidgetItem*))); |
448 | 140 | 143 | ||
449 | 141 | // Connect and initialize checkboxes and other widgets | 144 | // Connect and initialize checkboxes and other widgets |
450 | @@ -602,6 +605,18 @@ | |||
451 | 602 | ui->projectionTextBrowser->setHtml(core->getProjection(StelCore::FrameJ2000)->getHtmlSummary()); | 605 | ui->projectionTextBrowser->setHtml(core->getProjection(StelCore::FrameJ2000)->getHtmlSummary()); |
452 | 603 | } | 606 | } |
453 | 604 | 607 | ||
454 | 608 | void ViewDialog::viewportVerticalShiftChanged(const int shift) | ||
455 | 609 | { | ||
456 | 610 | StelCore* core = StelApp::getInstance().getCore(); | ||
457 | 611 | StelProjector::StelProjectorParams params=core->getCurrentStelProjectorParams(); | ||
458 | 612 | params.viewportCenterOffset[1]=qMax(-0.5f, qMin(shift/100.0f, 0.5f)); // Sanity check | ||
459 | 613 | |||
460 | 614 | params.viewportCenter.set(params.viewportXywh[0]+(0.5f+params.viewportCenterOffset.v[0])*params.viewportXywh[2], | ||
461 | 615 | params.viewportXywh[1]+(0.5f+params.viewportCenterOffset.v[1])*params.viewportXywh[3]); | ||
462 | 616 | |||
463 | 617 | core->setCurrentStelProjectorParams(params); | ||
464 | 618 | } | ||
465 | 619 | |||
466 | 605 | void ViewDialog::landscapeChanged(QListWidgetItem* item) | 620 | void ViewDialog::landscapeChanged(QListWidgetItem* item) |
467 | 606 | { | 621 | { |
468 | 607 | LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr); | 622 | LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr); |
469 | @@ -612,8 +627,7 @@ | |||
470 | 612 | ui->landscapeTextBrowser->setHtml(lmgr->getCurrentLandscapeHtmlDescription()); | 627 | ui->landscapeTextBrowser->setHtml(lmgr->getCurrentLandscapeHtmlDescription()); |
471 | 613 | ui->useAsDefaultLandscapeCheckBox->setChecked(lmgr->getDefaultLandscapeID()==lmgr->getCurrentLandscapeID()); | 628 | ui->useAsDefaultLandscapeCheckBox->setChecked(lmgr->getDefaultLandscapeID()==lmgr->getCurrentLandscapeID()); |
472 | 614 | ui->useAsDefaultLandscapeCheckBox->setEnabled(lmgr->getDefaultLandscapeID()!=lmgr->getCurrentLandscapeID()); | 629 | ui->useAsDefaultLandscapeCheckBox->setEnabled(lmgr->getDefaultLandscapeID()!=lmgr->getCurrentLandscapeID()); |
475 | 615 | //StelSkyDrawer *drawer=StelApp::getInstance().getSkyDrawer(); | 630 | // Reset values that might have changed. |
474 | 616 | // GZ: Reset values that might have changed. | ||
476 | 617 | ui->showFogCheckBox->setChecked(lmgr->getFlagFog()); | 631 | ui->showFogCheckBox->setChecked(lmgr->getFlagFog()); |
477 | 618 | ui->lightPollutionSpinBox->setValue(StelApp::getInstance().getCore()->getSkyDrawer()->getBortleScaleIndex()); | 632 | ui->lightPollutionSpinBox->setValue(StelApp::getInstance().getCore()->getSkyDrawer()->getBortleScaleIndex()); |
478 | 619 | } | 633 | } |
479 | @@ -630,9 +644,6 @@ | |||
480 | 630 | { | 644 | { |
481 | 631 | if(atmosphereDialog == NULL) | 645 | if(atmosphereDialog == NULL) |
482 | 632 | atmosphereDialog = new AtmosphereDialog(); | 646 | atmosphereDialog = new AtmosphereDialog(); |
483 | 633 | //ui->temperatureDoubleSpinBox->setValue(StelApp::getInstance().getCore()->getSkyDrawer()->getAtmosphereTemperature()); | ||
484 | 634 | //ui->extinctionDoubleSpinBox->setValue(StelApp::getInstance().getCore()->getSkyDrawer()->getExtinctionCoefficient()); | ||
485 | 635 | //ui->pressureDoubleSpinBox->setValue(StelApp::getInstance().getCore()->getSkyDrawer()->getAtmospherePressure()); | ||
486 | 636 | 647 | ||
487 | 637 | atmosphereDialog->setVisible(true); | 648 | atmosphereDialog->setVisible(true); |
488 | 638 | } | 649 | } |
489 | 639 | 650 | ||
490 | === modified file 'src/gui/ViewDialog.hpp' | |||
491 | --- src/gui/ViewDialog.hpp 2015-04-11 14:08:59 +0000 | |||
492 | +++ src/gui/ViewDialog.hpp 2015-07-24 14:57:31 +0000 | |||
493 | @@ -50,6 +50,7 @@ | |||
494 | 50 | void populateLists(); | 50 | void populateLists(); |
495 | 51 | void skyCultureChanged(const QString& cultureName); | 51 | void skyCultureChanged(const QString& cultureName); |
496 | 52 | void projectionChanged(const QString& projectionName); | 52 | void projectionChanged(const QString& projectionName); |
497 | 53 | void viewportVerticalShiftChanged(const int shift); | ||
498 | 53 | void landscapeChanged(QListWidgetItem* item); | 54 | void landscapeChanged(QListWidgetItem* item); |
499 | 54 | void setZhrFromControls(int zhr); | 55 | void setZhrFromControls(int zhr); |
500 | 55 | void updateZhrDescription(); | 56 | void updateZhrDescription(); |
501 | 56 | 57 | ||
502 | === modified file 'src/gui/viewDialog.ui' | |||
503 | --- src/gui/viewDialog.ui 2015-05-23 20:00:14 +0000 | |||
504 | +++ src/gui/viewDialog.ui 2015-07-24 14:57:31 +0000 | |||
505 | @@ -340,7 +340,7 @@ | |||
506 | 340 | <item row="1" column="0"> | 340 | <item row="1" column="0"> |
507 | 341 | <widget class="QStackedWidget" name="stackedWidget"> | 341 | <widget class="QStackedWidget" name="stackedWidget"> |
508 | 342 | <property name="currentIndex"> | 342 | <property name="currentIndex"> |
510 | 343 | <number>0</number> | 343 | <number>1</number> |
511 | 344 | </property> | 344 | </property> |
512 | 345 | <widget class="QWidget" name="page"> | 345 | <widget class="QWidget" name="page"> |
513 | 346 | <layout class="QGridLayout" name="gridLayout"> | 346 | <layout class="QGridLayout" name="gridLayout"> |
514 | @@ -1636,11 +1636,68 @@ | |||
515 | 1636 | </widget> | 1636 | </widget> |
516 | 1637 | </item> | 1637 | </item> |
517 | 1638 | <item> | 1638 | <item> |
523 | 1639 | <widget class="QTextBrowser" name="projectionTextBrowser"> | 1639 | <layout class="QVBoxLayout" name="projectionDetailsVerticalLayout"> |
524 | 1640 | <property name="openExternalLinks"> | 1640 | <item> |
525 | 1641 | <bool>true</bool> | 1641 | <widget class="QTextBrowser" name="projectionTextBrowser"> |
526 | 1642 | </property> | 1642 | <property name="openExternalLinks"> |
527 | 1643 | </widget> | 1643 | <bool>true</bool> |
528 | 1644 | </property> | ||
529 | 1645 | </widget> | ||
530 | 1646 | </item> | ||
531 | 1647 | <item> | ||
532 | 1648 | <layout class="QHBoxLayout" name="viewportOffsetHorizontalLayout"> | ||
533 | 1649 | <item> | ||
534 | 1650 | <widget class="QLabel" name="viewportOffsetLabel"> | ||
535 | 1651 | <property name="text"> | ||
536 | 1652 | <string>Vertical viewport offset</string> | ||
537 | 1653 | </property> | ||
538 | 1654 | </widget> | ||
539 | 1655 | </item> | ||
540 | 1656 | <item> | ||
541 | 1657 | <widget class="QSpinBox" name="viewportOffsetSpinBox"> | ||
542 | 1658 | <property name="sizePolicy"> | ||
543 | 1659 | <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> | ||
544 | 1660 | <horstretch>0</horstretch> | ||
545 | 1661 | <verstretch>0</verstretch> | ||
546 | 1662 | </sizepolicy> | ||
547 | 1663 | </property> | ||
548 | 1664 | <property name="minimum"> | ||
549 | 1665 | <number>-50</number> | ||
550 | 1666 | </property> | ||
551 | 1667 | <property name="maximum"> | ||
552 | 1668 | <number>50</number> | ||
553 | 1669 | </property> | ||
554 | 1670 | </widget> | ||
555 | 1671 | </item> | ||
556 | 1672 | <item> | ||
557 | 1673 | <widget class="QLabel" name="percentLabel"> | ||
558 | 1674 | <property name="sizePolicy"> | ||
559 | 1675 | <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> | ||
560 | 1676 | <horstretch>0</horstretch> | ||
561 | 1677 | <verstretch>0</verstretch> | ||
562 | 1678 | </sizepolicy> | ||
563 | 1679 | </property> | ||
564 | 1680 | <property name="text"> | ||
565 | 1681 | <string>%</string> | ||
566 | 1682 | </property> | ||
567 | 1683 | </widget> | ||
568 | 1684 | </item> | ||
569 | 1685 | <item> | ||
570 | 1686 | <spacer name="horizontalSpacer"> | ||
571 | 1687 | <property name="orientation"> | ||
572 | 1688 | <enum>Qt::Horizontal</enum> | ||
573 | 1689 | </property> | ||
574 | 1690 | <property name="sizeHint" stdset="0"> | ||
575 | 1691 | <size> | ||
576 | 1692 | <width>40</width> | ||
577 | 1693 | <height>20</height> | ||
578 | 1694 | </size> | ||
579 | 1695 | </property> | ||
580 | 1696 | </spacer> | ||
581 | 1697 | </item> | ||
582 | 1698 | </layout> | ||
583 | 1699 | </item> | ||
584 | 1700 | </layout> | ||
585 | 1644 | </item> | 1701 | </item> |
586 | 1645 | </layout> | 1702 | </layout> |
587 | 1646 | </widget> | 1703 | </widget> |
588 | @@ -2171,7 +2228,6 @@ | |||
589 | 2171 | <tabstop>showConstellationBoundariesCheckBox</tabstop> | 2228 | <tabstop>showConstellationBoundariesCheckBox</tabstop> |
590 | 2172 | <tabstop>showConstellationArtCheckBox</tabstop> | 2229 | <tabstop>showConstellationArtCheckBox</tabstop> |
591 | 2173 | <tabstop>constellationArtBrightnessSpinBox</tabstop> | 2230 | <tabstop>constellationArtBrightnessSpinBox</tabstop> |
592 | 2174 | <tabstop>projectionTextBrowser</tabstop> | ||
593 | 2175 | <tabstop>landscapeTextBrowser</tabstop> | 2231 | <tabstop>landscapeTextBrowser</tabstop> |
594 | 2176 | <tabstop>showGroundCheckBox</tabstop> | 2232 | <tabstop>showGroundCheckBox</tabstop> |
595 | 2177 | <tabstop>showFogCheckBox</tabstop> | 2233 | <tabstop>showFogCheckBox</tabstop> |
596 | 2178 | 2234 | ||
597 | === modified file 'src/scripting/StelMainScriptAPI.cpp' | |||
598 | --- src/scripting/StelMainScriptAPI.cpp 2015-04-21 20:23:14 +0000 | |||
599 | +++ src/scripting/StelMainScriptAPI.cpp 2015-07-24 14:57:31 +0000 | |||
600 | @@ -1072,6 +1072,40 @@ | |||
601 | 1072 | lmgr->setFlagFog(false); | 1072 | lmgr->setFlagFog(false); |
602 | 1073 | zl->setFlagShow(false); | 1073 | zl->setFlagShow(false); |
603 | 1074 | } | 1074 | } |
604 | 1075 | else if (state.toLower() == "galactic") | ||
605 | 1076 | { | ||
606 | 1077 | movmgr->setMountMode(StelMovementMgr::MountGalactic); | ||
607 | 1078 | skyd->setFlagTwinkle(false); | ||
608 | 1079 | skyd->setFlagLuminanceAdaptation(false); | ||
609 | 1080 | ssmgr->setFlagPlanets(false); | ||
610 | 1081 | ssmgr->setFlagHints(false); | ||
611 | 1082 | ssmgr->setFlagOrbits(false); | ||
612 | 1083 | ssmgr->setFlagMoonScale(false); | ||
613 | 1084 | ssmgr->setFlagTrails(false); | ||
614 | 1085 | mmgr->setZHR(0); | ||
615 | 1086 | glmgr->setFlagAzimuthalGrid(false); | ||
616 | 1087 | glmgr->setFlagGalacticGrid(false); | ||
617 | 1088 | glmgr->setFlagEquatorGrid(false); | ||
618 | 1089 | glmgr->setFlagEquatorLine(false); | ||
619 | 1090 | glmgr->setFlagEclipticLine(false); | ||
620 | 1091 | glmgr->setFlagMeridianLine(false); | ||
621 | 1092 | glmgr->setFlagLongitudeLine(false); | ||
622 | 1093 | glmgr->setFlagHorizonLine(false); | ||
623 | 1094 | glmgr->setFlagGalacticEquatorLine(false); | ||
624 | 1095 | glmgr->setFlagEquatorJ2000Grid(false); | ||
625 | 1096 | lmgr->setFlagCardinalsPoints(false); | ||
626 | 1097 | cmgr->setFlagLines(false); | ||
627 | 1098 | cmgr->setFlagLabels(false); | ||
628 | 1099 | cmgr->setFlagBoundaries(false); | ||
629 | 1100 | cmgr->setFlagArt(false); | ||
630 | 1101 | smgr->setFlagLabels(false); | ||
631 | 1102 | ssmgr->setFlagLabels(false); | ||
632 | 1103 | nmgr->setFlagHints(false); | ||
633 | 1104 | lmgr->setFlagLandscape(false); | ||
634 | 1105 | lmgr->setFlagAtmosphere(false); | ||
635 | 1106 | lmgr->setFlagFog(false); | ||
636 | 1107 | zl->setFlagShow(false); | ||
637 | 1108 | } | ||
638 | 1075 | else | 1109 | else |
639 | 1076 | { | 1110 | { |
640 | 1077 | qWarning() << "WARNING clear(" << state << ") - state not known"; | 1111 | qWarning() << "WARNING clear(" << state << ") - state not known"; |
641 | 1078 | 1112 | ||
642 | === modified file 'src/scripting/StelMainScriptAPI.hpp' | |||
643 | --- src/scripting/StelMainScriptAPI.hpp 2015-07-05 19:50:54 +0000 | |||
644 | +++ src/scripting/StelMainScriptAPI.hpp 2015-07-24 14:57:31 +0000 | |||
645 | @@ -219,6 +219,7 @@ | |||
646 | 219 | //! - starchart : equatorial mount, constellation lines, | 219 | //! - starchart : equatorial mount, constellation lines, |
647 | 220 | //! no landscape, atmosphere etc. labels & markers on. | 220 | //! no landscape, atmosphere etc. labels & markers on. |
648 | 221 | //! - deepspace : like starchart, but no planets, no eq.grid, no markers, no lines. | 221 | //! - deepspace : like starchart, but no planets, no eq.grid, no markers, no lines. |
649 | 222 | //! - galactic : like deepspace, but in galactic coordinate system. | ||
650 | 222 | //! @param state the name of a preset state. | 223 | //! @param state the name of a preset state. |
651 | 223 | void clear(const QString& state="natural"); | 224 | void clear(const QString& state="natural"); |
652 | 224 | 225 |
Current implementation has stepwise centering of the object when zooming. Can it be smooth zooming?