Merge lp:~alexwolf/stellarium/navstars-plugin into lp:stellarium
- navstars-plugin
- Merge into trunk
Proposed by
Alexander Wolf
Status: | Merged |
---|---|
Merged at revision: | 6456 |
Proposed branch: | lp:~alexwolf/stellarium/navstars-plugin |
Merge into: | lp:stellarium |
Diff against target: |
856 lines (+732/-7) 13 files modified
CMakeLists.txt (+1/-0) plugins/CMakeLists.txt (+3/-0) plugins/NavStars/CMakeLists.txt (+16/-0) plugins/NavStars/COPYING (+340/-0) plugins/NavStars/resources/NavStars.qrc (+6/-0) plugins/NavStars/src/CMakeLists.txt (+23/-0) plugins/NavStars/src/NavStars.cpp (+223/-0) plugins/NavStars/src/NavStars.hpp (+99/-0) po/stellarium/POTFILES.in (+1/-0) src/CMakeLists.txt (+5/-0) src/core/StelApp.cpp (+4/-0) src/core/modules/StarMgr.hpp (+10/-4) src/gui/ViewDialog.cpp (+1/-3) |
To merge this branch: | bzr merge lp:~alexwolf/stellarium/navstars-plugin |
Related bugs: | |
Related blueprints: |
Nautical Navigation
(Low)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
gzotti | Approve | ||
Review via email: mp+201297@code.launchpad.net |
This proposal supersedes a proposal from 2014-01-10.
Commit message
Description of the change
This small plugin marks the navigational stars.
To post a comment you must log in.
Revision history for this message
gzotti (georg-zotti) wrote : Posted in a previous version of this proposal | # |
review:
Needs Fixing
Revision history for this message
Alexander Wolf (alexwolf) wrote : | # |
I rewrite part of Navigational Stars plugin and now it doesn't block global settings for stars labels.
Revision history for this message
gzotti (georg-zotti) wrote : | # |
Excellent! Thank you :-)
After merge, we should write a clearer explanation of what it does.
G.
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2014-01-11 17:11:32 +0000 |
3 | +++ CMakeLists.txt 2014-01-11 19:24:01 +0000 |
4 | @@ -191,6 +191,7 @@ |
5 | SET(USE_PLUGIN_EXOPLANETS 1 CACHE BOOL "Define whether the Exoplanets plugin should be created.") |
6 | SET(USE_PLUGIN_FOV 1 CACHE BOOL "Define whether the FOV plugin should be created.") |
7 | SET(USE_PLUGIN_LOGBOOK 0 CACHE BOOL "Define whether the LogBook plugin should be created.") |
8 | +SET(USE_PLUGIN_NAVSTARS 1 CACHE BOOL "Define whether the NavStars plugin should be created.") |
9 | SET(USE_PLUGIN_NOVAE 1 CACHE BOOL "Define whether the Novae plugin should be created.") |
10 | SET(USE_PLUGIN_OBSERVABILITY 1 CACHE BOOL "Define whether the Observability plugin should be created.") |
11 | SET(USE_PLUGIN_OCULARS 1 CACHE BOOL "Define whether the Oculars plugin should be created.") |
12 | |
13 | === modified file 'plugins/CMakeLists.txt' |
14 | --- plugins/CMakeLists.txt 2014-01-08 13:50:13 +0000 |
15 | +++ plugins/CMakeLists.txt 2014-01-11 19:24:01 +0000 |
16 | @@ -49,6 +49,9 @@ |
17 | IF (USE_PLUGIN_SUPERNOVAE) |
18 | ADD_SUBDIRECTORY( Supernovae ) |
19 | ENDIF() |
20 | +IF (USE_PLUGIN_NAVSTARS) |
21 | + ADD_SUBDIRECTORY( NavStars ) |
22 | +ENDIF() |
23 | IF (USE_PLUGIN_NOVAE) |
24 | ADD_SUBDIRECTORY( Novae ) |
25 | ENDIF() |
26 | |
27 | === added directory 'plugins/NavStars' |
28 | === added file 'plugins/NavStars/CMakeLists.txt' |
29 | --- plugins/NavStars/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
30 | +++ plugins/NavStars/CMakeLists.txt 2014-01-11 19:24:01 +0000 |
31 | @@ -0,0 +1,16 @@ |
32 | +SET(NS_MAJOR "0") |
33 | +SET(NS_MINOR "1") |
34 | +SET(NS_PATCH "0") |
35 | +SET(NS_VERSION "${NS_MAJOR}.${NS_MINOR}.${NS_PATCH}") |
36 | + |
37 | +IF(APPLE) |
38 | + SET(CMAKE_INSTALL_PREFIX $ENV{HOME}/Library/Application\ Support/Stellarium) |
39 | +ElSE(APPLE) |
40 | + SET(CMAKE_INSTALL_PREFIX $ENV{HOME}/.stellarium) |
41 | +ENDIF(APPLE) |
42 | + |
43 | +ADD_DEFINITIONS(-DNAVSTARS_PLUGIN_VERSION="${NS_VERSION}") |
44 | + |
45 | +ADD_SUBDIRECTORY( src ) |
46 | + |
47 | +INSTALL(FILES DESTINATION "modules/NavStars") |
48 | |
49 | === added file 'plugins/NavStars/COPYING' |
50 | --- plugins/NavStars/COPYING 1970-01-01 00:00:00 +0000 |
51 | +++ plugins/NavStars/COPYING 2014-01-11 19:24:01 +0000 |
52 | @@ -0,0 +1,340 @@ |
53 | + GNU GENERAL PUBLIC LICENSE |
54 | + Version 2, June 1991 |
55 | + |
56 | + Copyright (C) 1989, 1991 Free Software Foundation, Inc. |
57 | + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA |
58 | + Everyone is permitted to copy and distribute verbatim copies |
59 | + of this license document, but changing it is not allowed. |
60 | + |
61 | + Preamble |
62 | + |
63 | + The licenses for most software are designed to take away your |
64 | +freedom to share and change it. By contrast, the GNU General Public |
65 | +License is intended to guarantee your freedom to share and change free |
66 | +software--to make sure the software is free for all its users. This |
67 | +General Public License applies to most of the Free Software |
68 | +Foundation's software and to any other program whose authors commit to |
69 | +using it. (Some other Free Software Foundation software is covered by |
70 | +the GNU Library General Public License instead.) You can apply it to |
71 | +your programs, too. |
72 | + |
73 | + When we speak of free software, we are referring to freedom, not |
74 | +price. Our General Public Licenses are designed to make sure that you |
75 | +have the freedom to distribute copies of free software (and charge for |
76 | +this service if you wish), that you receive source code or can get it |
77 | +if you want it, that you can change the software or use pieces of it |
78 | +in new free programs; and that you know you can do these things. |
79 | + |
80 | + To protect your rights, we need to make restrictions that forbid |
81 | +anyone to deny you these rights or to ask you to surrender the rights. |
82 | +These restrictions translate to certain responsibilities for you if you |
83 | +distribute copies of the software, or if you modify it. |
84 | + |
85 | + For example, if you distribute copies of such a program, whether |
86 | +gratis or for a fee, you must give the recipients all the rights that |
87 | +you have. You must make sure that they, too, receive or can get the |
88 | +source code. And you must show them these terms so they know their |
89 | +rights. |
90 | + |
91 | + We protect your rights with two steps: (1) copyright the software, and |
92 | +(2) offer you this license which gives you legal permission to copy, |
93 | +distribute and/or modify the software. |
94 | + |
95 | + Also, for each author's protection and ours, we want to make certain |
96 | +that everyone understands that there is no warranty for this free |
97 | +software. If the software is modified by someone else and passed on, we |
98 | +want its recipients to know that what they have is not the original, so |
99 | +that any problems introduced by others will not reflect on the original |
100 | +authors' reputations. |
101 | + |
102 | + Finally, any free program is threatened constantly by software |
103 | +patents. We wish to avoid the danger that redistributors of a free |
104 | +program will individually obtain patent licenses, in effect making the |
105 | +program proprietary. To prevent this, we have made it clear that any |
106 | +patent must be licensed for everyone's free use or not licensed at all. |
107 | + |
108 | + The precise terms and conditions for copying, distribution and |
109 | +modification follow. |
110 | + |
111 | |
112 | + GNU GENERAL PUBLIC LICENSE |
113 | + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION |
114 | + |
115 | + 0. This License applies to any program or other work which contains |
116 | +a notice placed by the copyright holder saying it may be distributed |
117 | +under the terms of this General Public License. The "Program", below, |
118 | +refers to any such program or work, and a "work based on the Program" |
119 | +means either the Program or any derivative work under copyright law: |
120 | +that is to say, a work containing the Program or a portion of it, |
121 | +either verbatim or with modifications and/or translated into another |
122 | +language. (Hereinafter, translation is included without limitation in |
123 | +the term "modification".) Each licensee is addressed as "you". |
124 | + |
125 | +Activities other than copying, distribution and modification are not |
126 | +covered by this License; they are outside its scope. The act of |
127 | +running the Program is not restricted, and the output from the Program |
128 | +is covered only if its contents constitute a work based on the |
129 | +Program (independent of having been made by running the Program). |
130 | +Whether that is true depends on what the Program does. |
131 | + |
132 | + 1. You may copy and distribute verbatim copies of the Program's |
133 | +source code as you receive it, in any medium, provided that you |
134 | +conspicuously and appropriately publish on each copy an appropriate |
135 | +copyright notice and disclaimer of warranty; keep intact all the |
136 | +notices that refer to this License and to the absence of any warranty; |
137 | +and give any other recipients of the Program a copy of this License |
138 | +along with the Program. |
139 | + |
140 | +You may charge a fee for the physical act of transferring a copy, and |
141 | +you may at your option offer warranty protection in exchange for a fee. |
142 | + |
143 | + 2. You may modify your copy or copies of the Program or any portion |
144 | +of it, thus forming a work based on the Program, and copy and |
145 | +distribute such modifications or work under the terms of Section 1 |
146 | +above, provided that you also meet all of these conditions: |
147 | + |
148 | + a) You must cause the modified files to carry prominent notices |
149 | + stating that you changed the files and the date of any change. |
150 | + |
151 | + b) You must cause any work that you distribute or publish, that in |
152 | + whole or in part contains or is derived from the Program or any |
153 | + part thereof, to be licensed as a whole at no charge to all third |
154 | + parties under the terms of this License. |
155 | + |
156 | + c) If the modified program normally reads commands interactively |
157 | + when run, you must cause it, when started running for such |
158 | + interactive use in the most ordinary way, to print or display an |
159 | + announcement including an appropriate copyright notice and a |
160 | + notice that there is no warranty (or else, saying that you provide |
161 | + a warranty) and that users may redistribute the program under |
162 | + these conditions, and telling the user how to view a copy of this |
163 | + License. (Exception: if the Program itself is interactive but |
164 | + does not normally print such an announcement, your work based on |
165 | + the Program is not required to print an announcement.) |
166 | + |
167 | |
168 | +These requirements apply to the modified work as a whole. If |
169 | +identifiable sections of that work are not derived from the Program, |
170 | +and can be reasonably considered independent and separate works in |
171 | +themselves, then this License, and its terms, do not apply to those |
172 | +sections when you distribute them as separate works. But when you |
173 | +distribute the same sections as part of a whole which is a work based |
174 | +on the Program, the distribution of the whole must be on the terms of |
175 | +this License, whose permissions for other licensees extend to the |
176 | +entire whole, and thus to each and every part regardless of who wrote it. |
177 | + |
178 | +Thus, it is not the intent of this section to claim rights or contest |
179 | +your rights to work written entirely by you; rather, the intent is to |
180 | +exercise the right to control the distribution of derivative or |
181 | +collective works based on the Program. |
182 | + |
183 | +In addition, mere aggregation of another work not based on the Program |
184 | +with the Program (or with a work based on the Program) on a volume of |
185 | +a storage or distribution medium does not bring the other work under |
186 | +the scope of this License. |
187 | + |
188 | + 3. You may copy and distribute the Program (or a work based on it, |
189 | +under Section 2) in object code or executable form under the terms of |
190 | +Sections 1 and 2 above provided that you also do one of the following: |
191 | + |
192 | + a) Accompany it with the complete corresponding machine-readable |
193 | + source code, which must be distributed under the terms of Sections |
194 | + 1 and 2 above on a medium customarily used for software interchange; or, |
195 | + |
196 | + b) Accompany it with a written offer, valid for at least three |
197 | + years, to give any third party, for a charge no more than your |
198 | + cost of physically performing source distribution, a complete |
199 | + machine-readable copy of the corresponding source code, to be |
200 | + distributed under the terms of Sections 1 and 2 above on a medium |
201 | + customarily used for software interchange; or, |
202 | + |
203 | + c) Accompany it with the information you received as to the offer |
204 | + to distribute corresponding source code. (This alternative is |
205 | + allowed only for noncommercial distribution and only if you |
206 | + received the program in object code or executable form with such |
207 | + an offer, in accord with Subsection b above.) |
208 | + |
209 | +The source code for a work means the preferred form of the work for |
210 | +making modifications to it. For an executable work, complete source |
211 | +code means all the source code for all modules it contains, plus any |
212 | +associated interface definition files, plus the scripts used to |
213 | +control compilation and installation of the executable. However, as a |
214 | +special exception, the source code distributed need not include |
215 | +anything that is normally distributed (in either source or binary |
216 | +form) with the major components (compiler, kernel, and so on) of the |
217 | +operating system on which the executable runs, unless that component |
218 | +itself accompanies the executable. |
219 | + |
220 | +If distribution of executable or object code is made by offering |
221 | +access to copy from a designated place, then offering equivalent |
222 | +access to copy the source code from the same place counts as |
223 | +distribution of the source code, even though third parties are not |
224 | +compelled to copy the source along with the object code. |
225 | + |
226 | |
227 | + 4. You may not copy, modify, sublicense, or distribute the Program |
228 | +except as expressly provided under this License. Any attempt |
229 | +otherwise to copy, modify, sublicense or distribute the Program is |
230 | +void, and will automatically terminate your rights under this License. |
231 | +However, parties who have received copies, or rights, from you under |
232 | +this License will not have their licenses terminated so long as such |
233 | +parties remain in full compliance. |
234 | + |
235 | + 5. You are not required to accept this License, since you have not |
236 | +signed it. However, nothing else grants you permission to modify or |
237 | +distribute the Program or its derivative works. These actions are |
238 | +prohibited by law if you do not accept this License. Therefore, by |
239 | +modifying or distributing the Program (or any work based on the |
240 | +Program), you indicate your acceptance of this License to do so, and |
241 | +all its terms and conditions for copying, distributing or modifying |
242 | +the Program or works based on it. |
243 | + |
244 | + 6. Each time you redistribute the Program (or any work based on the |
245 | +Program), the recipient automatically receives a license from the |
246 | +original licensor to copy, distribute or modify the Program subject to |
247 | +these terms and conditions. You may not impose any further |
248 | +restrictions on the recipients' exercise of the rights granted herein. |
249 | +You are not responsible for enforcing compliance by third parties to |
250 | +this License. |
251 | + |
252 | + 7. If, as a consequence of a court judgment or allegation of patent |
253 | +infringement or for any other reason (not limited to patent issues), |
254 | +conditions are imposed on you (whether by court order, agreement or |
255 | +otherwise) that contradict the conditions of this License, they do not |
256 | +excuse you from the conditions of this License. If you cannot |
257 | +distribute so as to satisfy simultaneously your obligations under this |
258 | +License and any other pertinent obligations, then as a consequence you |
259 | +may not distribute the Program at all. For example, if a patent |
260 | +license would not permit royalty-free redistribution of the Program by |
261 | +all those who receive copies directly or indirectly through you, then |
262 | +the only way you could satisfy both it and this License would be to |
263 | +refrain entirely from distribution of the Program. |
264 | + |
265 | +If any portion of this section is held invalid or unenforceable under |
266 | +any particular circumstance, the balance of the section is intended to |
267 | +apply and the section as a whole is intended to apply in other |
268 | +circumstances. |
269 | + |
270 | +It is not the purpose of this section to induce you to infringe any |
271 | +patents or other property right claims or to contest validity of any |
272 | +such claims; this section has the sole purpose of protecting the |
273 | +integrity of the free software distribution system, which is |
274 | +implemented by public license practices. Many people have made |
275 | +generous contributions to the wide range of software distributed |
276 | +through that system in reliance on consistent application of that |
277 | +system; it is up to the author/donor to decide if he or she is willing |
278 | +to distribute software through any other system and a licensee cannot |
279 | +impose that choice. |
280 | + |
281 | +This section is intended to make thoroughly clear what is believed to |
282 | +be a consequence of the rest of this License. |
283 | + |
284 | |
285 | + 8. If the distribution and/or use of the Program is restricted in |
286 | +certain countries either by patents or by copyrighted interfaces, the |
287 | +original copyright holder who places the Program under this License |
288 | +may add an explicit geographical distribution limitation excluding |
289 | +those countries, so that distribution is permitted only in or among |
290 | +countries not thus excluded. In such case, this License incorporates |
291 | +the limitation as if written in the body of this License. |
292 | + |
293 | + 9. The Free Software Foundation may publish revised and/or new versions |
294 | +of the General Public License from time to time. Such new versions will |
295 | +be similar in spirit to the present version, but may differ in detail to |
296 | +address new problems or concerns. |
297 | + |
298 | +Each version is given a distinguishing version number. If the Program |
299 | +specifies a version number of this License which applies to it and "any |
300 | +later version", you have the option of following the terms and conditions |
301 | +either of that version or of any later version published by the Free |
302 | +Software Foundation. If the Program does not specify a version number of |
303 | +this License, you may choose any version ever published by the Free Software |
304 | +Foundation. |
305 | + |
306 | + 10. If you wish to incorporate parts of the Program into other free |
307 | +programs whose distribution conditions are different, write to the author |
308 | +to ask for permission. For software which is copyrighted by the Free |
309 | +Software Foundation, write to the Free Software Foundation; we sometimes |
310 | +make exceptions for this. Our decision will be guided by the two goals |
311 | +of preserving the free status of all derivatives of our free software and |
312 | +of promoting the sharing and reuse of software generally. |
313 | + |
314 | + NO WARRANTY |
315 | + |
316 | + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY |
317 | +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN |
318 | +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES |
319 | +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED |
320 | +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
321 | +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS |
322 | +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE |
323 | +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, |
324 | +REPAIR OR CORRECTION. |
325 | + |
326 | + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
327 | +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR |
328 | +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, |
329 | +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING |
330 | +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED |
331 | +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY |
332 | +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER |
333 | +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE |
334 | +POSSIBILITY OF SUCH DAMAGES. |
335 | + |
336 | + END OF TERMS AND CONDITIONS |
337 | + |
338 | |
339 | + How to Apply These Terms to Your New Programs |
340 | + |
341 | + If you develop a new program, and you want it to be of the greatest |
342 | +possible use to the public, the best way to achieve this is to make it |
343 | +free software which everyone can redistribute and change under these terms. |
344 | + |
345 | + To do so, attach the following notices to the program. It is safest |
346 | +to attach them to the start of each source file to most effectively |
347 | +convey the exclusion of warranty; and each file should have at least |
348 | +the "copyright" line and a pointer to where the full notice is found. |
349 | + |
350 | + <one line to give the program's name and a brief idea of what it does.> |
351 | + Copyright (C) <year> <name of author> |
352 | + |
353 | + This program is free software; you can redistribute it and/or modify |
354 | + it under the terms of the GNU General Public License as published by |
355 | + the Free Software Foundation; either version 2 of the License, or |
356 | + (at your option) any later version. |
357 | + |
358 | + This program is distributed in the hope that it will be useful, |
359 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
360 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
361 | + GNU General Public License for more details. |
362 | + |
363 | + You should have received a copy of the GNU General Public License |
364 | + along with this program; if not, write to the Free Software |
365 | + Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA |
366 | + |
367 | + |
368 | +Also add information on how to contact you by electronic and paper mail. |
369 | + |
370 | +If the program is interactive, make it output a short notice like this |
371 | +when it starts in an interactive mode: |
372 | + |
373 | + Gnomovision version 69, Copyright (C) year name of author |
374 | + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
375 | + This is free software, and you are welcome to redistribute it |
376 | + under certain conditions; type `show c' for details. |
377 | + |
378 | +The hypothetical commands `show w' and `show c' should show the appropriate |
379 | +parts of the General Public License. Of course, the commands you use may |
380 | +be called something other than `show w' and `show c'; they could even be |
381 | +mouse-clicks or menu items--whatever suits your program. |
382 | + |
383 | +You should also get your employer (if you work as a programmer) or your |
384 | +school, if any, to sign a "copyright disclaimer" for the program, if |
385 | +necessary. Here is a sample; alter the names: |
386 | + |
387 | + Yoyodyne, Inc., hereby disclaims all copyright interest in the program |
388 | + `Gnomovision' (which makes passes at compilers) written by James Hacker. |
389 | + |
390 | + <signature of Ty Coon>, 1 April 1989 |
391 | + Ty Coon, President of Vice |
392 | + |
393 | +This General Public License does not permit incorporating your program into |
394 | +proprietary programs. If your program is a subroutine library, you may |
395 | +consider it more useful to permit linking proprietary applications with the |
396 | +library. If this is what you want to do, use the GNU Library General |
397 | +Public License instead of this License. |
398 | |
399 | === added directory 'plugins/NavStars/resources' |
400 | === added file 'plugins/NavStars/resources/NavStars.qrc' |
401 | --- plugins/NavStars/resources/NavStars.qrc 1970-01-01 00:00:00 +0000 |
402 | +++ plugins/NavStars/resources/NavStars.qrc 2014-01-11 19:24:01 +0000 |
403 | @@ -0,0 +1,6 @@ |
404 | +<RCC> |
405 | + <qresource prefix="/NavStars"> |
406 | + <file>btNavStars-off.png</file> |
407 | + <file>btNavStars-on.png</file> |
408 | + </qresource> |
409 | +</RCC> |
410 | |
411 | === added file 'plugins/NavStars/resources/btNavStars-off.png' |
412 | Binary files plugins/NavStars/resources/btNavStars-off.png 1970-01-01 00:00:00 +0000 and plugins/NavStars/resources/btNavStars-off.png 2014-01-11 19:24:01 +0000 differ |
413 | === added file 'plugins/NavStars/resources/btNavStars-on.png' |
414 | Binary files plugins/NavStars/resources/btNavStars-on.png 1970-01-01 00:00:00 +0000 and plugins/NavStars/resources/btNavStars-on.png 2014-01-11 19:24:01 +0000 differ |
415 | === added directory 'plugins/NavStars/src' |
416 | === added file 'plugins/NavStars/src/CMakeLists.txt' |
417 | --- plugins/NavStars/src/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
418 | +++ plugins/NavStars/src/CMakeLists.txt 2014-01-11 19:24:01 +0000 |
419 | @@ -0,0 +1,23 @@ |
420 | +INCLUDE_DIRECTORIES( |
421 | + . |
422 | + ${CMAKE_BINARY_DIR}/plugins/NavStars/src |
423 | +) |
424 | + |
425 | +LINK_DIRECTORIES(${BUILD_DIR}/src) |
426 | + |
427 | +SET(NavStars_SRCS |
428 | + NavStars.hpp |
429 | + NavStars.cpp |
430 | +) |
431 | + |
432 | +SET(NavStars_RES ../resources/NavStars.qrc) |
433 | +QT5_ADD_RESOURCES(NavStars_RES_CXX ${NavStars_RES}) |
434 | + |
435 | +SET(extLinkerOption ${PNG_LIBRARIES} ${OPENGL_LIBRARIES}) |
436 | + |
437 | +ADD_LIBRARY(NavStars-static STATIC ${NavStars_SRCS} ${NavStars_RES_CXX}) |
438 | +QT5_USE_MODULES(NavStars-static Core Declarative Network) |
439 | +SET_TARGET_PROPERTIES(NavStars-static PROPERTIES OUTPUT_NAME "NavStars") |
440 | +TARGET_LINK_LIBRARIES(NavStars-static ${extLinkerOption}) |
441 | +SET_TARGET_PROPERTIES(NavStars-static PROPERTIES COMPILE_FLAGS "-DQT_STATICPLUGIN") |
442 | +ADD_DEPENDENCIES(AllStaticPlugins NavStars-static) |
443 | |
444 | === added file 'plugins/NavStars/src/NavStars.cpp' |
445 | --- plugins/NavStars/src/NavStars.cpp 1970-01-01 00:00:00 +0000 |
446 | +++ plugins/NavStars/src/NavStars.cpp 2014-01-11 19:24:01 +0000 |
447 | @@ -0,0 +1,223 @@ |
448 | +/* |
449 | + * Navigational Stars plug-in |
450 | + * Copyright (C) 2014 Alexander Wolf |
451 | + * |
452 | + * This program is free software; you can redistribute it and/or |
453 | + * modify it under the terms of the GNU General Public License |
454 | + * as published by the Free Software Foundation; either version 2 |
455 | + * of the License, or (at your option) any later version. |
456 | + * |
457 | + * This program is distributed in the hope that it will be useful, |
458 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
459 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
460 | + * GNU General Public License for more details. |
461 | + * |
462 | + * You should have received a copy of the GNU General Public License |
463 | + * along with this program; if not, write to the Free Software |
464 | + * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. |
465 | + */ |
466 | + |
467 | +#include "StelProjector.hpp" |
468 | +#include "StelPainter.hpp" |
469 | +#include "StelApp.hpp" |
470 | +#include "StelCore.hpp" |
471 | +#include "StelGui.hpp" |
472 | +#include "StelGuiItems.hpp" |
473 | +#include "StelModuleMgr.hpp" |
474 | +#include "StelTextureMgr.hpp" |
475 | +#include "StelTranslator.hpp" |
476 | +#include "StelFileMgr.hpp" |
477 | +#include "StelObjectMgr.hpp" |
478 | +#include "StarMgr.hpp" |
479 | +#include "StelUtils.hpp" |
480 | +#include "NavStars.hpp" |
481 | + |
482 | +#include <QList> |
483 | +#include <QSharedPointer> |
484 | + |
485 | +/* |
486 | + This method is the one called automatically by the StelModuleMgr just |
487 | + after loading the dynamic library |
488 | +*/ |
489 | +StelModule* NavStarsStelPluginInterface::getStelModule() const |
490 | +{ |
491 | + return new NavStars(); |
492 | +} |
493 | + |
494 | +StelPluginInfo NavStarsStelPluginInterface::getPluginInfo() const |
495 | +{ |
496 | + Q_INIT_RESOURCE(NavStars); |
497 | + |
498 | + StelPluginInfo info; |
499 | + info.id = "NavStars"; |
500 | + info.displayedName = N_("Navigational Stars"); |
501 | + info.authors = "Alexander Wolf"; |
502 | + info.contact = "http://stellarium.org/"; |
503 | + info.description = N_("This plugin marks the navigational stars."); |
504 | + return info; |
505 | +} |
506 | + |
507 | +/* |
508 | + Constructor |
509 | +*/ |
510 | +NavStars::NavStars() |
511 | + : OnIcon(NULL) |
512 | + , OffIcon(NULL) |
513 | + , GlowIcon(NULL) |
514 | + , toolbarButton(NULL) |
515 | +{ |
516 | + setObjectName("NavStars"); |
517 | + conf = StelApp::getInstance().getSettings(); |
518 | + |
519 | + // Set default color |
520 | + navStarColor = Vec3f(0.8, 0.0, 0.0); |
521 | + if (conf->contains("navstars/navstars_color")) |
522 | + { |
523 | + // OK, we have color settings |
524 | + navStarColor = StelUtils::strToVec3f(conf->value("navstars/navstars_color", "0.8,0.0,0.0").toString()); |
525 | + } |
526 | + else |
527 | + { |
528 | + // Oops... no value in config, create a default value |
529 | + conf->setValue("navstars/navstars_color", "0.8,0.0,0.0"); |
530 | + } |
531 | +} |
532 | + |
533 | +/* |
534 | + Destructor |
535 | +*/ |
536 | +NavStars::~NavStars() |
537 | +{ |
538 | + if (GlowIcon) |
539 | + delete GlowIcon; |
540 | + if (OnIcon) |
541 | + delete OnIcon; |
542 | + if (OffIcon) |
543 | + delete OffIcon; |
544 | +} |
545 | + |
546 | +void NavStars::deinit() |
547 | +{ |
548 | + markerTexture.clear(); |
549 | +} |
550 | + |
551 | +/* |
552 | + Reimplementation of the getCallOrder method |
553 | +*/ |
554 | +double NavStars::getCallOrder(StelModuleActionName actionName) const |
555 | +{ |
556 | + if (actionName==StelModule::ActionDraw) |
557 | + return StelApp::getInstance().getModuleMgr().getModule("ConstellationMgr")->getCallOrder(actionName)+10.; |
558 | + return 0; |
559 | +} |
560 | + |
561 | + |
562 | +/* |
563 | + Init our module |
564 | +*/ |
565 | +void NavStars::init() |
566 | +{ |
567 | + smgr = GETSTELMODULE(StarMgr); |
568 | + |
569 | + // List of HIP numbers of navigational stars |
570 | + nstar << 11767 << 677 << 2081 << 3179 << 3419 << 7588 << 9884 << 13847 << 14135 << 15863 << 21421 << 24436 << 24608 << 25336 << 25428 << 26311; |
571 | + nstar << 27989 << 30438 << 32349 << 33579 << 37279 << 37826 << 41037 << 44816 << 45238 << 46390 << 49669 << 54061 << 57632 << 59803 << 60718; |
572 | + nstar << 61084 << 62956 << 65474 << 67301 << 68702 << 68933 << 69673 << 71683 << 72603 << 72607 << 76267 << 80763 << 82273 << 84012 << 85927; |
573 | + nstar << 86032 << 87833 << 90185 << 91262 << 92855 << 97649 << 100751 << 102098 << 107315 << 109268 << 113368 << 113963; |
574 | + |
575 | + // texture for marker |
576 | + markerTexture = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/planet-indicator.png"); |
577 | + |
578 | + // key bindings and other actions |
579 | + addAction("actionShow_NavStars", N_("Navigational Stars"), N_("Mark the navigational stars"), "navStarsVisible", ""); |
580 | + |
581 | + // Icon for toolbar button |
582 | + GlowIcon = new QPixmap(":/graphicsGui/glow32x32.png"); |
583 | + OnIcon = new QPixmap(":/NavStars/btNavStars-on.png"); |
584 | + OffIcon = new QPixmap(":/NavStars/btNavStars-off.png"); |
585 | + |
586 | + StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui()); |
587 | + if (toolbarButton==NULL) { |
588 | + // Create the nav. stars button |
589 | + toolbarButton = new StelButton(NULL, *OnIcon, *OffIcon, *GlowIcon, "actionShow_NavStars"); |
590 | + } |
591 | + gui->getButtonBar()->addButton(toolbarButton, "065-pluginsGroup"); |
592 | + |
593 | + connect(smgr, SIGNAL(starLabelsDisplayedChanged(bool)), this, SLOT(starNamesChanged(bool))); |
594 | + starNamesState=false; |
595 | +} |
596 | + |
597 | +/* |
598 | + Draw our module. |
599 | +*/ |
600 | +void NavStars::draw(StelCore* core) |
601 | +{ |
602 | + if (navStarsMarkerFader.getInterstate() <= 0.0) { return; } |
603 | + |
604 | + StelProjectorP prj = core->getProjection(StelCore::FrameJ2000); |
605 | + StelPainter painter(prj); |
606 | + StelObjectMgr* omgr = GETSTELMODULE(StelObjectMgr); |
607 | + |
608 | + Vec3d pos; |
609 | + QString name, num; |
610 | + for (int i = 0; i < nstar.size(); ++i) |
611 | + { |
612 | + // Search HIP numbers... |
613 | + name = QString("HIP %1").arg(nstar.at(i)); |
614 | + StelObjectP obj = omgr->searchByName(name); |
615 | + prj->projectCheck(obj->getJ2000EquatorialPos(core), pos); |
616 | + |
617 | + // ... and draw markers around stars |
618 | + glEnable(GL_BLEND); |
619 | + painter.enableTexture2d(true); |
620 | + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
621 | + painter.setColor(navStarColor[0], navStarColor[1], navStarColor[2], navStarsMarkerFader.getInterstate()); |
622 | + markerTexture->bind(); |
623 | + painter.drawSprite2dMode(pos[0], pos[1], 11.f); |
624 | + if (i>0) |
625 | + num.setNum(i); |
626 | + else |
627 | + num = "*"; |
628 | + painter.drawText(pos[0], pos[1], QString("%1 (%2)").arg(obj->getNameI18n()).arg(num), 0, 10.f, 10.f, false); |
629 | + } |
630 | + |
631 | +} |
632 | + |
633 | +void NavStars::update(double deltaTime) |
634 | +{ |
635 | + navStarsMarkerFader.update((int)(deltaTime*1000)); |
636 | +} |
637 | + |
638 | +void NavStars::setNavStarsMarks(bool b) |
639 | +{ |
640 | + if (b == navStarsMarkerFader) |
641 | + return; |
642 | + |
643 | + if (b) |
644 | + { |
645 | + // Save the display state of the star labels and hide them. |
646 | + starNamesState = smgr->getFlagLabels(); |
647 | + smgr->setFlagLabels(false); |
648 | + } |
649 | + else |
650 | + { |
651 | + // Restore the star labels state. |
652 | + smgr->setFlagLabels(starNamesState); |
653 | + } |
654 | + |
655 | + navStarsMarkerFader = b; |
656 | + emit navStarsMarksChanged(b); |
657 | +} |
658 | + |
659 | +bool NavStars::getNavStarsMarks() const |
660 | +{ |
661 | + return navStarsMarkerFader; |
662 | +} |
663 | + |
664 | +void NavStars::starNamesChanged(bool b) |
665 | +{ |
666 | + if (b && getNavStarsMarks()) { |
667 | + starNamesState=true; |
668 | + setNavStarsMarks(false); |
669 | + } |
670 | +} |
671 | |
672 | === added file 'plugins/NavStars/src/NavStars.hpp' |
673 | --- plugins/NavStars/src/NavStars.hpp 1970-01-01 00:00:00 +0000 |
674 | +++ plugins/NavStars/src/NavStars.hpp 2014-01-11 19:24:01 +0000 |
675 | @@ -0,0 +1,99 @@ |
676 | +/* |
677 | + * Navigational Stars plug-in |
678 | + * Copyright (C) 2014 Alexander Wolf |
679 | + * |
680 | + * This program is free software; you can redistribute it and/or |
681 | + * modify it under the terms of the GNU General Public License |
682 | + * as published by the Free Software Foundation; either version 2 |
683 | + * of the License, or (at your option) any later version. |
684 | + * |
685 | + * This program is distributed in the hope that it will be useful, |
686 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
687 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
688 | + * GNU General Public License for more details. |
689 | + * |
690 | + * You should have received a copy of the GNU General Public License |
691 | + * along with this program; if not, write to the Free Software |
692 | + * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. |
693 | + */ |
694 | + |
695 | +#ifndef _NAVSTARS_HPP_ |
696 | +#define _NAVSTARS_HPP_ |
697 | + |
698 | +#include "StelObjectModule.hpp" |
699 | +#include "StelObject.hpp" |
700 | +#include "StelTextureTypes.hpp" |
701 | +#include "StelPainter.hpp" |
702 | +#include "StarMgr.hpp" |
703 | +#include "QSettings" |
704 | + |
705 | +class QPixmap; |
706 | +class StelButton; |
707 | +class StelPainter; |
708 | + |
709 | +//! This is an example of a plug-in which can be dynamically loaded into stellarium |
710 | +class NavStars : public StelModule |
711 | +{ |
712 | + Q_OBJECT |
713 | + Q_PROPERTY(bool navStarsVisible |
714 | + READ getNavStarsMarks |
715 | + WRITE setNavStarsMarks |
716 | + NOTIFY navStarsMarksChanged) |
717 | +public: |
718 | + NavStars(); |
719 | + virtual ~NavStars(); |
720 | + |
721 | + /////////////////////////////////////////////////////////////////////////// |
722 | + // Methods defined in the StelModule class |
723 | + virtual void init(); |
724 | + virtual void deinit(); |
725 | + virtual void update(double deltaTime); |
726 | + virtual void draw(StelCore* core); |
727 | + virtual double getCallOrder(StelModuleActionName actionName) const; |
728 | + |
729 | + |
730 | +public slots: |
731 | + |
732 | + void setNavStarsMarks(bool b); |
733 | + bool getNavStarsMarks(void) const; |
734 | + |
735 | +signals: |
736 | + void navStarsMarksChanged(bool b); |
737 | + |
738 | +private slots: |
739 | + void starNamesChanged(bool b); |
740 | + |
741 | +private: |
742 | + StarMgr* smgr; |
743 | + QSettings* conf; |
744 | + StelTextureSP markerTexture; |
745 | + |
746 | + QList<int> nstar; |
747 | + |
748 | + Vec3f navStarColor; |
749 | + LinearFader navStarsMarkerFader; |
750 | + bool starNamesState; |
751 | + |
752 | + QPixmap* OnIcon; |
753 | + QPixmap* OffIcon; |
754 | + QPixmap* GlowIcon; |
755 | + StelButton* toolbarButton; |
756 | +}; |
757 | + |
758 | + |
759 | + |
760 | +#include <QObject> |
761 | +#include "StelPluginInterface.hpp" |
762 | + |
763 | +//! This class is used by Qt to manage a plug-in interface |
764 | +class NavStarsStelPluginInterface : public QObject, public StelPluginInterface |
765 | +{ |
766 | + Q_OBJECT |
767 | + Q_PLUGIN_METADATA(IID "stellarium.StelGuiPluginInterface/1.0") |
768 | + Q_INTERFACES(StelPluginInterface) |
769 | +public: |
770 | + virtual StelModule* getStelModule() const; |
771 | + virtual StelPluginInfo getPluginInfo() const; |
772 | +}; |
773 | + |
774 | +#endif // _NAVSTARS_HPP_ |
775 | |
776 | === modified file 'po/stellarium/POTFILES.in' |
777 | --- po/stellarium/POTFILES.in 2014-01-08 13:50:13 +0000 |
778 | +++ po/stellarium/POTFILES.in 2014-01-11 19:24:01 +0000 |
779 | @@ -110,3 +110,4 @@ |
780 | plugins/FOV/src/FOV.cpp |
781 | plugins/FOV/src/gui/FOVWindow.cpp |
782 | plugins/FOV/src/ui_fovWindow.h |
783 | +plugins/NavStars/src/NavStars.cpp |
784 | |
785 | === modified file 'src/CMakeLists.txt' |
786 | --- src/CMakeLists.txt 2014-01-08 13:50:13 +0000 |
787 | +++ src/CMakeLists.txt 2014-01-11 19:24:01 +0000 |
788 | @@ -477,6 +477,11 @@ |
789 | SET(QT_USE_QTSQL TRUE) |
790 | ENDIF() |
791 | |
792 | +IF (USE_PLUGIN_NAVSTARS) |
793 | + SET(STELLARIUM_STATIC_PLUGINS_LIBRARIES ${STELLARIUM_STATIC_PLUGINS_LIBRARIES} "${CMAKE_BINARY_DIR}/plugins/NavStars/src/${CMAKE_CFG_INTDIR}/libNavStars.a") |
794 | + ADD_DEFINITIONS(-DUSE_STATIC_PLUGIN_NAVSTARS) |
795 | +ENDIF() |
796 | + |
797 | IF (USE_PLUGIN_NOVAE) |
798 | SET(STELLARIUM_STATIC_PLUGINS_LIBRARIES ${STELLARIUM_STATIC_PLUGINS_LIBRARIES} "${CMAKE_BINARY_DIR}/plugins/Novae/src/${CMAKE_CFG_INTDIR}/libNovae.a") |
799 | ADD_DEFINITIONS(-DUSE_STATIC_PLUGIN_NOVAE) |
800 | |
801 | === modified file 'src/core/StelApp.cpp' |
802 | --- src/core/StelApp.cpp 2014-01-08 13:50:13 +0000 |
803 | +++ src/core/StelApp.cpp 2014-01-11 19:24:01 +0000 |
804 | @@ -127,6 +127,10 @@ |
805 | Q_IMPORT_PLUGIN(TimeZoneConfigurationStelPluginInterface) |
806 | #endif |
807 | |
808 | +#ifdef USE_STATIC_PLUGIN_NAVSTARS |
809 | +Q_IMPORT_PLUGIN(NavStarsStelPluginInterface) |
810 | +#endif |
811 | + |
812 | #ifdef USE_STATIC_PLUGIN_NOVAE |
813 | Q_IMPORT_PLUGIN(NovaeStelPluginInterface) |
814 | #endif |
815 | |
816 | === modified file 'src/core/modules/StarMgr.hpp' |
817 | --- src/core/modules/StarMgr.hpp 2013-10-13 20:39:02 +0000 |
818 | +++ src/core/modules/StarMgr.hpp 2014-01-11 19:24:01 +0000 |
819 | @@ -81,11 +81,13 @@ |
820 | { |
821 | Q_OBJECT |
822 | Q_PROPERTY(bool flagStarsDisplayed |
823 | - READ getFlagStars |
824 | - WRITE setFlagStars) |
825 | + READ getFlagStars |
826 | + WRITE setFlagStars |
827 | + NOTIFY starsDisplayedChanged) |
828 | Q_PROPERTY(bool flagLabelsDisplayed |
829 | - READ getFlagLabels |
830 | - WRITE setFlagLabels) |
831 | + READ getFlagLabels |
832 | + WRITE setFlagLabels |
833 | + NOTIFY starLabelsDisplayedChanged) |
834 | |
835 | public: |
836 | StarMgr(void); |
837 | @@ -252,6 +254,10 @@ |
838 | //! @param skyCultureDir the name of the directory containing the sky culture to use. |
839 | void updateSkyCulture(const QString& skyCultureDir); |
840 | |
841 | +signals: |
842 | + void starLabelsDisplayedChanged(const bool displayed); |
843 | + void starsDisplayedChanged(const bool displayed); |
844 | + |
845 | private: |
846 | |
847 | void setCheckFlag(const QString& catalogId, bool b); |
848 | |
849 | === modified file 'src/gui/ViewDialog.cpp' |
850 | --- src/gui/ViewDialog.cpp 2013-12-22 18:36:36 +0000 |
851 | +++ src/gui/ViewDialog.cpp 2014-01-11 19:24:01 +0000 |
852 | @@ -192,9 +192,7 @@ |
853 | |
854 | // Labels section |
855 | StarMgr* smgr = GETSTELMODULE(StarMgr); |
856 | - ui->starLabelCheckBox->setChecked(smgr->getFlagLabels()); |
857 | - connect(ui->starLabelCheckBox, SIGNAL(toggled(bool)), smgr, SLOT(setFlagLabels(bool))); |
858 | - |
859 | + connectCheckBox(ui->starLabelCheckBox, "actionShow_Stars_Labels"); |
860 | connectCheckBox(ui->nebulaLabelCheckBox, "actionShow_Nebulas"); |
861 | connectCheckBox(ui->planetLabelCheckBox, "actionShow_Planets_Labels"); |
862 |
This fulfills exactly its blueprint and is a good starting point for similar special requirements.
I see a bug to fix before merge: If you switch on star names, switch on and off the plugin, its draw() will remember and reset the previous setting of the global star names display (smgr). If you then switch global star names off via GUI, they will still be shown.