• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
skymap.cpp
Go to the documentation of this file.
1 /**************************************************************************
2  skymap.cpp - K Desktop Planetarium
3  -------------------
4  begin : Sat Feb 10 2001
5  copyright : (C) 2001 by Jason Harris
6  email : jharris@30doradus.org
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifdef _WIN32
19 #include <windows.h>
20 #endif
21 #include "skymap.h"
22 
23 #include <cmath>
24 
25 #include <QCursor>
26 #include <QBitmap>
27 #include <QPainter>
28 #include <QPixmap>
29 #include <QToolTip>
30 #include <QTextStream>
31 #include <QFile>
32 #include <QPointF>
33 #include <QApplication>
34 #include <QGraphicsScene>
35 #include <QInputDialog>
36 
37 #include <kactioncollection.h>
38 #include <kconfig.h>
39 #include <kiconloader.h>
40 #include <kstatusbar.h>
41 #include <kmessagebox.h>
42 #include <kaction.h>
43 #include <kstandarddirs.h>
44 #include <ktoolbar.h>
45 #include <ktoolinvocation.h>
46 #include <kicon.h>
47 
48 #include "Options.h"
49 #include "kstars.h"
50 #include "kstarsdata.h"
51 #include "ksutils.h"
52 #include "imageviewer.h"
53 #include "dialogs/detaildialog.h"
54 #include "dialogs/addlinkdialog.h"
55 #include "kspopupmenu.h"
56 #include "printing/printingwizard.h"
57 #include "simclock.h"
58 #include "skyobjects/skyobject.h"
59 #include "skyobjects/deepskyobject.h"
60 #include "skyobjects/ksplanetbase.h"
61 #include "skycomponents/skymapcomposite.h"
62 #include "skycomponents/flagcomponent.h"
63 #include "widgets/infoboxwidget.h"
64 #include "projections/projector.h"
65 #include "projections/lambertprojector.h"
66 #include "projections/gnomonicprojector.h"
67 #include "projections/stereographicprojector.h"
68 #include "projections/orthographicprojector.h"
69 #include "projections/azimuthalequidistantprojector.h"
70 #include "projections/equirectangularprojector.h"
71 #include "fov.h"
72 
73 #include "tools/flagmanager.h"
74 
75 #include "texturemanager.h"
76 
77 #include "skymapqdraw.h"
78 
79 #ifdef HAVE_OPENGL
80 #include "skymapgldraw.h"
81 #endif
82 
83 // DEBUG TODO: Remove later -- required to display starhop results for debug.
84 #include "skycomponents/targetlistcomponent.h"
85 
86 #include "starhopper.h"
87 
88 #ifdef HAVE_XPLANET
89 #include <KProcess>
90 #include <kfiledialog.h>
91 #endif
92 
93 namespace {
94 
95  // Draw bitmap for zoom cursor. Width is size of pen to draw with.
96  QBitmap zoomCursorBitmap(int width) {
97  QBitmap b(32, 32);
98  b.fill(Qt::color0);
99  int mx = 16, my = 16;
100  // Begin drawing
101  QPainter p;
102  p.begin( &b );
103  p.setPen( QPen( Qt::color1, width ) );
104  p.drawEllipse( mx - 7, my - 7, 14, 14 );
105  p.drawLine( mx + 5, my + 5, mx + 11, my + 11 );
106  p.end();
107  return b;
108  }
109 
110  // Draw bitmap for default cursor. Width is size of pen to draw with.
111  QBitmap defaultCursorBitmap(int width) {
112  QBitmap b(32, 32);
113  b.fill(Qt::color0);
114  int mx = 16, my = 16;
115  // Begin drawing
116  QPainter p;
117  p.begin( &b );
118  p.setPen( QPen( Qt::color1, width ) );
119  // 1. diagonal
120  p.drawLine (mx - 2, my - 2, mx - 8, mx - 8);
121  p.drawLine (mx + 2, my + 2, mx + 8, mx + 8);
122  // 2. diagonal
123  p.drawLine (mx - 2, my + 2, mx - 8, mx + 8);
124  p.drawLine (mx + 2, my - 2, mx + 8, mx - 8);
125  p.end();
126  return b;
127  }
128 }
129 
130 
131 SkyMap* SkyMap::pinstance = 0;
132 
133 
134 SkyMap* SkyMap::Create()
135 {
136  delete pinstance;
137  pinstance = new SkyMap();
138  return pinstance;
139 }
140 
141 SkyMap* SkyMap::Instance( )
142 {
143  return pinstance;
144 }
145 
146 SkyMap::SkyMap() :
147  QGraphicsView( KStars::Instance() ),
148  computeSkymap(true), rulerMode(false),
149  data( KStarsData::Instance() ), pmenu(0),
150  ClickedObject(0), FocusObject(0), m_proj(0),
151  m_previewLegend(false), m_objPointingMode(false)
152 {
153  m_Scale = 1.0;
154 
155  ZoomRect = QRect();
156 
157  setDefaultMouseCursor(); // set the cross cursor
158 
159  QPalette p = palette();
160  p.setColor( QPalette::Window, QColor( data->colorScheme()->colorNamed( "SkyColor" ) ) );
161  setPalette( p );
162 
163  setFocusPolicy( Qt::StrongFocus );
164  setMinimumSize( 380, 250 );
165  setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
166  setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
167  setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
168  setStyleSheet( "QGraphicsView { border-style: none; }" );
169 
170  setMouseTracking (true); //Generate MouseMove events!
171  midMouseButtonDown = false;
172  mouseButtonDown = false;
173  slewing = false;
174  clockSlewing = false;
175 
176  ClickedObject = NULL;
177  FocusObject = NULL;
178 
179  m_SkyMapDraw = 0;
180 
181  pmenu = new KSPopupMenu();
182 
183  setupProjector();
184 
185  //Initialize Transient label stuff
186  m_HoverTimer.setSingleShot( true ); // using this timer as a single shot timer
187 
188  connect( &m_HoverTimer, SIGNAL( timeout() ), this, SLOT( slotTransientLabel() ) );
189  connect( this, SIGNAL( destinationChanged() ), this, SLOT( slewFocus() ) );
190 
191  // Time infobox
192  m_timeBox = new InfoBoxWidget( Options::shadeTimeBox(),
193  Options::positionTimeBox(),
194  Options::stickyTimeBox(),
195  QStringList(), this);
196  m_timeBox->setVisible( Options::showTimeBox() );
197  connect(data->clock(), SIGNAL( timeChanged() ),
198  m_timeBox, SLOT( slotTimeChanged() ) );
199  connect(data->clock(), SIGNAL( timeAdvanced() ),
200  m_timeBox, SLOT( slotTimeChanged() ) );
201 
202  // Geo infobox
203  m_geoBox = new InfoBoxWidget( Options::shadeGeoBox(),
204  Options::positionGeoBox(),
205  Options::stickyGeoBox(),
206  QStringList(), this);
207  m_geoBox->setVisible( Options::showGeoBox() );
208  connect(data, SIGNAL( geoChanged() ),
209  m_geoBox, SLOT( slotGeoChanged() ) );
210 
211  // Object infobox
212  m_objBox = new InfoBoxWidget( Options::shadeFocusBox(),
213  Options::positionFocusBox(),
214  Options::stickyFocusBox(),
215  QStringList(), this);
216  m_objBox->setVisible( Options::showFocusBox() );
217  connect(this, SIGNAL( objectChanged( SkyObject*) ),
218  m_objBox, SLOT( slotObjectChanged( SkyObject*) ) );
219  connect(this, SIGNAL( positionChanged( SkyPoint*) ),
220  m_objBox, SLOT( slotPointChanged(SkyPoint*) ) );
221 
222 #ifdef HAVE_OPENGL
223  m_SkyMapQDraw = new SkyMapQDraw( this );
224  m_SkyMapQDraw->setMouseTracking( true );
225  m_SkyMapGLDraw = new SkyMapGLDraw( this );
226  m_SkyMapGLDraw->setMouseTracking( true );
227  m_SkyMapGLDraw->hide();
228  m_SkyMapQDraw->hide();
229 
230  if( Options::useGL() )
231  m_SkyMapDraw = m_SkyMapGLDraw;
232  else
233  m_SkyMapDraw = m_SkyMapQDraw;
234 #else
235  m_SkyMapDraw = new SkyMapQDraw( this );
236  m_SkyMapDraw->setMouseTracking( true );
237 #endif
238 
239  m_SkyMapDraw->setParent( this->viewport() );
240  m_SkyMapDraw->show();
241 
242  /*
243  m_Scene = new QGraphicsScene( rect() );
244  setScene( m_Scene );
245  */
246 
247 #ifdef HAVE_OPENGL
248  // If GL is enabled, the InfoBoxes work only with native painting.
249  m_iboxes = new InfoBoxes( m_SkyMapQDraw );
250 #else
251  m_iboxes = new InfoBoxes( m_SkyMapDraw );
252 #endif
253 
254  m_iboxes->setVisible( Options::showInfoBoxes() );
255  m_iboxes->addInfoBox(m_timeBox);
256  m_iboxes->addInfoBox(m_geoBox);
257  m_iboxes->addInfoBox(m_objBox);
258  /*
259  ( m_Scene->addWidget( m_iboxes ) )->setAcceptedMouseButtons( Qt::NoButton );
260  */
261 
262 
263  //The update timer will be destructed when SkyMap is..
264  QTimer *update = new QTimer(this);
265  update->setInterval(30);
266  connect(update, SIGNAL(timeout()), this, SLOT(update()) );
267  update->start();
268 
269 }
270 
271 void SkyMap::slotToggleGeoBox(bool flag) {
272  m_geoBox->setVisible(flag);
273 }
274 
275 void SkyMap::slotToggleFocusBox(bool flag) {
276  m_objBox->setVisible(flag);
277 }
278 
279 void SkyMap::slotToggleTimeBox(bool flag) {
280  m_timeBox->setVisible(flag);
281 }
282 
283 void SkyMap::slotToggleInfoboxes(bool flag) {
284  m_iboxes->setVisible(flag);
285 }
286 
287 SkyMap::~SkyMap() {
288  /* == Save infoxes status into Options == */
289  Options::setShowInfoBoxes( m_iboxes->isVisibleTo( parentWidget() ) );
290  // Time box
291  Options::setPositionTimeBox( m_timeBox->pos() );
292  Options::setShadeTimeBox( m_timeBox->shaded() );
293  Options::setStickyTimeBox( m_timeBox->sticky() );
294  Options::setShowTimeBox( m_timeBox->isVisibleTo(m_iboxes) );
295  // Geo box
296  Options::setPositionGeoBox( m_geoBox->pos() );
297  Options::setShadeGeoBox( m_geoBox->shaded() );
298  Options::setStickyGeoBox( m_geoBox->sticky() );
299  Options::setShowGeoBox( m_geoBox->isVisibleTo(m_iboxes) );
300  // Obj box
301  Options::setPositionFocusBox( m_objBox->pos() );
302  Options::setShadeFocusBox( m_objBox->shaded() );
303  Options::setStickyFocusBox( m_objBox->sticky() );
304  Options::setShowFocusBox( m_objBox->isVisibleTo(m_iboxes) );
305 
306  //store focus values in Options
307  //If not tracking and using Alt/Az coords, stor the Alt/Az coordinates
308  if ( Options::useAltAz() && ! Options::isTracking() ) {
309  Options::setFocusRA( focus()->az().Degrees() );
310  Options::setFocusDec( focus()->alt().Degrees() );
311  } else {
312  Options::setFocusRA( focus()->ra().Hours() );
313  Options::setFocusDec( focus()->dec().Degrees() );
314  }
315 
316 #ifdef HAVE_OPENGL
317  delete m_SkyMapGLDraw;
318  delete m_SkyMapQDraw;
319  m_SkyMapDraw = 0; // Just a formality
320 #else
321  delete m_SkyMapDraw;
322 #endif
323 
324  delete pmenu;
325 
326  delete m_proj;
327 
328  pinstance = 0;
329 }
330 
331 void SkyMap::showFocusCoords() {
332  if( focusObject() && Options::isTracking() )
333  emit objectChanged( focusObject() );
334  else
335  emit positionChanged( focus() );
336 }
337 
338 void SkyMap::slotTransientLabel() {
339  //This function is only called if the HoverTimer manages to timeout.
340  //(HoverTimer is restarted with every mouseMoveEvent; so if it times
341  //out, that means there was no mouse movement for HOVER_INTERVAL msec.)
342  if ( ! slewing && ! ( Options::useAltAz() && Options::showGround() &&
343  SkyPoint::refract(m_MousePoint.alt()).Degrees() < 0.0 ) ) {
344  double maxrad = 1000.0/Options::zoomFactor();
345  SkyObject *so = data->skyComposite()->objectNearest( &m_MousePoint, maxrad );
346 
347  if ( so && ! isObjectLabeled( so ) ) {
348  QToolTip::showText(
349  QCursor::pos(),
350  i18n("%1: %2<sup>m</sup>",
351  so->translatedLongName(),
352  QString::number(so->mag(), 'f', 1)),
353  this);
354  }
355  }
356 }
357 
358 
359 //Slots
360 
361 void SkyMap::setClickedObject( SkyObject *o ) {
362  ClickedObject = o;
363 }
364 
365 void SkyMap::setFocusObject( SkyObject *o ) {
366  FocusObject = o;
367  if ( FocusObject )
368  Options::setFocusObject( FocusObject->name() );
369  else
370  Options::setFocusObject( i18n( "nothing" ) );
371 }
372 
373 void SkyMap::slotCenter() {
374  KStars* kstars = KStars::Instance();
375  TrailObject* trailObj = dynamic_cast<TrailObject*>( focusObject() );
376 
377  setFocusPoint( clickedPoint() );
378  if ( Options::useAltAz() )
379  focusPoint()->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
380 
381  //clear the planet trail of old focusObject, if it was temporary
382  if( trailObj && data->temporaryTrail ) {
383  trailObj->clearTrail();
384  data->temporaryTrail = false;
385  }
386 
387  //If the requested object is below the opaque horizon, issue a warning message
388  //(unless user is already pointed below the horizon)
389  if ( Options::useAltAz() && Options::showGround() &&
390  focus()->alt().Degrees() > -1.0 && focusPoint()->alt().Degrees() < -1.0 ) {
391 
392  QString caption = i18n( "Requested Position Below Horizon" );
393  QString message = i18n( "The requested position is below the horizon.\nWould you like to go there anyway?" );
394  if ( KMessageBox::warningYesNo( this, message, caption,
395  KGuiItem(i18n("Go Anyway")), KGuiItem(i18n("Keep Position")), "dag_focus_below_horiz" )==KMessageBox::No ) {
396  setClickedObject( NULL );
397  setFocusObject( NULL );
398  Options::setIsTracking( false );
399 
400  return;
401  }
402  }
403 
404  //set FocusObject before slewing. Otherwise, KStarsData::updateTime() can reset
405  //destination to previous object...
406  setFocusObject( ClickedObject );
407  Options::setIsTracking( true );
408  if ( kstars ) {
409  kstars->actionCollection()->action("track_object")->setIcon( KIcon("document-encrypt") );
410  kstars->actionCollection()->action("track_object")->setText( i18n( "Stop &Tracking" ) );
411  }
412 
413  //If focusObject is a SS body and doesn't already have a trail, set the temporaryTrail
414 
415  if( Options::useAutoTrail() && trailObj && trailObj->hasTrail() ) {
416  trailObj->addToTrail();
417  data->temporaryTrail = true;
418  }
419 
420  //update the destination to the selected coordinates
421  if ( Options::useAltAz() ) {
422  setDestinationAltAz( focusPoint()->altRefracted(), focusPoint()->az() );
423  } else {
424  setDestination( *focusPoint() );
425  }
426 
427  focusPoint()->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
428 
429  //display coordinates in statusBar
430  emit mousePointChanged( focusPoint() );
431  showFocusCoords(); //update FocusBox
432 }
433 
434 void SkyMap::slotDSS() {
435  dms ra(0.0), dec(0.0);
436  QString urlstring;
437 
438  //ra and dec must be the coordinates at J2000. If we clicked on an object, just use the object's ra0, dec0 coords
439  //if we clicked on empty sky, we need to precess to J2000.
440  if ( clickedObject() ) {
441  urlstring = KSUtils::getDSSURL( clickedObject() );
442  } else {
443  SkyPoint deprecessedPoint = clickedPoint()->deprecess( data->updateNum() );
444  ra = deprecessedPoint.ra();
445  dec = deprecessedPoint.dec();
446  urlstring = KSUtils::getDSSURL( ra, dec ); // Use default size for non-objects
447  }
448 
449  KUrl url ( urlstring );
450 
451  KStars* kstars = KStars::Instance();
452  if( kstars ) {
453  ImageViewer *iv = new ImageViewer( url,
454  i18n( "Digitized Sky Survey image provided by the Space Telescope Science Institute [public domain]." ),
455  this );
456  iv->show();
457  }
458 }
459 
460 void SkyMap::slotSDSS() {
461  // TODO: Remove code duplication -- we have the same stuff
462  // implemented in ObservingList::setCurrentImage() etc. in
463  // tools/observinglist.cpp; must try to de-duplicate as much as
464  // possible.
465  QString URLprefix( "http://casjobs.sdss.org/ImgCutoutDR6/getjpeg.aspx?" );
466  QString URLsuffix( "&scale=1.0&width=600&height=600&opt=GST&query=SR(10,20)" );
467  dms ra(0.0), dec(0.0);
468  QString RAString, DecString;
469 
470  //ra and dec must be the coordinates at J2000. If we clicked on an object, just use the object's ra0, dec0 coords
471  //if we clicked on empty sky, we need to precess to J2000.
472  if ( clickedObject() ) {
473  ra = clickedObject()->ra0();
474  dec = clickedObject()->dec0();
475  } else {
476  SkyPoint deprecessedPoint = clickedPoint()->deprecess( data->updateNum() );
477  ra = deprecessedPoint.ra();
478  dec = deprecessedPoint.dec();
479  }
480 
481  RAString = RAString.sprintf( "ra=%f", ra.Degrees() );
482  DecString = DecString.sprintf( "&dec=%f", dec.Degrees() );
483 
484  //concat all the segments into the kview command line:
485  KUrl url (URLprefix + RAString + DecString + URLsuffix);
486 
487  KStars* kstars = KStars::Instance();
488  if( kstars ) {
489  ImageViewer *iv = new ImageViewer( url,
490  i18n( "Sloan Digital Sky Survey image provided by the Astrophysical Research Consortium [free for non-commercial use]." ),
491  this );
492  iv->show();
493  }
494 }
495 
496 void SkyMap::slotBeginAngularDistance() {
497  beginRulerMode( false );
498 }
499 
500 void SkyMap::slotBeginStarHop() {
501  beginRulerMode( true );
502 }
503 
504 void SkyMap::beginRulerMode( bool starHopRuler ) {
505  rulerMode = true;
506  starHopDefineMode = starHopRuler;
507  AngularRuler.clear();
508 
509  //If the cursor is near a SkyObject, reset the AngularRuler's
510  //start point to the position of the SkyObject
511  double maxrad = 1000.0/Options::zoomFactor();
512  SkyObject *so = data->skyComposite()->objectNearest( clickedPoint(), maxrad );
513  if ( so ) {
514  AngularRuler.append( so );
515  AngularRuler.append( so );
516  } else {
517  AngularRuler.append( clickedPoint() );
518  AngularRuler.append( clickedPoint() );
519  }
520 
521  AngularRuler.update( data );
522 }
523 
524 void SkyMap::slotEndRulerMode() {
525  if( !rulerMode )
526  return;
527  if( !starHopDefineMode ) { // Angular Ruler
528  QString sbMessage;
529 
530  //If the cursor is near a SkyObject, reset the AngularRuler's
531  //end point to the position of the SkyObject
532  double maxrad = 1000.0/Options::zoomFactor();
533  SkyObject *so = data->skyComposite()->objectNearest( clickedPoint(), maxrad );
534  if ( so ) {
535  AngularRuler.setPoint( 1, so );
536  sbMessage = so->translatedLongName() + " ";
537  } else {
538  AngularRuler.setPoint( 1, clickedPoint() );
539  }
540 
541  rulerMode=false;
542  AngularRuler.update( data );
543  dms angularDistance = AngularRuler.angularSize();
544  AngularRuler.clear();
545 
546  sbMessage += i18n( "Angular distance: %1", angularDistance.toDMSString() );
547 
548  // Create unobsructive message box with suicidal tendencies
549  // to display result.
550  InfoBoxWidget* box = new InfoBoxWidget(
551  true, mapFromGlobal( QCursor::pos() ), 0, QStringList(sbMessage), this);
552  connect(box, SIGNAL( clicked() ), box, SLOT( deleteLater() ));
553  QTimer::singleShot(5000, box, SLOT( deleteLater() ));
554  box->adjust();
555  box->show();
556  }
557  else { // Star Hop
558  StarHopper hopper;
559  const SkyPoint &startHop = *AngularRuler.point( 0 );
560  const SkyPoint &stopHop = *clickedPoint();
561  double fov; // Field of view in arcminutes
562  bool ok; // true if user did not cancel the operation
563  if( data->getVisibleFOVs().size() == 1 ) {
564  // Exactly 1 FOV symbol visible, so use that. Also assume a circular FOV of size min{sizeX, sizeY}
565  FOV *f = data->getVisibleFOVs().first();
566  fov = ( ( f->sizeX() >= f->sizeY() && f->sizeY() != 0 ) ? f->sizeY() : f->sizeX() );
567  ok = true;
568  }
569  else if( !data->getVisibleFOVs().isEmpty() ) {
570  // Ask the user to choose from a list of available FOVs.
571  FOV const *f;
572  QMap< QString, double > nameToFovMap;
573  foreach( f, data->getVisibleFOVs() ) {
574  nameToFovMap.insert( f->name(), ( ( f->sizeX() >= f->sizeY() && f->sizeY() != 0) ? f->sizeY() : f->sizeX() ) );
575  }
576  fov = nameToFovMap[ QInputDialog::getItem( this, i18n("Star Hopper: Choose a field-of-view"), i18n("FOV to use for star hopping:"), nameToFovMap.uniqueKeys(), 0, false, &ok ) ];
577  }
578  else {
579  // Ask the user to enter a field of view
580  fov = QInputDialog::getDouble( this, i18n("Star Hopper: Enter field-of-view to use"), i18n("FOV to use for star hopping (in arcminutes):"), 60.0, 1.0, 600.0, 1, &ok );
581  }
582 
583  Q_ASSERT( fov > 0.0 );
584 
585  if( ok ) {
586 
587  kDebug() << "fov = " << fov;
588 
589  QList<const StarObject *> path = hopper.computePath( startHop, stopHop, fov/60.0, 9.0 ); // FIXME: Hardcoded magnitude limits for testing
590 
591  QList<SkyObject *> *mutablestarlist = new QList<SkyObject *>(); // FIXME: Memory leak
592  kDebug() << "path count: " << path.count();
593  foreach( const StarObject *conststar, path ) {
594  StarObject *mutablestar = const_cast<StarObject *>(conststar); // FIXME: Ugly const_cast
595  mutablestarlist->append( mutablestar );
596  kDebug() << "Added star!";
597  }
598 
599  TargetListComponent *t = KStarsData::Instance()->skyComposite()->getStarHopRouteList();
600  delete t->list;
601  t->list = mutablestarlist;
602  }
603 
604  rulerMode = false;
605  }
606 
607 }
608 
609 void SkyMap::slotCancelRulerMode(void) {
610  rulerMode = false;
611  AngularRuler.clear();
612 }
613 
614 void SkyMap::slotAddFlag() {
615  KStars *ks = KStars::Instance();
616 
617  // popup FlagManager window and update coordinates
618  ks->slotFlagManager();
619  ks->getFlagManager()->clearFields();
620  ks->getFlagManager()->setRaDec( clickedPoint()->ra(), clickedPoint()->dec() );
621 }
622 
623 void SkyMap::slotEditFlag( int flagIdx ) {
624  KStars *ks = KStars::Instance();
625 
626  // popup FlagManager window and switch to selected flag
627  ks->slotFlagManager();
628  ks->getFlagManager()->showFlag( flagIdx );
629 }
630 
631 void SkyMap::slotDeleteFlag( int flagIdx ) {
632  KStars *ks = KStars::Instance();
633 
634  ks->data()->skyComposite()->flags()->remove( flagIdx );
635  ks->data()->skyComposite()->flags()->saveToFile();
636 
637  // if there is FlagManager created, update its flag model
638  if ( ks->getFlagManager() ) {
639  ks->getFlagManager()->deleteFlagItem( flagIdx );
640  }
641 }
642 
643 void SkyMap::slotImage() {
644  QString message = ((KAction*)sender())->text();
645  message = message.remove( '&' ); //Get rid of accelerator markers
646 
647  // Need to do this because we are comparing translated strings
648  int index = -1;
649  for( int i = 0; i < clickedObject()->ImageTitle().size(); ++i ) {
650  if( i18nc( "Image/info menu item (should be translated)", clickedObject()->ImageTitle().at( i ).toLocal8Bit().data() ) == message ) {
651  index = i;
652  break;
653  }
654  }
655 
656  QString sURL;
657  if ( index >= 0 && index < clickedObject()->ImageList().size() ) {
658  sURL = clickedObject()->ImageList()[ index ];
659  } else {
660  kWarning() << "ImageList index out of bounds: " << index;
661  if ( index == -1 ) {
662  kWarning() << "Message string \"" << message << "\" not found in ImageTitle.";
663  kDebug() << clickedObject()->ImageTitle();
664  }
665  }
666 
667  KUrl url ( sURL );
668  if( !url.isEmpty() )
669  new ImageViewer( url, clickedObject()->messageFromTitle(message), this );
670 }
671 
672 void SkyMap::slotInfo() {
673  QString message = ((KAction*)sender())->text();
674  message = message.remove( '&' ); //Get rid of accelerator markers
675 
676  // Need to do this because we are comparing translated strings
677  int index = -1;
678  for( int i = 0; i < clickedObject()->InfoTitle().size(); ++i ) {
679  if( i18nc( "Image/info menu item (should be translated)", clickedObject()->InfoTitle().at( i ).toLocal8Bit().data() ) == message ) {
680  index = i;
681  break;
682  }
683  }
684 
685  QString sURL;
686  if ( index >= 0 && index < clickedObject()->InfoList().size() ) {
687  sURL = clickedObject()->InfoList()[ index ];
688  } else {
689  kWarning() << "InfoList index out of bounds: " << index;
690  if ( index == -1 ) {
691  kWarning() << "Message string \"" << message << "\" not found in InfoTitle.";
692  kDebug() << clickedObject()->InfoTitle();
693  }
694  }
695 
696  KUrl url ( sURL );
697  if (!url.isEmpty())
698  KToolInvocation::invokeBrowser(sURL);
699 }
700 
701 bool SkyMap::isObjectLabeled( SkyObject *object ) {
702  return data->skyComposite()->labelObjects().contains( object );
703 }
704 
705 SkyPoint SkyMap::getCenterPoint()
706 {
707  SkyPoint retVal;
708  // FIXME: subtraction of these 0.00001 is a simple workaround, because wrong SkyPoint is returned when _exact_ center of
709  // SkyMap is passed to the projector.
710  retVal = projector()->fromScreen( QPointF(width() / 2 - 0.00001, height() / 2 - 0.00001), data->lst(), data->geo()->lat() );
711  return retVal;
712 }
713 
714 void SkyMap::slotRemoveObjectLabel() {
715  data->skyComposite()->removeNameLabel( clickedObject() );
716  forceUpdate();
717 }
718 
719 void SkyMap::slotAddObjectLabel() {
720  data->skyComposite()->addNameLabel( clickedObject() );
721  forceUpdate();
722 }
723 
724 void SkyMap::slotRemovePlanetTrail() {
725  TrailObject* tobj = dynamic_cast<TrailObject*>( clickedObject() );
726  if( tobj ) {
727  tobj->clearTrail();
728  forceUpdate();
729  }
730 }
731 
732 void SkyMap::slotAddPlanetTrail() {
733  TrailObject* tobj = dynamic_cast<TrailObject*>( clickedObject() );
734  if( tobj ) {
735  tobj->addToTrail();
736  forceUpdate();
737  }
738 }
739 
740 void SkyMap::slotDetail() {
741  // check if object is selected
742  if ( !clickedObject() ) {
743  KMessageBox::sorry( this, i18n("No object selected."), i18n("Object Details") );
744  return;
745  }
746  DetailDialog* detail = new DetailDialog( clickedObject(), data->ut(), data->geo(), KStars::Instance() );
747  detail->setAttribute(Qt::WA_DeleteOnClose);
748  detail->show();
749 }
750 
751 void SkyMap::slotObjectSelected() {
752  if(m_objPointingMode && KStars::Instance()->getPrintingWizard()) {
753  KStars::Instance()->getPrintingWizard()->pointingDone(clickedObject());
754  m_objPointingMode = false;
755  }
756 }
757 
758 void SkyMap::slotCancelLegendPreviewMode() {
759  m_previewLegend = false;
760  forceUpdate(true);
761  KStars::Instance()->showImgExportDialog();
762 }
763 
764 void SkyMap::slotFinishFovCaptureMode() {
765  if(m_fovCaptureMode && KStars::Instance()->getPrintingWizard()) {
766  KStars::Instance()->getPrintingWizard()->fovCaptureDone();
767  m_fovCaptureMode = false;
768  }
769 }
770 
771 void SkyMap::slotCaptureFov() {
772  if(KStars::Instance()->getPrintingWizard()) {
773  KStars::Instance()->getPrintingWizard()->captureFov();
774  }
775 }
776 
777 void SkyMap::slotClockSlewing() {
778  //If the current timescale exceeds slewTimeScale, set clockSlewing=true, and stop the clock.
779  if( (fabs( data->clock()->scale() ) > Options::slewTimeScale()) ^ clockSlewing ) {
780  data->clock()->setManualMode( !clockSlewing );
781  clockSlewing = !clockSlewing;
782  // don't change automatically the DST status
783  KStars* kstars = KStars::Instance();
784  if( kstars )
785  kstars->updateTime( false );
786  }
787 }
788 
789 void SkyMap::setFocus( SkyPoint *p ) {
790  setFocus( p->ra(), p->dec() );
791 }
792 
793 void SkyMap::setFocus( const dms &ra, const dms &dec ) {
794  Options::setFocusRA( ra.Hours() );
795  Options::setFocusDec( dec.Degrees() );
796 
797  focus()->set( ra, dec );
798  focus()->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
799 }
800 
801 void SkyMap::setFocusAltAz( const dms &alt, const dms &az) {
802  Options::setFocusRA( focus()->ra().Hours() );
803  Options::setFocusDec( focus()->dec().Degrees() );
804  focus()->setAlt(alt);
805  focus()->setAz(az);
806  focus()->HorizontalToEquatorial( data->lst(), data->geo()->lat() );
807 
808  slewing = false;
809  forceUpdate(); //need a total update, or slewing with the arrow keys doesn't work.
810 }
811 
812 void SkyMap::setDestination( const SkyPoint& p ) {
813  setDestination( p.ra(), p.dec() );
814 }
815 
816 void SkyMap::setDestination( const dms &ra, const dms &dec ) {
817  destination()->set( ra, dec );
818  destination()->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
819  emit destinationChanged();
820 }
821 
822 void SkyMap::setDestinationAltAz( const dms &alt, const dms &az) {
823  destination()->setAlt(alt);
824  destination()->setAz(az);
825  destination()->HorizontalToEquatorial( data->lst(), data->geo()->lat() );
826  emit destinationChanged();
827 }
828 
829 void SkyMap::setClickedPoint( SkyPoint *f ) {
830  ClickedPoint = *f;
831 }
832 
833 void SkyMap::updateFocus() {
834  if( slewing )
835  return;
836 
837  //Tracking on an object
838  if ( Options::isTracking() && focusObject() != NULL ) {
839  if ( Options::useAltAz() ) {
840  //Tracking any object in Alt/Az mode requires focus updates
841  setFocusAltAz( focusObject()->altRefracted(), focusObject()->az() );
842  focus()->HorizontalToEquatorial( data->lst(), data->geo()->lat() );
843  setDestination( *focus() );
844  } else {
845  //Tracking in equatorial coords
846  setFocus( focusObject() );
847  focus()->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
848  setDestination( *focus() );
849  }
850 
851  //Tracking on empty sky
852  } else if ( Options::isTracking() && focusPoint() != NULL ) {
853  if ( Options::useAltAz() ) {
854  //Tracking on empty sky in Alt/Az mode
855  setFocus( focusPoint() );
856  focus()->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
857  setDestination( *focus() );
858  }
859 
860  // Not tracking and not slewing, let sky drift by
861  // This means that horizontal coordinates are constant.
862  } else {
863  focus()->HorizontalToEquatorial(data->lst(), data->geo()->lat() );
864  }
865 }
866 
867 void SkyMap::slewFocus() {
868  //Don't slew if the mouse button is pressed
869  //Also, no animated slews if the Manual Clock is active
870  //08/2002: added possibility for one-time skipping of slew with snapNextFocus
871  if ( !mouseButtonDown ) {
872  bool goSlew = ( Options::useAnimatedSlewing() && ! data->snapNextFocus() ) &&
873  !( data->clock()->isManualMode() && data->clock()->isActive() );
874  if ( goSlew ) {
875  double dX, dY;
876  double maxstep = 10.0;
877  if ( Options::useAltAz() ) {
878  dX = destination()->az().Degrees() - focus()->az().Degrees();
879  dY = destination()->alt().Degrees() - focus()->alt().Degrees();
880  } else {
881  dX = destination()->ra().Degrees() - focus()->ra().Degrees();
882  dY = destination()->dec().Degrees() - focus()->dec().Degrees();
883  }
884 
885  //switch directions to go the short way around the celestial sphere, if necessary.
886  dX = KSUtils::reduceAngle(dX, -180.0, 180.0);
887 
888  double r0 = sqrt( dX*dX + dY*dY );
889  if ( r0 < 20.0 ) { //smaller slews have smaller maxstep
890  maxstep *= (10.0 + 0.5*r0)/20.0;
891  }
892  double step = 0.5;
893  double r = r0;
894  while ( r > step ) {
895  //DEBUG
896  kDebug() << step << ": " << r << ": " << r0 << endl;
897  double fX = dX / r;
898  double fY = dY / r;
899 
900  if ( Options::useAltAz() ) {
901  focus()->setAlt( focus()->alt().Degrees() + fY*step );
902  focus()->setAz( dms( focus()->az().Degrees() + fX*step ).reduce() );
903  focus()->HorizontalToEquatorial( data->lst(), data->geo()->lat() );
904  } else {
905  fX = fX/15.; //convert RA degrees to hours
906  SkyPoint newFocus( focus()->ra().Hours() + fX*step, focus()->dec().Degrees() + fY*step );
907  setFocus( &newFocus );
908  focus()->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
909  }
910 
911  slewing = true;
912 
913  forceUpdate();
914  qApp->processEvents(); //keep up with other stuff
915 
916  if ( Options::useAltAz() ) {
917  dX = destination()->az().Degrees() - focus()->az().Degrees();
918  dY = destination()->alt().Degrees() - focus()->alt().Degrees();
919  } else {
920  dX = destination()->ra().Degrees() - focus()->ra().Degrees();
921  dY = destination()->dec().Degrees() - focus()->dec().Degrees();
922  }
923 
924  //switch directions to go the short way around the celestial sphere, if necessary.
925  dX = KSUtils::reduceAngle(dX, -180.0, 180.0);
926  r = sqrt( dX*dX + dY*dY );
927 
928  //Modify step according to a cosine-shaped profile
929  //centered on the midpoint of the slew
930  //NOTE: don't allow the full range from -PI/2 to PI/2
931  //because the slew will never reach the destination as
932  //the speed approaches zero at the end!
933  double t = dms::PI*(r - 0.5*r0)/(1.05*r0);
934  step = cos(t)*maxstep;
935  }
936  }
937 
938  //Either useAnimatedSlewing==false, or we have slewed, and are within one step of destination
939  //set focus=destination.
940  if ( Options::useAltAz() ) {
941  setFocusAltAz( destination()->alt(), destination()->az() );
942  focus()->HorizontalToEquatorial( data->lst(), data->geo()->lat() );
943  } else {
944  setFocus( destination() );
945  focus()->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
946  }
947 
948  slewing = false;
949 
950  //Turn off snapNextFocus, we only want it to happen once
951  if ( data->snapNextFocus() ) {
952  data->setSnapNextFocus(false);
953  }
954 
955  //Start the HoverTimer. if the user leaves the mouse in place after a slew,
956  //we want to attach a label to the nearest object.
957  if ( Options::useHoverLabel() )
958  m_HoverTimer.start( HOVER_INTERVAL );
959 
960  forceUpdate();
961  }
962 }
963 
964 void SkyMap::slotZoomIn() {
965  setZoomFactor( Options::zoomFactor() * DZOOM );
966 }
967 
968 void SkyMap::slotZoomOut() {
969  setZoomFactor( Options::zoomFactor() / DZOOM );
970 }
971 
972 void SkyMap::slotZoomDefault() {
973  setZoomFactor( DEFAULTZOOM );
974 }
975 
976 void SkyMap::setZoomFactor(double factor) {
977  Options::setZoomFactor( KSUtils::clamp(factor, MINZOOM, MAXZOOM) );
978  forceUpdate();
979  emit zoomChanged();
980 }
981 
982 // force a new calculation of the skymap (used instead of update(), which may skip the redraw)
983 // if now=true, SkyMap::paintEvent() is run immediately, rather than being added to the event queue
984 // also, determine new coordinates of mouse cursor.
985 void SkyMap::forceUpdate( bool now )
986 {
987  QPoint mp( mapFromGlobal( QCursor::pos() ) );
988  if (! projector()->unusablePoint( mp )) {
989  //determine RA, Dec of mouse pointer
990  m_MousePoint = projector()->fromScreen( mp, data->lst(), data->geo()->lat() );
991  }
992 
993  computeSkymap = true;
994 
995  // Ensure that stars are recomputed
996  data->incUpdateID();
997 
998  if( now )
999  m_SkyMapDraw->repaint();
1000  else
1001  m_SkyMapDraw->update();
1002 
1003 }
1004 
1005 float SkyMap::fov() {
1006  float diagonalPixels = sqrt(static_cast<double>( width() * width() + height() * height() ));
1007  return diagonalPixels / ( 2 * Options::zoomFactor() * dms::DegToRad );
1008 }
1009 
1010 void SkyMap::setupProjector() {
1011  //Update View Parameters for projection
1012  ViewParams p;
1013  p.focus = focus();
1014  p.height = height();
1015  p.width = width();
1016  p.useAltAz = Options::useAltAz();
1017  p.useRefraction = Options::useRefraction();
1018  p.zoomFactor = Options::zoomFactor();
1019  p.fillGround = Options::showGround();
1020  //Check if we need a new projector
1021  if( m_proj && Options::projection() == m_proj->type() )
1022  m_proj->setViewParams(p);
1023  else {
1024  delete m_proj;
1025  switch( Options::projection() ) {
1026  case Gnomonic:
1027  m_proj = new GnomonicProjector(p);
1028  break;
1029  case Stereographic:
1030  m_proj = new StereographicProjector(p);
1031  break;
1032  case Orthographic:
1033  m_proj = new OrthographicProjector(p);
1034  break;
1035  case AzimuthalEquidistant:
1036  m_proj = new AzimuthalEquidistantProjector(p);
1037  break;
1038  case Equirectangular:
1039  m_proj = new EquirectangularProjector(p);
1040  break;
1041  case Lambert: default:
1042  //TODO: implement other projection classes
1043  m_proj = new LambertProjector(p);
1044  break;
1045  }
1046  }
1047 }
1048 
1049 void SkyMap::setZoomMouseCursor()
1050 {
1051  mouseMoveCursor = false; // no mousemove cursor
1052  QBitmap cursor = zoomCursorBitmap(2);
1053  QBitmap mask = zoomCursorBitmap(4);
1054  setCursor( QCursor(cursor, mask) );
1055 }
1056 
1057 void SkyMap::setDefaultMouseCursor()
1058 {
1059  mouseMoveCursor = false; // no mousemove cursor
1060  QBitmap cursor = defaultCursorBitmap(2);
1061  QBitmap mask = defaultCursorBitmap(3);
1062  setCursor( QCursor(cursor, mask) );
1063 }
1064 
1065 void SkyMap::setMouseMoveCursor()
1066 {
1067  if (mouseButtonDown)
1068  {
1069  setCursor(Qt::SizeAllCursor); // cursor shape defined in qt
1070  mouseMoveCursor = true;
1071  }
1072 }
1073 
1074 void SkyMap::addLink() {
1075  if( !clickedObject() )
1076  return;
1077  QPointer<AddLinkDialog> adialog = new AddLinkDialog( this, clickedObject()->name() );
1078  QString entry;
1079  QFile file;
1080 
1081  if ( adialog->exec()==QDialog::Accepted ) {
1082  if ( adialog->isImageLink() ) {
1083  //Add link to object's ImageList, and descriptive text to its ImageTitle list
1084  clickedObject()->ImageList().append( adialog->url() );
1085  clickedObject()->ImageTitle().append( adialog->desc() );
1086 
1087  //Also, update the user's custom image links database
1088  //check for user's image-links database. If it doesn't exist, create it.
1089  file.setFileName( KStandardDirs::locateLocal( "appdata", "image_url.dat" ) ); //determine filename in local user KDE directory tree.
1090 
1091  if ( !file.open( QIODevice::ReadWrite | QIODevice::Append ) ) {
1092  QString message = i18n( "Custom image-links file could not be opened.\nLink cannot be recorded for future sessions." );
1093  KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) );
1094  delete adialog;
1095  return;
1096  } else {
1097  entry = clickedObject()->name() + ':' + adialog->desc() + ':' + adialog->url();
1098  QTextStream stream( &file );
1099  stream << entry << endl;
1100  file.close();
1101  emit linkAdded();
1102  }
1103  } else {
1104  clickedObject()->InfoList().append( adialog->url() );
1105  clickedObject()->InfoTitle().append( adialog->desc() );
1106 
1107  //check for user's image-links database. If it doesn't exist, create it.
1108  file.setFileName( KStandardDirs::locateLocal( "appdata", "info_url.dat" ) ); //determine filename in local user KDE directory tree.
1109 
1110  if ( !file.open( QIODevice::ReadWrite | QIODevice::Append ) ) {
1111  QString message = i18n( "Custom information-links file could not be opened.\nLink cannot be recorded for future sessions." );
1112  KMessageBox::sorry( 0, message, i18n( "Could not Open File" ) );
1113  delete adialog;
1114  return;
1115  } else {
1116  entry = clickedObject()->name() + ':' + adialog->desc() + ':' + adialog->url();
1117  QTextStream stream( &file );
1118  stream << entry << endl;
1119  file.close();
1120  emit linkAdded();
1121  }
1122  }
1123  }
1124  delete adialog;
1125 }
1126 
1127 void SkyMap::updateAngleRuler() {
1128  if( rulerMode && (!pmenu || !pmenu->isVisible()) )
1129  AngularRuler.setPoint( 1, &m_MousePoint );
1130  AngularRuler.update( data );
1131 }
1132 
1133 bool SkyMap::isSlewing() const {
1134  return (slewing || ( clockSlewing && data->clock()->isActive() ) );
1135 }
1136 
1137 #ifdef HAVE_OPENGL
1138 void SkyMap::slotToggleGL() {
1139 
1140  Q_ASSERT( m_SkyMapGLDraw );
1141  Q_ASSERT( m_SkyMapQDraw );
1142 
1143  m_SkyMapDraw->setParent( 0 );
1144  m_SkyMapDraw->hide();
1145 
1146  if( Options::useGL() ) {
1147  // Do NOT use GL
1148  Options::setUseGL( false );
1149  m_SkyMapDraw = m_SkyMapQDraw;
1150  KStars::Instance()->actionCollection()->action( "opengl" )->setText(i18n("Switch to OpenGL backend"));
1151  }
1152  else {
1153  // Use GL
1154  QString message = i18n("This version of KStars comes with new experimental OpenGL support. Our experience is that OpenGL works "
1155  "much faster on machines with hardware acceleration. Would you like to switch to OpenGL painting backends?");
1156 
1157  int result = KMessageBox::warningYesNo( this, message,
1158  i18n("Switch to OpenGL backend"),
1159  KStandardGuiItem::yes(),
1160  KStandardGuiItem::no(),
1161  "dag_opengl_switch" );
1162 
1163  if ( result == KMessageBox::Yes ) {
1164 
1165  KMessageBox::information( this, i18n("Infoboxes will be disabled as they do not work correctly when using OpenGL backends as of this version"),
1166  i18n("Switch to OpenGL backend"),
1167  "dag_opengl_infoboxes" );
1168 
1169  Options::setUseGL( true );
1170 
1171  m_SkyMapDraw = m_SkyMapGLDraw;
1172  KStars::Instance()->actionCollection()->action( "opengl" )->setText(i18n("Switch to QPainter backend"));
1173  }
1174  }
1175  m_SkyMapDraw->setParent( viewport() );
1176  m_SkyMapDraw->show();
1177  m_SkyMapDraw->resize( size() );
1178 }
1179 #endif
1180 
1181 #ifdef HAVE_XPLANET
1182 void SkyMap::startXplanet( const QString & outputFile ) {
1183  QString year, month, day, hour, minute, seconde, fov;
1184 
1185  // If Options::xplanetPath() is empty, return
1186  if ( Options::xplanetPath().isEmpty() ) {
1187  KMessageBox::error(0, i18n("Xplanet binary path is empty in config panel."));
1188  return;
1189  }
1190 
1191  // Format date
1192  if ( year.setNum( data->ut().date().year() ).size() == 1 ) year.push_front( '0' );
1193  if ( month.setNum( data->ut().date().month() ).size() == 1 ) month.push_front( '0' );
1194  if ( day.setNum( data->ut().date().day() ).size() == 1 ) day.push_front( '0' );
1195  if ( hour.setNum( data->ut().time().hour() ).size() == 1 ) hour.push_front( '0' );
1196  if ( minute.setNum( data->ut().time().minute() ).size() == 1 ) minute.push_front( '0' );
1197  if ( seconde.setNum( data->ut().time().second() ).size() == 1 ) seconde.push_front( '0' );
1198 
1199  // Create xplanet process
1200  KProcess *xplanetProc = new KProcess;
1201 
1202  // Add some options
1203  *xplanetProc << Options::xplanetPath()
1204  << "-body" << clickedObject()->name().toLower()
1205  << "-geometry" << Options::xplanetWidth() + 'x' + Options::xplanetHeight()
1206  << "-date" << year + month + day + '.' + hour + minute + seconde
1207  << "-glare" << Options::xplanetGlare()
1208  << "-base_magnitude" << Options::xplanetMagnitude()
1209  << "-light_time"
1210  << "-window";
1211 
1212  // General options
1213  if ( ! Options::xplanetTitle().isEmpty() )
1214  *xplanetProc << "-window_title" << "\"" + Options::xplanetTitle() + "\"";
1215  if ( Options::xplanetFOV() )
1216  *xplanetProc << "-fov" << fov.setNum( this->fov() ).replace( '.', ',' );
1217  if ( Options::xplanetConfigFile() )
1218  *xplanetProc << "-config" << Options::xplanetConfigFilePath();
1219  if ( Options::xplanetStarmap() )
1220  *xplanetProc << "-starmap" << Options::xplanetStarmapPath();
1221  if ( Options::xplanetArcFile() )
1222  *xplanetProc << "-arc_file" << Options::xplanetArcFilePath();
1223  if ( Options::xplanetWait() )
1224  *xplanetProc << "-wait" << Options::xplanetWaitValue();
1225  if ( !outputFile.isEmpty() )
1226  *xplanetProc << "-output" << outputFile << "-quality" << Options::xplanetQuality();
1227 
1228  // Labels
1229  if ( Options::xplanetLabel() ) {
1230  *xplanetProc << "-fontsize" << Options::xplanetFontSize()
1231  << "-color" << "0x" + Options::xplanetColor().mid( 1 )
1232  << "-date_format" << Options::xplanetDateFormat();
1233 
1234  if ( Options::xplanetLabelGMT() )
1235  *xplanetProc << "-gmtlabel";
1236  else
1237  *xplanetProc << "-label";
1238  if ( !Options::xplanetLabelString().isEmpty() )
1239  *xplanetProc << "-label_string" << "\"" + Options::xplanetLabelString() + "\"";
1240  if ( Options::xplanetLabelTL() )
1241  *xplanetProc << "-labelpos" << "+15+15";
1242  else if ( Options::xplanetLabelTR() )
1243  *xplanetProc << "-labelpos" << "-15+15";
1244  else if ( Options::xplanetLabelBR() )
1245  *xplanetProc << "-labelpos" << "-15-15";
1246  else if ( Options::xplanetLabelBL() )
1247  *xplanetProc << "-labelpos" << "+15-15";
1248  }
1249 
1250  // Markers
1251  if ( Options::xplanetMarkerFile() )
1252  *xplanetProc << "-marker_file" << Options::xplanetMarkerFilePath();
1253  if ( Options::xplanetMarkerBounds() )
1254  *xplanetProc << "-markerbounds" << Options::xplanetMarkerBoundsPath();
1255 
1256  // Position
1257  if ( Options::xplanetRandom() )
1258  *xplanetProc << "-random";
1259  else
1260  *xplanetProc << "-latitude" << Options::xplanetLatitude() << "-longitude" << Options::xplanetLongitude();
1261 
1262  // Projection
1263  if ( Options::xplanetProjection() ) {
1264  switch ( Options::xplanetProjection() ) {
1265  case 1 : *xplanetProc << "-projection" << "ancient"; break;
1266  case 2 : *xplanetProc << "-projection" << "azimuthal"; break;
1267  case 3 : *xplanetProc << "-projection" << "bonne"; break;
1268  case 4 : *xplanetProc << "-projection" << "gnomonic"; break;
1269  case 5 : *xplanetProc << "-projection" << "hemisphere"; break;
1270  case 6 : *xplanetProc << "-projection" << "lambert"; break;
1271  case 7 : *xplanetProc << "-projection" << "mercator"; break;
1272  case 8 : *xplanetProc << "-projection" << "mollweide"; break;
1273  case 9 : *xplanetProc << "-projection" << "orthographic"; break;
1274  case 10 : *xplanetProc << "-projection" << "peters"; break;
1275  case 11 : *xplanetProc << "-projection" << "polyconic"; break;
1276  case 12 : *xplanetProc << "-projection" << "rectangular"; break;
1277  case 13 : *xplanetProc << "-projection" << "tsc"; break;
1278  default : break;
1279  }
1280  if ( Options::xplanetBackground() ) {
1281  if ( Options::xplanetBackgroundImage() )
1282  *xplanetProc << "-background" << Options::xplanetBackgroundImagePath();
1283  else
1284  *xplanetProc << "-background" << "0x" + Options::xplanetBackgroundColorValue().mid( 1 );
1285  }
1286  }
1287 
1288  // We add this option at the end otherwise it does not work (???)
1289  *xplanetProc << "-origin" << "earth";
1290 
1291  // Run xplanet
1292  kDebug() << "Run:" << xplanetProc->program().join(" ");
1293  xplanetProc->start();
1294 }
1295 
1296 void SkyMap::slotXplanetToScreen() {
1297  startXplanet();
1298 }
1299 
1300 void SkyMap::slotXplanetToFile() {
1301  QString filename = KFileDialog::getSaveFileName( );
1302  if ( ! filename.isEmpty() ) {
1303  startXplanet( filename );
1304  }
1305 }
1306 #endif
1307 
1308 #include "skymap.moc"
stereographicprojector.h
SkyPoint::deprecess
SkyPoint deprecess(const KSNumbers *num, long double epoch=J2000)
Obtain a Skypoint with RA0 and Dec0 set from the RA, Dec of this skypoint.
Definition: skypoint.cpp:190
Options::xplanetArcFilePath
static QString xplanetArcFilePath()
Get Path to arc file.
Definition: Options.h:4103
TrailObject::hasTrail
bool hasTrail() const
Definition: trailobject.h:46
SkyMap::slotClockSlewing
void slotClockSlewing()
Checks whether the timestep exceeds a threshold value.
Definition: skymap.cpp:777
SkyMap::slotZoomIn
void slotZoomIn()
Zoom in one step.
Definition: skymap.cpp:964
Options::shadeFocusBox
static bool shadeFocusBox()
Get Is the focus InfoBox in the "shaded" state?
Definition: Options.h:108
KStars::showImgExportDialog
void showImgExportDialog()
Definition: kstars.cpp:230
ksplanetbase.h
SkyPoint::ra
const dms & ra() const
Definition: skypoint.h:171
orthographicprojector.h
SkyMap::fov
float fov()
Definition: skymap.cpp:1005
DetailDialog
window showing detailed information for a selected object.
Definition: detaildialog.h:88
SkyPoint::set
void set(const dms &r, const dms &d)
Sets RA, Dec and RA0, Dec0 according to arguments.
Definition: skypoint.cpp:46
SkyMap::AzimuthalEquidistant
Definition: skymap.h:97
SimClock::setManualMode
void setManualMode(bool on=true)
Sets Manual Mode on/off according to the bool argument.
Definition: simclock.cpp:73
imageviewer.h
Options::xplanetWaitValue
static QString xplanetWaitValue()
Get Number of seconds to wait before updating.
Definition: Options.h:3951
ViewParams::useRefraction
bool useRefraction
Definition: projector.h:42
KSUtils::reduceAngle
T reduceAngle(T x, T min, T max)
Put angle into range.
Definition: ksutils.h:74
SkyMap::slotCancelRulerMode
void slotCancelRulerMode()
Disables the angular distance measuring mode.
Definition: skymap.cpp:609
SkyPoint::dec0
const dms & dec0() const
Definition: skypoint.h:168
KStarsData::clock
SimClock * clock()
Definition: kstarsdata.h:158
SkyMap::slewFocus
void slewFocus()
Step the Focus point toward the Destination point.
Definition: skymap.cpp:867
KStarsData
KStarsData is the backbone of KStars.
Definition: kstarsdata.h:66
DZOOM
#define DZOOM
Definition: kstarsdata.h:41
FOV
class encapulating a Field-of-View symbol
Definition: fov.h:32
Options::xplanetHeight
static QString xplanetHeight()
Get Height of xplanet window.
Definition: Options.h:3590
Options::xplanetLabelTR
static bool xplanetLabelTR()
Get Top right.
Definition: Options.h:3761
SkyMapComposite::labelObjects
QList< SkyObject * > & labelObjects()
Definition: skymapcomposite.h:175
TargetListComponent
Highlights objects present in certain lists by drawing "target" symbols around them.
Definition: skycomponents/targetlistcomponent.h:50
KSPopupMenu
The KStars Popup Menu.
Definition: kspopupmenu.h:43
SkyPoint::az
const dms & az() const
Definition: skypoint.h:177
Options::xplanetLabelBR
static bool xplanetLabelBR()
Get Bottom right.
Definition: Options.h:3780
SkyMap::slotFinishFovCaptureMode
void slotFinishFovCaptureMode()
Definition: skymap.cpp:764
Options::xplanetFOV
static bool xplanetFOV()
Get Use kstars's FOV.
Definition: Options.h:4160
Options::setPositionFocusBox
static void setPositionFocusBox(const QPoint &v)
Set Position of the focus InfoBox.
Definition: Options.h:41
Options::setShadeGeoBox
static void setShadeGeoBox(bool v)
Set Is the geographic InfoBox in the "shaded" state?
Definition: Options.h:117
SkyMap::slotCenter
void slotCenter()
Center the display at the point ClickedPoint.
Definition: skymap.cpp:373
OrthographicProjector
Definition: orthographicprojector.h:27
SimClock::isManualMode
bool isManualMode() const
Manual Mode is a new (04/2002) addition to the SimClock.
Definition: simclock.h:72
SkyMap::setFocusObject
void setFocusObject(SkyObject *o)
Set the FocusObject pointer to the argument.
Definition: skymap.cpp:365
KStarsData::colorScheme
ColorScheme * colorScheme()
Definition: kstarsdata.h:149
PrintingWizard::captureFov
void captureFov()
Capture current contents of FOV symbol.
Definition: printingwizard.cpp:138
detaildialog.h
skyobject.h
SkyMap::slotInfo
void slotInfo()
Popup menu function: Show webpage about ClickedObject (only available for some objects).
Definition: skymap.cpp:672
Options::xplanetLabelString
static QString xplanetLabelString()
Get Planet string.
Definition: Options.h:3666
FOV::sizeX
float sizeX() const
Definition: fov.h:53
deepskyobject.h
SkyMap::setDestination
void setDestination(const SkyPoint &f)
sets the destination point of the sky map.
Definition: skymap.cpp:812
Projector::type
virtual SkyMap::Projection type() const =0
Return the type of this projection.
SkyPoint::refract
static double refract(const double alt)
Apply refraction correction to altitude.
Definition: skypoint.cpp:765
Options::xplanetConfigFilePath
static QString xplanetConfigFilePath()
Get Path to config file.
Definition: Options.h:4141
SkyMap::setClickedObject
void setClickedObject(SkyObject *o)
Set the ClickedObject pointer to the argument.
Definition: skymap.cpp:361
SkyMap::SkyMap
SkyMap()
Constructor.
Definition: skymap.cpp:146
SkyMap::setFocus
void setFocus(SkyPoint *f)
sets the central focus point of the sky map.
Definition: skymap.cpp:789
SkyMap::Gnomonic
Definition: skymap.h:101
SkyPoint::setAz
void setAz(dms az)
Sets Az, the Azimuth.
Definition: skypoint.h:152
ViewParams::focus
SkyPoint * focus
Definition: projector.h:45
KStarsData::lst
dms * lst()
Definition: kstarsdata.h:161
KStarsData::Instance
static KStarsData * Instance()
Definition: kstarsdata.h:92
Options::setPositionGeoBox
static void setPositionGeoBox(const QPoint &v)
Set Position of the geographic InfoBox.
Definition: Options.h:60
dms::Degrees
const double & Degrees() const
Definition: dms.h:98
SkyMap::slotAddPlanetTrail
void slotAddPlanetTrail()
Add a Planet Trail to ClickedObject.
Definition: skymap.cpp:732
Options::setStickyGeoBox
static void setStickyGeoBox(int v)
Set Geographic InfoBox anchor flag.
Definition: Options.h:274
LambertProjector
Definition: lambertprojector.h:28
gnomonicprojector.h
StarHopper::computePath
QList< StarObject const * > computePath(const SkyPoint &src, const SkyPoint &dest, float fov_, float maglim_)
Definition: starhopper.cpp:30
Options::setShowFocusBox
static void setShowFocusBox(bool v)
Set Display the focus InfoBox?
Definition: Options.h:174
EquirectangularProjector
Definition: equirectangularprojector.h:27
Options::xplanetLatitude
static QString xplanetLatitude()
Get Latitude in degrees.
Definition: Options.h:3875
Options::xplanetArcFile
static bool xplanetArcFile()
Get Arc file.
Definition: Options.h:4084
KStars::Instance
static KStars * Instance()
Definition: kstars.h:125
SkyMap::focusPoint
SkyPoint * focusPoint()
retrieve the FocusPoint position.
Definition: skymap.h:140
SkyMap::slotDetail
void slotDetail()
Popup menu function: Show the Detailed Information window for ClickedObject.
Definition: skymap.cpp:740
Options::setShowTimeBox
static void setShowTimeBox(bool v)
Set Display the time InfoBox?
Definition: Options.h:155
ColorScheme::colorNamed
QColor colorNamed(const QString &name) const
Retrieve a color by name.
Definition: colorscheme.cpp:97
SkyMap::forceUpdate
void forceUpdate(bool now=false)
Recalculates the positions of objects in the sky, and then repaints the sky map.
Definition: skymap.cpp:985
Options::positionTimeBox
static QPoint positionTimeBox()
Get Position of the time InfoBox.
Definition: Options.h:32
Options::setPositionTimeBox
static void setPositionTimeBox(const QPoint &v)
Set Position of the time InfoBox.
Definition: Options.h:22
Options::xplanetMarkerBounds
static bool xplanetMarkerBounds()
Get Write marker bounds.
Definition: Options.h:4217
PrintingWizard::pointingDone
void pointingDone(SkyObject *obj)
Quit object pointing mode and set the pointed object.
Definition: printingwizard.cpp:111
SkyMap::slotRemoveObjectLabel
void slotRemoveObjectLabel()
Remove ClickedObject from KStarsData::ObjLabelList, which stores pointers to SkyObjects which have Us...
Definition: skymap.cpp:714
KStarsData::geo
GeoLocation * geo()
Definition: kstarsdata.h:164
KStarsData::snapNextFocus
bool snapNextFocus() const
Definition: kstarsdata.h:183
Options::xplanetBackground
static bool xplanetBackground()
Get Use background.
Definition: Options.h:3970
targetlistcomponent.h
SkyLine::update
void update(KStarsData *data, KSNumbers *num=0)
Definition: skyline.cpp:71
SkyLine::clear
void clear()
Remove all points from list.
Definition: skyline.cpp:29
Options::isTracking
static bool isTracking()
Get Is tracking engaged?
Definition: Options.h:1075
InfoBoxes
Definition: infoboxwidget.h:31
Options::useGL
static bool useGL()
Get Switch to OpenGL backend.
Definition: Options.h:2740
SkyMap::Lambert
Definition: skymap.h:96
KStars
This is the main window for KStars.
Definition: kstars.h:94
Options::xplanetMarkerFile
static bool xplanetMarkerFile()
Get Use marker file.
Definition: Options.h:4179
SkyMap::setupProjector
void setupProjector()
Call to set up the projector before a draw cycle.
Definition: skymap.cpp:1010
SkyPoint::ra0
const dms & ra0() const
Definition: skypoint.h:165
SkyLine::setPoint
void setPoint(int i, SkyPoint *p)
Set point i in the SkyLine.
Definition: skyline.cpp:38
Options::setShadeTimeBox
static void setShadeTimeBox(bool v)
Set Is the time InfoBox in the "shaded" state?
Definition: Options.h:79
Options::useAnimatedSlewing
static bool useAnimatedSlewing()
Get Use animated slewing effects when changing focus position?
Definition: Options.h:961
SkyMap::addLink
void addLink()
Popup menu function: Add a custom Image or Information URL.
Definition: skymap.cpp:1074
SkyMapComposite::objectNearest
virtual SkyObject * objectNearest(SkyPoint *p, double &maxrad)
Definition: skymapcomposite.cpp:309
Options::xplanetMarkerBoundsPath
static QString xplanetMarkerBoundsPath()
Get Marker bounds file path.
Definition: Options.h:4236
SkyMap::slotAddFlag
void slotAddFlag()
Open Flag Manager window with clickedObject() RA and Dec entered.
Definition: skymap.cpp:614
Options::shadeGeoBox
static bool shadeGeoBox()
Get Is the geographic InfoBox in the "shaded" state?
Definition: Options.h:127
SkyObject::InfoList
QStringList & InfoList()
Definition: skyobject.h:309
Options::xplanetPath
static QString xplanetPath()
Get Path to xplanet binary.
Definition: Options.h:3533
SimClock::isActive
bool isActive()
Whether the clock is active or not is a bit complicated by the introduction of "manual mode"...
Definition: simclock.cpp:97
SkyMap::slotBeginAngularDistance
void slotBeginAngularDistance()
Enables the angular distance measuring mode.
Definition: skymap.cpp:496
fov.h
Options::useHoverLabel
static bool useHoverLabel()
Get Add temporary label on mouse hover?
Definition: Options.h:2443
starhopper.h
Options::showGround
static bool showGround()
Get Draw opaque ground in the sky map?
Definition: Options.h:1740
SkyMap::slotEndRulerMode
void slotEndRulerMode()
Computes the angular distance, prints the result in the status bar and disables the angular distance ...
Definition: skymap.cpp:524
MAXZOOM
#define MAXZOOM
Definition: kstarsdata.h:39
SkyMap::slotToggleTimeBox
void slotToggleTimeBox(bool)
Toggle visibility of time infobox.
Definition: skymap.cpp:279
SkyMap::zoomChanged
void zoomChanged()
Emitted when zoom level is changed.
SkyMap::Create
static SkyMap * Create()
Definition: skymap.cpp:134
Options::showGeoBox
static bool showGeoBox()
Get Display the geographic InfoBox?
Definition: Options.h:203
SkyMap::getCenterPoint
SkyPoint getCenterPoint()
Definition: skymap.cpp:705
Options::xplanetMarkerFilePath
static QString xplanetMarkerFilePath()
Get Marker file path.
Definition: Options.h:4198
TrailObject::clearTrail
void clearTrail()
clear the Trail
Definition: trailobject.cpp:66
KStars::getPrintingWizard
PrintingWizard * getPrintingWizard() const
Definition: kstars.h:163
Options::stickyTimeBox
static int stickyTimeBox()
Get Time InfoBox anchor flag.
Definition: Options.h:234
NaN::f
const float f
Definition: nan.h:36
Options::xplanetWait
static bool xplanetWait()
Get Update view.
Definition: Options.h:3932
KStarsData::updateNum
KSNumbers * updateNum()
Definition: kstarsdata.h:226
kspopupmenu.h
Options::xplanetQuality
static QString xplanetQuality()
Get Output file quality.
Definition: Options.h:4293
Options::xplanetRandom
static bool xplanetRandom()
Get Random latitude and longitude.
Definition: Options.h:3837
Options::projection
static uint projection()
Get Mapping projection algorithm.
Definition: Options.h:2310
texturemanager.h
InfoBoxes::addInfoBox
void addInfoBox(InfoBoxWidget *ibox)
Definition: infoboxwidget.cpp:38
Options::positionFocusBox
static QPoint positionFocusBox()
Get Position of the focus InfoBox.
Definition: Options.h:51
SkyPoint
The sky coordinates of a point in the sky.
Definition: skypoint.h:50
ImageViewer
Image viewer window for KStars.
Definition: imageviewer.h:61
SkyMapComposite::flags
FlagComponent * flags()
Definition: skymapcomposite.cpp:605
ViewParams::width
float width
Definition: projector.h:40
SkyMap::slotToggleInfoboxes
void slotToggleInfoboxes(bool)
Toggle visibility of all infoboxes.
Definition: skymap.cpp:283
Options::slewTimeScale
static double slewTimeScale()
Get Minimum timescale for forced-slewing mode.
Definition: Options.h:2272
SkyMap::slotObjectSelected
void slotObjectSelected()
Object pointing for Printing Wizard done.
Definition: skymap.cpp:751
SkyMap::slotDeleteFlag
void slotDeleteFlag(int flagIdx)
Delete selected flag.
Definition: skymap.cpp:631
SkyMap::showFocusCoords
void showFocusCoords()
Update object name and coordinates in the Focus InfoBox.
Definition: skymap.cpp:331
Options::xplanetWidth
static QString xplanetWidth()
Get Width of xplanet window.
Definition: Options.h:3571
SkyMap::setZoomFactor
void setZoomFactor(double factor)
@ Set zoom factor.
Definition: skymap.cpp:976
TrailObject::addToTrail
void addToTrail()
adds a point to the planet's trail
Definition: trailobject.cpp:54
skymapcomposite.h
SkyMap::slotCaptureFov
void slotCaptureFov()
Definition: skymap.cpp:771
SkyMap::focus
SkyPoint * focus()
Retrieve the Focus point; the position on the sky at the center of the skymap.
Definition: skymap.h:120
KSUtils::getDSSURL
QString getDSSURL(const SkyPoint *const p)
Create a URL to obtain a DSS image for a given SkyPoint.
Options::xplanetLabelBL
static bool xplanetLabelBL()
Get Bottom left.
Definition: Options.h:3799
Options::setIsTracking
static void setIsTracking(bool v)
Set Is tracking engaged?
Definition: Options.h:1065
SkyObject::ImageList
QStringList & ImageList()
Definition: skyobject.h:299
MINZOOM
#define MINZOOM
Definition: kstarsdata.h:38
Options::xplanetTitle
static QString xplanetTitle()
Get Window title.
Definition: Options.h:3552
SkyMapComposite::addNameLabel
bool addNameLabel(SkyObject *o)
Definition: skymapcomposite.cpp:395
Options::positionGeoBox
static QPoint positionGeoBox()
Get Position of the geographic InfoBox.
Definition: Options.h:70
ViewParams::useAltAz
bool useAltAz
Definition: projector.h:43
Options::xplanetConfigFile
static bool xplanetConfigFile()
Get Config file.
Definition: Options.h:4122
Options::setShadeFocusBox
static void setShadeFocusBox(bool v)
Set Is the focus InfoBox in the "shaded" state?
Definition: Options.h:98
SkyLine::angularSize
dms angularSize(int i=0) const
Definition: skyline.cpp:46
Projector::fromScreen
virtual SkyPoint fromScreen(const QPointF &p, dms *LST, const dms *lat) const
Determine RA, Dec coordinates of the pixel at (dx, dy), which are the screen pixel coordinate offsets...
Definition: projector.cpp:353
SkyMapGLDraw
This class draws the SkyMap using OpenGL.
Definition: skymapgldraw.h:31
SkyObject::messageFromTitle
QString messageFromTitle(const QString &imageTitle)
Given the Image title from a URL file, try to convert it to an image credit string.
Definition: skyobject.cpp:374
Options::setFocusObject
static void setFocusObject(const QString &v)
Set Name of focused object.
Definition: Options.h:1046
Options::setStickyTimeBox
static void setStickyTimeBox(int v)
Set Time InfoBox anchor flag.
Definition: Options.h:212
ViewParams::height
float height
Definition: projector.h:40
KStars::getFlagManager
FlagManager * getFlagManager() const
Definition: kstars.h:161
SkyMap::isSlewing
bool isSlewing() const
Definition: skymap.cpp:1133
lambertprojector.h
skymapqdraw.h
SkyMap::slotImage
void slotImage()
Popup menu function: Show image of ClickedObject (only available for some objects).
Definition: skymap.cpp:643
skymap.h
Options::xplanetLongitude
static QString xplanetLongitude()
Get Longitude in degrees.
Definition: Options.h:3894
DEFAULTZOOM
#define DEFAULTZOOM
Definition: kstarsdata.h:40
i18nc
i18nc("string from libindi, used in the config dialog","100x")
SkyMap::setFocusAltAz
void setFocusAltAz(const dms &alt, const dms &az)
sets the focus point of the sky map, using its alt/az coordinates
Definition: skymap.cpp:801
Options::xplanetLabel
static bool xplanetLabel()
Get Show label.
Definition: Options.h:3609
KStars::updateTime
void updateTime(const bool automaticDSTchange=true)
Update time-dependent data and (possibly) repaint the sky map.
Definition: kstars.cpp:334
SimClock::scale
double scale() const
Definition: simclock.h:60
SkyMap::slotCancelLegendPreviewMode
void slotCancelLegendPreviewMode()
Definition: skymap.cpp:758
SkyPoint::HorizontalToEquatorial
void HorizontalToEquatorial(const dms *LST, const dms *lat)
Determine the (RA, Dec) coordinates of the SkyPoint from its (Altitude, Azimuth) coordinates, given the local sidereal time and the observer's latitude.
Definition: skypoint.cpp:102
addlinkdialog.h
SkyObject::translatedLongName
QString translatedLongName() const
Definition: skyobject.h:145
Options::xplanetBackgroundColorValue
static QString xplanetBackgroundColorValue()
Get Background color.
Definition: Options.h:4046
KStarsData::skyComposite
SkyMapComposite * skyComposite()
Definition: kstarsdata.h:146
SkyMap::objectChanged
void objectChanged(SkyObject *)
Emitted when current object changed.
SkyMap::slotToggleFocusBox
void slotToggleFocusBox(bool)
Toggle visibility of focus infobox.
Definition: skymap.cpp:275
SkyMap::~SkyMap
~SkyMap()
Destructor (empty)
Definition: skymap.cpp:287
InfoBoxWidget::sticky
int sticky() const
Get stickyness status of.
Definition: infoboxwidget.h:68
SkyMap::mousePointChanged
void mousePointChanged(SkyPoint *)
Emitted when position under mouse changed.
StarHopper
Helps planning star hopping.
Definition: starhopper.h:32
Options::showTimeBox
static bool showTimeBox()
Get Display the time InfoBox?
Definition: Options.h:165
dms
An angle, stored as degrees, but expressible in many ways.
Definition: dms.h:42
Options::stickyFocusBox
static int stickyFocusBox()
Get Time InfoBox anchor flag.
Definition: Options.h:265
simclock.h
Options::stickyGeoBox
static int stickyGeoBox()
Get Geographic InfoBox anchor flag.
Definition: Options.h:296
Options::setShowGeoBox
static void setShowGeoBox(bool v)
Set Display the geographic InfoBox?
Definition: Options.h:193
KStars::slotFlagManager
void slotFlagManager()
action slot: open Flag Manager
Definition: kstarsactions.cpp:397
SkyPoint::dec
const dms & dec() const
Definition: skypoint.h:174
dms::Hours
double Hours() const
Definition: dms.h:125
Options::xplanetLabelGMT
static bool xplanetLabelGMT()
Get Show GMT label.
Definition: Options.h:3647
SkyLine::point
SkyPoint * point(int i) const
Definition: skyline.h:54
Options::shadeTimeBox
static bool shadeTimeBox()
Get Is the time InfoBox in the "shaded" state?
Definition: Options.h:89
SkyPoint::EquatorialToHorizontal
void EquatorialToHorizontal(const dms *LST, const dms *lat)
Determine the (Altitude, Azimuth) coordinates of the SkyPoint from its (RA, Dec) coordinates, given the local sidereal time and the observer's latitude.
Definition: skypoint.cpp:55
SkyMap::destinationChanged
void destinationChanged()
Emitted by setDestination(), and connected to slewFocus().
InfoBoxWidget
Small optianally transparent box for display of text messages.
Definition: infoboxwidget.h:48
Options::xplanetBackgroundImage
static bool xplanetBackgroundImage()
Get Use background image.
Definition: Options.h:3989
FlagComponent::saveToFile
void saveToFile()
Save flags to flags.dat file.
Definition: flagcomponent.cpp:114
SkyMap::slotToggleGeoBox
void slotToggleGeoBox(bool)
Toggle visibility of geo infobox.
Definition: skymap.cpp:271
SkyMap::isObjectLabeled
bool isObjectLabeled(SkyObject *o)
Definition: skymap.cpp:701
azimuthalequidistantprojector.h
SkyMap::clickedPoint
SkyPoint * clickedPoint()
Retrieve the ClickedPoint position.
Definition: skymap.h:200
Options::xplanetStarmapPath
static QString xplanetStarmapPath()
Get Star map file path.
Definition: Options.h:4274
Options::setZoomFactor
static void setZoomFactor(double v)
Set Zoom Factor, in pixels per radian.
Definition: Options.h:2509
SkyMap::Equirectangular
Definition: skymap.h:99
Options::useRefraction
static bool useRefraction()
Get Correct positions for atmospheric refraction?
Definition: Options.h:2462
infoboxwidget.h
printingwizard.h
Options.h
SkyMap::updateAngleRuler
void updateAngleRuler()
update the geometry of the angle ruler.
Definition: skymap.cpp:1127
PrintingWizard::fovCaptureDone
void fovCaptureDone()
Disable FOV capture mode.
Definition: printingwizard.cpp:179
TargetListComponent::list
SkyObjectList * list
Definition: skycomponents/targetlistcomponent.h:75
SkyObject::mag
float mag(void) const
Definition: skyobject.h:182
skymapgldraw.h
KStarsData::getVisibleFOVs
const QList< FOV * > getVisibleFOVs() const
Definition: kstarsdata.h:211
equirectangularprojector.h
Options::showInfoBoxes
static bool showInfoBoxes()
Get Meta-option to toggle display of all InfoBoxes.
Definition: Options.h:146
QTextStream
Options::xplanetStarmap
static bool xplanetStarmap()
Get Star map.
Definition: Options.h:4255
Options::setShowInfoBoxes
static void setShowInfoBoxes(bool v)
Set Meta-option to toggle display of all InfoBoxes.
Definition: Options.h:136
Options::setStickyFocusBox
static void setStickyFocusBox(int v)
Set Time InfoBox anchor flag.
Definition: Options.h:243
Options::xplanetBackgroundImagePath
static QString xplanetBackgroundImagePath()
Get Background image path.
Definition: Options.h:4008
SkyObject::InfoTitle
QStringList & InfoTitle()
Definition: skyobject.h:314
SkyMap::slotZoomDefault
void slotZoomDefault()
Set default zoom.
Definition: skymap.cpp:972
GeoLocation::lat
const dms * lat() const
Definition: geolocation.h:79
Options::setFocusDec
static void setFocusDec(double v)
Set Declination of focus position.
Definition: Options.h:1027
Options::xplanetFontSize
static QString xplanetFontSize()
Get Font Size.
Definition: Options.h:3685
InfoBoxWidget::shaded
bool shaded() const
Check whether box is shaded.
Definition: infoboxwidget.h:66
SkyMap::setClickedPoint
void setClickedPoint(SkyPoint *f)
Set the ClickedPoint to the skypoint given as an argument.
Definition: skymap.cpp:829
SkyMap::slotAddObjectLabel
void slotAddObjectLabel()
Add ClickedObject to KStarsData::ObjLabelList, which stores pointers to SkyObjects which have User La...
Definition: skymap.cpp:719
KStarsData::setSnapNextFocus
void setSnapNextFocus(bool b=true)
Disable or re-enable the slewing animation for the next Focus change.
Definition: kstarsdata.h:194
PI
#define PI
Definition: satellite.cpp:43
StereographicProjector
Definition: stereographicprojector.h:27
SkyMap::slotZoomOut
void slotZoomOut()
Zoom out one step.
Definition: skymap.cpp:968
Options::zoomFactor
static double zoomFactor()
Get Zoom Factor, in pixels per radian.
Definition: Options.h:2531
SkyMap::slotDSS
void slotDSS()
Popup menu function: Display 1st-Generation DSS image with the Image Viewer.
Definition: skymap.cpp:434
AzimuthalEquidistantProjector
Definition: azimuthalequidistantprojector.h:27
TrailObject
provides a SkyObject with an attachable Trail
Definition: trailobject.h:33
Options::showFocusBox
static bool showFocusBox()
Get Display the focus InfoBox?
Definition: Options.h:184
SkyMap::slotEditFlag
void slotEditFlag(int flagIdx)
Open Flag Manager window with selected flag focused and ready to edit.
Definition: skymap.cpp:623
SkyMap
This is the canvas on which the sky is painted.
Definition: skymap.h:72
projector.h
SkyMap::Instance
static SkyMap * Instance()
Definition: skymap.cpp:141
QGraphicsView
Options::useAltAz
static bool useAltAz()
Get Use horizontal coordinate system?
Definition: Options.h:2386
ViewParams::zoomFactor
float zoomFactor
Definition: projector.h:41
KStars::data
KStarsData * data() const
Definition: kstars.h:131
Options::setFocusRA
static void setFocusRA(double v)
Set Right Ascension of focus position.
Definition: Options.h:1008
Options::xplanetDateFormat
static QString xplanetDateFormat()
Get Date format.
Definition: Options.h:3723
FOV::name
QString name() const
Definition: fov.h:46
SkyMap::updateFocus
void updateFocus()
Update the focus position according to current options.
Definition: skymap.cpp:833
Options::setUseGL
static void setUseGL(bool v)
Set Switch to OpenGL backend.
Definition: Options.h:2730
KSUtils::clamp
T clamp(T x, T min, T max)
Clamp value into range.
Definition: ksutils.h:59
SkyPoint::setAlt
void setAlt(dms alt)
Sets Alt, the Altitude.
Definition: skypoint.h:141
SkyMap::Stereographic
Definition: skymap.h:100
kstarsdata.h
KStarsData::ut
const KStarsDateTime & ut() const
Definition: kstarsdata.h:140
SkyMapComposite::removeNameLabel
bool removeNameLabel(SkyObject *o)
Definition: skymapcomposite.cpp:401
Options::xplanetProjection
static uint xplanetProjection()
Get Projection.
Definition: Options.h:3913
SkyPoint::alt
const dms & alt() const
Definition: skypoint.h:180
flagmanager.h
SkyMap::clickedObject
SkyObject * clickedObject() const
Retrieve the object nearest to a mouse click event.
Definition: skymap.h:214
SkyLine::append
void append(SkyPoint *p)
Append a segment to the list by adding a new endpoint.
Definition: skyline.cpp:34
SkyObject::name
virtual QString name(void) const
Definition: skyobject.h:124
SkyMap::setFocusPoint
void setFocusPoint(SkyPoint *f)
set the FocusPoint; the position that is to be the next Destination.
Definition: skymap.h:191
SkyMap::focusObject
SkyObject * focusObject() const
Retrieve the object which is centered in the sky map.
Definition: skymap.h:229
SkyMap::Orthographic
Definition: skymap.h:98
FlagComponent::remove
void remove(int index)
Remove a flag.
Definition: flagcomponent.cpp:144
ksutils.h
StarObject
This is a subclass of SkyObject.
Definition: starobject.h:41
Options::xplanetGlare
static QString xplanetGlare()
Get Sun Glare.
Definition: Options.h:3818
SkyObject
Provides all necessary information about an object in the sky: its coordinates, name(s), type, magnitude, and QStringLists of URLs for images and webpages regarding the object.
Definition: skyobject.h:46
Options::xplanetMagnitude
static QString xplanetMagnitude()
Get Base magnitude.
Definition: Options.h:4065
Options::useAutoTrail
static bool useAutoTrail()
Get Automatically add trail to centered solar system body?
Definition: Options.h:2424
FOV::sizeY
float sizeY() const
Definition: fov.h:54
SkyMap::projector
const Projector * projector() const
Get the current projector.
Definition: skymap.h:264
SkyObject::ImageTitle
QStringList & ImageTitle()
Definition: skyobject.h:304
SkyMap::slotSDSS
void slotSDSS()
Popup menu function: Display Sloan Digital Sky Survey image with the Image Viewer.
Definition: skymap.cpp:460
SkyMap::setDestinationAltAz
void setDestinationAltAz(const dms &alt, const dms &az)
sets the destination point of the sky map, using its alt/az coordinates.
Definition: skymap.cpp:822
SkyMap::slotBeginStarHop
void slotBeginStarHop()
Definition: skymap.cpp:500
flagcomponent.h
KStarsData::incUpdateID
unsigned int incUpdateID()
Definition: kstarsdata.cpp:253
kstars.h
GnomonicProjector
Definition: gnomonicprojector.h:27
Options::xplanetColor
static QString xplanetColor()
Get Label color.
Definition: Options.h:3704
SkyMap::slotRemovePlanetTrail
void slotRemovePlanetTrail()
Remove the PlanetTrail from ClickedObject.
Definition: skymap.cpp:724
SkyMap::destination
SkyPoint * destination()
retrieve the Destination position.
Definition: skymap.h:129
SkyMap::SkyMapQDraw
friend class SkyMapQDraw
Definition: skymap.h:77
SkyMap::linkAdded
void linkAdded()
Emitted by SkyMap::addLink().
Projector::setViewParams
void setViewParams(const ViewParams &p)
Update cached values for projector.
Definition: projector.cpp:60
QList
ViewParams
This is just a container that holds infromation needed to do projections.
Definition: projector.h:37
ViewParams::fillGround
bool fillGround
If the ground is filled, then points below horizon are invisible.
Definition: projector.h:44
SkyMapComposite::getStarHopRouteList
TargetListComponent * getStarHopRouteList()
Definition: skymapcomposite.h:195
Options::xplanetLabelTL
static bool xplanetLabelTL()
Get Top left.
Definition: Options.h:3742
SkyMap::positionChanged
void positionChanged(SkyPoint *)
Emitted when pointing changed.
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:21 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal