Merge lp:~georg-zotti/stellarium/gz-better-anglemeasure into lp:stellarium
- gz-better-anglemeasure
- Merge into trunk
Proposed by
gzotti
Status: | Merged |
---|---|
Merged at revision: | 7072 |
Proposed branch: | lp:~georg-zotti/stellarium/gz-better-anglemeasure |
Merge into: | lp:stellarium |
Diff against target: |
633 lines (+321/-53) 6 files modified
plugins/AngleMeasure/CMakeLists.txt (+1/-1) plugins/AngleMeasure/ChangeLog (+6/-0) plugins/AngleMeasure/src/AngleMeasure.cpp (+163/-42) plugins/AngleMeasure/src/AngleMeasure.hpp (+36/-1) plugins/AngleMeasure/src/gui/AngleMeasureDialog.cpp (+16/-5) plugins/AngleMeasure/src/gui/angleMeasureDialog.ui (+99/-4) |
To merge this branch: | bzr merge lp:~georg-zotti/stellarium/gz-better-anglemeasure |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
gzotti | Needs Resubmitting | ||
Alexander Wolf | Approve | ||
Review via email: mp+237430@code.launchpad.net |
Commit message
Added alt-azimuth mode in angle measure plugin
Description of the change
To post a comment you must log in.
Revision history for this message
gzotti (georg-zotti) wrote : | # |
I found how to make functional groups in the GUI now. The checkboxes in the group boxes are 1-2 pixels smaller than the single checkboxes, don't know how to fix that.
On the author list: All "contributors" (listed only in the plugin's own config panel) are now in the author list (visible in list in main program's plugin config dialog).
review:
Needs Resubmitting
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'plugins/AngleMeasure/CMakeLists.txt' |
2 | --- plugins/AngleMeasure/CMakeLists.txt 2014-03-03 19:43:04 +0000 |
3 | +++ plugins/AngleMeasure/CMakeLists.txt 2014-10-07 18:19:23 +0000 |
4 | @@ -1,5 +1,5 @@ |
5 | # This is the cmake config file for the AngleMeasure plugin |
6 | -SET(ANGLEMEASURE_VERSION "0.3.1") |
7 | +SET(ANGLEMEASURE_VERSION "0.4.0") |
8 | ADD_DEFINITIONS(-DANGLEMEASURE_VERSION="${ANGLEMEASURE_VERSION}") |
9 | |
10 | ADD_SUBDIRECTORY( src ) |
11 | |
12 | === modified file 'plugins/AngleMeasure/ChangeLog' |
13 | --- plugins/AngleMeasure/ChangeLog 2014-02-16 12:58:17 +0000 |
14 | +++ plugins/AngleMeasure/ChangeLog 2014-10-07 18:19:23 +0000 |
15 | @@ -1,3 +1,9 @@ |
16 | +0.3.2 [2014-08-14] |
17 | +Added horizontal mode (no refraction) |
18 | + |
19 | +0.3.1 |
20 | +Undocumented change |
21 | + |
22 | 0.3.0 |
23 | Added GUI |
24 | Added calculation of position angle |
25 | |
26 | === modified file 'plugins/AngleMeasure/src/AngleMeasure.cpp' |
27 | --- plugins/AngleMeasure/src/AngleMeasure.cpp 2014-04-15 19:39:05 +0000 |
28 | +++ plugins/AngleMeasure/src/AngleMeasure.cpp 2014-10-07 18:19:23 +0000 |
29 | @@ -1,5 +1,6 @@ |
30 | /* |
31 | * Copyright (C) 2009 Matthew Gates |
32 | + * Copyright (C) 2014 Georg Zotti |
33 | * |
34 | * This program is free software; you can redistribute it and/or |
35 | * modify it under the terms of the GNU General Public License |
36 | @@ -54,7 +55,7 @@ |
37 | StelPluginInfo info; |
38 | info.id = "AngleMeasure"; |
39 | info.displayedName = N_("Angle Measure"); |
40 | - info.authors = "Matthew Gates"; |
41 | + info.authors = "Matthew Gates, Bogdan Marinov, Alexander Wolf, Georg Zotti"; |
42 | info.contact = "http://porpoisehead.net/"; |
43 | info.description = N_("Provides an angle measurement tool"); |
44 | info.version = ANGLEMEASURE_VERSION; |
45 | @@ -67,6 +68,11 @@ |
46 | , angle(0.) |
47 | , flagUseDmsFormat(false) |
48 | , flagShowPA(false) |
49 | + , flagShowEquatorial(false) |
50 | + , flagShowHorizontal(false) |
51 | + , flagShowHorizontalPA(false) |
52 | + , flagShowHorizontalStartSkylinked(false) |
53 | + , flagShowHorizontalEndSkylinked(false) |
54 | , toolbarButton(NULL) |
55 | { |
56 | setObjectName("AngleMeasure"); |
57 | @@ -117,6 +123,12 @@ |
58 | perp1EndPoint.set(0.,0.,0.); |
59 | perp2StartPoint.set(0.,0.,0.); |
60 | perp2EndPoint.set(0.,0.,0.); |
61 | + startPointHor.set(0.,0.,0.); |
62 | + endPointHor.set(0.,0.,0.); |
63 | + perp1StartPointHor.set(0.,0.,0.); |
64 | + perp1EndPointHor.set(0.,0.,0.); |
65 | + perp2StartPointHor.set(0.,0.,0.); |
66 | + perp2EndPointHor.set(0.,0.,0.); |
67 | |
68 | StelApp& app = StelApp::getInstance(); |
69 | |
70 | @@ -152,15 +164,25 @@ |
71 | { |
72 | messageFader.update((int)(deltaTime*1000)); |
73 | lineVisible.update((int)(deltaTime*1000)); |
74 | + static StelCore *core=StelApp::getInstance().getCore(); |
75 | + |
76 | + // if altAz endpoint linked to the rotating sky, move respective point(s) |
77 | + if (flagShowHorizontalStartSkylinked) |
78 | + { |
79 | + startPointHor = core->equinoxEquToAltAz(startPoint, StelCore::RefractionAuto); |
80 | + calculateEnds(); |
81 | + } |
82 | + if (flagShowHorizontalEndSkylinked) |
83 | + { |
84 | + endPointHor = core->equinoxEquToAltAz(endPoint, StelCore::RefractionAuto); |
85 | + calculateEnds(); |
86 | + } |
87 | } |
88 | |
89 | -//! Draw any parts on the screen which are for our module |
90 | -void AngleMeasure::draw(StelCore* core) |
91 | + |
92 | +void AngleMeasure::drawOne(StelCore *core, const StelCore::FrameType frameType, const StelCore::RefractionMode refractionMode, const Vec3f txtColor, const Vec3f lineColor) |
93 | { |
94 | - if (lineVisible.getInterstate() < 0.000001f && messageFader.getInterstate() < 0.000001f) |
95 | - return; |
96 | - |
97 | - const StelProjectorP prj = core->getProjection(StelCore::FrameEquinoxEqu); |
98 | + const StelProjectorP prj = core->getProjection(frameType, refractionMode); |
99 | StelPainter painter(prj); |
100 | painter.setFont(font); |
101 | |
102 | @@ -169,36 +191,61 @@ |
103 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
104 | glEnable(GL_BLEND); |
105 | glEnable(GL_TEXTURE_2D); |
106 | - |
107 | + |
108 | Vec3d xy; |
109 | QString displayedText; |
110 | - if (prj->project(perp1EndPoint,xy)) |
111 | - { |
112 | - painter.setColor(textColor[0], textColor[1], textColor[2], lineVisible.getInterstate()); |
113 | - if (flagShowPA) |
114 | - displayedText = QString("%1 (%2%3)").arg(calculateAngle(), messagePA, calculatePositionAngle(startPoint, endPoint)); |
115 | - else |
116 | - displayedText = calculateAngle(); |
117 | - painter.drawText(xy[0], xy[1], displayedText, 0, 15, 15); |
118 | + if (frameType==StelCore::FrameEquinoxEqu) |
119 | + { |
120 | + if (prj->project(perp1EndPoint,xy)) |
121 | + { |
122 | + painter.setColor(txtColor[0], txtColor[1], txtColor[2], lineVisible.getInterstate()); |
123 | + if (flagShowPA) |
124 | + displayedText = QString("%1 (%2%3)").arg(calculateAngle(), messagePA, calculatePositionAngle(startPoint, endPoint)); |
125 | + else |
126 | + displayedText = calculateAngle(); |
127 | + painter.drawText(xy[0], xy[1], displayedText, 0, 15, 15); |
128 | + } |
129 | + } |
130 | + else |
131 | + { |
132 | + if (prj->project(perp1EndPointHor,xy)) |
133 | + { |
134 | + painter.setColor(txtColor[0], txtColor[1], txtColor[2], lineVisible.getInterstate()); |
135 | + if (flagShowHorizontalPA) |
136 | + displayedText = QString("%1 (%2%3)").arg(calculateAngle(true), messagePA, calculatePositionAngle(startPointHor, endPointHor)); |
137 | + else |
138 | + displayedText = calculateAngle(true); |
139 | + painter.drawText(xy[0], xy[1], displayedText, 0, 15, -5); |
140 | + } |
141 | } |
142 | |
143 | glDisable(GL_TEXTURE_2D); |
144 | // OpenGL ES 2.0 doesn't have GL_LINE_SMOOTH |
145 | // glEnable(GL_LINE_SMOOTH); |
146 | glEnable(GL_BLEND); |
147 | - |
148 | - // main line is a great circle |
149 | + |
150 | + // main line is a great circle |
151 | painter.setColor(lineColor[0], lineColor[1], lineColor[2], lineVisible.getInterstate()); |
152 | - painter.drawGreatCircleArc(startPoint, endPoint, NULL); |
153 | - |
154 | - // End lines |
155 | - painter.drawGreatCircleArc(perp1StartPoint, perp1EndPoint, NULL); |
156 | - painter.drawGreatCircleArc(perp2StartPoint, perp2EndPoint, NULL); |
157 | + if (frameType==StelCore::FrameEquinoxEqu) |
158 | + { |
159 | + painter.drawGreatCircleArc(startPoint, endPoint, NULL); |
160 | + |
161 | + // End lines |
162 | + painter.drawGreatCircleArc(perp1StartPoint, perp1EndPoint, NULL); |
163 | + painter.drawGreatCircleArc(perp2StartPoint, perp2EndPoint, NULL); |
164 | + } |
165 | + else |
166 | + { |
167 | + painter.drawGreatCircleArc(startPointHor, endPointHor, NULL); |
168 | + |
169 | + // End lines |
170 | + painter.drawGreatCircleArc(perp1StartPointHor, perp1EndPointHor, NULL); |
171 | + painter.drawGreatCircleArc(perp2StartPointHor, perp2EndPointHor, NULL); |
172 | + } |
173 | } |
174 | - |
175 | if (messageFader.getInterstate() > 0.000001f) |
176 | { |
177 | - painter.setColor(textColor[0], textColor[1], textColor[2], messageFader.getInterstate()); |
178 | + painter.setColor(txtColor[0], txtColor[1], txtColor[2], messageFader.getInterstate()); |
179 | int x = 83; |
180 | int y = 120; |
181 | int ls = painter.getFontMetrics().lineSpacing(); |
182 | @@ -208,19 +255,39 @@ |
183 | y -= ls; |
184 | painter.drawText(x, y, messageRightButton); |
185 | } |
186 | + |
187 | + |
188 | +} |
189 | + |
190 | +//! Draw any parts on the screen which are for our module |
191 | +void AngleMeasure::draw(StelCore* core) |
192 | +{ |
193 | + if (lineVisible.getInterstate() < 0.000001f && messageFader.getInterstate() < 0.000001f) |
194 | + return; |
195 | + if (flagShowHorizontal) |
196 | + { |
197 | + drawOne(core, StelCore::FrameAltAz, StelCore::RefractionOff, horTextColor, horLineColor); |
198 | + } |
199 | + if (flagShowEquatorial) |
200 | + { |
201 | + drawOne(core, StelCore::FrameEquinoxEqu, StelCore::RefractionAuto, textColor, lineColor); |
202 | + } |
203 | } |
204 | |
205 | QString AngleMeasure::calculatePositionAngle(const Vec3d p1, const Vec3d p2) const |
206 | { |
207 | double y = cos(p2.latitude())*sin(p2.longitude()-p1.longitude()); |
208 | double x = cos(p1.latitude())*sin(p2.latitude()) - sin(p1.latitude())*cos(p2.latitude())*cos(p2.longitude()-p1.longitude()); |
209 | - double r = std::atan(y/x); |
210 | - if (x<0) |
211 | - r += M_PI; |
212 | - if (y<0) |
213 | - r += 2*M_PI; |
214 | - if (r>(2*M_PI)) |
215 | - r -= 2*M_PI; |
216 | + double r = std::atan2(y,x); |
217 | + // GZ ATAN2 makes many tests unnecessary... |
218 | +// if (x<0) |
219 | +// r += M_PI; |
220 | +// if (y<0) |
221 | +// r += 2*M_PI; |
222 | +// if (r>(2*M_PI)) |
223 | +// r -= 2*M_PI; |
224 | + if (r<0) |
225 | + r+= 2*M_PI; |
226 | |
227 | unsigned int d, m; |
228 | double s; |
229 | @@ -249,12 +316,16 @@ |
230 | { |
231 | const StelProjectorP prj = StelApp::getInstance().getCore()->getProjection(StelCore::FrameEquinoxEqu); |
232 | prj->unProject(event->x(),event->y(),startPoint); |
233 | + const StelProjectorP prjHor = StelApp::getInstance().getCore()->getProjection(StelCore::FrameAltAz, StelCore::RefractionOff); |
234 | + prjHor->unProject(event->x(),event->y(),startPointHor); |
235 | + |
236 | |
237 | // first click reset the line... only draw it after we've dragged a little. |
238 | if (!dragging) |
239 | { |
240 | lineVisible = false; |
241 | endPoint = startPoint; |
242 | + endPointHor=startPointHor; |
243 | } |
244 | else |
245 | lineVisible = true; |
246 | @@ -275,6 +346,8 @@ |
247 | { |
248 | const StelProjectorP prj = StelApp::getInstance().getCore()->getProjection(StelCore::FrameEquinoxEqu); |
249 | prj->unProject(event->x(),event->y(),endPoint); |
250 | + const StelProjectorP prjHor = StelApp::getInstance().getCore()->getProjection(StelCore::FrameAltAz, StelCore::RefractionOff); |
251 | + prjHor->unProject(event->x(),event->y(),endPointHor); |
252 | calculateEnds(); |
253 | event->setAccepted(true); |
254 | return; |
255 | @@ -288,6 +361,8 @@ |
256 | { |
257 | const StelProjectorP prj = StelApp::getInstance().getCore()->getProjection(StelCore::FrameEquinoxEqu); |
258 | prj->unProject(x,y,endPoint); |
259 | + const StelProjectorP prjHor = StelApp::getInstance().getCore()->getProjection(StelCore::FrameAltAz, StelCore::RefractionOff); |
260 | + prjHor->unProject(x,y,endPointHor); |
261 | calculateEnds(); |
262 | lineVisible = true; |
263 | return true; |
264 | @@ -298,29 +373,41 @@ |
265 | |
266 | void AngleMeasure::calculateEnds(void) |
267 | { |
268 | - Vec3d v0 = endPoint - startPoint; |
269 | - Vec3d v1 = Vec3d(0,0,0) - startPoint; |
270 | + if (flagShowEquatorial) |
271 | + calculateEndsOneLine(startPoint, endPoint, perp1StartPoint, perp1EndPoint, perp2StartPoint, perp2EndPoint, angle); |
272 | + if (flagShowHorizontal) |
273 | + calculateEndsOneLine(startPointHor, endPointHor, perp1StartPointHor, perp1EndPointHor, perp2StartPointHor, perp2EndPointHor, angleHor); |
274 | +} |
275 | + |
276 | +void AngleMeasure::calculateEndsOneLine(const Vec3d start, const Vec3d end, Vec3d &perp1Start, Vec3d &perp1End, Vec3d &perp2Start, Vec3d &perp2End, double &angle) |
277 | +{ |
278 | + Vec3d v0 = end - start; |
279 | + Vec3d v1 = Vec3d(0,0,0) - start; |
280 | Vec3d p = v0 ^ v1; |
281 | p *= 0.08; // end width |
282 | - perp1StartPoint.set(startPoint[0]-p[0],startPoint[1]-p[1],startPoint[2]-p[2]); |
283 | - perp1EndPoint.set(startPoint[0]+p[0],startPoint[1]+p[1],startPoint[2]+p[2]); |
284 | + perp1Start.set(start[0]-p[0],start[1]-p[1],start[2]-p[2]); |
285 | + perp1End.set(start[0]+p[0],start[1]+p[1],start[2]+p[2]); |
286 | |
287 | - v1 = Vec3d(0,0,0) - endPoint; |
288 | + v1 = Vec3d(0,0,0) - end; |
289 | p = v0 ^ v1; |
290 | p *= 0.08; // end width |
291 | - perp2StartPoint.set(endPoint[0]-p[0],endPoint[1]-p[1],endPoint[2]-p[2]); |
292 | - perp2EndPoint.set(endPoint[0]+p[0],endPoint[1]+p[1],endPoint[2]+p[2]); |
293 | + perp2Start.set(end[0]-p[0],end[1]-p[1],end[2]-p[2]); |
294 | + perp2End.set(end[0]+p[0],end[1]+p[1],end[2]+p[2]); |
295 | |
296 | - angle = startPoint.angle(endPoint); |
297 | + angle = start.angle(end); |
298 | } |
299 | |
300 | -QString AngleMeasure::calculateAngle() const |
301 | +// GZ Misnomer! should be called formatAngleString() |
302 | +QString AngleMeasure::calculateAngle(bool horizontal) const |
303 | { |
304 | unsigned int d, m; |
305 | double s; |
306 | bool sign; |
307 | |
308 | - StelUtils::radToDms(angle, sign, d, m, s); |
309 | + if (horizontal) |
310 | + StelUtils::radToDms(angleHor, sign, d, m, s); |
311 | + else |
312 | + StelUtils::radToDms(angle, sign, d, m, s); |
313 | if (flagUseDmsFormat) |
314 | return QString("%1d %2m %3s").arg(d).arg(m).arg(s, 0, 'f', 2); |
315 | else |
316 | @@ -344,6 +431,26 @@ |
317 | flagShowPA = b; |
318 | } |
319 | |
320 | +void AngleMeasure::showPositionAngleHor(bool b) |
321 | +{ |
322 | + flagShowHorizontalPA = b; |
323 | +} |
324 | +void AngleMeasure::showEquatorial(bool b) |
325 | +{ |
326 | + flagShowEquatorial = b; |
327 | +} |
328 | +void AngleMeasure::showHorizontal(bool b) |
329 | +{ |
330 | + flagShowHorizontal = b; |
331 | +} |
332 | +void AngleMeasure::showHorizontalStartSkylinked(bool b) |
333 | +{ |
334 | + flagShowHorizontalStartSkylinked = b; |
335 | +} |
336 | +void AngleMeasure::showHorizontalEndSkylinked(bool b) |
337 | +{ |
338 | + flagShowHorizontalEndSkylinked = b; |
339 | +} |
340 | void AngleMeasure::useDmsFormat(bool b) |
341 | { |
342 | flagUseDmsFormat=b; |
343 | @@ -380,6 +487,8 @@ |
344 | conf->beginGroup("AngleMeasure"); |
345 | conf->setValue("text_color", "0,0.5,1"); |
346 | conf->setValue("line_color", "0,0.5,1"); |
347 | + conf->setValue("text_color_horizontal", "0.9,0.6,0.4"); |
348 | + conf->setValue("line_color_horizontal", "0.9,0.6,0.4"); |
349 | conf->endGroup(); |
350 | } |
351 | |
352 | @@ -391,6 +500,13 @@ |
353 | showPositionAngle(conf->value("show_position_angle", false).toBool()); |
354 | textColor = StelUtils::strToVec3f(conf->value("text_color", "0,0.5,1").toString()); |
355 | lineColor = StelUtils::strToVec3f(conf->value("line_color", "0,0.5,1").toString()); |
356 | + horTextColor = StelUtils::strToVec3f(conf->value("text_color_horizontal", "0.9,0.6,0.4").toString()); |
357 | + horLineColor = StelUtils::strToVec3f(conf->value("line_color_horizontal", "0.9,0.6,0.4").toString()); |
358 | + showPositionAngleHor(conf->value("show_position_angle_horizontal", false).toBool()); |
359 | + flagShowEquatorial = conf->value("show_equatorial", true).toBool(); |
360 | + flagShowHorizontal = conf->value("show_horizontal", false).toBool(); |
361 | + flagShowHorizontalStartSkylinked = conf->value("link_horizontal_start_to_sky", false).toBool(); |
362 | + flagShowHorizontalEndSkylinked = conf->value("link_horizontal_end_to_sky", false).toBool(); |
363 | |
364 | conf->endGroup(); |
365 | } |
366 | @@ -401,6 +517,11 @@ |
367 | |
368 | conf->setValue("angle_format_dms", isDmsFormat()); |
369 | conf->setValue("show_position_angle", isPaDisplayed()); |
370 | + conf->setValue("show_position_angle_horizontal", isHorPaDisplayed()); |
371 | + conf->setValue("show_equatorial", isEquatorial()); |
372 | + conf->setValue("show_horizontal", isHorizontal()); |
373 | + conf->setValue("link_horizontal_start_to_sky", isHorizontalStartSkylinked()); |
374 | + conf->setValue("link_horizontal_end_to_sky", isHorizontalEndSkylinked()); |
375 | |
376 | conf->endGroup(); |
377 | } |
378 | |
379 | === modified file 'plugins/AngleMeasure/src/AngleMeasure.hpp' |
380 | --- plugins/AngleMeasure/src/AngleMeasure.hpp 2014-03-01 15:42:49 +0000 |
381 | +++ plugins/AngleMeasure/src/AngleMeasure.hpp 2014-10-07 18:19:23 +0000 |
382 | @@ -1,5 +1,6 @@ |
383 | /* |
384 | * Copyright (C) 2009 Matthew Gates |
385 | + * Copyright (C) 2014 Georg Zotti |
386 | * |
387 | * This program is free software; you can redistribute it and/or |
388 | * modify it under the terms of the GNU General Public License |
389 | @@ -25,6 +26,7 @@ |
390 | #include "VecMath.hpp" |
391 | #include "StelModule.hpp" |
392 | #include "StelFader.hpp" |
393 | +#include "StelCore.hpp" |
394 | |
395 | class QTimer; |
396 | class QPixmap; |
397 | @@ -33,6 +35,10 @@ |
398 | |
399 | //! Main class of the Angle Measure plug-in. |
400 | //! Provides an on-screen angle measuring tool. |
401 | +//! GZ extended in 2014-09, enough to call it V4.0 |
402 | +//! Equatorial Mode (original): mark start,end: distance/position angle in the sky, line rotates with sky, spherical angles influenced by refraction (numbers given on celestial sphere). |
403 | +//! Horizontal Mode: mark start,end: distance/position angle in alt/azimuthal coordinates, line stays fixed in alt-az system. Angle may be different near to horizon because of refraction! |
404 | +//! It is possible to link start and/or end to the sky. Distance/position angle still always in alt/azimuthal coordinates. |
405 | class AngleMeasure : public StelModule |
406 | { |
407 | Q_OBJECT |
408 | @@ -62,6 +68,12 @@ |
409 | bool isEnabled() const {return flagShowAngleMeasure;} |
410 | bool isDmsFormat() const { return flagUseDmsFormat; } |
411 | bool isPaDisplayed() const { return flagShowPA; } |
412 | + bool isEquatorial() const { return flagShowEquatorial; } |
413 | + bool isHorizontal() const { return flagShowHorizontal; } |
414 | + bool isHorizontalStartSkylinked() const { return flagShowHorizontalStartSkylinked; } |
415 | + bool isHorizontalEndSkylinked() const { return flagShowHorizontalEndSkylinked; } |
416 | + bool isHorPaDisplayed() const { return flagShowHorizontalPA; } |
417 | + |
418 | |
419 | //! Restore the plug-in's settings to the default state. |
420 | //! Replace the plug-in's settings in Stellarium's configuration file |
421 | @@ -88,6 +100,11 @@ |
422 | void enableAngleMeasure(bool b); |
423 | void useDmsFormat(bool b); |
424 | void showPositionAngle(bool b); |
425 | + void showPositionAngleHor(bool b); |
426 | + void showEquatorial(bool b); |
427 | + void showHorizontal(bool b); |
428 | + void showHorizontalStartSkylinked(bool b); |
429 | + void showHorizontalEndSkylinked(bool b); |
430 | |
431 | private slots: |
432 | void updateMessageText(); |
433 | @@ -115,11 +132,29 @@ |
434 | double angle; |
435 | bool flagUseDmsFormat; |
436 | bool flagShowPA; |
437 | + bool flagShowEquatorial; |
438 | + bool flagShowHorizontal; |
439 | + bool flagShowHorizontalPA; |
440 | + bool flagShowHorizontalStartSkylinked; |
441 | + bool flagShowHorizontalEndSkylinked; |
442 | + Vec3f horTextColor; |
443 | + Vec3f horLineColor; |
444 | + Vec3d startPointHor; |
445 | + Vec3d endPointHor; |
446 | + Vec3d perp1StartPointHor; |
447 | + Vec3d perp1EndPointHor; |
448 | + Vec3d perp2StartPointHor; |
449 | + Vec3d perp2EndPointHor; |
450 | + double angleHor; |
451 | + |
452 | + |
453 | StelButton* toolbarButton; |
454 | |
455 | void calculateEnds(); |
456 | - QString calculateAngle(void) const; |
457 | + void calculateEndsOneLine(const Vec3d start, const Vec3d end, Vec3d &perp1Start, Vec3d &perp1End, Vec3d &perp2Start, Vec3d &perp2End, double &angle); |
458 | + QString calculateAngle(bool horizontal=false) const; |
459 | QString calculatePositionAngle(const Vec3d p1, const Vec3d p2) const; |
460 | + void drawOne(StelCore *core, const StelCore::FrameType frameType, const StelCore::RefractionMode refractionMode, const Vec3f txtColor, const Vec3f lineColor); |
461 | |
462 | QSettings* conf; |
463 | |
464 | |
465 | === modified file 'plugins/AngleMeasure/src/gui/AngleMeasureDialog.cpp' |
466 | --- plugins/AngleMeasure/src/gui/AngleMeasureDialog.cpp 2014-09-08 14:57:05 +0000 |
467 | +++ plugins/AngleMeasure/src/gui/AngleMeasureDialog.cpp 2014-10-07 18:19:23 +0000 |
468 | @@ -1,7 +1,7 @@ |
469 | /* |
470 | * Angle Measure plug-in for Stellarium |
471 | * |
472 | - * Copyright (C) 2014 Alexander Wolf |
473 | + * Copyright (C) 2014 Alexander Wolf, Georg Zotti |
474 | * |
475 | * This program is free software; you can redistribute it and/or |
476 | * modify it under the terms of the GNU General Public License |
477 | @@ -53,9 +53,9 @@ |
478 | am = GETSTELMODULE(AngleMeasure); |
479 | ui->setupUi(dialog); |
480 | |
481 | - //Kinetic scrolling for tablet pc and pc |
482 | - QList<QWidget *> addscroll; |
483 | - addscroll << ui->aboutTextBrowser; |
484 | + //Kinetic scrolling for tablet pc and pc |
485 | + QList<QWidget *> addscroll; |
486 | + addscroll << ui->aboutTextBrowser; |
487 | installKineticScrolling(addscroll); |
488 | |
489 | connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); |
490 | @@ -65,6 +65,16 @@ |
491 | connect(ui->useDmsFormatCheckBox, SIGNAL(toggled(bool)), am, SLOT(useDmsFormat(bool))); |
492 | ui->showPositionAngleCheckBox->setChecked(am->isPaDisplayed()); |
493 | connect(ui->showPositionAngleCheckBox, SIGNAL(toggled(bool)), am, SLOT(showPositionAngle(bool))); |
494 | + ui->showPositionAngleHorizontalCheckBox->setChecked(am->isHorPaDisplayed()); |
495 | + connect(ui->showPositionAngleHorizontalCheckBox, SIGNAL(toggled(bool)), am, SLOT(showPositionAngleHor(bool))); |
496 | + ui->showEquatorial_GroupBox->setChecked(am->isEquatorial()); |
497 | + connect(ui->showEquatorial_GroupBox, SIGNAL(toggled(bool)), am, SLOT(showEquatorial(bool))); |
498 | + ui->showHorizontal_GroupBox->setChecked(am->isHorizontal()); |
499 | + connect(ui->showHorizontal_GroupBox, SIGNAL(toggled(bool)), am, SLOT(showHorizontal(bool))); |
500 | + ui->azAltStartOnSkyCheckBox->setChecked(am->isHorizontalStartSkylinked()); |
501 | + connect(ui->azAltStartOnSkyCheckBox, SIGNAL(toggled(bool)), am, SLOT(showHorizontalStartSkylinked(bool))); |
502 | + ui->azAltEndOnSkyCheckBox->setChecked(am->isHorizontalEndSkylinked()); |
503 | + connect(ui->azAltEndOnSkyCheckBox, SIGNAL(toggled(bool)), am, SLOT(showHorizontalEndSkylinked(bool))); |
504 | |
505 | connect(ui->saveSettingsButton, SIGNAL(clicked()), this, SLOT(saveAngleMeasureSettings())); |
506 | connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(resetAngleMeasureSettings())); |
507 | @@ -78,10 +88,11 @@ |
508 | html += "<h2>" + q_("Angle Measure Plug-in") + "</h2><table width=\"90%\">"; |
509 | html += "<tr width=\"30%\"><td><strong>" + q_("Version") + ":</strong></td><td>" + ANGLEMEASURE_VERSION + "</td></tr>"; |
510 | html += "<tr><td><strong>" + q_("Author") + ":</strong></td><td>Matthew Gates</td></tr>"; |
511 | - html += "<tr><td><strong>" + q_("Contributors") + ":</strong></td><td>Bogdan Marinov<br />Alexander Wolf <alex.v.wolf@gmail.com></td></tr>"; |
512 | + html += "<tr><td><strong>" + q_("Contributors") + ":</strong></td><td>Bogdan Marinov<br />Alexander Wolf <alex.v.wolf@gmail.com> <br />Georg Zotti</td></tr>"; |
513 | html += "</table>"; |
514 | |
515 | html += "<p>" + q_("The Angle Measure plugin is a small tool which is used to measure the angular distance between two points on the sky (and calculation of position angle between those two points).") + "</p>"; |
516 | + html += "<p>" + q_("Start and end points in horizontal mode can be linked to the rotating sky, which may be helpful to keep relations between landscape and some celestial object or (with both linked) for Dobsonian starhopping.") + "</p>"; |
517 | html += "<p>" + q_("*goes misty eyed* I recall measuring the size of the Cassini Division when I was a student. It was not the high academic glamor one might expect... It was cloudy... It was rainy... The observatory lab had some old scopes set up at one end, pointing at a <em>photograph</em> of Saturn at the other end of the lab. We measured. We calculated. We wished we were in Hawaii.") + "</p>"; |
518 | |
519 | html += "<h3>" + q_("Links") + "</h3>"; |
520 | |
521 | === modified file 'plugins/AngleMeasure/src/gui/angleMeasureDialog.ui' |
522 | --- plugins/AngleMeasure/src/gui/angleMeasureDialog.ui 2014-02-16 12:58:17 +0000 |
523 | +++ plugins/AngleMeasure/src/gui/angleMeasureDialog.ui 2014-10-07 18:19:23 +0000 |
524 | @@ -162,10 +162,105 @@ |
525 | </widget> |
526 | </item> |
527 | <item> |
528 | - <widget class="QCheckBox" name="showPositionAngleCheckBox"> |
529 | - <property name="text"> |
530 | - <string>Show position angle</string> |
531 | - </property> |
532 | + <widget class="QGroupBox" name="showEquatorial_GroupBox"> |
533 | + <property name="sizePolicy"> |
534 | + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> |
535 | + <horstretch>0</horstretch> |
536 | + <verstretch>0</verstretch> |
537 | + </sizepolicy> |
538 | + </property> |
539 | + <property name="minimumSize"> |
540 | + <size> |
541 | + <width>0</width> |
542 | + <height>80</height> |
543 | + </size> |
544 | + </property> |
545 | + <property name="title"> |
546 | + <string>Show in Equatorial Coordinates</string> |
547 | + </property> |
548 | + <property name="flat"> |
549 | + <bool>true</bool> |
550 | + </property> |
551 | + <property name="checkable"> |
552 | + <bool>true</bool> |
553 | + </property> |
554 | + <widget class="QCheckBox" name="showPositionAngleCheckBox"> |
555 | + <property name="enabled"> |
556 | + <bool>true</bool> |
557 | + </property> |
558 | + <property name="geometry"> |
559 | + <rect> |
560 | + <x>26</x> |
561 | + <y>40</y> |
562 | + <width>400</width> |
563 | + <height>17</height> |
564 | + </rect> |
565 | + </property> |
566 | + <property name="text"> |
567 | + <string>Display with position angle</string> |
568 | + </property> |
569 | + </widget> |
570 | + </widget> |
571 | + </item> |
572 | + <item> |
573 | + <widget class="QGroupBox" name="showHorizontal_GroupBox"> |
574 | + <property name="minimumSize"> |
575 | + <size> |
576 | + <width>0</width> |
577 | + <height>135</height> |
578 | + </size> |
579 | + </property> |
580 | + <property name="title"> |
581 | + <string>Show in Horizontal Coordinates</string> |
582 | + </property> |
583 | + <property name="flat"> |
584 | + <bool>true</bool> |
585 | + </property> |
586 | + <property name="checkable"> |
587 | + <bool>true</bool> |
588 | + </property> |
589 | + <widget class="QCheckBox" name="showPositionAngleHorizontalCheckBox"> |
590 | + <property name="geometry"> |
591 | + <rect> |
592 | + <x>26</x> |
593 | + <y>40</y> |
594 | + <width>484</width> |
595 | + <height>17</height> |
596 | + </rect> |
597 | + </property> |
598 | + <property name="toolTip"> |
599 | + <string>(e.g. for Dobson starhopping)</string> |
600 | + </property> |
601 | + <property name="text"> |
602 | + <string>Display with position angle </string> |
603 | + </property> |
604 | + </widget> |
605 | + <widget class="QCheckBox" name="azAltStartOnSkyCheckBox"> |
606 | + <property name="geometry"> |
607 | + <rect> |
608 | + <x>26</x> |
609 | + <y>65</y> |
610 | + <width>400</width> |
611 | + <height>17</height> |
612 | + </rect> |
613 | + </property> |
614 | + <property name="text"> |
615 | + <string>Attach start point to rotating sky</string> |
616 | + </property> |
617 | + </widget> |
618 | + <widget class="QCheckBox" name="azAltEndOnSkyCheckBox"> |
619 | + <property name="geometry"> |
620 | + <rect> |
621 | + <x>26</x> |
622 | + <y>90</y> |
623 | + <width>400</width> |
624 | + <height>17</height> |
625 | + </rect> |
626 | + </property> |
627 | + <property name="text"> |
628 | + <string>Attach end point to rotating sky</string> |
629 | + </property> |
630 | + </widget> |
631 | </widget> |
632 | </item> |
633 | </layout> |
What about possible small improvements?
1. GUI changes:
1.1 [ ] Show in equatorial coordinates [ ] ...with position angle
1.2 [ ] Show in horizontal coordinates [ ] ...with position angle
2. Description changes:
2.1 Removing our names from authors list (we already in the contributors list :) )