• 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
skymapevents.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  skymapevents.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 //This file contains Event handlers for the SkyMap class.
19 
20 #include <QCursor>
21 #include <QPainter>
22 #include <QMouseEvent>
23 #include <QWheelEvent>
24 #include <QResizeEvent>
25 #include <QKeyEvent>
26 #include <QKeySequence>
27 #include <QPaintEvent>
28 #include <QToolTip>
29 
30 #include <kstatusbar.h>
31 
32 #include "skymap.h"
33 #include "skyqpainter.h"
34 #include "skyglpainter.h"
35 #include "Options.h"
36 #include "kstars.h"
37 #include "kstarsdata.h"
38 #include "ksutils.h"
39 #include "simclock.h"
40 #include "kspopupmenu.h"
41 #include "skyobjects/ksplanetbase.h"
42 #include "widgets/infoboxwidget.h"
43 #include "printing/simplefovexporter.h"
44 
45 #include "projections/projector.h"
46 
47 #include "skycomponents/skymapcomposite.h"
48 
49 // TODO: Remove if debug key binding is removed
50 #include "skycomponents/skylabeler.h"
51 #include "skycomponents/starcomponent.h"
52 
53 
54 
55 void SkyMap::resizeEvent( QResizeEvent * )
56 {
57  computeSkymap = true; // skymap must be new computed
58 
59  //FIXME: No equivalent for this line in Qt4 ??
60  // if ( testWState( Qt::WState_AutoMask ) ) updateMask();
61 
62  // Resize the widget that draws the sky map.
63  // FIXME: The resize event doesn't pass to children. Any better way of doing this?
64  m_SkyMapDraw->resize( size() );
65 
66  // Resize infoboxes container.
67  // FIXME: this is not really pretty. Maybe there are some better way to this???
68  m_iboxes->resize( size() );
69 }
70 
71 void SkyMap::keyPressEvent( QKeyEvent *e ) {
72  KStars* kstars = KStars::Instance();
73  QString s;
74  bool arrowKeyPressed( false );
75  bool shiftPressed( false );
76  float step = 1.0;
77  if ( e->modifiers() & Qt::ShiftModifier ) { step = 10.0; shiftPressed = true; }
78 
79  //If the DBus resume key is not empty, then DBus processing is
80  //paused while we wait for a keypress
81  if ( ! data->resumeKey.isEmpty() && QKeySequence(e->key()) == data->resumeKey ) {
82  //The resumeKey was pressed. Signal that it was pressed by
83  //resetting it to empty; this will break the loop in
84  //KStars::waitForKey()
85  data->resumeKey = QKeySequence();
86  return;
87  }
88 
89  if(m_previewLegend) {
90  slotCancelLegendPreviewMode();
91  }
92 
93  switch ( e->key() ) {
94  case Qt::Key_Left :
95  if ( Options::useAltAz() ) {
96  focus()->setAz( dms( focus()->az().Degrees() - step * MINZOOM/Options::zoomFactor() ).reduce() );
97  focus()->HorizontalToEquatorial( data->lst(), data->geo()->lat() );
98  } else {
99  focus()->setRA( focus()->ra().Hours() + 0.05*step * MINZOOM/Options::zoomFactor() );
100  focus()->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
101  }
102 
103  arrowKeyPressed = true;
104  slewing = true;
105  break;
106 
107  case Qt::Key_Right :
108  if ( Options::useAltAz() ) {
109  focus()->setAz( dms( focus()->az().Degrees() + step * MINZOOM/Options::zoomFactor() ).reduce() );
110  focus()->HorizontalToEquatorial( data->lst(), data->geo()->lat() );
111  } else {
112  focus()->setRA( focus()->ra().Hours() - 0.05*step * MINZOOM/Options::zoomFactor() );
113  focus()->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
114  }
115 
116  arrowKeyPressed = true;
117  slewing = true;
118  break;
119 
120  case Qt::Key_Up :
121  if ( Options::useAltAz() ) {
122  focus()->setAlt( focus()->alt().Degrees() + step * MINZOOM/Options::zoomFactor() );
123  if ( focus()->alt().Degrees() > 90.0 ) focus()->setAlt( 90.0 );
124  focus()->HorizontalToEquatorial( data->lst(), data->geo()->lat() );
125  } else {
126  focus()->setDec( focus()->dec().Degrees() + step * MINZOOM/Options::zoomFactor() );
127  if (focus()->dec().Degrees() > 90.0) focus()->setDec( 90.0 );
128  focus()->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
129  }
130 
131  arrowKeyPressed = true;
132  slewing = true;
133  break;
134 
135  case Qt::Key_Down:
136  if ( Options::useAltAz() ) {
137  focus()->setAlt( focus()->alt().Degrees() - step * MINZOOM/Options::zoomFactor() );
138  if ( focus()->alt().Degrees() < -90.0 ) focus()->setAlt( -90.0 );
139  focus()->HorizontalToEquatorial(data->lst(), data->geo()->lat() );
140  } else {
141  focus()->setDec( focus()->dec().Degrees() - step * MINZOOM/Options::zoomFactor() );
142  if (focus()->dec().Degrees() < -90.0) focus()->setDec( -90.0 );
143  focus()->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
144  }
145 
146  arrowKeyPressed = true;
147  slewing = true;
148  break;
149 
150  case Qt::Key_Plus: //Zoom in
151  case Qt::Key_Equal:
152  zoomInOrMagStep( e->modifiers() );
153  break;
154 
155  case Qt::Key_Minus: //Zoom out
156  case Qt::Key_Underscore:
157  zoomOutOrMagStep( e->modifiers() );
158  break;
159 
160  case Qt::Key_0: //center on Sun
161  setClickedObject( data->skyComposite()->planet( KSPlanetBase::SUN ) );
162  setClickedPoint( clickedObject() );
163  slotCenter();
164  break;
165 
166  case Qt::Key_1: //center on Mercury
167  setClickedObject( data->skyComposite()->planet( KSPlanetBase::MERCURY ) );
168  setClickedPoint( clickedObject() );
169  slotCenter();
170  break;
171 
172  case Qt::Key_2: //center on Venus
173  setClickedObject( data->skyComposite()->planet( KSPlanetBase::VENUS ) );
174  setClickedPoint( clickedObject() );
175  slotCenter();
176  break;
177 
178  case Qt::Key_3: //center on Moon
179  setClickedObject( data->skyComposite()->planet( KSPlanetBase::MOON ) );
180  setClickedPoint( clickedObject() );
181  slotCenter();
182  break;
183 
184  case Qt::Key_4: //center on Mars
185  setClickedObject( data->skyComposite()->planet( KSPlanetBase:: MARS) );
186  setClickedPoint( clickedObject() );
187  slotCenter();
188  break;
189 
190  case Qt::Key_5: //center on Jupiter
191  setClickedObject( data->skyComposite()->planet( KSPlanetBase::JUPITER ) );
192  setClickedPoint( clickedObject() );
193  slotCenter();
194  break;
195 
196  case Qt::Key_6: //center on Saturn
197  setClickedObject( data->skyComposite()->planet( KSPlanetBase::SATURN ) );
198  setClickedPoint( clickedObject() );
199  slotCenter();
200  break;
201 
202  case Qt::Key_7: //center on Uranus
203  setClickedObject( data->skyComposite()->planet( KSPlanetBase::URANUS ) );
204  setClickedPoint( clickedObject() );
205  slotCenter();
206  break;
207 
208  case Qt::Key_8: //center on Neptune
209  setClickedObject( data->skyComposite()->planet( KSPlanetBase::NEPTUNE ) );
210  setClickedPoint( clickedObject() );
211  slotCenter();
212  break;
213 
214  case Qt::Key_9: //center on Pluto
215  setClickedObject( data->skyComposite()->planet( KSPlanetBase::PLUTO ) );
216  setClickedPoint( clickedObject() );
217  slotCenter();
218  break;
219 
220  case Qt::Key_BracketLeft: // Begin measuring angular distance
221  if( !rulerMode )
222  slotBeginAngularDistance();
223  break;
224  case Qt::Key_Escape: // Cancel angular distance measurement
225  {
226  if( rulerMode )
227  slotCancelRulerMode();
228 
229  if( m_fovCaptureMode )
230  slotFinishFovCaptureMode();
231  break;
232  }
233 
234  case Qt::Key_C: //Center clicked object
235  if ( clickedObject() ) slotCenter();
236  break;
237 
238  case Qt::Key_D: //Details window for Clicked/Centered object
239  {
240  SkyObject *orig = 0;
241  if ( shiftPressed ) {
242  orig = clickedObject();
243  setClickedObject( focusObject() );
244  }
245 
246  if ( clickedObject() ) {
247  slotDetail();
248  }
249 
250  if ( orig ) {
251  setClickedObject( orig );
252  }
253  break;
254  }
255 
256  case Qt::Key_P: //Show Popup menu for Clicked/Centered object
257  if ( shiftPressed ) {
258  if ( focusObject() )
259  focusObject()->showPopupMenu( pmenu, QCursor::pos() );
260  } else {
261  if ( clickedObject() )
262  clickedObject()->showPopupMenu( pmenu, QCursor::pos() );
263  }
264  break;
265 
266  case Qt::Key_O: //Add object to Observing List
267  {
268  SkyObject *orig = 0;
269  if ( shiftPressed ) {
270  orig = clickedObject();
271  setClickedObject( focusObject() );
272  }
273 
274  if ( clickedObject() ) {
275  kstars->observingList()->slotAddObject();
276  }
277 
278  if ( orig ) {
279  setClickedObject( orig );
280  }
281  break;
282  }
283 
284  case Qt::Key_L: //Toggle User label on Clicked/Centered object
285  {
286  SkyObject *orig = 0;
287  if ( shiftPressed ) {
288  orig = clickedObject();
289  setClickedObject( focusObject() );
290  }
291 
292  if ( clickedObject() ) {
293  if ( isObjectLabeled( clickedObject() ) )
294  slotRemoveObjectLabel();
295  else
296  slotAddObjectLabel();
297  }
298 
299  if ( orig ) {
300  setClickedObject( orig );
301  }
302  break;
303  }
304 
305  case Qt::Key_T: //Toggle planet trail on Clicked/Centered object (if solsys)
306  {
307  SkyObject *orig = 0;
308  if ( shiftPressed ) {
309  orig = clickedObject();
310  setClickedObject( focusObject() );
311  }
312 
313  KSPlanetBase* planet = dynamic_cast<KSPlanetBase*>( clickedObject() );
314  if( planet ) {
315  if( planet->hasTrail() )
316  slotRemovePlanetTrail();
317  else
318  slotAddPlanetTrail();
319  }
320 
321  if ( orig ) {
322  setClickedObject( orig );
323  }
324  break;
325  }
326 
327  case Qt::Key_R:
328  {
329  // Toggle relativistic corrections
330  Options::setUseRelativistic( ! Options::useRelativistic() );
331  kDebug() << "Relativistc corrections: " << Options::useRelativistic();
332  forceUpdate();
333  break;
334  }
335 
336  case Qt::Key_A:
337  Options::setUseAntialias( ! Options::useAntialias() );
338  kDebug() << "Use Antialiasing: " << Options::useAntialias();
339  forceUpdate();
340  break;
341 
342  case Qt::Key_K:
343  {
344  if(m_fovCaptureMode)
345  slotCaptureFov();
346  break;
347  }
348 
349  case Qt::Key_PageUp:
350  {
351  KStars::Instance()->selectPreviousFov();
352  break;
353  }
354 
355  case Qt::Key_PageDown:
356  {
357  KStars::Instance()->selectNextFov();
358  break;
359  }
360 
361  default:
362  // We don't want to do anything in this case. Key is unknown
363  return;
364  }
365 
366  if ( arrowKeyPressed ) {
367  stopTracking();
368  setDestination( *focus() );
369  }
370 
371  forceUpdate(); //need a total update, or slewing with the arrow keys doesn't work.
372 }
373 
374 void SkyMap::stopTracking() {
375  KStars* kstars = KStars::Instance();
376  emit positionChanged( focus() );
377  if( kstars && Options::isTracking() )
378  kstars->slotTrack();
379 }
380 
381 void SkyMap::keyReleaseEvent( QKeyEvent *e ) {
382  switch ( e->key() ) {
383  case Qt::Key_Plus: //Zoom in
384  case Qt::Key_Equal:
385  case Qt::Key_Minus: //Zoom out
386  case Qt::Key_Underscore:
387 
388  case Qt::Key_Left : //no break; continue to Qt::Key_Down
389  case Qt::Key_Right : //no break; continue to Qt::Key_Down
390  case Qt::Key_Up : //no break; continue to Qt::Key_Down
391  case Qt::Key_Down :
392  slewing = false;
393 
394  if ( Options::useAltAz() )
395  setDestinationAltAz( focus()->alt(), focus()->az() );
396  else
397  setDestination( *focus() );
398 
399  showFocusCoords();
400  forceUpdate(); // Need a full update to draw faint objects that are not drawn while slewing.
401  break;
402  }
403 }
404 
405 void SkyMap::mouseMoveEvent( QMouseEvent *e ) {
406  if ( Options::useHoverLabel() ) {
407  //Start a single-shot timer to monitor whether we are currently hovering.
408  //The idea is that whenever a moveEvent occurs, the timer is reset. It
409  //will only timeout if there are no move events for HOVER_INTERVAL ms
410  m_HoverTimer.start( HOVER_INTERVAL );
411  QToolTip::hideText();
412  }
413 
414  //Are we defining a ZoomRect?
415  if ( ZoomRect.center().x() > 0 && ZoomRect.center().y() > 0 ) {
416  //cancel operation if the user let go of CTRL
417  if ( !( e->modifiers() & Qt::ControlModifier ) ) {
418  ZoomRect = QRect(); //invalidate ZoomRect
419  update();
420  } else {
421  //Resize the rectangle so that it passes through the cursor position
422  QPoint pcenter = ZoomRect.center();
423  int dx = abs(e->x() - pcenter.x());
424  int dy = abs(e->y() - pcenter.y());
425  if ( dx == 0 || float(dy)/float(dx) > float(height())/float(width()) ) {
426  //Size rect by height
427  ZoomRect.setHeight( 2*dy );
428  ZoomRect.setWidth( 2*dy*width()/height() );
429  } else {
430  //Size rect by height
431  ZoomRect.setWidth( 2*dx );
432  ZoomRect.setHeight( 2*dx*height()/width() );
433  }
434  ZoomRect.moveCenter( pcenter ); //reset center
435 
436  update();
437  return;
438  }
439  }
440 
441  if ( projector()->unusablePoint( e->pos() ) ) return; // break if point is unusable
442 
443  //determine RA, Dec of mouse pointer
444  m_MousePoint = projector()->fromScreen( e->pos(), data->lst(), data->geo()->lat() );
445 
446  double dyPix = 0.5*height() - e->y();
447  if ( midMouseButtonDown ) { //zoom according to y-offset
448  float yoff = dyPix - y0;
449  if (yoff > 10 ) {
450  y0 = dyPix;
451  slotZoomIn();
452  }
453  if (yoff < -10 ) {
454  y0 = dyPix;
455  slotZoomOut();
456  }
457  }
458 
459  if ( mouseButtonDown ) {
460  // set the mouseMoveCursor and set slewing=true, if they are not set yet
461  if( !mouseMoveCursor )
462  setMouseMoveCursor();
463  if( !slewing ) {
464  slewing = true;
465  stopTracking(); //toggle tracking off
466  }
467 
468  //Update focus such that the sky coords at mouse cursor remain approximately constant
469  if ( Options::useAltAz() ) {
470  m_MousePoint.EquatorialToHorizontal( data->lst(), data->geo()->lat() );
471  clickedPoint()->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
472  dms dAz = m_MousePoint.az() - clickedPoint()->az();
473  dms dAlt = m_MousePoint.alt() - clickedPoint()->alt();
474  focus()->setAz( focus()->az().Degrees() - dAz.Degrees() ); //move focus in opposite direction
475  focus()->setAz( focus()->az().reduce() );
476  focus()->setAlt(
477  KSUtils::clamp( focus()->alt().Degrees() - dAlt.Degrees() , -90.0 , 90.0 ) );
478  focus()->HorizontalToEquatorial( data->lst(), data->geo()->lat() );
479  } else {
480  dms dRA = m_MousePoint.ra() - clickedPoint()->ra();
481  dms dDec = m_MousePoint.dec() - clickedPoint()->dec();
482  focus()->setRA( focus()->ra().Hours() - dRA.Hours() ); //move focus in opposite direction
483  focus()->setRA( focus()->ra().reduce() );
484  focus()->setDec(
485  KSUtils::clamp( focus()->dec().Degrees() - dDec.Degrees() , -90.0 , 90.0 ) );
486  focus()->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
487  }
488  showFocusCoords();
489 
490  //redetermine RA, Dec of mouse pointer, using new focus
491  m_MousePoint = projector()->fromScreen( e->pos(), data->lst(), data->geo()->lat() );
492  setClickedPoint( &m_MousePoint );
493 
494  forceUpdate(); // must be new computed
495 
496  } else { //mouse button not down
497  emit mousePointChanged( &m_MousePoint );
498  }
499 }
500 
501 void SkyMap::wheelEvent( QWheelEvent *e ) {
502  if ( e->delta() > 0 )
503  zoomInOrMagStep ( e->modifiers() );
504  else
505  zoomOutOrMagStep( e->modifiers() );
506 }
507 
508 void SkyMap::mouseReleaseEvent( QMouseEvent * ) {
509  if ( ZoomRect.isValid() ) {
510  stopTracking();
511  SkyPoint newcenter = projector()->fromScreen( ZoomRect.center(), data->lst(), data->geo()->lat() );
512  setFocus( &newcenter );
513  setDestination( newcenter );
514 
515  //Zoom in on center of Zoom Circle, by a factor equal to the ratio
516  //of the sky pixmap's width to the Zoom Circle's diameter
517  float factor = float(width()) / float(ZoomRect.width());
518  setZoomFactor( Options::zoomFactor() * factor );
519  }
520  setDefaultMouseCursor();
521  ZoomRect = QRect(); //invalidate ZoomRect
522 
523  if(m_previewLegend) {
524  slotCancelLegendPreviewMode();
525  }
526 
527  //false if double-clicked, because it's unset there.
528  if (mouseButtonDown) {
529  mouseButtonDown = false;
530  if ( slewing ) {
531  slewing = false;
532  if ( Options::useAltAz() )
533  setDestinationAltAz( focus()->alt(), focus()->az() );
534  else
535  setDestination( *focus() );
536  }
537  forceUpdate(); // is needed because after moving the sky not all stars are shown
538  }
539  // if middle button was pressed unset here
540  midMouseButtonDown = false;
541 }
542 
543 void SkyMap::mousePressEvent( QMouseEvent *e ) {
544  KStars* kstars = KStars::Instance();
545 
546  if ( ( e->modifiers() & Qt::ControlModifier ) && (e->button() == Qt::LeftButton) ) {
547  ZoomRect.moveCenter( e->pos() );
548  setZoomMouseCursor();
549  update(); //refresh without redrawing skymap
550  return;
551  }
552 
553  // if button is down and cursor is not moved set the move cursor after 500 ms
554  QTimer::singleShot(500, this, SLOT (setMouseMoveCursor()));
555 
556  // break if point is unusable
557  if ( projector()->unusablePoint( e->pos() ) )
558  return;
559 
560  if ( !midMouseButtonDown && e->button() == Qt::MidButton ) {
561  y0 = 0.5*height() - e->y(); //record y pixel coordinate for middle-button zooming
562  midMouseButtonDown = true;
563  }
564 
565  if ( !mouseButtonDown ) {
566  if ( e->button() == Qt::LeftButton ) {
567  mouseButtonDown = true;
568  }
569 
570  //determine RA, Dec of mouse pointer
571  m_MousePoint = projector()->fromScreen( e->pos(), data->lst(), data->geo()->lat() );
572  setClickedPoint( &m_MousePoint );
573 
574  //Find object nearest to clickedPoint()
575  double maxrad = 1000.0/Options::zoomFactor();
576  SkyObject* obj = data->skyComposite()->objectNearest( clickedPoint(), maxrad );
577  setClickedObject( obj );
578  if( obj )
579  setClickedPoint( obj );
580 
581  switch( e->button() ) {
582  case Qt::LeftButton:
583  if( kstars ) {
584  QString name;
585  if( clickedObject() )
586  name = clickedObject()->translatedLongName();
587  else
588  name = i18n( "Empty sky" );
589  kstars->statusBar()->changeItem(name, 0 );
590  }
591  break;
592  case Qt::RightButton:
593  if( rulerMode ) {
594  // Compute angular distance.
595  slotEndRulerMode();
596  } else {
597  // Show popup menu
598  if( clickedObject() ) {
599  clickedObject()->showPopupMenu( pmenu, QCursor::pos() );
600  } else {
601  pmenu->createEmptyMenu( clickedPoint() );
602  pmenu->popup( QCursor::pos() );
603  }
604  }
605  break;
606  default: ;
607  }
608  }
609 }
610 
611 void SkyMap::mouseDoubleClickEvent( QMouseEvent *e ) {
612  if ( e->button() == Qt::LeftButton && !projector()->unusablePoint( e->pos() ) ) {
613  mouseButtonDown = false;
614  if( e->x() != width()/2 || e->y() != height()/2 )
615  slotCenter();
616  }
617 }
618 
619 double SkyMap::zoomFactor( const int modifier ) {
620  double factor = ( modifier & Qt::ControlModifier) ? DZOOM : 2.0;
621  if ( modifier & Qt::ShiftModifier )
622  factor = sqrt( factor );
623  return factor;
624 }
625 
626 void SkyMap::zoomInOrMagStep( const int modifier ) {
627  if ( modifier & Qt::AltModifier )
628  incMagLimit( modifier );
629  else
630  setZoomFactor( Options::zoomFactor() * zoomFactor( modifier ) );
631 }
632 
633 
634 void SkyMap::zoomOutOrMagStep( const int modifier ) {
635  if ( modifier & Qt::AltModifier )
636  decMagLimit( modifier );
637  else
638  setZoomFactor( Options::zoomFactor() / zoomFactor (modifier ) );
639 }
640 
641 double SkyMap::magFactor( const int modifier ) {
642  double factor = ( modifier & Qt::ControlModifier) ? 0.2 : 1.0;
643  if ( modifier & Qt::ShiftModifier )
644  factor /= 2.0;
645  return factor;
646 }
647 
648 void SkyMap::incMagLimit( const int modifier ) {
649  double limit = 2.222 * log10(static_cast<double>( Options::starDensity() )) + 0.35;
650  limit += magFactor( modifier );
651  if ( limit > 7.94 ) limit = 7.94;
652  Options::setStarDensity( pow( 10, ( limit - 0.35 ) / 2.222) );
653  //printf("maglim set to %3.1f\n", limit);
654  forceUpdate();
655 }
656 
657 void SkyMap::decMagLimit( const int modifier ) {
658  double limit = 2.222 * log10(static_cast<double>( Options::starDensity() )) + 0.35;
659  limit -= magFactor( modifier );
660  if ( limit < 3.55 ) limit = 3.55;
661  Options::setStarDensity( pow( 10, ( limit - 0.35 ) / 2.222) );
662  //printf("maglim set to %3.1f\n", limit);
663  forceUpdate();
664 }
665 
SkyMap::mouseDoubleClickEvent
virtual void mouseDoubleClickEvent(QMouseEvent *e)
Center SkyMap at double-clicked location.
Definition: skymapevents.cpp:611
TrailObject::hasTrail
bool hasTrail() const
Definition: trailobject.h:46
SkyMap::slotZoomIn
void slotZoomIn()
Zoom in one step.
Definition: skymap.cpp:964
ksplanetbase.h
SkyPoint::ra
const dms & ra() const
Definition: skypoint.h:171
SkyMap::slotCancelRulerMode
void slotCancelRulerMode()
Disables the angular distance measuring mode.
Definition: skymap.cpp:609
Options::setStarDensity
static void setStarDensity(int v)
Set Density of stars in the field of view.
Definition: Options.h:2616
DZOOM
#define DZOOM
Definition: kstarsdata.h:41
KSPlanetBase::NEPTUNE
Definition: ksplanetbase.h:82
SkyPoint::az
const dms & az() const
Definition: skypoint.h:177
SkyMap::slotFinishFovCaptureMode
void slotFinishFovCaptureMode()
Definition: skymap.cpp:764
SkyMap::slotCenter
void slotCenter()
Center the display at the point ClickedPoint.
Definition: skymap.cpp:373
KSPlanetBase::JUPITER
Definition: ksplanetbase.h:82
KSPlanetBase::MOON
Definition: ksplanetbase.h:82
SkyMap::setDestination
void setDestination(const SkyPoint &f)
sets the destination point of the sky map.
Definition: skymap.cpp:812
SkyMap::setClickedObject
void setClickedObject(SkyObject *o)
Set the ClickedObject pointer to the argument.
Definition: skymap.cpp:361
SkyMap::setFocus
void setFocus(SkyPoint *f)
sets the central focus point of the sky map.
Definition: skymap.cpp:789
SkyPoint::setAz
void setAz(dms az)
Sets Az, the Azimuth.
Definition: skypoint.h:152
KStarsData::lst
dms * lst()
Definition: kstarsdata.h:161
dms::Degrees
const double & Degrees() const
Definition: dms.h:98
starcomponent.h
SkyMap::slotAddPlanetTrail
void slotAddPlanetTrail()
Add a Planet Trail to ClickedObject.
Definition: skymap.cpp:732
skyglpainter.h
Options::setUseRelativistic
static void setUseRelativistic(bool v)
Set Apply relativistic corrections due to the bending of light in sun's gravitational field...
Definition: Options.h:2471
KStars::Instance
static KStars * Instance()
Definition: kstars.h:125
SkyMap::slotDetail
void slotDetail()
Popup menu function: Show the Detailed Information window for ClickedObject.
Definition: skymap.cpp:740
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::starDensity
static int starDensity()
Get Density of stars in the field of view.
Definition: Options.h:2626
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
KSPopupMenu::createEmptyMenu
void createEmptyMenu(SkyPoint *nullObj)
Create a popup menu for empty sky.
Definition: kspopupmenu.cpp:124
Options::isTracking
static bool isTracking()
Get Is tracking engaged?
Definition: Options.h:1075
Options::useRelativistic
static bool useRelativistic()
Get Apply relativistic corrections due to the bending of light in sun's gravitational field...
Definition: Options.h:2481
KSPlanetBase::MERCURY
Definition: ksplanetbase.h:82
KStars
This is the main window for KStars.
Definition: kstars.h:94
SkyMap::stopTracking
void stopTracking()
Definition: skymapevents.cpp:374
SkyMapComposite::objectNearest
virtual SkyObject * objectNearest(SkyPoint *p, double &maxrad)
Definition: skymapcomposite.cpp:309
SkyMap::slotBeginAngularDistance
void slotBeginAngularDistance()
Enables the angular distance measuring mode.
Definition: skymap.cpp:496
Options::useHoverLabel
static bool useHoverLabel()
Get Add temporary label on mouse hover?
Definition: Options.h:2443
SkyMap::slotEndRulerMode
void slotEndRulerMode()
Computes the angular distance, prints the result in the status bar and disables the angular distance ...
Definition: skymap.cpp:524
SkyMap::mouseReleaseEvent
virtual void mouseReleaseEvent(QMouseEvent *e)
set mouseButtonDown==false, slewing==false
Definition: skymapevents.cpp:508
kspopupmenu.h
SkyPoint
The sky coordinates of a point in the sky.
Definition: skypoint.h:50
SkyMap::keyPressEvent
virtual void keyPressEvent(QKeyEvent *e)
Process keystrokes:
Definition: skymapevents.cpp:71
SkyMap::showFocusCoords
void showFocusCoords()
Update object name and coordinates in the Focus InfoBox.
Definition: skymap.cpp:331
SkyMap::setZoomFactor
void setZoomFactor(double factor)
@ Set zoom factor.
Definition: skymap.cpp:976
skymapcomposite.h
SkyMap::slotCaptureFov
void slotCaptureFov()
Definition: skymap.cpp:771
KStars::observingList
ObservingList * observingList() const
Definition: kstars.h:136
SkyMap::focus
SkyPoint * focus()
Retrieve the Focus point; the position on the sky at the center of the skymap.
Definition: skymap.h:120
MINZOOM
#define MINZOOM
Definition: kstarsdata.h:38
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
KSPlanetBase::MARS
Definition: ksplanetbase.h:82
skymap.h
KStars::selectNextFov
void selectNextFov()
Definition: kstars.cpp:272
SkyMap::slotCancelLegendPreviewMode
void slotCancelLegendPreviewMode()
Definition: skymap.cpp:758
SkyObject::showPopupMenu
void showPopupMenu(KSPopupMenu *pmenu, const QPoint &pos)
Show Type-specific popup menu.
Definition: skyobject.cpp:83
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
SkyObject::translatedLongName
QString translatedLongName() const
Definition: skyobject.h:145
KStarsData::skyComposite
SkyMapComposite * skyComposite()
Definition: kstarsdata.h:146
SkyMap::mousePointChanged
void mousePointChanged(SkyPoint *)
Emitted when position under mouse changed.
SkyMap::resizeEvent
virtual void resizeEvent(QResizeEvent *)
If the skymap will be resized, the sky must be new computed.
Definition: skymapevents.cpp:55
dms
An angle, stored as degrees, but expressible in many ways.
Definition: dms.h:42
simclock.h
KStars::slotTrack
void slotTrack()
action slot: Toggle whether kstars is tracking current position
Definition: kstarsactions.cpp:892
SkyPoint::dec
const dms & dec() const
Definition: skypoint.h:174
dms::Hours
double Hours() const
Definition: dms.h:125
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
SkyMapComposite::planet
KSPlanetBase * planet(int n)
Definition: skymapcomposite.cpp:453
SkyMap::isObjectLabeled
bool isObjectLabeled(SkyObject *o)
Definition: skymap.cpp:701
SkyMap::clickedPoint
SkyPoint * clickedPoint()
Retrieve the ClickedPoint position.
Definition: skymap.h:200
KSPlanetBase::SATURN
Definition: ksplanetbase.h:82
infoboxwidget.h
Options.h
KSPlanetBase::PLUTO
Definition: ksplanetbase.h:82
SkyMap::keyReleaseEvent
virtual void keyReleaseEvent(QKeyEvent *e)
When keyRelease is triggered, just set the "slewing" flag to false, and update the display (to draw o...
Definition: skymapevents.cpp:381
KStars::selectPreviousFov
void selectPreviousFov()
Definition: kstars.cpp:301
GeoLocation::lat
const dms * lat() const
Definition: geolocation.h:79
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
SkyMap::slotZoomOut
void slotZoomOut()
Zoom out one step.
Definition: skymap.cpp:968
simplefovexporter.h
Options::zoomFactor
static double zoomFactor()
Get Zoom Factor, in pixels per radian.
Definition: Options.h:2531
skyqpainter.h
projector.h
Options::useAltAz
static bool useAltAz()
Get Use horizontal coordinate system?
Definition: Options.h:2386
KSPlanetBase
A subclass of TrailObject that provides additional information needed for most solar system objects...
Definition: ksplanetbase.h:63
Options::setUseAntialias
static void setUseAntialias(bool v)
Set Use antialiasing when drawing the screen?
Definition: Options.h:2490
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
SkyPoint::setRA
void setRA(dms r)
Sets RA, the current Right Ascension.
Definition: skypoint.h:119
KSPlanetBase::SUN
Definition: ksplanetbase.h:82
SkyPoint::setDec
void setDec(dms d)
Sets Dec, the current Declination.
Definition: skypoint.h:130
kstarsdata.h
SkyMap::mousePressEvent
virtual void mousePressEvent(QMouseEvent *e)
Determine RA, Dec coordinates of clicked location.
Definition: skymapevents.cpp:543
skylabeler.h
SkyPoint::alt
const dms & alt() const
Definition: skypoint.h:180
SkyMap::clickedObject
SkyObject * clickedObject() const
Retrieve the object nearest to a mouse click event.
Definition: skymap.h:214
SkyMap::wheelEvent
virtual void wheelEvent(QWheelEvent *e)
Zoom in and out with the mouse wheel.
Definition: skymapevents.cpp:501
KSPlanetBase::VENUS
Definition: ksplanetbase.h:82
SkyMap::focusObject
SkyObject * focusObject() const
Retrieve the object which is centered in the sky map.
Definition: skymap.h:229
Projector::unusablePoint
virtual bool unusablePoint(const QPointF &p) const
Check if the current point on screen is a valid point on the sky.
Definition: projector.cpp:338
ksutils.h
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
KSPlanetBase::URANUS
Definition: ksplanetbase.h:82
SkyMap::projector
const Projector * projector() const
Get the current projector.
Definition: skymap.h:264
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
kstars.h
SkyMap::mouseMoveEvent
virtual void mouseMoveEvent(QMouseEvent *e)
This function does several different things depending on the state of the program: ...
Definition: skymapevents.cpp:405
Options::useAntialias
static bool useAntialias()
Get Use antialiasing when drawing the screen?
Definition: Options.h:2500
SkyMap::slotRemovePlanetTrail
void slotRemovePlanetTrail()
Remove the PlanetTrail from ClickedObject.
Definition: skymap.cpp:724
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