14 #include "ui_StarsConfigWidget.h"
19 #include <QContextMenuEvent>
21 #include <QColorDialog>
42 m_renderStars( true ),
43 m_renderConstellationLines( true ),
44 m_renderConstellationLabels( true ),
46 m_renderDsoLabels( true ),
48 m_renderEcliptic( true ),
49 m_renderCelestialEquator( true ),
50 m_renderCelestialPole( true ),
51 m_starsLoaded( false ),
52 m_constellationsLoaded( false ),
53 m_dsosLoaded( false ),
54 m_magnitudeLimit( 100 ),
68 return QStringList(
"stars" );
73 return QString(
"SPECIFIED_ALWAYS" );
78 return QStringList() <<
"STARS";
93 return tr(
"&Stars" );
98 return QString(
"stars" );
108 return tr(
"A plugin that shows the Starry Sky and the Sun." );
118 return QList<PluginAuthor>()
121 <<
PluginAuthor(
"Timothy Lanzi",
"trlanzi@gmail.com" );
126 return QIcon(
":/icons/stars.png");
140 if ( !m_configDialog ) {
142 m_configDialog =
new QDialog();
143 ui_configWidget =
new Ui::StarsConfigWidget;
144 ui_configWidget->setupUi( m_configDialog );
148 connect( ui_configWidget->m_buttonBox, SIGNAL(accepted()), SLOT(
writeSettings()) );
149 connect( ui_configWidget->m_buttonBox, SIGNAL(rejected()), SLOT(
readSettings()) );
151 connect( ui_configWidget->m_constellationColorButton, SIGNAL(clicked()),
this,
154 connect( ui_configWidget->m_constellationLabelColorButton, SIGNAL(clicked()),
this,
157 connect( ui_configWidget->m_dsoLabelColorButton, SIGNAL(clicked()),
this,
160 connect( ui_configWidget->m_eclipticColorButton, SIGNAL(clicked()),
this,
163 connect( ui_configWidget->m_celestialEquatorColorButton, SIGNAL(clicked()),
this,
166 connect( ui_configWidget->m_celestialPoleColorButton, SIGNAL(clicked()),
this,
174 return m_configDialog;
181 settings[
"nameIndex"] = m_nameIndex;
182 settings[
"renderStars"] = m_renderStars;
183 settings[
"renderConstellationLines"] = m_renderConstellationLines;
184 settings[
"renderConstellationLabels"] = m_renderConstellationLabels;
185 settings[
"renderDsos"] = m_renderDsos;
186 settings[
"renderDsoLabels"] = m_renderDsoLabels;
187 settings[
"renderSun"] = m_renderSun;
188 settings[
"renderEcliptic"] = m_renderEcliptic;
189 settings[
"renderCelestialEquator"] = m_renderCelestialEquator;
190 settings[
"renderCelestialPole"] = m_renderCelestialPole;
191 settings[
"magnitudeLimit"] = m_magnitudeLimit;
192 settings[
"constellationBrush"] = m_constellationBrush.color().rgb();
193 settings[
"constellationLabelBrush"] = m_constellationLabelBrush.color().rgb();
194 settings[
"dsoLabelBrush"] = m_dsoLabelBrush.color().rgb();
195 settings[
"eclipticBrush"] = m_eclipticBrush.color().rgb();
196 settings[
"celestialEaquatorBrush"] = m_celestialEquatorBrush.color().rgb();
197 settings[
"celestialPoleBrush"] = m_celestialPoleBrush.color().rgb();
206 m_nameIndex = readSetting<int>(
settings,
"nameIndex", 0 );
207 m_renderStars = readSetting<bool>(
settings,
"renderStars", true );
208 m_renderConstellationLines = readSetting<bool>(
settings,
"renderConstellationLines", true );
209 m_renderConstellationLabels = readSetting<bool>(
settings,
"renderConstellationLabels", true );
210 m_renderDsos = readSetting<bool>(
settings,
"renderDsos", true );
211 m_renderDsoLabels = readSetting<bool>(
settings,
"renderDsoLabels",
true);
212 m_renderSun = readSetting<bool>(
settings,
"renderSun", true );
213 m_renderEcliptic = readSetting<bool>(
settings,
"renderEcliptic", true );
214 m_renderCelestialEquator = readSetting<bool>(
settings,
"renderCelestialEquator", true );
215 m_renderCelestialPole = readSetting<bool>(
settings,
"renderCelestialPole", true );
216 m_magnitudeLimit = readSetting<int>(
settings,
"magnitudeLimit", 100 );
218 m_constellationBrush = QColor( readSetting<QRgb>( settings,
"constellationBrush", defaultColor.rgb() ) );
219 m_constellationLabelBrush = QColor( readSetting<QRgb>( settings,
"constellationLabelBrush", defaultColor.rgb()) );
220 m_dsoLabelBrush = QColor( readSetting<QRgb>( settings,
"dsoLabelBrush", defaultColor.rgb() ) );
221 m_eclipticBrush = QColor( readSetting<QRgb>( settings,
"eclipticBrush", defaultColor.rgb() ) );
222 m_celestialEquatorBrush = QColor( readSetting<QRgb>( settings,
"celestialEquatorBrush", defaultColor.rgb() ) );
223 m_celestialPoleBrush = QColor( readSetting<QRgb>( settings,
"celestialPoleBrush", defaultColor.rgb() ) );
226 void StarsPlugin::prepareNames()
229 m_nativeHash[
"Andromeda"] = tr(
"Andromeda");
230 m_abbrHash[
"Andromeda"] =
"And";
233 m_nativeHash[
"Antlia"] = tr(
"Antlia");
234 m_abbrHash[
"Antlia"] =
"Ant";
237 m_nativeHash[
"Apus"] = tr(
"Apus");
238 m_abbrHash[
"Apus"] =
"Aps";
241 m_nativeHash[
"Aquarius"] = tr(
"Aquarius");
242 m_abbrHash[
"Aquarius"] =
"Aqr";
245 m_nativeHash[
"Aquila"] = tr(
"Aquila");
246 m_abbrHash[
"Aquila"] =
"Aql";
249 m_nativeHash[
"Ara"] = tr(
"Ara");
250 m_abbrHash[
"Ara"] =
"Ara";
253 m_nativeHash[
"Aries"] = tr(
"Aries");
254 m_abbrHash[
"Aries"] =
"Ari";
257 m_nativeHash[
"Auriga"] = tr(
"Auriga");
258 m_abbrHash[
"Auriga"] =
"Aur";
261 m_nativeHash[
"Boötes"] = tr(
"Boötes");
262 m_abbrHash[
"Boötes"] =
"Boo";
265 m_nativeHash[
"Caelum"] = tr(
"Caelum");
266 m_abbrHash[
"Caelum"] =
"Cae";
269 m_nativeHash[
"Camelopardalis"] = tr(
"Camelopardalis");
270 m_abbrHash[
"Camelopardalis"] =
"Cam";
273 m_nativeHash[
"Cancer"] = tr(
"Cancer");
274 m_abbrHash[
"Cancer"] =
"Cnc";
277 m_nativeHash[
"Canes Venatici"] = tr(
"Canes Venatici");
278 m_abbrHash[
"Canes Venatici"] =
"CVn";
281 m_nativeHash[
"Canis Major"] = tr(
"Canis Major");
282 m_abbrHash[
"Canis Major"] =
"CMa";
285 m_nativeHash[
"Canis Minor"] = tr(
"Canis Minor");
286 m_abbrHash[
"Canis Minor"] =
"CMi";
289 m_nativeHash[
"Capricornus"] = tr(
"Capricornus");
290 m_abbrHash[
"Capricornus"] =
"Cap";
293 m_nativeHash[
"Carina"] = tr(
"Carina");
294 m_abbrHash[
"Carina"] =
"Car";
297 m_nativeHash[
"Cassiopeia"] = tr(
"Cassiopeia");
298 m_abbrHash[
"Cassiopeia"] =
"Cas";
301 m_nativeHash[
"Centaurus"] = tr(
"Centaurus");
302 m_abbrHash[
"Centaurus"] =
"Cen";
305 m_nativeHash[
"Cepheus"] = tr(
"Cepheus");
306 m_abbrHash[
"Cepheus"] =
"Cep";
309 m_nativeHash[
"Cetus"] = tr(
"Cetus");
310 m_abbrHash[
"Cetus"] =
"Cet";
313 m_nativeHash[
"Chamaeleon"] = tr(
"Chamaeleon");
314 m_abbrHash[
"Chamaeleon"] =
"Cha";
317 m_nativeHash[
"Circinus"] = tr(
"Circinus");
318 m_abbrHash[
"Circinus"] =
"Cir";
321 m_nativeHash[
"Columba"] = tr(
"Columba");
322 m_abbrHash[
"Columba"] =
"Col";
325 m_nativeHash[
"Coma Berenices"] = tr(
"Coma Berenices");
326 m_abbrHash[
"Coma Berenices"] =
"Com";
329 m_nativeHash[
"Corona Australis"] = tr(
"Corona Australis");
330 m_abbrHash[
"Corona Australis"] =
"CrA";
333 m_nativeHash[
"Corona Borealis"] = tr(
"Corona Borealis");
334 m_abbrHash[
"Corona Borealis"] =
"CrB";
337 m_nativeHash[
"Corvus"] = tr(
"Corvus");
338 m_abbrHash[
"Corvus"] =
"Crv";
341 m_nativeHash[
"Crater"] = tr(
"Crater");
342 m_abbrHash[
"Crater"] =
"Crt";
345 m_nativeHash[
"Crux"] = tr(
"Crux");
346 m_abbrHash[
"Crux"] =
"Cru";
349 m_nativeHash[
"Cygnus"] = tr(
"Cygnus");
350 m_abbrHash[
"Cygnus"] =
"Cyg";
353 m_nativeHash[
"Delphinus"] = tr(
"Delphinus");
354 m_abbrHash[
"Delphinus"] =
"Del";
357 m_nativeHash[
"Dorado"] = tr(
"Dorado");
358 m_abbrHash[
"Dorado"] =
"Dor";
361 m_nativeHash[
"Draco"] = tr(
"Draco");
362 m_abbrHash[
"Draco"] =
"Dra";
365 m_nativeHash[
"Equuleus"] = tr(
"Equuleus");
366 m_abbrHash[
"Equuleus"] =
"Equ";
369 m_nativeHash[
"Eridanus"] = tr(
"Eridanus");
370 m_abbrHash[
"Eridanus"] =
"Eri";
373 m_nativeHash[
"Fornax"] = tr(
"Fornax");
374 m_abbrHash[
"Fornax"] =
"For";
377 m_nativeHash[
"Gemini"] = tr(
"Gemini");
378 m_abbrHash[
"Gemini"] =
"Gem";
381 m_nativeHash[
"Grus"] = tr(
"Grus");
382 m_abbrHash[
"Grus"] =
"Gru";
385 m_nativeHash[
"Hercules"] = tr(
"Hercules");
386 m_abbrHash[
"Hercules"] =
"Her";
389 m_nativeHash[
"Horologium"] = tr(
"Horologium");
390 m_abbrHash[
"Horologium"] =
"Hor";
393 m_nativeHash[
"Hydra"] = tr(
"Hydra");
394 m_abbrHash[
"Hydra"] =
"Hya";
397 m_nativeHash[
"Hydrus"] = tr(
"Hydrus");
398 m_abbrHash[
"Hydrus"] =
"Hyi";
401 m_nativeHash[
"Indus"] = tr(
"Indus");
402 m_abbrHash[
"Indus"] =
"Ind";
405 m_nativeHash[
"Lacerta"] = tr(
"Lacerta");
406 m_abbrHash[
"Lacerta"] =
"Lac";
409 m_nativeHash[
"Leo"] = tr(
"Leo");
410 m_abbrHash[
"Leo"] =
"Leo";
413 m_nativeHash[
"Leo Minor"] = tr(
"Leo Minor");
414 m_abbrHash[
"Leo Minor"] =
"LMi";
417 m_nativeHash[
"Lepus"] = tr(
"Lepus");
418 m_abbrHash[
"Lepus"] =
"Lep";
421 m_nativeHash[
"Libra"] = tr(
"Libra");
422 m_abbrHash[
"Libra"] =
"Lib";
425 m_nativeHash[
"Lupus"] = tr(
"Lupus");
426 m_abbrHash[
"Lupus"] =
"Lup";
429 m_nativeHash[
"Lynx"] = tr(
"Lynx");
430 m_abbrHash[
"Lynx"] =
"Lyn";
433 m_nativeHash[
"Lyra"] = tr(
"Lyra");
434 m_abbrHash[
"Lyra"] =
"Lyr";
437 m_nativeHash[
"Mensa"] = tr(
"Mensa");
438 m_abbrHash[
"Mensa"] =
"Men";
441 m_nativeHash[
"Microscopium"] = tr(
"Microscopium");
442 m_abbrHash[
"Microscopium"] =
"Mic";
445 m_nativeHash[
"Monoceros"] = tr(
"Monoceros");
446 m_abbrHash[
"Monoceros"] =
"Mon";
449 m_nativeHash[
"Musca"] = tr(
"Musca");
450 m_abbrHash[
"Musca"] =
"Mus";
453 m_nativeHash[
"Norma"] = tr(
"Norma");
454 m_abbrHash[
"Norma"] =
"Nor";
457 m_nativeHash[
"Octans"] = tr(
"Octans");
458 m_abbrHash[
"Octans"] =
"Oct";
461 m_nativeHash[
"Ophiuchus"] = tr(
"Ophiuchus");
462 m_abbrHash[
"Ophiuchus"] =
"Oph";
465 m_nativeHash[
"Orion"] = tr(
"Orion");
466 m_abbrHash[
"Orion"] =
"Ori";
469 m_nativeHash[
"Pavo"] = tr(
"Pavo");
470 m_abbrHash[
"Pavo"] =
"Pav";
473 m_nativeHash[
"Pegasus"] = tr(
"Pegasus");
474 m_abbrHash[
"Pegasus"] =
"Peg";
477 m_nativeHash[
"Perseus"] = tr(
"Perseus");
478 m_abbrHash[
"Perseus"] =
"Per";
481 m_nativeHash[
"Phoenix"] = tr(
"Phoenix");
482 m_abbrHash[
"Phoenix"] =
"Phe";
485 m_nativeHash[
"Pictor"] = tr(
"Pictor");
486 m_abbrHash[
"Pictor"] =
"Pic";
489 m_nativeHash[
"Pisces"] = tr(
"Pisces");
490 m_abbrHash[
"Pisces"] =
"Psc";
493 m_nativeHash[
"Piscis Austrinus"] = tr(
"Piscis Austrinus");
494 m_abbrHash[
"Piscis Austrinus"] =
"PsA";
497 m_nativeHash[
"Puppis"] = tr(
"Puppis");
498 m_abbrHash[
"Puppis"] =
"Pup";
501 m_nativeHash[
"Pyxis"] = tr(
"Pyxis");
502 m_abbrHash[
"Pyxis"] =
"Pyx";
505 m_nativeHash[
"Reticulum"] = tr(
"Reticulum");
506 m_abbrHash[
"Reticulum"] =
"Ret";
509 m_nativeHash[
"Sagitta"] = tr(
"Sagitta");
510 m_abbrHash[
"Sagitta"] =
"Sge";
513 m_nativeHash[
"Sagittarius"] = tr(
"Sagittarius");
514 m_abbrHash[
"Sagittarius"] =
"Sgr";
517 m_nativeHash[
"Scorpius"] = tr(
"Scorpius");
518 m_abbrHash[
"Scorpius"] =
"Sco";
521 m_nativeHash[
"Sculptor"] = tr(
"Sculptor");
522 m_abbrHash[
"Sculptor"] =
"Scl";
525 m_nativeHash[
"Scutum"] = tr(
"Scutum");
526 m_abbrHash[
"Scutum"] =
"Sct";
529 m_nativeHash[
"Serpens"] = tr(
"Serpens");
530 m_abbrHash[
"Serpens"] =
"Ser";
533 m_nativeHash[
"Sextans"] = tr(
"Sextans");
534 m_abbrHash[
"Sextans"] =
"Sex";
537 m_nativeHash[
"Taurus"] = tr(
"Taurus");
538 m_abbrHash[
"Taurus"] =
"Tau";
541 m_nativeHash[
"Telescopium"] = tr(
"Telescopium");
542 m_abbrHash[
"Telescopium"] =
"Tel";
545 m_nativeHash[
"Triangulum"] = tr(
"Triangulum");
546 m_abbrHash[
"Triangulum"] =
"Tri";
549 m_nativeHash[
"Triangulum Australe"] = tr(
"Triangulum Australe");
550 m_abbrHash[
"Triangulum Australe"] =
"TrA";
553 m_nativeHash[
"Tucana"] = tr(
"Tucana");
554 m_abbrHash[
"Tucana"] =
"Tuc";
557 m_nativeHash[
"Ursa Major"] = tr(
"Ursa Major");
558 m_abbrHash[
"Ursa Major"] =
"UMa";
561 m_nativeHash[
"Ursa Minor"] = tr(
"Ursa Minor");
562 m_abbrHash[
"Ursa Minor"] =
"UMi";
565 m_nativeHash[
"Vela"] = tr(
"Vela");
566 m_abbrHash[
"Vela"] =
"Vel";
569 m_nativeHash[
"Virgo"] = tr(
"Virgo");
570 m_abbrHash[
"Virgo"] =
"Vir";
573 m_nativeHash[
"Volans"] = tr(
"Volans");
574 m_abbrHash[
"Volans"] =
"Vol";
577 m_nativeHash[
"Vulpecula"] = tr(
"Vulpecula");
578 m_abbrHash[
"Vulpecula"] =
"Vul";
583 switch (m_nameIndex) {
587 return m_nativeHash[
name];
589 return m_abbrHash[
name];
597 if ( !m_configDialog ) {
601 ui_configWidget->constellationNamesComboBox->setCurrentIndex(m_nameIndex);
603 Qt::CheckState
const constellationLineState = m_renderConstellationLines ? Qt::Checked : Qt::Unchecked;
604 ui_configWidget->m_viewConstellationLinesCheckbox->setCheckState( constellationLineState );
606 Qt::CheckState
const constellationLabelState = m_renderConstellationLabels ? Qt::Checked : Qt::Unchecked;
607 ui_configWidget->m_viewConstellationLabelsCheckbox->setCheckState( constellationLabelState );
609 Qt::CheckState
const dsoState = m_renderDsos ? Qt::Checked : Qt::Unchecked;
610 ui_configWidget->m_viewDsosCheckbox->setCheckState( dsoState );
612 Qt::CheckState
const dsoLabelState = m_renderDsoLabels ? Qt::Checked : Qt::Unchecked;
613 ui_configWidget->m_viewDsoLabelCheckbox->setCheckState( dsoLabelState );
615 Qt::CheckState
const sunState = m_renderSun ? Qt::Checked : Qt::Unchecked;
616 ui_configWidget->m_viewSunCheckbox->setCheckState( sunState );
618 Qt::CheckState
const eclipticState = m_renderEcliptic ? Qt::Checked : Qt::Unchecked;
619 ui_configWidget->m_viewEclipticCheckbox->setCheckState( eclipticState );
621 Qt::CheckState
const celestialEquatorState = m_renderCelestialEquator ? Qt::Checked : Qt::Unchecked;
622 ui_configWidget->m_viewCelestialEquatorCheckbox->setCheckState( celestialEquatorState );
624 Qt::CheckState
const celestialPoleState = m_renderCelestialPole ? Qt::Checked : Qt::Unchecked;
625 ui_configWidget->m_viewCelestialPoleCheckbox->setCheckState( celestialPoleState );
628 int magState = m_magnitudeLimit;
629 if ( magState < ui_configWidget->m_magnitudeSlider->minimum() ) {
630 magState = ui_configWidget->m_magnitudeSlider->minimum();
632 else if ( magState > ui_configWidget->m_magnitudeSlider->maximum() ) {
633 magState = ui_configWidget->m_magnitudeSlider->maximum();
636 ui_configWidget->m_magnitudeSlider->setValue(magState);
638 QPalette constellationPalette;
639 constellationPalette.setColor( QPalette::Button, m_constellationBrush.color() );
640 ui_configWidget->m_constellationColorButton->setPalette( constellationPalette );
642 QPalette constellationLabelPalette;
643 constellationLabelPalette.setColor( QPalette::Button, m_constellationLabelBrush.color() );
644 ui_configWidget->m_constellationLabelColorButton->setPalette( constellationLabelPalette );
646 QPalette dsoLabelPalette;
647 dsoLabelPalette.setColor( QPalette::Button, m_dsoLabelBrush.color() );
648 ui_configWidget->m_dsoLabelColorButton->setPalette( dsoLabelPalette );
650 QPalette eclipticPalette;
651 eclipticPalette.setColor( QPalette::Button, m_eclipticBrush.color() );
652 ui_configWidget->m_eclipticColorButton->setPalette( eclipticPalette );
654 QPalette celestialEquatorPalette;
655 celestialEquatorPalette.setColor( QPalette::Button, m_celestialEquatorBrush.color() );
656 ui_configWidget->m_celestialEquatorColorButton->setPalette( celestialEquatorPalette );
658 QPalette celestialPolePalette;
659 celestialPolePalette.setColor( QPalette::Button, m_celestialPoleBrush.color() );
660 ui_configWidget->m_celestialPoleColorButton->setPalette( celestialPolePalette );
667 m_nameIndex = ui_configWidget->constellationNamesComboBox->currentIndex();
668 m_renderConstellationLines = ui_configWidget->m_viewConstellationLinesCheckbox->checkState() == Qt::Checked;
669 m_renderConstellationLabels = ui_configWidget->m_viewConstellationLabelsCheckbox->checkState() == Qt::Checked;
670 m_renderDsos = ui_configWidget->m_viewDsosCheckbox->checkState() == Qt::Checked;
671 m_renderDsoLabels = ui_configWidget->m_viewDsoLabelCheckbox->checkState() == Qt::Checked;
672 m_renderSun = ui_configWidget->m_viewSunCheckbox->checkState() == Qt::Checked;
673 m_renderEcliptic = ui_configWidget->m_viewEclipticCheckbox->checkState() == Qt::Checked;
674 m_renderCelestialEquator = ui_configWidget->m_viewCelestialEquatorCheckbox->checkState() == Qt::Checked;
675 m_renderCelestialPole = ui_configWidget->m_viewCelestialPoleCheckbox->checkState() == Qt::Checked;
676 m_magnitudeLimit = ui_configWidget->m_magnitudeSlider->value();
677 m_constellationBrush = QBrush( ui_configWidget->m_constellationColorButton->palette().color( QPalette::Button) );
678 m_constellationLabelBrush = QBrush( ui_configWidget->m_constellationLabelColorButton->palette().color( QPalette::Button) );
679 m_dsoLabelBrush = QBrush( ui_configWidget->m_dsoLabelColorButton->palette().color( QPalette::Button) );
680 m_eclipticBrush = QBrush( ui_configWidget->m_eclipticColorButton->palette().color( QPalette::Button) );
681 m_celestialEquatorBrush = QBrush( ui_configWidget->m_celestialEquatorColorButton->palette().color( QPalette::Button) );
682 m_celestialPoleBrush = QBrush( ui_configWidget->m_celestialPoleColorButton->palette().color( QPalette::Button) );
688 const QColor c = QColorDialog::getColor( m_constellationBrush.color(), 0, tr(
"Please choose the color for the constellation lines.") );
691 QPalette palette = ui_configWidget->m_constellationColorButton->palette();
692 palette.setColor( QPalette::Button, c );
693 ui_configWidget->m_constellationColorButton->setPalette( palette );
699 const QColor c = QColorDialog::getColor( m_constellationLabelBrush.color(), 0, tr(
"Please choose the color for the constellation labels.") );
702 QPalette palette = ui_configWidget->m_constellationLabelColorButton->palette();
703 palette.setColor( QPalette::Button, c );
704 ui_configWidget->m_constellationLabelColorButton->setPalette( palette );
710 const QColor c = QColorDialog::getColor( m_dsoLabelBrush.color(), 0, tr(
"Please choose the color for the dso labels.") );
713 QPalette palette = ui_configWidget->m_dsoLabelColorButton->palette();
714 palette.setColor( QPalette::Button, c );
715 ui_configWidget->m_dsoLabelColorButton->setPalette( palette );
721 const QColor c = QColorDialog::getColor( m_eclipticBrush.color(), 0, tr(
"Please choose the color for the ecliptic.") );
724 QPalette palette = ui_configWidget->m_eclipticColorButton->palette();
725 palette.setColor( QPalette::Button, c );
726 ui_configWidget->m_eclipticColorButton->setPalette( palette );
732 const QColor c = QColorDialog::getColor( m_celestialEquatorBrush.color(), 0, tr(
"Please choose the color for the celestial equator.") );
735 QPalette palette = ui_configWidget->m_celestialEquatorColorButton->palette();
736 palette.setColor( QPalette::Button, c );
737 ui_configWidget->m_celestialEquatorColorButton->setPalette( palette );
743 const QColor c = QColorDialog::getColor( m_celestialPoleBrush.color(), 0, tr(
"Please choose the color for the celestial equator.") );
746 QPalette palette = ui_configWidget->m_celestialPoleColorButton->palette();
747 palette.setColor( QPalette::Button, c );
748 ui_configWidget->m_celestialPoleColorButton->setPalette( palette );
752 void StarsPlugin::loadStars()
759 starFile.open( QIODevice::ReadOnly );
760 QDataStream in( &starFile );
765 if ( magic != 0x73746172 ) {
772 if ( version > 004 ) {
773 mDebug() <<
"stars.dat: file too new.";
777 if ( version == 003 ) {
778 mDebug() <<
"stars.dat: file version no longer supported.";
792 while ( !in.atEnd() ) {
793 if ( version >= 2 ) {
803 if ( version >= 4 ) {
807 StarPoint star(
id, ( qreal )( ra ), ( qreal )( de ), ( qreal )( mag ), colorId );
812 m_idHash[id] = starIndex;
822 QVector<QPixmap> m_pixBigStars;
823 m_pixBigStars.clear();
824 m_pixBigStars.append(QPixmap(
MarbleDirs::path(
"bitmaps/stars/star_0_blue.png")));
825 m_pixBigStars.append(QPixmap(
MarbleDirs::path(
"bitmaps/stars/star_0_bluewhite.png")));
826 m_pixBigStars.append(QPixmap(
MarbleDirs::path(
"bitmaps/stars/star_0_white.png")));
827 m_pixBigStars.append(QPixmap(
MarbleDirs::path(
"bitmaps/stars/star_0_yellow.png")));
828 m_pixBigStars.append(QPixmap(
MarbleDirs::path(
"bitmaps/stars/star_0_orange.png")));
829 m_pixBigStars.append(QPixmap(
MarbleDirs::path(
"bitmaps/stars/star_0_red.png")));
830 m_pixBigStars.append(QPixmap(
MarbleDirs::path(
"bitmaps/stars/star_0_garnetred.png")));
832 QVector<QPixmap> m_pixSmallStars;
833 m_pixSmallStars.clear();
834 m_pixSmallStars.append(QPixmap(
MarbleDirs::path(
"bitmaps/stars/star_3_blue.png")));
835 m_pixSmallStars.append(QPixmap(
MarbleDirs::path(
"bitmaps/stars/star_3_bluewhite.png")));
836 m_pixSmallStars.append(QPixmap(
MarbleDirs::path(
"bitmaps/stars/star_3_white.png")));
837 m_pixSmallStars.append(QPixmap(
MarbleDirs::path(
"bitmaps/stars/star_3_yellow.png")));
838 m_pixSmallStars.append(QPixmap(
MarbleDirs::path(
"bitmaps/stars/star_3_orange.png")));
839 m_pixSmallStars.append(QPixmap(
MarbleDirs::path(
"bitmaps/stars/star_3_red.png")));
840 m_pixSmallStars.append(QPixmap(
MarbleDirs::path(
"bitmaps/stars/star_3_garnetred.png")));
844 m_pixN1Stars.clear();
845 for (
int p=0; p < m_pixBigStars.size(); ++p) {
846 int width = 1.0*m_pixBigStars.at(p).width();
847 m_pixN1Stars.append(m_pixBigStars.at(p).scaledToWidth(width,Qt::SmoothTransformation));
850 m_pixP0Stars.clear();
851 for (
int p=0; p < m_pixBigStars.size(); ++p) {
852 int width = 0.90*m_pixBigStars.at(p).width();
853 m_pixP0Stars.append(m_pixBigStars.at(p).scaledToWidth(width,Qt::SmoothTransformation));
856 m_pixP1Stars.clear();
857 for (
int p=0; p < m_pixBigStars.size(); ++p) {
858 int width = 0.80*m_pixBigStars.at(p).width();
859 m_pixP1Stars.append(m_pixBigStars.at(p).scaledToWidth(width,Qt::SmoothTransformation));
862 m_pixP2Stars.clear();
863 for (
int p=0; p < m_pixBigStars.size(); ++p) {
864 int width = 0.70*m_pixBigStars.at(p).width();
865 m_pixP2Stars.append(m_pixBigStars.at(p).scaledToWidth(width,Qt::SmoothTransformation));
868 m_pixP3Stars.clear();
869 for (
int p=0; p < m_pixSmallStars.size(); ++p) {
871 m_pixP3Stars.append(m_pixSmallStars.at(p).scaledToWidth(width,Qt::SmoothTransformation));
874 m_pixP4Stars.clear();
875 for (
int p=0; p < m_pixSmallStars.size(); ++p) {
877 m_pixP4Stars.append(m_pixSmallStars.at(p).scaledToWidth(width,Qt::SmoothTransformation));
880 m_pixP5Stars.clear();
881 for (
int p=0; p < m_pixSmallStars.size(); ++p) {
883 m_pixP5Stars.append(m_pixSmallStars.at(p).scaledToWidth(width,Qt::SmoothTransformation));
886 m_pixP6Stars.clear();
887 for (
int p=0; p < m_pixSmallStars.size(); ++p) {
889 m_pixP6Stars.append(m_pixSmallStars.at(p).scaledToWidth(width,Qt::SmoothTransformation));
892 m_pixP7Stars.clear();
893 for (
int p=0; p < m_pixSmallStars.size(); ++p) {
895 m_pixP7Stars.append(m_pixSmallStars.at(p).scaledToWidth(width,Qt::SmoothTransformation));
898 m_starsLoaded =
true;
902 void StarsPlugin::loadConstellations()
905 m_constellations.clear();
908 constellationFile.open( QIODevice::ReadOnly );
909 QTextStream in( &constellationFile );
913 while ( !in.atEnd() ) {
914 line = in.readLine();
917 if ( line.isNull() ) {
923 if ( line.startsWith(
'#' ) ) {
927 indexList = in.readLine();
930 if ( indexList.isNull() ) {
934 Constellation constellation(
this, line, indexList );
935 m_constellations << constellation;
938 m_constellationsLoaded =
true;
942 void StarsPlugin::loadDsos()
948 dsoFile.open( QIODevice::ReadOnly );
949 QTextStream in( &dsoFile );
952 while ( !in.atEnd() ) {
953 line = in.readLine();
956 if ( line.isNull() ) {
962 if ( line.startsWith(
'#' ) ) {
966 QStringList entries = line.split( QLatin1Char(
',' ) );
968 QString
id = entries.at( 0 );
970 double raH = entries.at( 1 ).toDouble();
971 double raM = entries.at( 2 ).toDouble();
972 double raS = entries.at( 3 ).toDouble();
973 double decD = entries.at( 4 ).toDouble();
974 double decM = entries.at( 5 ).toDouble();
975 double decS = entries.at( 6 ).toDouble();
977 double raRad = ( raH+raM/60.0+raS/3600.0 )*15.0*
M_PI/180.0;
981 decRad = ( decD+decM/60.0+decS/3600.0 )*
M_PI/180.0;
984 decRad = ( decD-decM/60.0-decS/3600.0 )*
M_PI/180.0;
987 DsoPoint dso(
id, ( qreal )( raRad ), ( qreal )( decRad ) );
999 Q_UNUSED( renderPos )
1006 if ( doRender != m_doRender ) {
1008 connect(
marbleModel()->clock(), SIGNAL(timeChanged()),
1009 this, SLOT(requestRepaint()) );
1011 disconnect(
marbleModel()->clock(), SIGNAL(timeChanged()),
1012 this, SLOT(requestRepaint()) );
1015 m_doRender = doRender;
1022 qreal gmst = siderealTime( currentDateTime );
1023 qreal skyRotationAngle = gmst / 12.0 *
M_PI;
1028 const qreal skyRadius = 0.6 * sqrt( ( qreal )viewport->
width() * viewport->
width() + viewport->
height() * viewport->
height() );
1034 if ( !m_starsLoaded ) {
1036 m_starsLoaded =
true;
1039 if ( !m_constellationsLoaded ) {
1040 loadConstellations();
1041 m_constellationsLoaded =
true;
1044 if ( !m_dsosLoaded ) {
1046 m_dsosLoaded =
true;
1049 const qreal earthRadius = viewport->
radius();
1052 QPen polesPen( m_celestialPoleBrush, 2, Qt::SolidLine );
1053 QPen constellationPenSolid( m_constellationBrush, 1, Qt::SolidLine );
1054 QPen constellationPenDash( m_constellationBrush, 1, Qt::DashLine );
1055 QPen constellationLabelPen( m_constellationLabelBrush, 1, Qt::SolidLine );
1056 QPen eclipticPen( m_eclipticBrush, 1, Qt::DotLine );
1057 QPen equatorPen( m_celestialEquatorBrush, 1, Qt::DotLine );
1058 QPen dsoLabelPen (m_dsoLabelBrush, 1, Qt::SolidLine);
1065 if ( m_renderCelestialPole ) {
1067 polesPen.setWidth( 2 );
1068 painter->setPen( polesPen );
1074 if ( qpos1.
v[
Q_Z] < 0 ) {
1075 const int x1 = ( int )( viewport->
width() / 2 + skyRadius * qpos1.
v[
Q_X] );
1076 const int y1 = ( int )( viewport->
height() / 2 - skyRadius * qpos1.
v[
Q_Y] );
1077 painter->drawLine( x1, y1, x1+10, y1 );
1078 painter->drawLine( x1+5, y1-5, x1+5, y1+5 );
1079 painter->
drawText( x1+8, y1+12,
"NP" );
1085 if ( qpos2.
v[
Q_Z] < 0 ) {
1086 const int x1 = ( int )( viewport->
width() / 2 + skyRadius * qpos2.
v[
Q_X] );
1087 const int y1 = ( int )( viewport->
height() / 2 - skyRadius * qpos2.
v[
Q_Y] );
1088 painter->drawLine( x1, y1, x1+10, y1 );
1089 painter->drawLine( x1+5, y1-5, x1+5, y1+5 );
1090 painter->
drawText( x1+8, y1+12,
"SP" );
1094 if( m_renderEcliptic ) {
1096 matrix eclipticAxisMatrix;
1097 (eclipticAxis * skyAxis).inverse().toMatrix( eclipticAxisMatrix );
1099 painter->setPen(eclipticPen);
1103 for (
int i = 0; i <= 36; ++i) {
1108 int x = ( int )( viewport->
width() / 2 + skyRadius * qpos.
v[
Q_X] );
1109 int y = ( int )( viewport->
height() / 2 - skyRadius * qpos.
v[
Q_Y] );
1111 if ( qpos.
v[
Q_Z] < 0 && previousX >= 0 ) painter->drawLine(previousX, previousY, x, y);
1118 if( m_renderCelestialEquator ) {
1119 painter->setPen(equatorPen);
1123 for (
int i = 0; i <= 36; ++i) {
1128 int x = ( int )( viewport->
width() / 2 + skyRadius * qpos.
v[
Q_X] );
1129 int y = ( int )( viewport->
height() / 2 - skyRadius * qpos.
v[
Q_Y] );
1131 if ( qpos.
v[
Q_Z] < 0 && previousX > 0 ) painter->drawLine(previousX, previousY, x, y);
1138 if ( m_renderDsos ) {
1139 painter->setPen(dsoLabelPen);
1141 for (
int d = 0; d < m_dsos.size(); ++d ) {
1142 Quaternion qpos = m_dsos.at( d ).quaternion();
1145 if ( qpos.
v[
Q_Z] > 0 ) {
1149 qreal earthCenteredX = qpos.
v[
Q_X] * skyRadius;
1150 qreal earthCenteredY = qpos.
v[
Q_Y] * skyRadius;
1153 if ( qpos.
v[
Q_Z] < 0
1154 && ( ( earthCenteredX * earthCenteredX
1155 + earthCenteredY * earthCenteredY )
1156 < earthRadius * earthRadius ) ) {
1161 const int x = ( int )( viewport->
width() / 2 + skyRadius * qpos.
v[
Q_X] );
1162 const int y = ( int )( viewport->
height() / 2 - skyRadius * qpos.
v[
Q_Y] );
1165 if ( x < 0 || x >= viewport->
width() ||
1166 y < 0 || y >= viewport->
height() ) {
1174 painter->
drawImage( QRectF( x-size/2, y-size/2, size, size ),m_dsoImage );
1175 if (m_renderDsoLabels) {
1176 painter->
drawText( x+8, y+12, m_dsos.at( d ).id() );
1181 if ( m_renderConstellationLines || m_renderConstellationLabels )
1184 for (
int c = 0; c < m_constellations.size(); ++c ) {
1188 painter->setPen( constellationPenSolid );
1190 for (
int s = 0; s < ( m_constellations.at( c ).size() - 1 ); ++s ) {
1191 int starId1 = m_constellations.at( c ).at( s );
1192 int starId2 = m_constellations.at( c ).at( s + 1 );
1194 if ( starId1 == -1 || starId2 == -1 ) {
1197 }
else if ( starId1 == -2 || starId2 == -2 ) {
1198 painter->setPen( constellationPenDash );
1199 }
else if ( starId1 == -3 || starId2 == -3 ) {
1200 painter->setPen( constellationPenSolid );
1203 int idx1 = m_idHash.value( starId1,-1 );
1204 int idx2 = m_idHash.value( starId2,-1 );
1208 mDebug() <<
"unknown star, "
1209 << starId1 <<
", in constellation "
1210 << m_constellations.at( c ).name();
1215 mDebug() <<
"unknown star, "
1216 << starId1 <<
", in constellation "
1217 << m_constellations.at( c ).name();
1221 Quaternion q1 = m_stars.at( idx1 ).quaternion();
1223 Quaternion q2 = m_stars.at( idx2 ).quaternion();
1228 if ( q1.
v[
Q_Z] > 0 || q2.
v[
Q_Z] > 0 ) {
1234 int x1 = ( int )( viewport->
width() / 2 + skyRadius * q1.
v[
Q_X] );
1235 int y1 = ( int )( viewport->
height() / 2 - skyRadius * q1.
v[
Q_Y] );
1236 int x2 = ( int )( viewport->
width() / 2 + skyRadius * q2.
v[
Q_X] );
1237 int y2 = ( int )( viewport->
height() / 2 - skyRadius * q2.
v[
Q_Y] );
1240 xMean = xMean + x1 + x2;
1241 yMean = yMean + y1 + y2;
1242 endptCount = endptCount + 2;
1244 if ( m_renderConstellationLines ) {
1245 painter->drawLine( x1, y1, x2, y2 );
1251 if ( endptCount > 0 ) {
1252 xMean = xMean / endptCount;
1253 yMean = yMean / endptCount;
1256 if ( endptCount < 1 || xMean < 0 || xMean >= viewport->
width()
1257 || yMean < 0 || yMean >= viewport->
height() )
1260 painter->setPen( constellationLabelPen );
1261 if ( m_renderConstellationLabels ) {
1262 painter->
drawText( xMean, yMean, m_constellations.at( c ).name() );
1270 for (
int s = 0; s < m_stars.size(); ++s ) {
1271 Quaternion qpos = m_stars.at(s).quaternion();
1275 if ( qpos.
v[
Q_Z] > 0 ) {
1279 qreal earthCenteredX = qpos.
v[
Q_X] * skyRadius;
1280 qreal earthCenteredY = qpos.
v[
Q_Y] * skyRadius;
1283 if ( qpos.
v[
Q_Z] < 0
1284 && ( ( earthCenteredX * earthCenteredX
1285 + earthCenteredY * earthCenteredY )
1286 < earthRadius * earthRadius ) ) {
1291 const int x = ( int )( viewport->
width() / 2 + skyRadius * qpos.
v[
Q_X] );
1292 const int y = ( int )( viewport->
height() / 2 - skyRadius * qpos.
v[
Q_Y] );
1295 if ( x < 0 || x >= viewport->
width()
1296 || y < 0 || y >= viewport->
height() )
1300 if ( m_stars.at(s).magnitude() < m_magnitudeLimit ) {
1303 int colorId = m_stars.at(s).colorId();
1307 if ( m_stars.at(s).magnitude() < -1 ) {
1308 s_pixmap = m_pixN1Stars.at(colorId);
1310 else if ( m_stars.at(s).magnitude() < 0 ) {
1311 s_pixmap = m_pixP0Stars.at(colorId);
1313 else if ( m_stars.at(s).magnitude() < 1 ) {
1314 s_pixmap = m_pixP1Stars.at(colorId);
1316 else if ( m_stars.at(s).magnitude() < 2 ) {
1317 s_pixmap = m_pixP2Stars.at(colorId);
1319 else if ( m_stars.at(s).magnitude() < 3 ) {
1320 s_pixmap = m_pixP3Stars.at(colorId);
1322 else if ( m_stars.at(s).magnitude() < 4 ) {
1323 s_pixmap = m_pixP4Stars.at(colorId);
1325 else if ( m_stars.at(s).magnitude() < 5 ) {
1326 s_pixmap = m_pixP5Stars.at(colorId);
1328 else if ( m_stars.at(s).magnitude() < 6 ) {
1329 s_pixmap = m_pixP6Stars.at(colorId);
1332 s_pixmap = m_pixP7Stars.at(colorId);
1335 int sizeX = s_pixmap.width();
1336 int sizeY = s_pixmap.height();
1337 painter->
drawPixmap( x-sizeX/2, y-sizeY/2 ,s_pixmap );
1342 if ( m_renderSun ) {
1350 if ( qpos.
v[
Q_Z] <= 0 ) {
1351 qreal deltaX = m_pixmapSun.width() / 2.;
1352 qreal deltaY = m_pixmapSun.height() / 2.;
1353 const int x = (int)(viewport->
width() / 2 + skyRadius * qpos.
v[
Q_X]);
1354 const int y = (int)(viewport->
height() / 2 - skyRadius * qpos.
v[
Q_Y]);
1355 painter->
drawPixmap( x - deltaX, y - deltaY, m_pixmapSun );
1365 qreal StarsPlugin::siderealTime(
const QDateTime& localDateTime )
1367 QDateTime utcDateTime = localDateTime.toTimeSpec( Qt::UTC );
1368 qreal mjdUtc = ( qreal )( utcDateTime.date().toJulianDay() );
1370 qreal offsetUtcSecs = -utcDateTime.time().secsTo( QTime( 00, 00 ) );
1371 qreal d_days = mjdUtc - 2451545.5;
1372 qreal d = d_days + ( offsetUtcSecs / ( 24.0 * 3600 ) );
1377 qreal gmst = 18.697374558 + 24.06570982441908 * d;
1380 return gmst - ( int )( gmst / 24.0 ) * 24.0;
1383 void StarsPlugin::requestRepaint()
1388 void StarsPlugin::toggleSun()
1390 m_renderSun = !m_renderSun;
1391 if ( m_configDialog ) {
1392 ui_configWidget->m_viewSunCheckbox->setChecked( m_renderSun );
1398 void StarsPlugin::toggleDsos()
1400 m_renderDsos = !m_renderDsos;
1401 if ( m_configDialog ) {
1402 ui_configWidget->m_viewDsosCheckbox->setChecked( m_renderDsos );
1408 void StarsPlugin::toggleDsoLabels()
1410 m_renderDsoLabels = !m_renderDsoLabels;
1411 if ( m_configDialog ) {
1412 ui_configWidget->m_viewDsoLabelCheckbox->setChecked( m_renderDsoLabels );
1419 void StarsPlugin::toggleConstellationLines()
1421 m_renderConstellationLines = !m_renderConstellationLines;
1422 if ( m_configDialog ) {
1423 ui_configWidget->m_viewConstellationLinesCheckbox->setChecked( m_renderConstellationLines );
1429 void StarsPlugin::toggleConstellationLabels()
1431 m_renderConstellationLabels = !m_renderConstellationLabels;
1432 if ( m_configDialog ) {
1433 ui_configWidget->m_viewConstellationLabelsCheckbox->setChecked( m_renderConstellationLabels );
1445 if( e->type() == QEvent::ContextMenu )
1448 QContextMenuEvent *menuEvent =
dynamic_cast<QContextMenuEvent *
> ( e );
1449 if( widget && menuEvent )
1451 qreal mouseLon, mouseLat;
1452 const bool aboveMap = widget->
geoCoordinates( menuEvent->x(), menuEvent->y(),
1460 && floatItem->
contains( menuEvent->pos() ) )
1467 QAction *constellationLinesAction = menu.addAction( tr(
"Show &Constellation Lines"),
this, SLOT(toggleConstellationLines()) );
1468 constellationLinesAction->setCheckable(
true );
1469 constellationLinesAction->setChecked( m_renderConstellationLines );
1471 QAction *constellationLabelsAction = menu.addAction( tr(
"Show Constellation &Labels"),
this, SLOT(toggleConstellationLabels()) );
1472 constellationLabelsAction->setCheckable(
true );
1473 constellationLabelsAction->setChecked( m_renderConstellationLabels );
1475 QAction *dsoAction = menu.addAction( tr(
"Show &Deep Sky Objects"),
this, SLOT(toggleDsos()) );
1476 dsoAction->setCheckable(
true );
1477 dsoAction->setChecked( m_renderDsos );
1479 QAction *dsoLabelAction = menu.addAction( tr(
"Show Deep Sky Object Labels"),
this, SLOT(toggleDsoLabels()) );
1480 dsoLabelAction->setCheckable(
true );
1481 dsoLabelAction->setChecked( m_renderDsoLabels );
1484 QAction *sunAction = menu.addAction( tr(
"Show &Sun"),
this, SLOT(toggleSun()) );
1485 sunAction->setCheckable(
true );
1486 sunAction->setChecked( m_renderSun );
1490 menu.addSeparator();
1491 QAction *configAction = menu.addAction( tr(
"&Configure..." ) );
1492 connect( configAction, SIGNAL(triggered()), dialog, SLOT(exec()) );
1494 menu.exec(widget->mapToGlobal(menuEvent->pos()));
1507 #include "StarsPlugin.moc"
void toMatrix(matrix &m) const
bool isInitialized() const
bool visible() const
is visible
bool visible() const
Check visibility of the float item.
QString description() const
Returns a user description of the plugin.
static QString path(const QString &relativePath)
bool eventFilter(QObject *object, QEvent *e)
bool render(GeoPainter *painter, ViewportParams *viewport, const QString &renderPos, GeoSceneLayer *layer=0)
Renders the content provided by the layer on the viewport.
void repaintNeeded(QRegion dirtyRegion=QRegion())
This signal is emitted if an update of the view is needed.
A painter that allows to draw geometric primitives on the map.
QStringList renderPosition() const
Preferred level in the layer stack for the rendering.
bool eventFilter(QObject *, QEvent *)
This file contains the headers for MarbleModel.
QDialog * configDialog()
Returns a pointer to the configuration dialog of the plugin.
SunLocator * sunLocator()
void celestialPoleGetColor()
QStringList backendTypes() const
Returns the name(s) of the backend that the plugin can render This method should return the name of t...
QString renderPolicy() const
Return how the plugin settings should be used.
Projection projection() const
void rotateAroundAxis(const Quaternion &q)
bool contains(const QPointF &point) const
Returns true if the Item contains point in parent coordinates.
Layer of a GeoScene document.
void settingsChanged(QString nameId)
This signal is emitted if the settings of the RenderPlugin changed.
The abstract class for float item plugins.
bool mapCoversViewport() const
QIcon icon() const
Returns an icon for the plugin.
virtual RenderType renderType() const
Render type of the plugin.
QHash< QString, QVariant > settings() const
Settings of the plugin.
A public class that controls what is visible in the viewport of a Marble map.
#define Q_EXPORT_PLUGIN2(a, b)
void drawImage(const GeoDataCoordinates ¢erPosition, const QImage &image)
Draws an image at the given position. The image is placed with its center located at the given center...
void constellationLabelGetColor()
QDateTime clockDateTime() const
This file contains the headers for ViewportParams.
QString guiString() const
String that should be displayed in GUI.
void constellationGetColor()
qreal centerLatitude() const
void celestialEquatorGetColor()
void drawText(const GeoDataCoordinates &position, const QString &text)
Draws the given text at a given geographic position. The text is drawn starting at the given position...
The data model (not based on QAbstractModel) for a MarbleWidget.
QString nameId() const
Returns the unique name of the plugin.
QString copyrightYears() const
Quaternion inverse() const
QColor const aluminumGray5
qreal centerLongitude() const
void setSettings(const QHash< QString, QVariant > &settings)
Set the settings of the plugin.
QString assembledConstellation(const QString &name)
QString name() const
Returns the user-visible name of the plugin.
bool enabled() const
is enabled
StarsPlugin(const MarbleModel *marbleModel=0)
const MarbleModel * marbleModel() const
Access to the MarbleModel.
virtual QHash< QString, QVariant > settings() const
Settings of the plugin.
RenderType
A Type of plugin.
QDebug mDebug()
a function to replace qDebug() in Marble library code
void drawPixmap(const GeoDataCoordinates ¢erPosition, const QPixmap &pixmap)
Draws a pixmap at the given position. The pixmap is placed with its center located at the given cente...
The abstract class that creates a renderable item.
virtual void setSettings(const QHash< QString, QVariant > &settings)
Set the settings of the plugin.
static Quaternion fromEuler(qreal pitch, qreal yaw, qreal roll)
QList< PluginAuthor > pluginAuthors() const
static Quaternion fromSpherical(qreal lon, qreal lat)
used to generate Quaternion from longitude and latitude